12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761 |
- (function universalModuleDefinition(root, factory) {
- var amdDependencies = [];
- if(typeof exports === 'object' && typeof module === 'object') {
- module.exports = factory();
- } else if(typeof define === 'function' && define.amd) {
- define("babylonjs-viewer", amdDependencies, factory);
- } else if(typeof exports === 'object') {
- exports["babylonjs-viewer"] = factory();
- } else {
- root["BabylonViewer"] = factory();
- }
- })(this, function() {
- var BabylonViewer=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t,r){(function(t){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./Legacy/legacy.ts")}({"../node_modules/tslib/tslib.es6.js":
- /*!******************************************!*\
- !*** ../node_modules/tslib/tslib.es6.js ***!
- \******************************************/
- /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */function(e,t,r){"use strict";r.r(t),r.d(t,"__extends",(function(){return i})),r.d(t,"__assign",(function(){return o})),r.d(t,"__rest",(function(){return s})),r.d(t,"__decorate",(function(){return a})),r.d(t,"__param",(function(){return l})),r.d(t,"__metadata",(function(){return c})),r.d(t,"__awaiter",(function(){return u})),r.d(t,"__generator",(function(){return d})),r.d(t,"__createBinding",(function(){return h})),r.d(t,"__exportStar",(function(){return f})),r.d(t,"__values",(function(){return p})),r.d(t,"__read",(function(){return m})),r.d(t,"__spread",(function(){return g})),r.d(t,"__spreadArrays",(function(){return _})),r.d(t,"__await",(function(){return v})),r.d(t,"__asyncGenerator",(function(){return y})),r.d(t,"__asyncDelegator",(function(){return b})),r.d(t,"__asyncValues",(function(){return A})),r.d(t,"__makeTemplateObject",(function(){return T})),r.d(t,"__importStar",(function(){return P})),r.d(t,"__importDefault",(function(){return S})),r.d(t,"__classPrivateFieldGet",(function(){return E})),r.d(t,"__classPrivateFieldSet",(function(){return C}));
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function l(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var h=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function f(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||h(t,e,r)}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function _(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function y(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof v?Promise.resolve(r.value.v).then(l,c):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function b(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function A(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&h(t,e,r);return M(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},"../node_modules/webpack/buildin/global.js":
- /*!*************************************************!*\
- !*** ../node_modules/webpack/buildin/global.js ***!
- \*************************************************/
- /*! no static exports found */function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},"./Actions/abstractActionManager.ts":
- /*!******************************************!*\
- !*** ./Actions/abstractActionManager.ts ***!
- \******************************************/
- /*! exports provided: AbstractActionManager */function(e,t,r){"use strict";r.r(t),r.d(t,"AbstractActionManager",(function(){return i}));var n=r(/*! ../Engines/constants */"./Engines/constants.ts"),i=function(){function e(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(e,"HasTriggers",{get:function(){for(var t in e.Triggers)if(e.Triggers.hasOwnProperty(t))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e,"HasPickTriggers",{get:function(){for(var t in e.Triggers)if(e.Triggers.hasOwnProperty(t)){var r=parseInt(t);if(r>=n.Constants.ACTION_OnPickTrigger&&r<=n.Constants.ACTION_OnPickUpTrigger)return!0}return!1},enumerable:!1,configurable:!0}),e.HasSpecificTrigger=function(t){for(var r in e.Triggers)if(e.Triggers.hasOwnProperty(r)&&parseInt(r)===t)return!0;return!1},e.Triggers={},e}()},"./Actions/action.ts":
- /*!***************************!*\
- !*** ./Actions/action.ts ***!
- \***************************/
- /*! exports provided: Action */function(e,t,r){"use strict";r.r(t),r.d(t,"Action",(function(){return a}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=function(){function e(e,t){this.triggerOptions=e,this.onBeforeExecuteObservable=new n.Observable,e.parameter?(this.trigger=e.trigger,this._triggerParameter=e.parameter):e.trigger?this.trigger=e.trigger:this.trigger=e,this._nextActiveAction=this,this._condition=t}return e.prototype._prepare=function(){},e.prototype.getTriggerParameter=function(){return this._triggerParameter},e.prototype._executeCurrent=function(e){if(this._nextActiveAction._condition){var t=this._nextActiveAction._condition,r=this._actionManager.getScene().getRenderId();if(t._evaluationId===r){if(!t._currentResult)return}else{if(t._evaluationId=r,!t.isValid())return void(t._currentResult=!1);t._currentResult=!0}}this.onBeforeExecuteObservable.notifyObservers(this),this._nextActiveAction.execute(e),this.skipToNextActiveAction()},e.prototype.execute=function(e){},e.prototype.skipToNextActiveAction=function(){this._nextActiveAction._child?(this._nextActiveAction._child._actionManager||(this._nextActiveAction._child._actionManager=this._actionManager),this._nextActiveAction=this._nextActiveAction._child):this._nextActiveAction=this},e.prototype.then=function(e){return this._child=e,e._actionManager=this._actionManager,e._prepare(),e},e.prototype._getProperty=function(e){return this._actionManager._getProperty(e)},e.prototype._getEffectiveTarget=function(e,t){return this._actionManager._getEffectiveTarget(e,t)},e.prototype.serialize=function(e){},e.prototype._serialize=function(e,t){var r={type:1,children:[],name:e.name,properties:e.properties||[]};if(this._child&&this._child.serialize(r),this._condition){var n=this._condition.serialize();return n.children.push(r),t&&t.children.push(n),n}return t&&t.children.push(r),r},e._SerializeValueAsString=function(e){return"number"==typeof e?e.toString():"boolean"==typeof e?e?"true":"false":e instanceof i.Vector2?e.x+", "+e.y:e instanceof i.Vector3?e.x+", "+e.y+", "+e.z:e instanceof o.Color3?e.r+", "+e.g+", "+e.b:e instanceof o.Color4?e.r+", "+e.g+", "+e.b+", "+e.a:e},e._GetTargetProperty=function(e){return{name:"target",targetType:e._isMesh?"MeshProperties":e._isLight?"LightProperties":e._isCamera?"CameraProperties":"SceneProperties",value:e._isScene?"Scene":e.name}},e}();s._TypeStore.RegisteredTypes["BABYLON.Action"]=a},"./Actions/actionEvent.ts":
- /*!********************************!*\
- !*** ./Actions/actionEvent.ts ***!
- \********************************/
- /*! exports provided: ActionEvent */function(e,t,r){"use strict";r.r(t),r.d(t,"ActionEvent",(function(){return n}));var n=function(){function e(e,t,r,n,i,o){this.source=e,this.pointerX=t,this.pointerY=r,this.meshUnderPointer=n,this.sourceEvent=i,this.additionalData=o}return e.CreateNew=function(t,r,n){var i=t.getScene();return new e(t,i.pointerX,i.pointerY,i.meshUnderPointer||t,r,n)},e.CreateNewFromSprite=function(t,r,n,i){return new e(t,r.pointerX,r.pointerY,r.meshUnderPointer,n,i)},e.CreateNewFromScene=function(t,r){return new e(null,t.pointerX,t.pointerY,t.meshUnderPointer,r)},e.CreateNewFromPrimitive=function(t,r,n,i){return new e(t,r.x,r.y,null,n,i)},e}()},"./Actions/actionManager.ts":
- /*!**********************************!*\
- !*** ./Actions/actionManager.ts ***!
- \**********************************/
- /*! exports provided: ActionManager */function(e,t,r){"use strict";r.r(t),r.d(t,"ActionManager",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ./condition */"./Actions/condition.ts"),a=r(/*! ./action */"./Actions/action.ts"),l=r(/*! ./directActions */"./Actions/directActions.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Misc/logger */"./Misc/logger.ts"),d=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),h=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),f=r(/*! ./abstractActionManager */"./Actions/abstractActionManager.ts"),p=r(/*! ../Engines/constants */"./Engines/constants.ts"),m=function(e){function t(t){var r=e.call(this)||this;return r._scene=t||c.EngineStore.LastCreatedScene,t.actionManagers.push(r),r}return Object(n.__extends)(t,e),t.prototype.dispose=function(){for(var e=this._scene.actionManagers.indexOf(this),r=0;r<this.actions.length;r++){var n=this.actions[r];t.Triggers[n.trigger]--,0===t.Triggers[n.trigger]&&delete t.Triggers[n.trigger]}e>-1&&this._scene.actionManagers.splice(e,1)},t.prototype.getScene=function(){return this._scene},t.prototype.hasSpecificTriggers=function(e){for(var t=0;t<this.actions.length;t++){var r=this.actions[t];if(e.indexOf(r.trigger)>-1)return!0}return!1},t.prototype.hasSpecificTriggers2=function(e,t){for(var r=0;r<this.actions.length;r++){var n=this.actions[r];if(e==n.trigger||t==n.trigger)return!0}return!1},t.prototype.hasSpecificTrigger=function(e,t){for(var r=0;r<this.actions.length;r++){var n=this.actions[r];if(n.trigger===e){if(!t)return!0;if(t(n.getTriggerParameter()))return!0}}return!1},Object.defineProperty(t.prototype,"hasPointerTriggers",{get:function(){for(var e=0;e<this.actions.length;e++){var r=this.actions[e];if(r.trigger>=t.OnPickTrigger&&r.trigger<=t.OnPointerOutTrigger)return!0}return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPickTriggers",{get:function(){for(var e=0;e<this.actions.length;e++){var r=this.actions[e];if(r.trigger>=t.OnPickTrigger&&r.trigger<=t.OnPickUpTrigger)return!0}return!1},enumerable:!1,configurable:!0}),t.prototype.registerAction=function(e){return e.trigger===t.OnEveryFrameTrigger&&this.getScene().actionManager!==this?(u.Logger.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"),null):(this.actions.push(e),t.Triggers[e.trigger]?t.Triggers[e.trigger]++:t.Triggers[e.trigger]=1,e._actionManager=this,e._prepare(),e)},t.prototype.unregisterAction=function(e){var r=this.actions.indexOf(e);return-1!==r&&(this.actions.splice(r,1),t.Triggers[e.trigger]-=1,0===t.Triggers[e.trigger]&&delete t.Triggers[e.trigger],delete e._actionManager,!0)},t.prototype.processTrigger=function(e,r){for(var n=0;n<this.actions.length;n++){var i=this.actions[n];if(i.trigger===e){if(r&&(e===t.OnKeyUpTrigger||e===t.OnKeyDownTrigger)){var o=i.getTriggerParameter();if(o&&o!==r.sourceEvent.keyCode){if(!o.toLowerCase)continue;var s=o.toLowerCase();if(s!==r.sourceEvent.key){var a=r.sourceEvent.charCode?r.sourceEvent.charCode:r.sourceEvent.keyCode;if(String.fromCharCode(a).toLowerCase()!==s)continue}}}i._executeCurrent(r)}}},t.prototype._getEffectiveTarget=function(e,t){for(var r=t.split("."),n=0;n<r.length-1;n++)e=e[r[n]];return e},t.prototype._getProperty=function(e){var t=e.split(".");return t[t.length-1]},t.prototype.serialize=function(e){for(var r={children:new Array,name:e,type:3,properties:new Array},n=0;n<this.actions.length;n++){var i={type:0,children:new Array,name:t.GetTriggerName(this.actions[n].trigger),properties:new Array},o=this.actions[n].triggerOptions;if(o&&"number"!=typeof o)if(o.parameter instanceof Node)i.properties.push(a.Action._GetTargetProperty(o.parameter));else{var s={};d.DeepCopier.DeepCopy(o.parameter,s,["mesh"]),o.parameter&&o.parameter.mesh&&(s._meshId=o.parameter.mesh.id),i.properties.push({name:"parameter",targetType:null,value:s})}this.actions[n].serialize(i),r.children.push(i)}return r},t.Parse=function(e,r,n){var a=new t(n);null===r?n.actionManager=a:r.actionManager=a;for(var c=function(e,t,r,n){if(null===n){var s=parseFloat(t);return"true"===t||"false"===t?"true"===t:isNaN(s)?t:s}for(var a=n.split("."),l=t.split(","),c=0;c<a.length;c++)r=r[a[c]];if("boolean"==typeof r)return"true"===l[0];if("string"==typeof r)return l[0];var u=new Array;for(c=0;c<l.length;c++)u.push(parseFloat(l[c]));return r instanceof i.Vector3?i.Vector3.FromArray(u):r instanceof i.Vector4?i.Vector4.FromArray(u):r instanceof o.Color3?o.Color3.FromArray(u):r instanceof o.Color4?o.Color4.FromArray(u):parseFloat(l[0])},u=function(e,r,i,o,d){if(void 0===d&&(d=null),!e.detached){var f=new Array,p=null,m=null,g=e.combine&&e.combine.length>0;if(2===e.type?f.push(a):f.push(r),g){for(var _=new Array,v=0;v<e.combine.length;v++)u(e.combine[v],t.NothingTrigger,i,o,_);f.push(_)}else for(var y=0;y<e.properties.length;y++){var b=e.properties[y].value,A=e.properties[y].name,T=e.properties[y].targetType;"target"===A?b=p=null!==T&&"SceneProperties"===T?n:n.getNodeByName(b):"parent"===A?b=n.getNodeByName(b):"sound"===A?n.getSoundByName&&(b=n.getSoundByName(b)):"propertyPath"!==A?b=2===e.type&&"operator"===A?s.ValueCondition[b]:c(0,b,p,"value"===A?m:null):m=b,f.push(b)}if(null===d?f.push(i):f.push(null),"InterpolateValueAction"===e.name){var M=f[f.length-2];f[f.length-1]=M,f[f.length-2]=i}var P=function(e,t){var r=h._TypeStore.GetClass("BABYLON."+e);if(r){var n=Object.create(r.prototype);return n.constructor.apply(n,t),n}}(e.name,f);if(P instanceof s.Condition&&null!==i){var S=new l.DoNothingAction(r,i);o?o.then(S):a.registerAction(S),o=S}for(null===d?P instanceof s.Condition?(i=P,P=o):(i=null,o?o.then(P):a.registerAction(P)):d.push(P),y=0;y<e.children.length;y++)u(e.children[y],r,i,P,null)}},d=0;d<e.children.length;d++){var f,p=e.children[d];if(p.properties.length>0){var m=p.properties[0].value,g=null===p.properties[0].targetType?m:n.getMeshByName(m);g._meshId&&(g.mesh=n.getMeshByID(g._meshId)),f={trigger:t[p.name],parameter:g}}else f=t[p.name];for(var _=0;_<p.children.length;_++)p.detached||u(p.children[_],f,null,null)}},t.GetTriggerName=function(e){switch(e){case 0:return"NothingTrigger";case 1:return"OnPickTrigger";case 2:return"OnLeftPickTrigger";case 3:return"OnRightPickTrigger";case 4:return"OnCenterPickTrigger";case 5:return"OnPickDownTrigger";case 6:return"OnPickUpTrigger";case 7:return"OnLongPressTrigger";case 8:return"OnPointerOverTrigger";case 9:return"OnPointerOutTrigger";case 10:return"OnEveryFrameTrigger";case 11:return"OnIntersectionEnterTrigger";case 12:return"OnIntersectionExitTrigger";case 13:return"OnKeyDownTrigger";case 14:return"OnKeyUpTrigger";case 15:return"OnPickOutTrigger";default:return""}},t.NothingTrigger=p.Constants.ACTION_NothingTrigger,t.OnPickTrigger=p.Constants.ACTION_OnPickTrigger,t.OnLeftPickTrigger=p.Constants.ACTION_OnLeftPickTrigger,t.OnRightPickTrigger=p.Constants.ACTION_OnRightPickTrigger,t.OnCenterPickTrigger=p.Constants.ACTION_OnCenterPickTrigger,t.OnPickDownTrigger=p.Constants.ACTION_OnPickDownTrigger,t.OnDoublePickTrigger=p.Constants.ACTION_OnDoublePickTrigger,t.OnPickUpTrigger=p.Constants.ACTION_OnPickUpTrigger,t.OnPickOutTrigger=p.Constants.ACTION_OnPickOutTrigger,t.OnLongPressTrigger=p.Constants.ACTION_OnLongPressTrigger,t.OnPointerOverTrigger=p.Constants.ACTION_OnPointerOverTrigger,t.OnPointerOutTrigger=p.Constants.ACTION_OnPointerOutTrigger,t.OnEveryFrameTrigger=p.Constants.ACTION_OnEveryFrameTrigger,t.OnIntersectionEnterTrigger=p.Constants.ACTION_OnIntersectionEnterTrigger,t.OnIntersectionExitTrigger=p.Constants.ACTION_OnIntersectionExitTrigger,t.OnKeyDownTrigger=p.Constants.ACTION_OnKeyDownTrigger,t.OnKeyUpTrigger=15,t}(f.AbstractActionManager)},"./Actions/condition.ts":
- /*!******************************!*\
- !*** ./Actions/condition.ts ***!
- \******************************/
- /*! exports provided: Condition, ValueCondition, PredicateCondition, StateCondition */function(e,t,r){"use strict";r.r(t),r.d(t,"Condition",(function(){return s})),r.d(t,"ValueCondition",(function(){return a})),r.d(t,"PredicateCondition",(function(){return l})),r.d(t,"StateCondition",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./action */"./Actions/action.ts"),o=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),s=function(){function e(e){this._actionManager=e}return e.prototype.isValid=function(){return!0},e.prototype._getProperty=function(e){return this._actionManager._getProperty(e)},e.prototype._getEffectiveTarget=function(e,t){return this._actionManager._getEffectiveTarget(e,t)},e.prototype.serialize=function(){},e.prototype._serialize=function(e){return{type:2,children:[],name:e.name,properties:e.properties}},e}(),a=function(e){function t(r,n,i,o,s){void 0===s&&(s=t.IsEqual);var a=e.call(this,r)||this;return a.propertyPath=i,a.value=o,a.operator=s,a._target=n,a._effectiveTarget=a._getEffectiveTarget(n,a.propertyPath),a._property=a._getProperty(a.propertyPath),a}return Object(n.__extends)(t,e),Object.defineProperty(t,"IsEqual",{get:function(){return t._IsEqual},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsDifferent",{get:function(){return t._IsDifferent},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsGreater",{get:function(){return t._IsGreater},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsLesser",{get:function(){return t._IsLesser},enumerable:!1,configurable:!0}),t.prototype.isValid=function(){switch(this.operator){case t.IsGreater:return this._effectiveTarget[this._property]>this.value;case t.IsLesser:return this._effectiveTarget[this._property]<this.value;case t.IsEqual:case t.IsDifferent:var e;return e=this.value.equals?this.value.equals(this._effectiveTarget[this._property]):this.value===this._effectiveTarget[this._property],this.operator===t.IsEqual?e:!e}return!1},t.prototype.serialize=function(){return this._serialize({name:"ValueCondition",properties:[i.Action._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:i.Action._SerializeValueAsString(this.value)},{name:"operator",value:t.GetOperatorName(this.operator)}]})},t.GetOperatorName=function(e){switch(e){case t._IsEqual:return"IsEqual";case t._IsDifferent:return"IsDifferent";case t._IsGreater:return"IsGreater";case t._IsLesser:return"IsLesser";default:return""}},t._IsEqual=0,t._IsDifferent=1,t._IsGreater=2,t._IsLesser=3,t}(s),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n}return Object(n.__extends)(t,e),t.prototype.isValid=function(){return this.predicate()},t}(s),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.value=n,i._target=r,i}return Object(n.__extends)(t,e),t.prototype.isValid=function(){return this._target.state===this.value},t.prototype.serialize=function(){return this._serialize({name:"StateCondition",properties:[i.Action._GetTargetProperty(this._target),{name:"value",value:this.value}]})},t}(s);o._TypeStore.RegisteredTypes["BABYLON.ValueCondition"]=a,o._TypeStore.RegisteredTypes["BABYLON.PredicateCondition"]=l,o._TypeStore.RegisteredTypes["BABYLON.StateCondition"]=c},"./Actions/directActions.ts":
- /*!**********************************!*\
- !*** ./Actions/directActions.ts ***!
- \**********************************/
- /*! exports provided: SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction */function(e,t,r){"use strict";r.r(t),r.d(t,"SwitchBooleanAction",(function(){return c})),r.d(t,"SetStateAction",(function(){return u})),r.d(t,"SetValueAction",(function(){return d})),r.d(t,"IncrementValueAction",(function(){return h})),r.d(t,"PlayAnimationAction",(function(){return f})),r.d(t,"StopAnimationAction",(function(){return p})),r.d(t,"DoNothingAction",(function(){return m})),r.d(t,"CombineAction",(function(){return g})),r.d(t,"ExecuteCodeAction",(function(){return _})),r.d(t,"SetParentAction",(function(){return v}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ./action */"./Actions/action.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),c=function(e){function t(t,r,n,i){var o=e.call(this,t,i)||this;return o.propertyPath=n,o._target=o._effectiveTarget=r,o}return Object(n.__extends)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){this._effectiveTarget[this._property]=!this._effectiveTarget[this._property]},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SwitchBooleanAction",properties:[s.Action._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath}]},t)},t}(s.Action),u=function(e){function t(t,r,n,i){var o=e.call(this,t,i)||this;return o.value=n,o._target=r,o}return Object(n.__extends)(t,e),t.prototype.execute=function(){this._target.state=this.value},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetStateAction",properties:[s.Action._GetTargetProperty(this._target),{name:"value",value:this.value}]},t)},t}(s.Action),d=function(e){function t(t,r,n,i,o){var s=e.call(this,t,o)||this;return s.propertyPath=n,s.value=i,s._target=s._effectiveTarget=r,s}return Object(n.__extends)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){this._effectiveTarget[this._property]=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetValueAction",properties:[s.Action._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:s.Action._SerializeValueAsString(this.value)}]},t)},t}(s.Action),h=function(e){function t(t,r,n,i,o){var s=e.call(this,t,o)||this;return s.propertyPath=n,s.value=i,s._target=s._effectiveTarget=r,s}return Object(n.__extends)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath),"number"!=typeof this._effectiveTarget[this._property]&&i.Logger.Warn("Warning: IncrementValueAction can only be used with number values")},t.prototype.execute=function(){this._effectiveTarget[this._property]+=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"IncrementValueAction",properties:[s.Action._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:s.Action._SerializeValueAsString(this.value)}]},t)},t}(s.Action),f=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t,s)||this;return a.from=n,a.to=i,a.loop=o,a._target=r,a}return Object(n.__extends)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){this._actionManager.getScene().beginAnimation(this._target,this.from,this.to,this.loop)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"PlayAnimationAction",properties:[s.Action._GetTargetProperty(this._target),{name:"from",value:String(this.from)},{name:"to",value:String(this.to)},{name:"loop",value:s.Action._SerializeValueAsString(this.loop)||!1}]},t)},t}(s.Action),p=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i._target=r,i}return Object(n.__extends)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){this._actionManager.getScene().stopAnimation(this._target)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"StopAnimationAction",properties:[s.Action._GetTargetProperty(this._target)]},t)},t}(s.Action),m=function(e){function t(t,r){return void 0===t&&(t=a.Constants.ACTION_NothingTrigger),e.call(this,t,r)||this}return Object(n.__extends)(t,e),t.prototype.execute=function(){},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"DoNothingAction",properties:[]},t)},t}(s.Action),g=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i.children=r,i}return Object(n.__extends)(t,e),t.prototype._prepare=function(){for(var e=0;e<this.children.length;e++)this.children[e]._actionManager=this._actionManager,this.children[e]._prepare()},t.prototype.execute=function(e){for(var t=0;t<this.children.length;t++)this.children[t].execute(e)},t.prototype.serialize=function(t){for(var r=e.prototype._serialize.call(this,{name:"CombineAction",properties:[],combine:[]},t),n=0;n<this.children.length;n++)r.combine.push(this.children[n].serialize(null));return r},t}(s.Action),_=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i.func=r,i}return Object(n.__extends)(t,e),t.prototype.execute=function(e){this.func(e)},t}(s.Action),v=function(e){function t(t,r,n,i){var o=e.call(this,t,i)||this;return o._target=r,o._parent=n,o}return Object(n.__extends)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){if(this._target.parent!==this._parent){var e=this._parent.getWorldMatrix().clone();e.invert(),this._target.position=o.Vector3.TransformCoordinates(this._target.position,e),this._target.parent=this._parent}},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetParentAction",properties:[s.Action._GetTargetProperty(this._target),s.Action._GetTargetProperty(this._parent)]},t)},t}(s.Action);l._TypeStore.RegisteredTypes["BABYLON.SetParentAction"]=v,l._TypeStore.RegisteredTypes["BABYLON.ExecuteCodeAction"]=_,l._TypeStore.RegisteredTypes["BABYLON.DoNothingAction"]=m,l._TypeStore.RegisteredTypes["BABYLON.StopAnimationAction"]=p,l._TypeStore.RegisteredTypes["BABYLON.PlayAnimationAction"]=f,l._TypeStore.RegisteredTypes["BABYLON.IncrementValueAction"]=h,l._TypeStore.RegisteredTypes["BABYLON.SetValueAction"]=d,l._TypeStore.RegisteredTypes["BABYLON.SetStateAction"]=u,l._TypeStore.RegisteredTypes["BABYLON.SetParentAction"]=v},"./Actions/directAudioActions.ts":
- /*!***************************************!*\
- !*** ./Actions/directAudioActions.ts ***!
- \***************************************/
- /*! exports provided: PlaySoundAction, StopSoundAction */function(e,t,r){"use strict";r.r(t),r.d(t,"PlaySoundAction",(function(){return s})),r.d(t,"StopSoundAction",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./action */"./Actions/action.ts"),o=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),s=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i._sound=r,i}return Object(n.__extends)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){void 0!==this._sound&&this._sound.play()},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"PlaySoundAction",properties:[{name:"sound",value:this._sound.name}]},t)},t}(i.Action),a=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i._sound=r,i}return Object(n.__extends)(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){void 0!==this._sound&&this._sound.stop()},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"StopSoundAction",properties:[{name:"sound",value:this._sound.name}]},t)},t}(i.Action);o._TypeStore.RegisteredTypes["BABYLON.PlaySoundAction"]=a,o._TypeStore.RegisteredTypes["BABYLON.StopSoundAction"]=a},"./Actions/index.ts":
- /*!**************************!*\
- !*** ./Actions/index.ts ***!
- \**************************/
- /*! exports provided: AbstractActionManager, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./abstractActionManager */"./Actions/abstractActionManager.ts");r.d(t,"AbstractActionManager",(function(){return n.AbstractActionManager}));var i=r(/*! ./action */"./Actions/action.ts");r.d(t,"Action",(function(){return i.Action}));var o=r(/*! ./actionEvent */"./Actions/actionEvent.ts");r.d(t,"ActionEvent",(function(){return o.ActionEvent}));var s=r(/*! ./actionManager */"./Actions/actionManager.ts");r.d(t,"ActionManager",(function(){return s.ActionManager}));var a=r(/*! ./condition */"./Actions/condition.ts");r.d(t,"Condition",(function(){return a.Condition})),r.d(t,"ValueCondition",(function(){return a.ValueCondition})),r.d(t,"PredicateCondition",(function(){return a.PredicateCondition})),r.d(t,"StateCondition",(function(){return a.StateCondition}));var l=r(/*! ./directActions */"./Actions/directActions.ts");r.d(t,"SwitchBooleanAction",(function(){return l.SwitchBooleanAction})),r.d(t,"SetStateAction",(function(){return l.SetStateAction})),r.d(t,"SetValueAction",(function(){return l.SetValueAction})),r.d(t,"IncrementValueAction",(function(){return l.IncrementValueAction})),r.d(t,"PlayAnimationAction",(function(){return l.PlayAnimationAction})),r.d(t,"StopAnimationAction",(function(){return l.StopAnimationAction})),r.d(t,"DoNothingAction",(function(){return l.DoNothingAction})),r.d(t,"CombineAction",(function(){return l.CombineAction})),r.d(t,"ExecuteCodeAction",(function(){return l.ExecuteCodeAction})),r.d(t,"SetParentAction",(function(){return l.SetParentAction}));var c=r(/*! ./directAudioActions */"./Actions/directAudioActions.ts");r.d(t,"PlaySoundAction",(function(){return c.PlaySoundAction})),r.d(t,"StopSoundAction",(function(){return c.StopSoundAction}));var u=r(/*! ./interpolateValueAction */"./Actions/interpolateValueAction.ts");r.d(t,"InterpolateValueAction",(function(){return u.InterpolateValueAction}))},"./Actions/interpolateValueAction.ts":
- /*!*******************************************!*\
- !*** ./Actions/interpolateValueAction.ts ***!
- \*******************************************/
- /*! exports provided: InterpolateValueAction */function(e,t,r){"use strict";r.r(t),r.d(t,"InterpolateValueAction",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./action */"./Actions/action.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../Animations/animation */"./Animations/animation.ts"),u=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),d=function(e){function t(t,r,n,i,o,a,l,c){void 0===o&&(o=1e3);var u=e.call(this,t,a)||this;return u.duration=1e3,u.onInterpolationDoneObservable=new s.Observable,u.propertyPath=n,u.value=i,u.duration=o,u.stopOtherAnimations=l,u.onInterpolationDone=c,u._target=u._effectiveTarget=r,u}return Object(n.__extends)(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){var e,t=this,r=this._actionManager.getScene(),n=[{frame:0,value:this._effectiveTarget[this._property]},{frame:100,value:this.value}];if("number"==typeof this.value)e=c.Animation.ANIMATIONTYPE_FLOAT;else if(this.value instanceof a.Color3)e=c.Animation.ANIMATIONTYPE_COLOR3;else if(this.value instanceof l.Vector3)e=c.Animation.ANIMATIONTYPE_VECTOR3;else if(this.value instanceof l.Matrix)e=c.Animation.ANIMATIONTYPE_MATRIX;else{if(!(this.value instanceof l.Quaternion))return void o.Logger.Warn("InterpolateValueAction: Unsupported type ("+typeof this.value+")");e=c.Animation.ANIMATIONTYPE_QUATERNION}var i=new c.Animation("InterpolateValueAction",this._property,1e3/this.duration*100,e,c.Animation.ANIMATIONLOOPMODE_CONSTANT);i.setKeys(n),this.stopOtherAnimations&&r.stopAnimation(this._effectiveTarget),r.beginDirectAnimation(this._effectiveTarget,[i],0,100,!1,1,(function(){t.onInterpolationDoneObservable.notifyObservers(t),t.onInterpolationDone&&t.onInterpolationDone()}))},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"InterpolateValueAction",properties:[i.Action._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:i.Action._SerializeValueAsString(this.value)},{name:"duration",value:i.Action._SerializeValueAsString(this.duration)},{name:"stopOtherAnimations",value:i.Action._SerializeValueAsString(this.stopOtherAnimations)||!1}]},t)},t}(i.Action);u._TypeStore.RegisteredTypes["BABYLON.InterpolateValueAction"]=d},"./Animations/animatable.interface.ts":
- /*!********************************************!*\
- !*** ./Animations/animatable.interface.ts ***!
- \********************************************/
- /*! no static exports found */function(e,t){},"./Animations/animatable.ts":
- /*!**********************************!*\
- !*** ./Animations/animatable.ts ***!
- \**********************************/
- /*! exports provided: Animatable */function(e,t,r){"use strict";r.r(t),r.d(t,"Animatable",(function(){return u}));var n=r(/*! ./animation */"./Animations/animation.ts"),i=r(/*! ./runtimeAnimation */"./Animations/runtimeAnimation.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../scene */"./scene.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../Misc/precisionDate */"./Misc/precisionDate.ts"),c=r(/*! ../Bones/bone */"./Bones/bone.ts"),u=function(){function e(e,t,r,n,i,s,a,l,c,u){void 0===r&&(r=0),void 0===n&&(n=100),void 0===i&&(i=!1),void 0===s&&(s=1),void 0===u&&(u=!1),this.target=t,this.fromFrame=r,this.toFrame=n,this.loopAnimation=i,this.onAnimationEnd=a,this.onAnimationLoop=c,this.isAdditive=u,this._localDelayOffset=null,this._pausedDelay=null,this._runtimeAnimations=new Array,this._paused=!1,this._speedRatio=1,this._weight=-1,this._syncRoot=null,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new o.Observable,this.onAnimationLoopObservable=new o.Observable,this._scene=e,l&&this.appendAnimations(t,l),this._speedRatio=s,e._activeAnimatables.push(this)}return Object.defineProperty(e.prototype,"syncRoot",{get:function(){return this._syncRoot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterFrame",{get:function(){return 0===this._runtimeAnimations.length?0:this._runtimeAnimations[0].currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},set:function(e){this._weight=-1!==e?Math.min(Math.max(e,0),1):-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){for(var t=0;t<this._runtimeAnimations.length;t++)this._runtimeAnimations[t]._prepareForSpeedRatioChange(e);this._speedRatio=e},enumerable:!1,configurable:!0}),e.prototype.syncWith=function(e){if(this._syncRoot=e,e){var t=this._scene._activeAnimatables.indexOf(this);t>-1&&(this._scene._activeAnimatables.splice(t,1),this._scene._activeAnimatables.push(this))}return this},e.prototype.getAnimations=function(){return this._runtimeAnimations},e.prototype.appendAnimations=function(e,t){for(var r=this,n=0;n<t.length;n++){var o=t[n],s=new i.RuntimeAnimation(e,o,this._scene,this);s._onLoop=function(){r.onAnimationLoopObservable.notifyObservers(r),r.onAnimationLoop&&r.onAnimationLoop()},this._runtimeAnimations.push(s)}},e.prototype.getAnimationByTargetProperty=function(e){for(var t=this._runtimeAnimations,r=0;r<t.length;r++)if(t[r].animation.targetProperty===e)return t[r].animation;return null},e.prototype.getRuntimeAnimationByTargetProperty=function(e){for(var t=this._runtimeAnimations,r=0;r<t.length;r++)if(t[r].animation.targetProperty===e)return t[r];return null},e.prototype.reset=function(){for(var e=this._runtimeAnimations,t=0;t<e.length;t++)e[t].reset(!0);this._localDelayOffset=null,this._pausedDelay=null},e.prototype.enableBlending=function(e){for(var t=this._runtimeAnimations,r=0;r<t.length;r++)t[r].animation.enableBlending=!0,t[r].animation.blendingSpeed=e},e.prototype.disableBlending=function(){for(var e=this._runtimeAnimations,t=0;t<e.length;t++)e[t].animation.enableBlending=!1},e.prototype.goToFrame=function(e){var t=this._runtimeAnimations;if(t[0]){var r=t[0].animation.framePerSecond,n=t[0].currentFrame,i=0===this.speedRatio?0:(e-n)/r*1e3/this.speedRatio;null===this._localDelayOffset&&(this._localDelayOffset=0),this._localDelayOffset-=i}for(var o=0;o<t.length;o++)t[o].goToFrame(e)},e.prototype.pause=function(){this._paused||(this._paused=!0)},e.prototype.restart=function(){this._paused=!1},e.prototype._raiseOnAnimationEnd=function(){this.onAnimationEnd&&this.onAnimationEnd(),this.onAnimationEndObservable.notifyObservers(this)},e.prototype.stop=function(e,t){if(e||t){var r=this._scene._activeAnimatables.indexOf(this);if(r>-1){for(var n=(o=this._runtimeAnimations).length-1;n>=0;n--){var i=o[n];e&&i.animation.name!=e||t&&!t(i.target)||(i.dispose(),o.splice(n,1))}0==o.length&&(this._scene._activeAnimatables.splice(r,1),this._raiseOnAnimationEnd())}}else if((n=this._scene._activeAnimatables.indexOf(this))>-1){this._scene._activeAnimatables.splice(n,1);var o=this._runtimeAnimations;for(n=0;n<o.length;n++)o[n].dispose();this._raiseOnAnimationEnd()}},e.prototype.waitAsync=function(){var e=this;return new Promise((function(t,r){e.onAnimationEndObservable.add((function(){t(e)}),void 0,void 0,e,!0)}))},e.prototype._animate=function(e){if(this._paused)return this.animationStarted=!1,null===this._pausedDelay&&(this._pausedDelay=e),!0;if(null===this._localDelayOffset?(this._localDelayOffset=e,this._pausedDelay=null):null!==this._pausedDelay&&(this._localDelayOffset+=e-this._pausedDelay,this._pausedDelay=null),0===this._weight)return!0;var t,r=!1,n=this._runtimeAnimations;for(t=0;t<n.length;t++){var i=n[t].animate(e-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight);r=r||i}if(this.animationStarted=r,!r){if(this.disposeOnEnd)for(t=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(t,1),t=0;t<n.length;t++)n[t].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return r},e}();s.Scene.prototype._animate=function(){if(this.animationsEnabled){var e=l.PrecisionDate.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=e}this.deltaTime=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=e;var t=this._activeAnimatables;if(0!==t.length){this._animationTime+=this.deltaTime;for(var r=this._animationTime,n=0;n<t.length;n++){var i=t[n];!i._animate(r)&&i.disposeOnEnd&&n--}this._processLateAnimationBindings()}}},s.Scene.prototype.beginWeightedAnimation=function(e,t,r,n,i,o,s,a,l,c,u){void 0===n&&(n=1),void 0===o&&(o=1),void 0===u&&(u=!1);var d=this.beginAnimation(e,t,r,i,o,s,a,!1,l,c,u);return d.weight=n,d},s.Scene.prototype.beginAnimation=function(e,t,r,n,i,o,s,a,l,c,d){void 0===i&&(i=1),void 0===a&&(a=!0),void 0===d&&(d=!1),t>r&&i>0&&(i*=-1),a&&this.stopAnimation(e,void 0,l),s||(s=new u(this,e,t,r,n,i,o,void 0,c,d));var h=!l||l(e);if(e.animations&&h&&s.appendAnimations(e,e.animations),e.getAnimatables)for(var f=e.getAnimatables(),p=0;p<f.length;p++)this.beginAnimation(f[p],t,r,n,i,o,s,a,l,c);return s.reset(),s},s.Scene.prototype.beginHierarchyAnimation=function(e,t,r,n,i,o,s,a,l,c,u,d){void 0===o&&(o=1),void 0===l&&(l=!0),void 0===d&&(d=!1);var h=e.getDescendants(t),f=[];f.push(this.beginAnimation(e,r,n,i,o,s,a,l,c,void 0,d));for(var p=0,m=h;p<m.length;p++){var g=m[p];f.push(this.beginAnimation(g,r,n,i,o,s,a,l,c,void 0,d))}return f},s.Scene.prototype.beginDirectAnimation=function(e,t,r,n,i,o,s,a,l){return void 0===l&&(l=!1),void 0===o&&(o=1),r>n&&o>0&&(o*=-1),new u(this,e,r,n,i,o,s,t,a,l)},s.Scene.prototype.beginDirectHierarchyAnimation=function(e,t,r,n,i,o,s,a,l,c){void 0===c&&(c=!1);var u=e.getDescendants(t),d=[];d.push(this.beginDirectAnimation(e,r,n,i,o,s,a,l,c));for(var h=0,f=u;h<f.length;h++){var p=f[h];d.push(this.beginDirectAnimation(p,r,n,i,o,s,a,l,c))}return d},s.Scene.prototype.getAnimatableByTarget=function(e){for(var t=0;t<this._activeAnimatables.length;t++)if(this._activeAnimatables[t].target===e)return this._activeAnimatables[t];return null},s.Scene.prototype.getAllAnimatablesByTarget=function(e){for(var t=[],r=0;r<this._activeAnimatables.length;r++)this._activeAnimatables[r].target===e&&t.push(this._activeAnimatables[r]);return t},s.Scene.prototype.stopAnimation=function(e,t,r){for(var n=0,i=this.getAllAnimatablesByTarget(e);n<i.length;n++)i[n].stop(t,r)},s.Scene.prototype.stopAllAnimations=function(){if(this._activeAnimatables){for(var e=0;e<this._activeAnimatables.length;e++)this._activeAnimatables[e].stop();this._activeAnimatables=[]}for(var t=0,r=this.animationGroups;t<r.length;t++)r[t].stop()},s.Scene.prototype._registerTargetForLateAnimationBinding=function(e,t){var r=e.target;this._registeredForLateAnimationBindings.pushNoDuplicate(r),r._lateAnimationHolders||(r._lateAnimationHolders={}),r._lateAnimationHolders[e.targetPath]||(r._lateAnimationHolders[e.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:t}),e.isAdditive?(r._lateAnimationHolders[e.targetPath].additiveAnimations.push(e),r._lateAnimationHolders[e.targetPath].totalAdditiveWeight+=e.weight):(r._lateAnimationHolders[e.targetPath].animations.push(e),r._lateAnimationHolders[e.targetPath].totalWeight+=e.weight)},s.Scene.prototype._processLateAnimationBindingsForMatrices=function(e){if(0===e.totalWeight&&0===e.totalAdditiveWeight)return e.originalValue;var t=1,r=a.TmpVectors.Vector3[0],n=a.TmpVectors.Vector3[1],i=a.TmpVectors.Quaternion[0],o=0,s=e.animations[0],l=e.originalValue,c=1,u=!1;if(e.totalWeight<1)c=1-e.totalWeight,l.decompose(n,i,r);else{if(o=1,t=e.totalWeight,1==(c=s.weight/t)){if(!e.totalAdditiveWeight)return s.currentValue;u=!0}s.currentValue.decompose(n,i,r)}if(!u){n.scaleInPlace(c),r.scaleInPlace(c),i.scaleInPlace(c);for(var d=o;d<e.animations.length;d++)if(0!==(g=e.animations[d]).weight){c=g.weight/t;var h=a.TmpVectors.Vector3[2],f=a.TmpVectors.Vector3[3],p=a.TmpVectors.Quaternion[1];g.currentValue.decompose(f,p,h),f.scaleAndAddToRef(c,n),p.scaleAndAddToRef(c,i),h.scaleAndAddToRef(c,r)}}for(var m=0;m<e.additiveAnimations.length;m++){var g;0!==(g=e.additiveAnimations[m]).weight&&(h=a.TmpVectors.Vector3[2],f=a.TmpVectors.Vector3[3],p=a.TmpVectors.Quaternion[1],g.currentValue.decompose(f,p,h),f.multiplyToRef(n,f),a.Vector3.LerpToRef(n,f,g.weight,n),i.multiplyToRef(p,p),a.Quaternion.SlerpToRef(i,p,g.weight,i),h.scaleAndAddToRef(g.weight,r))}var _=s?s._animationState.workValue:a.TmpVectors.Matrix[0].clone();return a.Matrix.ComposeToRef(n,i,r,_),_},s.Scene.prototype._processLateAnimationBindingsForQuaternions=function(e,t){if(0===e.totalWeight&&0===e.totalAdditiveWeight)return t;var r=e.animations[0],n=e.originalValue,i=t;if(0===e.totalWeight&&e.totalAdditiveWeight>0)i.copyFrom(n);else if(1===e.animations.length){if(a.Quaternion.SlerpToRef(n,r.currentValue,Math.min(1,e.totalWeight),i),0===e.totalAdditiveWeight)return i}else if(e.animations.length>1){var o=1,s=void 0,l=void 0;if(e.totalWeight<1){var c=1-e.totalWeight;l=[],(s=[]).push(n),l.push(c)}else{if(2===e.animations.length&&(a.Quaternion.SlerpToRef(e.animations[0].currentValue,e.animations[1].currentValue,e.animations[1].weight/e.totalWeight,t),0===e.totalAdditiveWeight))return t;s=[],l=[],o=e.totalWeight}for(var u=0;u<e.animations.length;u++){var d=e.animations[u];s.push(d.currentValue),l.push(d.weight/o)}for(var h=0,f=0;f<s.length;)f?(h+=l[f],a.Quaternion.SlerpToRef(i,s[f],l[f]/h,i),f++):(a.Quaternion.SlerpToRef(s[f],s[f+1],l[f+1]/(l[f]+l[f+1]),t),i=t,h=l[f]+l[f+1],f+=2)}for(var p=0;p<e.additiveAnimations.length;p++)0!==(d=e.additiveAnimations[p]).weight&&(i.multiplyToRef(d.currentValue,a.TmpVectors.Quaternion[0]),a.Quaternion.SlerpToRef(i,a.TmpVectors.Quaternion[0],d.weight,i));return i},s.Scene.prototype._processLateAnimationBindings=function(){if(this._registeredForLateAnimationBindings.length){for(var e=0;e<this._registeredForLateAnimationBindings.length;e++){var t=this._registeredForLateAnimationBindings.data[e];for(var r in t._lateAnimationHolders){var i=t._lateAnimationHolders[r],o=i.animations[0],s=i.originalValue,l=n.Animation.AllowMatrixDecomposeForInterpolation&&s.m,c=t[r];if(l)c=this._processLateAnimationBindingsForMatrices(i);else if(void 0!==s.w)c=this._processLateAnimationBindingsForQuaternions(i,c||a.Quaternion.Identity());else{var u=0,d=1;if(i.totalWeight<1)c=o&&s.scale?s.scale(1-i.totalWeight):o?s*(1-i.totalWeight):s.clone?s.clone():s;else if(o){d=i.totalWeight;var h=o.weight/d;c=1!==h?o.currentValue.scale?o.currentValue.scale(h):o.currentValue*h:o.currentValue,u=1}for(var f=u;f<i.animations.length;f++)(g=(m=i.animations[f]).weight/d)&&(m.currentValue.scaleAndAddToRef?m.currentValue.scaleAndAddToRef(g,c):c+=m.currentValue*g);for(var p=0;p<i.additiveAnimations.length;p++){var m,g;(g=(m=i.additiveAnimations[p]).weight)&&(m.currentValue.scaleAndAddToRef?m.currentValue.scaleAndAddToRef(g,c):c+=m.currentValue*g)}}t[r]=c}t._lateAnimationHolders={}}this._registeredForLateAnimationBindings.reset()}},c.Bone.prototype.copyAnimationRange=function(e,t,r,i,o){void 0===i&&(i=!1),void 0===o&&(o=null),0===this.animations.length&&(this.animations.push(new n.Animation(this.name,"_matrix",e.animations[0].framePerSecond,n.Animation.ANIMATIONTYPE_MATRIX,0)),this.animations[0].setKeys([]));var s=e.animations[0].getRange(t);if(!s)return!1;for(var a,l,c,u=s.from,d=s.to,h=e.animations[0].getKeys(),f=e.length,p=e.getParent(),m=this.getParent(),g=i&&p&&f&&this.length&&f!==this.length,_=g&&m&&p?m.length/p.length:1,v=i&&!m&&o&&(1!==o.x||1!==o.y||1!==o.z),y=this.animations[0].getKeys(),b=0,A=h.length;b<A;b++)(a=h[b]).frame>=u&&a.frame<=d&&(i?(c=a.value.clone(),g?(l=c.getTranslation(),c.setTranslation(l.scaleInPlace(_))):v&&o?(l=c.getTranslation(),c.setTranslation(l.multiplyInPlace(o))):c=a.value):c=a.value,y.push({frame:a.frame+r,value:c}));return this.animations[0].createRange(t,u+r,d+r),!0}},"./Animations/animation.ts":
- /*!*********************************!*\
- !*** ./Animations/animation.ts ***!
- \*********************************/
- /*! exports provided: _IAnimationState, Animation */function(e,t,r){"use strict";r.r(t),r.d(t,"_IAnimationState",(function(){return f})),r.d(t,"Animation",(function(){return p}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),a=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ./animationKey */"./Animations/animationKey.ts"),c=r(/*! ./animationRange */"./Animations/animationRange.ts"),u=r(/*! ../node */"./node.ts"),d=r(/*! ../Maths/math.size */"./Maths/math.size.ts"),h=r(/*! ../Misc/webRequest */"./Misc/webRequest.ts"),f=function(){},p=function(){function e(t,r,n,i,o,s){this.name=t,this.targetProperty=r,this.framePerSecond=n,this.dataType=i,this.loopMode=o,this.enableBlending=s,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=r.split("."),this.dataType=i,this.loopMode=void 0===o?e.ANIMATIONLOOPMODE_CYCLE:o}return e._PrepareAnimation=function(t,r,o,s,a,l,c,u){var h=void 0;if(!isNaN(parseFloat(a))&&isFinite(a)?h=e.ANIMATIONTYPE_FLOAT:a instanceof n.Quaternion?h=e.ANIMATIONTYPE_QUATERNION:a instanceof n.Vector3?h=e.ANIMATIONTYPE_VECTOR3:a instanceof n.Vector2?h=e.ANIMATIONTYPE_VECTOR2:a instanceof i.Color3?h=e.ANIMATIONTYPE_COLOR3:a instanceof i.Color4?h=e.ANIMATIONTYPE_COLOR4:a instanceof d.Size&&(h=e.ANIMATIONTYPE_SIZE),null==h)return null;var f=new e(t,r,o,h,c),p=[{frame:0,value:a},{frame:s,value:l}];return f.setKeys(p),void 0!==u&&f.setEasingFunction(u),f},e.CreateAnimation=function(t,r,n,i){var o=new e(t+"Animation",t,n,r,e.ANIMATIONLOOPMODE_CONSTANT);return o.setEasingFunction(i),o},e.CreateAndStartAnimation=function(t,r,n,i,o,s,a,l,c,u){var d=e._PrepareAnimation(t,n,i,o,s,a,l,c);return d?r.getScene().beginDirectAnimation(r,[d],0,o,1===d.loopMode,1,u):null},e.CreateAndStartHierarchyAnimation=function(t,r,n,i,o,s,a,l,c,u,d){var h=e._PrepareAnimation(t,i,o,s,a,l,c,u);return h?r.getScene().beginDirectHierarchyAnimation(r,n,[h],0,s,1===h.loopMode,1,d):null},e.CreateMergeAndStartAnimation=function(t,r,n,i,o,s,a,l,c,u){var d=e._PrepareAnimation(t,n,i,o,s,a,l,c);return d?(r.animations.push(d),r.getScene().beginAnimation(r,0,o,1===d.loopMode,1,u)):null},e.MakeAnimationAdditive=function(t,r,i,o,s){void 0===r&&(r=0),void 0===o&&(o=!1);var a=t;if(o&&((a=t.clone()).name=s||a.name),!a._keys.length)return a;r=r>=0?r:0;var l=0,c=a._keys[0],u=a._keys.length-1,d=a._keys[u],h={referenceValue:c.value,referencePosition:n.TmpVectors.Vector3[0],referenceQuaternion:n.TmpVectors.Quaternion[0],referenceScaling:n.TmpVectors.Vector3[1],keyPosition:n.TmpVectors.Vector3[2],keyQuaternion:n.TmpVectors.Quaternion[1],keyScaling:n.TmpVectors.Vector3[3]},f=!1,p=c.frame,m=d.frame;if(i){var g=a.getRange(i);g&&(p=g.from,m=g.to)}var _=c.frame===p,v=d.frame===m;if(1===a._keys.length){var y=a._getKeyValue(a._keys[0]);h.referenceValue=y.clone?y.clone():y,f=!0}else r<=c.frame?(y=a._getKeyValue(c.value),h.referenceValue=y.clone?y.clone():y,f=!0):r>=d.frame&&(y=a._getKeyValue(d.value),h.referenceValue=y.clone?y.clone():y,f=!0);for(var b=0;!f||!_||!v&&b<a._keys.length-1;){var A=a._keys[b],T=a._keys[b+1];if(!f&&r>=A.frame&&r<=T.frame){if(y=void 0,r===A.frame)y=a._getKeyValue(A.value);else if(r===T.frame)y=a._getKeyValue(T.value);else{var M={key:b,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};y=a._interpolate(r,M)}h.referenceValue=y.clone?y.clone():y,f=!0}if(!_&&p>=A.frame&&p<=T.frame){if(p===A.frame)l=b;else if(p===T.frame)l=b+1;else{M={key:b,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};var P={frame:p,value:(y=a._interpolate(p,M)).clone?y.clone():y};a._keys.splice(b+1,0,P),l=b+1}_=!0}!v&&m>=A.frame&&m<=T.frame&&(m===A.frame?u=b:(m===T.frame||(M={key:b,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},P={frame:m,value:(y=a._interpolate(m,M)).clone?y.clone():y},a._keys.splice(b+1,0,P)),u=b+1),v=!0),b++}for(a.dataType===e.ANIMATIONTYPE_QUATERNION?h.referenceValue.normalize().conjugateInPlace():a.dataType===e.ANIMATIONTYPE_MATRIX&&(h.referenceValue.decompose(h.referenceScaling,h.referenceQuaternion,h.referencePosition),h.referenceQuaternion.normalize().conjugateInPlace()),b=l;b<=u;b++)if(P=a._keys[b],!b||a.dataType===e.ANIMATIONTYPE_FLOAT||P.value!==c.value)switch(a.dataType){case e.ANIMATIONTYPE_MATRIX:P.value.decompose(h.keyScaling,h.keyQuaternion,h.keyPosition),h.keyPosition.subtractInPlace(h.referencePosition),h.keyScaling.divideInPlace(h.referenceScaling),h.referenceQuaternion.multiplyToRef(h.keyQuaternion,h.keyQuaternion),n.Matrix.ComposeToRef(h.keyScaling,h.keyQuaternion,h.keyPosition,P.value);break;case e.ANIMATIONTYPE_QUATERNION:h.referenceValue.multiplyToRef(P.value,P.value);break;case e.ANIMATIONTYPE_VECTOR2:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:P.value.subtractToRef(h.referenceValue,P.value);break;case e.ANIMATIONTYPE_SIZE:P.value.width-=h.referenceValue.width,P.value.height-=h.referenceValue.height;break;default:P.value-=h.referenceValue}return a},e.TransitionTo=function(e,t,r,n,i,o,s,a){if(void 0===a&&(a=null),s<=0)return r[e]=t,a&&a(),null;var l=i*(s/1e3);o.setKeys([{frame:0,value:r[e].clone?r[e].clone():r[e]},{frame:l,value:t}]),r.animations||(r.animations=[]),r.animations.push(o);var c=n.beginAnimation(r,0,l,!1);return c.onAnimationEnd=a,c},Object.defineProperty(e.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRunningRuntimeAnimations",{get:function(){for(var e=0,t=this._runtimeAnimations;e<t.length;e++)if(!t[e].isStopped)return!0;return!1},enumerable:!1,configurable:!0}),e.prototype.toString=function(e){var t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var r=!0;for(var n in this._ranges)r&&(t+=", ",r=!1),t+=n;t+="}"}return t},e.prototype.addEvent=function(e){this._events.push(e),this._events.sort((function(e,t){return e.frame-t.frame}))},e.prototype.removeEvents=function(e){for(var t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)},e.prototype.getEvents=function(){return this._events},e.prototype.createRange=function(e,t,r){this._ranges[e]||(this._ranges[e]=new c.AnimationRange(e,t,r))},e.prototype.deleteRange=function(e,t){void 0===t&&(t=!0);var r=this._ranges[e];if(r){if(t)for(var n=r.from,i=r.to,o=this._keys.length-1;o>=0;o--)this._keys[o].frame>=n&&this._keys[o].frame<=i&&this._keys.splice(o,1);this._ranges[e]=null}},e.prototype.getRange=function(e){return this._ranges[e]},e.prototype.getKeys=function(){return this._keys},e.prototype.getHighestFrame=function(){for(var e=0,t=0,r=this._keys.length;t<r;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e},e.prototype.getEasingFunction=function(){return this._easingFunction},e.prototype.setEasingFunction=function(e){this._easingFunction=e},e.prototype.floatInterpolateFunction=function(e,t,r){return o.Scalar.Lerp(e,t,r)},e.prototype.floatInterpolateFunctionWithTangents=function(e,t,r,n,i){return o.Scalar.Hermite(e,t,r,n,i)},e.prototype.quaternionInterpolateFunction=function(e,t,r){return n.Quaternion.Slerp(e,t,r)},e.prototype.quaternionInterpolateFunctionWithTangents=function(e,t,r,i,o){return n.Quaternion.Hermite(e,t,r,i,o).normalize()},e.prototype.vector3InterpolateFunction=function(e,t,r){return n.Vector3.Lerp(e,t,r)},e.prototype.vector3InterpolateFunctionWithTangents=function(e,t,r,i,o){return n.Vector3.Hermite(e,t,r,i,o)},e.prototype.vector2InterpolateFunction=function(e,t,r){return n.Vector2.Lerp(e,t,r)},e.prototype.vector2InterpolateFunctionWithTangents=function(e,t,r,i,o){return n.Vector2.Hermite(e,t,r,i,o)},e.prototype.sizeInterpolateFunction=function(e,t,r){return d.Size.Lerp(e,t,r)},e.prototype.color3InterpolateFunction=function(e,t,r){return i.Color3.Lerp(e,t,r)},e.prototype.color4InterpolateFunction=function(e,t,r){return i.Color4.Lerp(e,t,r)},e.prototype._getKeyValue=function(e){return"function"==typeof e?e():e},e.prototype._interpolate=function(t,r){if(r.loopMode===e.ANIMATIONLOOPMODE_CONSTANT&&r.repeatCount>0)return r.highLimitValue.clone?r.highLimitValue.clone():r.highLimitValue;var n=this._keys;if(1===n.length)return this._getKeyValue(n[0].value);var i=r.key;if(n[i].frame>=t)for(;i-1>=0&&n[i].frame>=t;)i--;for(var o=i;o<n.length;o++){var s=n[o+1];if(s.frame>=t){r.key=o;var a=n[o],c=this._getKeyValue(a.value);if(a.interpolation===l.AnimationKeyInterpolation.STEP)return c;var u=this._getKeyValue(s.value),d=void 0!==a.outTangent&&void 0!==s.inTangent,h=s.frame-a.frame,f=(t-a.frame)/h,p=this.getEasingFunction();switch(null!=p&&(f=p.ease(f)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var m=d?this.floatInterpolateFunctionWithTangents(c,a.outTangent*h,u,s.inTangent*h,f):this.floatInterpolateFunction(c,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return m;case e.ANIMATIONLOOPMODE_RELATIVE:return r.offsetValue*r.repeatCount+m}break;case e.ANIMATIONTYPE_QUATERNION:var g=d?this.quaternionInterpolateFunctionWithTangents(c,a.outTangent.scale(h),u,s.inTangent.scale(h),f):this.quaternionInterpolateFunction(c,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return g;case e.ANIMATIONLOOPMODE_RELATIVE:return g.addInPlace(r.offsetValue.scale(r.repeatCount))}return g;case e.ANIMATIONTYPE_VECTOR3:var _=d?this.vector3InterpolateFunctionWithTangents(c,a.outTangent.scale(h),u,s.inTangent.scale(h),f):this.vector3InterpolateFunction(c,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return _;case e.ANIMATIONLOOPMODE_RELATIVE:return _.add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_VECTOR2:var v=d?this.vector2InterpolateFunctionWithTangents(c,a.outTangent.scale(h),u,s.inTangent.scale(h),f):this.vector2InterpolateFunction(c,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return v;case e.ANIMATIONLOOPMODE_RELATIVE:return v.add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_SIZE:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(c,u,f);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(c,u,f).add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_COLOR3:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(c,u,f);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(c,u,f).add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_COLOR4:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color4InterpolateFunction(c,u,f);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color4InterpolateFunction(c,u,f).add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_MATRIX:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(c,u,f,r.workValue);case e.ANIMATIONLOOPMODE_RELATIVE:return c}}break}}return this._getKeyValue(n[n.length-1].value)},e.prototype.matrixInterpolateFunction=function(t,r,i,o){return e.AllowMatrixDecomposeForInterpolation?o?(n.Matrix.DecomposeLerpToRef(t,r,i,o),o):n.Matrix.DecomposeLerp(t,r,i):o?(n.Matrix.LerpToRef(t,r,i,o),o):n.Matrix.Lerp(t,r,i)},e.prototype.clone=function(){var t=new e(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,this._keys&&t.setKeys(this._keys),this._ranges)for(var r in t._ranges={},this._ranges){var n=this._ranges[r];n&&(t._ranges[r]=n.clone())}return t},e.prototype.setKeys=function(e){this._keys=e.slice(0)},e.prototype.serialize=function(){var t={};t.name=this.name,t.property=this.targetProperty,t.framePerSecond=this.framePerSecond,t.dataType=this.dataType,t.loopBehavior=this.loopMode,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed;var r=this.dataType;t.keys=[];for(var n=this.getKeys(),i=0;i<n.length;i++){var o=n[i],s={};switch(s.frame=o.frame,r){case e.ANIMATIONTYPE_FLOAT:s.values=[o.value];break;case e.ANIMATIONTYPE_QUATERNION:case e.ANIMATIONTYPE_MATRIX:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:s.values=o.value.asArray()}t.keys.push(s)}for(var a in t.ranges=[],this._ranges){var l=this._ranges[a];if(l){var c={};c.name=a,c.from=l.from,c.to=l.to,t.ranges.push(c)}}return t},e._UniversalLerp=function(e,t,r){var n=e.constructor;return n.Lerp?n.Lerp(e,t,r):n.Slerp?n.Slerp(e,t,r):e.toFixed?e*(1-r)+r*t:t},e.Parse=function(t){var r,o,s=new e(t.name,t.property,t.framePerSecond,t.dataType,t.loopBehavior),a=t.dataType,l=[];for(t.enableBlending&&(s.enableBlending=t.enableBlending),t.blendingSpeed&&(s.blendingSpeed=t.blendingSpeed),o=0;o<t.keys.length;o++){var c,u,d=t.keys[o];switch(a){case e.ANIMATIONTYPE_FLOAT:r=d.values[0],d.values.length>=1&&(c=d.values[1]),d.values.length>=2&&(u=d.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(r=n.Quaternion.FromArray(d.values),d.values.length>=8){var h=n.Quaternion.FromArray(d.values.slice(4,8));h.equals(n.Quaternion.Zero())||(c=h)}if(d.values.length>=12){var f=n.Quaternion.FromArray(d.values.slice(8,12));f.equals(n.Quaternion.Zero())||(u=f)}break;case e.ANIMATIONTYPE_MATRIX:r=n.Matrix.FromArray(d.values);break;case e.ANIMATIONTYPE_COLOR3:r=i.Color3.FromArray(d.values);break;case e.ANIMATIONTYPE_COLOR4:r=i.Color4.FromArray(d.values);break;case e.ANIMATIONTYPE_VECTOR3:default:r=n.Vector3.FromArray(d.values)}var p={};p.frame=d.frame,p.value=r,null!=c&&(p.inTangent=c),null!=u&&(p.outTangent=u),l.push(p)}if(s.setKeys(l),t.ranges)for(o=0;o<t.ranges.length;o++)r=t.ranges[o],s.createRange(r.name,r.from,r.to);return s},e.AppendSerializedAnimations=function(e,t){s.SerializationHelper.AppendSerializedAnimations(e,t)},e.ParseFromFileAsync=function(e,t){var r=this;return new Promise((function(n,i){var o=new h.WebRequest;o.addEventListener("readystatechange",(function(){if(4==o.readyState)if(200==o.status){var t=JSON.parse(o.responseText);if(t.length){for(var s=new Array,a=0,l=t;a<l.length;a++){var c=l[a];s.push(r.Parse(c))}n(s)}else s=r.Parse(t),e&&(s.name=e),n(s)}else i("Unable to load the animation")})),o.open("GET",t),o.send()}))},e.CreateFromSnippetAsync=function(e){var t=this;return new Promise((function(r,n){var i=new h.WebRequest;i.addEventListener("readystatechange",(function(){if(4==i.readyState)if(200==i.status){var o=JSON.parse(JSON.parse(i.responseText).jsonPayload);if(o.animations){for(var s=JSON.parse(o.animations),a=new Array,l=0,c=s;l<c.length;l++){var u=c[l];a.push(t.Parse(u))}r(a)}else s=JSON.parse(o.animation),(a=t.Parse(s)).snippetId=e,r(a)}else n("Unable to load the snippet "+e)})),i.open("GET",t.SnippetUrl+"/"+e.replace(/#/g,"/")),i.send()}))},e.AllowMatricesInterpolation=!1,e.AllowMatrixDecomposeForInterpolation=!0,e.SnippetUrl="https://snippet.babylonjs.com",e.ANIMATIONTYPE_FLOAT=0,e.ANIMATIONTYPE_VECTOR3=1,e.ANIMATIONTYPE_QUATERNION=2,e.ANIMATIONTYPE_MATRIX=3,e.ANIMATIONTYPE_COLOR3=4,e.ANIMATIONTYPE_COLOR4=7,e.ANIMATIONTYPE_VECTOR2=5,e.ANIMATIONTYPE_SIZE=6,e.ANIMATIONLOOPMODE_RELATIVE=0,e.ANIMATIONLOOPMODE_CYCLE=1,e.ANIMATIONLOOPMODE_CONSTANT=2,e}();a._TypeStore.RegisteredTypes["BABYLON.Animation"]=p,u.Node._AnimationRangeFactory=function(e,t,r){return new c.AnimationRange(e,t,r)}},"./Animations/animationEvent.ts":
- /*!**************************************!*\
- !*** ./Animations/animationEvent.ts ***!
- \**************************************/
- /*! exports provided: AnimationEvent */function(e,t,r){"use strict";r.r(t),r.d(t,"AnimationEvent",(function(){return n}));var n=function(){function e(e,t,r){this.frame=e,this.action=t,this.onlyOnce=r,this.isDone=!1}return e.prototype._clone=function(){return new e(this.frame,this.action,this.onlyOnce)},e}()},"./Animations/animationGroup.ts":
- /*!**************************************!*\
- !*** ./Animations/animationGroup.ts ***!
- \**************************************/
- /*! exports provided: TargetedAnimation, AnimationGroup */function(e,t,r){"use strict";r.r(t),r.d(t,"TargetedAnimation",(function(){return s})),r.d(t,"AnimationGroup",(function(){return a}));var n=r(/*! ./animation */"./Animations/animation.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),s=(r(/*! ./animatable */"./Animations/animatable.ts"),function(){function e(){}return e.prototype.getClassName=function(){return"TargetedAnimation"},e.prototype.serialize=function(){var e={};return e.animation=this.animation.serialize(),e.targetId=this.target.id,e},e}()),a=function(){function e(e,t){void 0===t&&(t=null),this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this.onAnimationEndObservable=new i.Observable,this.onAnimationLoopObservable=new i.Observable,this.onAnimationGroupLoopObservable=new i.Observable,this.onAnimationGroupEndObservable=new i.Observable,this.onAnimationGroupPauseObservable=new i.Observable,this.onAnimationGroupPlayObservable=new i.Observable,this._scene=t||o.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}return Object.defineProperty(e.prototype,"from",{get:function(){return this._from},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"to",{get:function(){return this._to},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._isStarted&&!this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){if(this._speedRatio!==e){this._speedRatio=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].speedRatio=this._speedRatio}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopAnimation",{get:function(){return this._loopAnimation},set:function(e){if(this._loopAnimation!==e){this._loopAnimation=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].loopAnimation=this._loopAnimation}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._isAdditive},set:function(e){if(this._isAdditive!==e){this._isAdditive=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].isAdditive=this._isAdditive}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetedAnimations",{get:function(){return this._targetedAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animatables",{get:function(){return this._animatables},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._targetedAnimations},enumerable:!1,configurable:!0}),e.prototype.addTargetedAnimation=function(e,t){var r=new s;r.animation=e,r.target=t;var n=e.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to<n[n.length-1].frame&&(this._to=n[n.length-1].frame),this._targetedAnimations.push(r),r},e.prototype.normalize=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null),null==e&&(e=this._from),null==t&&(t=this._to);for(var r=0;r<this._targetedAnimations.length;r++){var n=this._targetedAnimations[r].animation.getKeys(),i=n[0],o=n[n.length-1];if(i.frame>e){var s={frame:e,value:i.value,inTangent:i.inTangent,outTangent:i.outTangent,interpolation:i.interpolation};n.splice(0,0,s)}o.frame<t&&(s={frame:t,value:o.value,inTangent:o.outTangent,outTangent:o.outTangent,interpolation:o.interpolation},n.push(s))}return this._from=e,this._to=t,this},e.prototype._processLoop=function(e,t,r){var n=this;e.onAnimationLoop=function(){n.onAnimationLoopObservable.notifyObservers(t),n._animationLoopFlags[r]||(n._animationLoopFlags[r]=!0,n._animationLoopCount++,n._animationLoopCount===n._targetedAnimations.length&&(n.onAnimationGroupLoopObservable.notifyObservers(n),n._animationLoopCount=0,n._animationLoopFlags=[]))}},e.prototype.start=function(e,t,r,n,i){var o=this;if(void 0===e&&(e=!1),void 0===t&&(t=1),this._isStarted||0===this._targetedAnimations.length)return this;this._loopAnimation=e,this._animationLoopCount=0,this._animationLoopFlags=[];for(var s=function(){var s=a._targetedAnimations[l],c=a._scene.beginDirectAnimation(s.target,[s.animation],void 0!==r?r:a._from,void 0!==n?n:a._to,e,t,void 0,void 0,void 0!==i?i:a._isAdditive);c.onAnimationEnd=function(){o.onAnimationEndObservable.notifyObservers(s),o._checkAnimationGroupEnded(c)},a._processLoop(c,s,l),a._animatables.push(c)},a=this,l=0;l<this._targetedAnimations.length;l++)s();if(this._speedRatio=t,void 0!==r&&void 0!==n)if(r<n&&this._speedRatio<0){var c=n;n=r,r=c}else r>n&&this._speedRatio>0&&(this._speedRatio=-t);return this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.pause=function(){if(!this._isStarted)return this;this._isPaused=!0;for(var e=0;e<this._animatables.length;e++)this._animatables[e].pause();return this.onAnimationGroupPauseObservable.notifyObservers(this),this},e.prototype.play=function(e){return this.isStarted&&this._animatables.length===this._targetedAnimations.length?(void 0!==e&&(this.loopAnimation=e),this.restart()):(this.stop(),this.start(e,this._speedRatio)),this._isPaused=!1,this},e.prototype.reset=function(){if(!this._isStarted)return this;for(var e=0;e<this._animatables.length;e++)this._animatables[e].reset();return this},e.prototype.restart=function(){if(!this._isStarted)return this;for(var e=0;e<this._animatables.length;e++)this._animatables[e].restart();return this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.stop=function(){if(!this._isStarted)return this;for(var e=this._animatables.slice(),t=0;t<e.length;t++)e[t].stop();return this._isStarted=!1,this},e.prototype.setWeightForAllAnimatables=function(e){for(var t=0;t<this._animatables.length;t++)this._animatables[t].weight=e;return this},e.prototype.syncAllAnimationsWith=function(e){for(var t=0;t<this._animatables.length;t++)this._animatables[t].syncWith(e);return this},e.prototype.goToFrame=function(e){if(!this._isStarted)return this;for(var t=0;t<this._animatables.length;t++)this._animatables[t].goToFrame(e);return this},e.prototype.dispose=function(){this._targetedAnimations=[],this._animatables=[];var e=this._scene.animationGroups.indexOf(this);e>-1&&this._scene.animationGroups.splice(e,1),this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()},e.prototype._checkAnimationGroupEnded=function(e){var t=this._animatables.indexOf(e);t>-1&&this._animatables.splice(t,1),0===this._animatables.length&&(this._isStarted=!1,this.onAnimationGroupEndObservable.notifyObservers(this))},e.prototype.clone=function(t,r){for(var n=new e(t||this.name,this._scene),i=0,o=this._targetedAnimations;i<o.length;i++){var s=o[i];n.addTargetedAnimation(s.animation.clone(),r?r(s.target):s.target)}return n},e.prototype.serialize=function(){var e={};e.name=this.name,e.from=this.from,e.to=this.to,e.targetedAnimations=[];for(var t=0;t<this.targetedAnimations.length;t++){var r=this.targetedAnimations[t];e.targetedAnimations[t]=r.serialize()}return e},e.Parse=function(t,r){for(var i=new e(t.name,r),o=0;o<t.targetedAnimations.length;o++){var s=t.targetedAnimations[o],a=n.Animation.Parse(s.animation),l=s.targetId;if("influence"===s.animation.property){var c=r.getMorphTargetById(l);c&&i.addTargetedAnimation(a,c)}else{var u=r.getNodeByID(l);null!=u&&i.addTargetedAnimation(a,u)}}return null!==t.from&&null!==t.to&&i.normalize(t.from,t.to),i},e.MakeAnimationAdditive=function(e,t,r,i,o){void 0===t&&(t=0),void 0===i&&(i=!1);var s=e;i&&(s=e.clone(o||s.name));for(var a=s.targetedAnimations,l=0;l<a.length;l++){var c=a[l];n.Animation.MakeAnimationAdditive(c.animation,t,r)}return s.isAdditive=!0,s},e.prototype.getClassName=function(){return"AnimationGroup"},e.prototype.toString=function(e){var t="Name: "+this.name;return t+=", type: "+this.getClassName(),e&&(t+=", from: "+this._from,t+=", to: "+this._to,t+=", isStarted: "+this._isStarted,t+=", speedRatio: "+this._speedRatio,t+=", targetedAnimations length: "+this._targetedAnimations.length,t+=", animatables length: "+this._animatables),t},e}()},"./Animations/animationKey.ts":
- /*!************************************!*\
- !*** ./Animations/animationKey.ts ***!
- \************************************/
- /*! exports provided: AnimationKeyInterpolation */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"AnimationKeyInterpolation",(function(){return n})),function(e){e[e.STEP=1]="STEP"}(n||(n={}))},"./Animations/animationPropertiesOverride.ts":
- /*!***************************************************!*\
- !*** ./Animations/animationPropertiesOverride.ts ***!
- \***************************************************/
- /*! exports provided: AnimationPropertiesOverride */function(e,t,r){"use strict";r.r(t),r.d(t,"AnimationPropertiesOverride",(function(){return i}));var n=r(/*! ../Animations/animation */"./Animations/animation.ts"),i=function(){this.enableBlending=!1,this.blendingSpeed=.01,this.loopMode=n.Animation.ANIMATIONLOOPMODE_CYCLE}},"./Animations/animationRange.ts":
- /*!**************************************!*\
- !*** ./Animations/animationRange.ts ***!
- \**************************************/
- /*! exports provided: AnimationRange */function(e,t,r){"use strict";r.r(t),r.d(t,"AnimationRange",(function(){return n}));var n=function(){function e(e,t,r){this.name=e,this.from=t,this.to=r}return e.prototype.clone=function(){return new e(this.name,this.from,this.to)},e}()},"./Animations/easing.ts":
- /*!******************************!*\
- !*** ./Animations/easing.ts ***!
- \******************************/
- /*! exports provided: EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase */function(e,t,r){"use strict";r.r(t),r.d(t,"EasingFunction",(function(){return o})),r.d(t,"CircleEase",(function(){return s})),r.d(t,"BackEase",(function(){return a})),r.d(t,"BounceEase",(function(){return l})),r.d(t,"CubicEase",(function(){return c})),r.d(t,"ElasticEase",(function(){return u})),r.d(t,"ExponentialEase",(function(){return d})),r.d(t,"PowerEase",(function(){return h})),r.d(t,"QuadraticEase",(function(){return f})),r.d(t,"QuarticEase",(function(){return p})),r.d(t,"QuinticEase",(function(){return m})),r.d(t,"SineEase",(function(){return g})),r.d(t,"BezierCurveEase",(function(){return _}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.path */"./Maths/math.path.ts"),o=function(){function e(){this._easingMode=e.EASINGMODE_EASEIN}return e.prototype.setEasingMode=function(e){var t=Math.min(Math.max(e,0),2);this._easingMode=t},e.prototype.getEasingMode=function(){return this._easingMode},e.prototype.easeInCore=function(e){throw new Error("You must implement this method")},e.prototype.ease=function(t){switch(this._easingMode){case e.EASINGMODE_EASEIN:return this.easeInCore(t);case e.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-t)}return t>=.5?.5*(1-this.easeInCore(2*(1-t)))+.5:.5*this.easeInCore(2*t)},e.EASINGMODE_EASEIN=0,e.EASINGMODE_EASEOUT=1,e.EASINGMODE_EASEINOUT=2,e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e=Math.max(0,Math.min(1,e)),1-Math.sqrt(1-e*e)},t}(o),a=function(e){function t(t){void 0===t&&(t=1);var r=e.call(this)||this;return r.amplitude=t,r}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)},t}(o),l=function(e){function t(t,r){void 0===t&&(t=3),void 0===r&&(r=2);var n=e.call(this)||this;return n.bounces=t,n.bounciness=r,n}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.bounces),r=this.bounciness;r<=1&&(r=1.001);var n=Math.pow(r,t),i=1-r,o=(1-n)/i+.5*n,s=e*o,a=Math.log(-s*(1-r)+1)/Math.log(r),l=Math.floor(a),c=l+1,u=(1-Math.pow(r,l))/(i*o),d=.5*(u+(1-Math.pow(r,c))/(i*o)),h=e-d,f=d-u;return-Math.pow(1/r,t-l)/(f*f)*(h-f)*(h+f)},t}(o),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e*e},t}(o),u=function(e){function t(t,r){void 0===t&&(t=3),void 0===r&&(r=3);var n=e.call(this)||this;return n.oscillations=t,n.springiness=r,n}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.oscillations),r=Math.max(0,this.springiness);return(0==r?e:(Math.exp(r*e)-1)/(Math.exp(r)-1))*Math.sin((6.283185307179586*t+1.5707963267948966)*e)},t}(o),d=function(e){function t(t){void 0===t&&(t=2);var r=e.call(this)||this;return r.exponent=t,r}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)},t}(o),h=function(e){function t(t){void 0===t&&(t=2);var r=e.call(this)||this;return r.power=t,r}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.power);return Math.pow(e,t)},t}(o),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e},t}(o),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e*e*e},t}(o),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e*e*e*e},t}(o),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return 1-Math.sin(1.5707963267948966*(1-e))},t}(o),_=function(e){function t(t,r,n,i){void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===i&&(i=1);var o=e.call(this)||this;return o.x1=t,o.y1=r,o.x2=n,o.y2=i,o}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return i.BezierCurve.Interpolate(e,this.x1,this.y1,this.x2,this.y2)},t}(o)},"./Animations/index.ts":
- /*!*****************************!*\
- !*** ./Animations/index.ts ***!
- \*****************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./animatable */"./Animations/animatable.ts");r.d(t,"Animatable",(function(){return n.Animatable}));var i=r(/*! ./animation */"./Animations/animation.ts");r.d(t,"_IAnimationState",(function(){return i._IAnimationState})),r.d(t,"Animation",(function(){return i.Animation}));var o=r(/*! ./animationGroup */"./Animations/animationGroup.ts");r.d(t,"TargetedAnimation",(function(){return o.TargetedAnimation})),r.d(t,"AnimationGroup",(function(){return o.AnimationGroup}));var s=r(/*! ./animationPropertiesOverride */"./Animations/animationPropertiesOverride.ts");r.d(t,"AnimationPropertiesOverride",(function(){return s.AnimationPropertiesOverride}));var a=r(/*! ./easing */"./Animations/easing.ts");r.d(t,"EasingFunction",(function(){return a.EasingFunction})),r.d(t,"CircleEase",(function(){return a.CircleEase})),r.d(t,"BackEase",(function(){return a.BackEase})),r.d(t,"BounceEase",(function(){return a.BounceEase})),r.d(t,"CubicEase",(function(){return a.CubicEase})),r.d(t,"ElasticEase",(function(){return a.ElasticEase})),r.d(t,"ExponentialEase",(function(){return a.ExponentialEase})),r.d(t,"PowerEase",(function(){return a.PowerEase})),r.d(t,"QuadraticEase",(function(){return a.QuadraticEase})),r.d(t,"QuarticEase",(function(){return a.QuarticEase})),r.d(t,"QuinticEase",(function(){return a.QuinticEase})),r.d(t,"SineEase",(function(){return a.SineEase})),r.d(t,"BezierCurveEase",(function(){return a.BezierCurveEase}));var l=r(/*! ./runtimeAnimation */"./Animations/runtimeAnimation.ts");r.d(t,"RuntimeAnimation",(function(){return l.RuntimeAnimation}));var c=r(/*! ./animationEvent */"./Animations/animationEvent.ts");r.d(t,"AnimationEvent",(function(){return c.AnimationEvent}));var u=r(/*! ./animationKey */"./Animations/animationKey.ts");r.d(t,"AnimationKeyInterpolation",(function(){return u.AnimationKeyInterpolation}));var d=r(/*! ./animationRange */"./Animations/animationRange.ts");r.d(t,"AnimationRange",(function(){return d.AnimationRange}));var h=r(/*! ./animatable.interface */"./Animations/animatable.interface.ts");for(var f in h)["Animatable","_IAnimationState","Animation","TargetedAnimation","AnimationGroup","AnimationPropertiesOverride","EasingFunction","CircleEase","BackEase","BounceEase","CubicEase","ElasticEase","ExponentialEase","PowerEase","QuadraticEase","QuarticEase","QuinticEase","SineEase","BezierCurveEase","RuntimeAnimation","AnimationEvent","AnimationKeyInterpolation","AnimationRange","default"].indexOf(f)<0&&function(e){r.d(t,e,(function(){return h[e]}))}(f)},"./Animations/runtimeAnimation.ts":
- /*!****************************************!*\
- !*** ./Animations/runtimeAnimation.ts ***!
- \****************************************/
- /*! exports provided: RuntimeAnimation */function(e,t,r){"use strict";r.r(t),r.d(t,"RuntimeAnimation",(function(){return h}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ./animation */"./Animations/animation.ts"),s=r(/*! ../Maths/math.size */"./Maths/math.size.ts"),a=Object.freeze(new n.Quaternion(0,0,0,0)),l=Object.freeze(n.Vector3.Zero()),c=Object.freeze(n.Vector2.Zero()),u=Object.freeze(s.Size.Zero()),d=Object.freeze(i.Color3.Black()),h=function(){function e(e,t,r,i){var s=this;if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._ratioOffset=0,this._previousDelay=0,this._previousRatio=0,this._targetIsArray=!1,this._animation=t,this._target=e,this._scene=r,this._host=i,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===o.Animation.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=n.Matrix.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minValue=this._keys[0].value,this._maxValue=this._keys[this._keys.length-1].value,0!==this._minFrame){var a={frame:0,value:this._minValue};this._keys.splice(0,0,a)}if(this._target instanceof Array){for(var l=0,c=0,u=this._target;c<u.length;c++){var d=u[c];this._preparePath(d,l),this._getOriginalValues(l),l++}this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];var h=t.getEvents();h&&h.length>0&&h.forEach((function(e){s._events.push(e._clone())})),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._currentActiveTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._host&&this._host.isAdditive},enumerable:!1,configurable:!0}),e.prototype._preparePath=function(e,t){void 0===t&&(t=0);var r=this._animation.targetPropertyPath;if(r.length>1){for(var n=e[r[0]],i=1;i<r.length-1;i++)n=n[r[i]];this._targetPath=r[r.length-1],this._activeTargets[t]=n}else this._targetPath=r[0],this._activeTargets[t]=e},Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!1,configurable:!0}),e.prototype.reset=function(e){if(void 0===e&&(e=!1),e)if(this._target instanceof Array)for(var t=0,r=0,n=this._target;r<n.length;r++){var i=n[r];void 0!==this._originalValue[t]&&this._setValue(i,this._activeTargets[t],this._originalValue[t],-1,t),t++}else void 0!==this._originalValue[0]&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);for(this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0,t=0;t<this._events.length;t++)this._events[t].isDone=!1},e.prototype.isStopped=function(){return this._stopped},e.prototype.dispose=function(){var e=this._animation.runtimeAnimations.indexOf(this);e>-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype.setValue=function(e,t){if(this._targetIsArray)for(var r=0;r<this._target.length;r++){var n=this._target[r];this._setValue(n,this._activeTargets[r],e,t,r)}else this._setValue(this._target,this._directTarget,e,t,0)},e.prototype._getOriginalValues=function(e){var t;void 0===e&&(e=0);var r=this._activeTargets[e];(t=r.getRestPose&&"_matrix"===this._targetPath?r.getRestPose():r[this._targetPath])&&t.clone?this._originalValue[e]=t.clone():this._originalValue[e]=t},e.prototype._setValue=function(e,t,r,i,s){if(this._currentActiveTarget=t,this._weight=i,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){var a=t[this._targetPath];a.clone?this._originalBlendValue=a.clone():this._originalBlendValue=a}this._originalBlendValue.m?o.Animation.AllowMatrixDecomposeForInterpolation?this._currentValue?n.Matrix.DecomposeLerpToRef(this._originalBlendValue,r,this._blendingFactor,this._currentValue):this._currentValue=n.Matrix.DecomposeLerp(this._originalBlendValue,r,this._blendingFactor):this._currentValue?n.Matrix.LerpToRef(this._originalBlendValue,r,this._blendingFactor,this._currentValue):this._currentValue=n.Matrix.Lerp(this._originalBlendValue,r,this._blendingFactor):this._currentValue=o.Animation._UniversalLerp(this._originalBlendValue,r,this._blendingFactor);var l=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=l}else this._currentValue=r;-1!==i?this._scene._registerTargetForLateAnimationBinding(this,this._originalValue[s]):t[this._targetPath]=this._currentValue,e.markAsDirty&&e.markAsDirty(this._animation.targetProperty)},e.prototype._getCorrectLoopMode=function(){return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode},e.prototype.goToFrame=function(e){var t=this._animation.getKeys();e<t[0].frame?e=t[0].frame:e>t[t.length-1].frame&&(e=t[t.length-1].frame);var r=this._events;if(r.length)for(var n=0;n<r.length;n++)r[n].onlyOnce||(r[n].isDone=r[n].frame<e);this._currentFrame=e;var i=this._animation._interpolate(e,this._animationState);this.setValue(i,-1)},e.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},e.prototype.animate=function(e,t,r,n,i,s){void 0===s&&(s=-1);var h=this._animation,f=h.targetPropertyPath;if(!f||f.length<1)return this._stopped=!0,!1;var p=!0;(t<this._minFrame||t>this._maxFrame)&&(t=this._minFrame),(r<this._minFrame||r>this._maxFrame)&&(r=this._maxFrame);var m,g,_=r-t,v=e*(h.framePerSecond*i)/1e3+this._ratioOffset,y=0;if(this._previousDelay=e,this._previousRatio=v,!n&&r>=t&&v>=_)p=!1,y=h._getKeyValue(this._maxValue);else if(!n&&t>=r&&v<=_)p=!1,y=h._getKeyValue(this._minValue);else if(this._animationState.loopMode!==o.Animation.ANIMATIONLOOPMODE_CYCLE){var b=r.toString()+t.toString();if(!this._offsetsCache[b]){this._animationState.repeatCount=0,this._animationState.loopMode=o.Animation.ANIMATIONLOOPMODE_CYCLE;var A=h._interpolate(t,this._animationState),T=h._interpolate(r,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),h.dataType){case o.Animation.ANIMATIONTYPE_FLOAT:this._offsetsCache[b]=T-A;break;case o.Animation.ANIMATIONTYPE_QUATERNION:this._offsetsCache[b]=T.subtract(A);break;case o.Animation.ANIMATIONTYPE_VECTOR3:this._offsetsCache[b]=T.subtract(A);case o.Animation.ANIMATIONTYPE_VECTOR2:this._offsetsCache[b]=T.subtract(A);case o.Animation.ANIMATIONTYPE_SIZE:this._offsetsCache[b]=T.subtract(A);case o.Animation.ANIMATIONTYPE_COLOR3:this._offsetsCache[b]=T.subtract(A)}this._highLimitsCache[b]=T}y=this._highLimitsCache[b],m=this._offsetsCache[b]}if(void 0===m)switch(h.dataType){case o.Animation.ANIMATIONTYPE_FLOAT:m=0;break;case o.Animation.ANIMATIONTYPE_QUATERNION:m=a;break;case o.Animation.ANIMATIONTYPE_VECTOR3:m=l;break;case o.Animation.ANIMATIONTYPE_VECTOR2:m=c;break;case o.Animation.ANIMATIONTYPE_SIZE:m=u;break;case o.Animation.ANIMATIONTYPE_COLOR3:m=d}if(this._host&&this._host.syncRoot){var M=this._host.syncRoot;g=t+(r-t)*((M.masterFrame-M.fromFrame)/(M.toFrame-M.fromFrame))}else g=p&&0!==_?t+v%_:r;var P=this._events;if((_>0&&this.currentFrame>g||_<0&&this.currentFrame<g)&&(this._onLoop(),P.length))for(var S=0;S<P.length;S++)P[S].onlyOnce||(P[S].isDone=!1);this._currentFrame=g,this._animationState.repeatCount=0===_?0:v/_>>0,this._animationState.highLimitValue=y,this._animationState.offsetValue=m;var E=h._interpolate(g,this._animationState);if(this.setValue(E,s),P.length)for(S=0;S<P.length;S++)if(_>0&&g>=P[S].frame&&P[S].frame>=t||_<0&&g<=P[S].frame&&P[S].frame<=t){var C=P[S];C.isDone||(C.onlyOnce&&(P.splice(S,1),S--),C.isDone=!0,C.action(g))}return p||(this._stopped=!0),p},e}()},"./Audio/analyser.ts":
- /*!***************************!*\
- !*** ./Audio/analyser.ts ***!
- \***************************/
- /*! exports provided: Analyser */function(e,t,r){"use strict";r.r(t),r.d(t,"Analyser",(function(){return i}));var n=r(/*! ../Engines/engine */"./Engines/engine.ts"),i=function(){function e(e){this.SMOOTHING=.75,this.FFT_SIZE=512,this.BARGRAPHAMPLITUDE=256,this.DEBUGCANVASPOS={x:20,y:20},this.DEBUGCANVASSIZE={width:320,height:200},this._scene=e,this._audioEngine=n.Engine.audioEngine,this._audioEngine.canUseWebAudio&&this._audioEngine.audioContext&&(this._webAudioAnalyser=this._audioEngine.audioContext.createAnalyser(),this._webAudioAnalyser.minDecibels=-140,this._webAudioAnalyser.maxDecibels=0,this._byteFreqs=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._byteTime=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._floatFreqs=new Float32Array(this._webAudioAnalyser.frequencyBinCount))}return e.prototype.getFrequencyBinCount=function(){return this._audioEngine.canUseWebAudio?this._webAudioAnalyser.frequencyBinCount:0},e.prototype.getByteFrequencyData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)),this._byteFreqs},e.prototype.getByteTimeDomainData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)),this._byteTime},e.prototype.getFloatFrequencyData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)),this._floatFreqs},e.prototype.drawDebugCanvas=function(){var e=this;if(this._audioEngine.canUseWebAudio&&(this._debugCanvas||(this._debugCanvas=document.createElement("canvas"),this._debugCanvas.width=this.DEBUGCANVASSIZE.width,this._debugCanvas.height=this.DEBUGCANVASSIZE.height,this._debugCanvas.style.position="absolute",this._debugCanvas.style.top=this.DEBUGCANVASPOS.y+"px",this._debugCanvas.style.left=this.DEBUGCANVASPOS.x+"px",this._debugCanvasContext=this._debugCanvas.getContext("2d"),document.body.appendChild(this._debugCanvas),this._registerFunc=function(){e.drawDebugCanvas()},this._scene.registerBeforeRender(this._registerFunc)),this._registerFunc&&this._debugCanvasContext)){var t=this.getByteFrequencyData();this._debugCanvasContext.fillStyle="rgb(0, 0, 0)",this._debugCanvasContext.fillRect(0,0,this.DEBUGCANVASSIZE.width,this.DEBUGCANVASSIZE.height);for(var r=0;r<this.getFrequencyBinCount();r++){var n=t[r]/this.BARGRAPHAMPLITUDE,i=this.DEBUGCANVASSIZE.height*n,o=this.DEBUGCANVASSIZE.height-i-1,s=this.DEBUGCANVASSIZE.width/this.getFrequencyBinCount(),a=r/this.getFrequencyBinCount()*360;this._debugCanvasContext.fillStyle="hsl("+a+", 100%, 50%)",this._debugCanvasContext.fillRect(r*s,o,s,i)}}},e.prototype.stopDebugCanvas=function(){this._debugCanvas&&(this._registerFunc&&(this._scene.unregisterBeforeRender(this._registerFunc),this._registerFunc=null),document.body.removeChild(this._debugCanvas),this._debugCanvas=null,this._debugCanvasContext=null)},e.prototype.connectAudioNodes=function(e,t){this._audioEngine.canUseWebAudio&&(e.connect(this._webAudioAnalyser),this._webAudioAnalyser.connect(t))},e.prototype.dispose=function(){this._audioEngine.canUseWebAudio&&this._webAudioAnalyser.disconnect()},e}()},"./Audio/audioEngine.ts":
- /*!******************************!*\
- !*** ./Audio/audioEngine.ts ***!
- \******************************/
- /*! exports provided: AudioEngine */function(e,t,r){"use strict";r.r(t),r.d(t,"AudioEngine",(function(){return o}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Misc/logger */"./Misc/logger.ts");r(/*! ../Engines/engine */"./Engines/engine.ts").Engine.AudioEngineFactory=function(e){return new o(e)};var o=function(){function e(e){var t=this;void 0===e&&(e=null),this._audioContext=null,this._audioContextInitialized=!1,this._muteButton=null,this.canUseWebAudio=!1,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!0,this.useCustomUnlockedButton=!1,this.onAudioUnlockedObservable=new n.Observable,this.onAudioLockedObservable=new n.Observable,this._tryToRun=!1,this._onResize=function(){t._moveButtonToTopLeft()},void 0===window.AudioContext&&void 0===window.webkitAudioContext||(window.AudioContext=window.AudioContext||window.webkitAudioContext,this.canUseWebAudio=!0);var r=document.createElement("audio");this._hostElement=e;try{r&&r.canPlayType&&r.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,"")&&(this.isMP3supported=!0)}catch(e){}try{r&&r.canPlayType&&r.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.isOGGsupported=!0)}catch(e){}}return Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._audioContextInitialized?this.unlocked||this._muteButton||this._displayMuteButton():this._initializeAudioContext(),this._audioContext},enumerable:!1,configurable:!0}),e.prototype.lock=function(){this._triggerSuspendedState()},e.prototype.unlock=function(){this._triggerRunningState()},e.prototype._resumeAudioContext=function(){var e;return void 0!==this._audioContext.resume&&(e=this._audioContext.resume()),e||Promise.resolve()},e.prototype._initializeAudioContext=function(){try{this.canUseWebAudio&&(this._audioContext=new AudioContext,this.masterGain=this._audioContext.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this._audioContext.destination),this._audioContextInitialized=!0,"running"===this._audioContext.state&&this._triggerRunningState())}catch(e){this.canUseWebAudio=!1,i.Logger.Error("Web Audio: "+e.message)}},e.prototype._triggerRunningState=function(){var e=this;this._tryToRun||(this._tryToRun=!0,this._resumeAudioContext().then((function(){e._tryToRun=!1,e._muteButton&&e._hideMuteButton(),e.unlocked=!0,e.onAudioUnlockedObservable.notifyObservers(e)})).catch((function(){e._tryToRun=!1,e.unlocked=!1})))},e.prototype._triggerSuspendedState=function(){this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this),this._displayMuteButton()},e.prototype._displayMuteButton=function(){var e=this;if(!this.useCustomUnlockedButton&&!this._muteButton){this._muteButton=document.createElement("BUTTON"),this._muteButton.className="babylonUnmuteIcon",this._muteButton.id="babylonUnmuteIconBtn",this._muteButton.title="Unmute";var t=".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E":"https://cdn.babylonjs.com/Assets/audio.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }",r=document.createElement("style");r.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(r),document.body.appendChild(this._muteButton),this._moveButtonToTopLeft(),this._muteButton.addEventListener("touchend",(function(){e._triggerRunningState()}),!0),this._muteButton.addEventListener("click",(function(){e._triggerRunningState()}),!0),window.addEventListener("resize",this._onResize)}},e.prototype._moveButtonToTopLeft=function(){this._hostElement&&this._muteButton&&(this._muteButton.style.top=this._hostElement.offsetTop+20+"px",this._muteButton.style.left=this._hostElement.offsetLeft+20+"px")},e.prototype._hideMuteButton=function(){this._muteButton&&(document.body.removeChild(this._muteButton),this._muteButton=null)},e.prototype.dispose=function(){this.canUseWebAudio&&this._audioContextInitialized&&(this._connectedAnalyser&&this._audioContext&&(this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser.dispose(),this.masterGain.disconnect(),this.masterGain.connect(this._audioContext.destination),this._connectedAnalyser=null),this.masterGain.gain.value=1),this.WarnedWebAudioUnsupported=!1,this._hideMuteButton(),window.removeEventListener("resize",this._onResize),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()},e.prototype.getGlobalVolume=function(){return this.canUseWebAudio&&this._audioContextInitialized?this.masterGain.gain.value:-1},e.prototype.setGlobalVolume=function(e){this.canUseWebAudio&&this._audioContextInitialized&&(this.masterGain.gain.value=e)},e.prototype.connectToAnalyser=function(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this.canUseWebAudio&&this._audioContextInitialized&&this._audioContext&&(this._connectedAnalyser=e,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._audioContext.destination))},e}()},"./Audio/audioSceneComponent.ts":
- /*!**************************************!*\
- !*** ./Audio/audioSceneComponent.ts ***!
- \**************************************/
- /*! exports provided: AudioSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"AudioSceneComponent",(function(){return d}));var n=r(/*! ./sound */"./Audio/sound.ts"),i=r(/*! ./soundTrack */"./Audio/soundTrack.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../sceneComponent */"./sceneComponent.ts"),l=r(/*! ../scene */"./scene.ts"),c=r(/*! ../abstractScene */"./abstractScene.ts"),u=(r(/*! ./audioEngine */"./Audio/audioEngine.ts"),r(/*! ../Misc/precisionDate */"./Misc/precisionDate.ts"));c.AbstractScene.AddParser(a.SceneComponentConstants.NAME_AUDIO,(function(e,t,r,i){var s,a=[];if(r.sounds=r.sounds||[],void 0!==e.sounds&&null!==e.sounds)for(var l=0,c=e.sounds.length;l<c;l++){var u=e.sounds[l];o.Engine.audioEngine.canUseWebAudio?(u.url||(u.url=u.name),a[u.url]?r.sounds.push(n.Sound.Parse(u,t,i,a[u.url])):(s=n.Sound.Parse(u,t,i),a[u.url]=s,r.sounds.push(s))):r.sounds.push(new n.Sound(u.name,null,t))}a=[]})),Object.defineProperty(l.Scene.prototype,"mainSoundTrack",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new d(this),this._addComponent(e)),this._mainSoundTrack||(this._mainSoundTrack=new i.SoundTrack(this,{mainTrack:!0})),this._mainSoundTrack},enumerable:!0,configurable:!0}),l.Scene.prototype.getSoundByName=function(e){var t;for(t=0;t<this.mainSoundTrack.soundCollection.length;t++)if(this.mainSoundTrack.soundCollection[t].name===e)return this.mainSoundTrack.soundCollection[t];if(this.soundTracks)for(var r=0;r<this.soundTracks.length;r++)for(t=0;t<this.soundTracks[r].soundCollection.length;t++)if(this.soundTracks[r].soundCollection[t].name===e)return this.soundTracks[r].soundCollection[t];return null},Object.defineProperty(l.Scene.prototype,"audioEnabled",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new d(this),this._addComponent(e)),e.audioEnabled},set:function(e){var t=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new d(this),this._addComponent(t)),e?t.enableAudio():t.disableAudio()},enumerable:!0,configurable:!0}),Object.defineProperty(l.Scene.prototype,"headphone",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new d(this),this._addComponent(e)),e.headphone},set:function(e){var t=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new d(this),this._addComponent(t)),e?t.switchAudioModeForHeadphones():t.switchAudioModeForNormalSpeakers()},enumerable:!0,configurable:!0}),Object.defineProperty(l.Scene.prototype,"audioListenerPositionProvider",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new d(this),this._addComponent(e)),e.audioListenerPositionProvider},set:function(e){var t=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);if(t||(t=new d(this),this._addComponent(t)),"function"!=typeof e)throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");t.audioListenerPositionProvider=e},enumerable:!0,configurable:!0}),Object.defineProperty(l.Scene.prototype,"audioPositioningRefreshRate",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new d(this),this._addComponent(e)),e.audioPositioningRefreshRate},set:function(e){var t=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new d(this),this._addComponent(t)),t.audioPositioningRefreshRate=e},enumerable:!0,configurable:!0});var d=function(){function e(e){this.name=a.SceneComponentConstants.NAME_AUDIO,this._audioEnabled=!0,this._headphone=!1,this.audioPositioningRefreshRate=500,this._audioListenerPositionProvider=null,this._cachedCameraDirection=new s.Vector3,this._cachedCameraPosition=new s.Vector3,this._lastCheck=0,this.scene=e,e.soundTracks=new Array,e.sounds=new Array}return Object.defineProperty(e.prototype,"audioEnabled",{get:function(){return this._audioEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headphone",{get:function(){return this._headphone},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioListenerPositionProvider",{get:function(){return this._audioListenerPositionProvider},set:function(e){this._audioListenerPositionProvider=e},enumerable:!1,configurable:!0}),e.prototype.register=function(){this.scene._afterRenderStage.registerStep(a.SceneComponentConstants.STEP_AFTERRENDER_AUDIO,this,this._afterRender)},e.prototype.rebuild=function(){},e.prototype.serialize=function(e){if(e.sounds=[],this.scene.soundTracks)for(var t=0;t<this.scene.soundTracks.length;t++)for(var r=this.scene.soundTracks[t],n=0;n<r.soundCollection.length;n++)e.sounds.push(r.soundCollection[n].serialize())},e.prototype.addFromContainer=function(e){var t=this;e.sounds&&e.sounds.forEach((function(e){e.play(),e.autoplay=!0,t.scene.mainSoundTrack.AddSound(e)}))},e.prototype.removeFromContainer=function(e,t){var r=this;void 0===t&&(t=!1),e.sounds&&e.sounds.forEach((function(e){e.stop(),e.autoplay=!1,r.scene.mainSoundTrack.RemoveSound(e),t&&e.dispose()}))},e.prototype.dispose=function(){var e=this.scene;if(e._mainSoundTrack&&e.mainSoundTrack.dispose(),e.soundTracks)for(var t=0;t<e.soundTracks.length;t++)e.soundTracks[t].dispose()},e.prototype.disableAudio=function(){var e,t=this.scene;for(this._audioEnabled=!1,o.Engine.audioEngine&&o.Engine.audioEngine.audioContext&&o.Engine.audioEngine.audioContext.suspend(),e=0;e<t.mainSoundTrack.soundCollection.length;e++)t.mainSoundTrack.soundCollection[e].pause();if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(var r=0;r<t.soundTracks[e].soundCollection.length;r++)t.soundTracks[e].soundCollection[r].pause()},e.prototype.enableAudio=function(){var e,t=this.scene;for(this._audioEnabled=!0,o.Engine.audioEngine&&o.Engine.audioEngine.audioContext&&o.Engine.audioEngine.audioContext.resume(),e=0;e<t.mainSoundTrack.soundCollection.length;e++)t.mainSoundTrack.soundCollection[e].isPaused&&t.mainSoundTrack.soundCollection[e].play();if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(var r=0;r<t.soundTracks[e].soundCollection.length;r++)t.soundTracks[e].soundCollection[r].isPaused&&t.soundTracks[e].soundCollection[r].play()},e.prototype.switchAudioModeForHeadphones=function(){var e=this.scene;if(this._headphone=!0,e.mainSoundTrack.switchPanningModelToHRTF(),e.soundTracks)for(var t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToHRTF()},e.prototype.switchAudioModeForNormalSpeakers=function(){var e=this.scene;if(this._headphone=!1,e.mainSoundTrack.switchPanningModelToEqualPower(),e.soundTracks)for(var t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToEqualPower()},e.prototype._afterRender=function(){var e=u.PrecisionDate.Now;if(!(this._lastCheck&&e-this._lastCheck<this.audioPositioningRefreshRate)){this._lastCheck=e;var t=this.scene;if(this._audioEnabled&&t._mainSoundTrack&&t.soundTracks&&(0!==t._mainSoundTrack.soundCollection.length||1!==t.soundTracks.length)){var r=o.Engine.audioEngine;if(r.audioContext){if(this._audioListenerPositionProvider){var n=this._audioListenerPositionProvider();n.x=n.x||0,n.y=n.y||0,n.z=n.z||0,r.audioContext.listener.setPosition(n.x,n.y,n.z)}else{var i;if(i=t.activeCameras.length>0?t.activeCameras[0]:t.activeCamera){this._cachedCameraPosition.equals(i.globalPosition)||(this._cachedCameraPosition.copyFrom(i.globalPosition),r.audioContext.listener.setPosition(i.globalPosition.x,i.globalPosition.y,i.globalPosition.z)),i.rigCameras&&i.rigCameras.length>0&&(i=i.rigCameras[0]);var a=s.Matrix.Invert(i.getViewMatrix()),l=s.Vector3.TransformNormal(new s.Vector3(0,0,-1),a);l.normalize(),isNaN(l.x)||isNaN(l.y)||isNaN(l.z)||this._cachedCameraDirection.equals(l)||(this._cachedCameraDirection.copyFrom(l),r.audioContext.listener.setOrientation(l.x,l.y,l.z,0,1,0))}else r.audioContext.listener.setPosition(0,0,0)}var c;for(c=0;c<t.mainSoundTrack.soundCollection.length;c++){var d=t.mainSoundTrack.soundCollection[c];d.useCustomAttenuation&&d.updateDistanceFromListener()}if(t.soundTracks)for(c=0;c<t.soundTracks.length;c++)for(var h=0;h<t.soundTracks[c].soundCollection.length;h++)(d=t.soundTracks[c].soundCollection[h]).useCustomAttenuation&&d.updateDistanceFromListener()}}}},e}();n.Sound._SceneComponentInitialization=function(e){var t=e._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new d(e),e._addComponent(t))}},"./Audio/index.ts":
- /*!************************!*\
- !*** ./Audio/index.ts ***!
- \************************/
- /*! exports provided: Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./analyser */"./Audio/analyser.ts");r.d(t,"Analyser",(function(){return n.Analyser}));var i=r(/*! ./audioEngine */"./Audio/audioEngine.ts");r.d(t,"AudioEngine",(function(){return i.AudioEngine}));var o=r(/*! ./audioSceneComponent */"./Audio/audioSceneComponent.ts");r.d(t,"AudioSceneComponent",(function(){return o.AudioSceneComponent}));var s=r(/*! ./sound */"./Audio/sound.ts");r.d(t,"Sound",(function(){return s.Sound}));var a=r(/*! ./soundTrack */"./Audio/soundTrack.ts");r.d(t,"SoundTrack",(function(){return a.SoundTrack}));var l=r(/*! ./weightedsound */"./Audio/weightedsound.ts");r.d(t,"WeightedSound",(function(){return l.WeightedSound}))},"./Audio/sound.ts":
- /*!************************!*\
- !*** ./Audio/sound.ts ***!
- \************************/
- /*! exports provided: Sound */function(e,t,r){"use strict";r.r(t),r.d(t,"Sound",(function(){return c}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),c=function(){function e(t,r,l,c,u){var d,h,f,p,m=this;if(void 0===c&&(c=null),this.autoplay=!1,this.loop=!1,this.useCustomAttenuation=!1,this.isPlaying=!1,this.isPaused=!1,this.spatialSound=!1,this.refDistance=1,this.rolloffFactor=1,this.maxDistance=100,this.distanceModel="linear",this.metadata=null,this.onEndedObservable=new i.Observable,this._panningModel="equalpower",this._playbackRate=1,this._streaming=!1,this._startTime=0,this._startOffset=0,this._position=o.Vector3.Zero(),this._positionInEmitterSpace=!1,this._localDirection=new o.Vector3(1,0,0),this._volume=1,this._isReadyToPlay=!1,this._isDirectional=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._coneOuterGain=0,this._isOutputConnected=!1,this._urlType="Unknown",this.name=t,this._scene=l,e._SceneComponentInitialization(l),this._readyToPlayCallback=c,this._customAttenuationFunction=function(e,t,r,n,i){return t<r?e*(1-t/r):0},u&&(this.autoplay=u.autoplay||!1,this.loop=u.loop||!1,void 0!==u.volume&&(this._volume=u.volume),this.spatialSound=null!==(d=u.spatialSound)&&void 0!==d&&d,this.maxDistance=null!==(h=u.maxDistance)&&void 0!==h?h:100,this.useCustomAttenuation=null!==(f=u.useCustomAttenuation)&&void 0!==f&&f,this.rolloffFactor=u.rolloffFactor||1,this.refDistance=u.refDistance||1,this.distanceModel=u.distanceModel||"linear",this._playbackRate=u.playbackRate||1,this._streaming=null!==(p=u.streaming)&&void 0!==p&&p,this._length=u.length,this._offset=u.offset),s.Engine.audioEngine.canUseWebAudio&&s.Engine.audioEngine.audioContext){this._soundGain=s.Engine.audioEngine.audioContext.createGain(),this._soundGain.gain.value=this._volume,this._inputAudioNode=this._soundGain,this._outputAudioNode=this._soundGain,this.spatialSound&&this._createSpatialParameters(),this._scene.mainSoundTrack.AddSound(this);var g=!0;if(r)try{"string"==typeof r?this._urlType="String":r instanceof ArrayBuffer?this._urlType="ArrayBuffer":r instanceof MediaStream?this._urlType="MediaStream":Array.isArray(r)&&(this._urlType="Array");var _=[],v=!1;switch(this._urlType){case"MediaStream":this._streaming=!0,this._isReadyToPlay=!0,this._streamingSource=s.Engine.audioEngine.audioContext.createMediaStreamSource(r),this.autoplay&&this.play(0,this._offset,this._length),this._readyToPlayCallback&&this._readyToPlayCallback();break;case"ArrayBuffer":r.byteLength>0&&(v=!0,this._soundLoaded(r));break;case"String":_.push(r);case"Array":0===_.length&&(_=r);for(var y=0;y<_.length;y++){var b=_[y];if(v=u&&u.skipCodecCheck||-1!==b.indexOf(".mp3",b.length-4)&&s.Engine.audioEngine.isMP3supported||-1!==b.indexOf(".ogg",b.length-4)&&s.Engine.audioEngine.isOGGsupported||-1!==b.indexOf(".wav",b.length-4)||-1!==b.indexOf("blob:")){this._streaming?(this._htmlAudioElement=new Audio(b),this._htmlAudioElement.controls=!1,this._htmlAudioElement.loop=this.loop,n.Tools.SetCorsBehavior(b,this._htmlAudioElement),this._htmlAudioElement.preload="auto",this._htmlAudioElement.addEventListener("canplaythrough",(function(){m._isReadyToPlay=!0,m.autoplay&&m.play(0,m._offset,m._length),m._readyToPlayCallback&&m._readyToPlayCallback()})),document.body.appendChild(this._htmlAudioElement),this._htmlAudioElement.load()):this._scene._loadFile(b,(function(e){m._soundLoaded(e)}),void 0,!0,!0,(function(e){e&&a.Logger.Error("XHR "+e.status+" error on: "+b+"."),a.Logger.Error("Sound creation aborted."),m._scene.mainSoundTrack.RemoveSound(m)}));break}}break;default:g=!1}g?v||(this._isReadyToPlay=!0,this._readyToPlayCallback&&window.setTimeout((function(){m._readyToPlayCallback&&m._readyToPlayCallback()}),1e3)):a.Logger.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.")}catch(e){a.Logger.Error("Unexpected error. Sound creation aborted."),this._scene.mainSoundTrack.RemoveSound(this)}}else this._scene.mainSoundTrack.AddSound(this),s.Engine.audioEngine.WarnedWebAudioUnsupported||(a.Logger.Error("Web Audio is not supported by your browser."),s.Engine.audioEngine.WarnedWebAudioUnsupported=!0),this._readyToPlayCallback&&window.setTimeout((function(){m._readyToPlayCallback&&m._readyToPlayCallback()}),1e3)}return e.prototype.dispose=function(){s.Engine.audioEngine.canUseWebAudio&&(this.isPlaying&&this.stop(),this._isReadyToPlay=!1,-1===this.soundTrackId?this._scene.mainSoundTrack.RemoveSound(this):this._scene.soundTracks&&this._scene.soundTracks[this.soundTrackId].RemoveSound(this),this._soundGain&&(this._soundGain.disconnect(),this._soundGain=null),this._soundPanner&&(this._soundPanner.disconnect(),this._soundPanner=null),this._soundSource&&(this._soundSource.disconnect(),this._soundSource=null),this._audioBuffer=null,this._htmlAudioElement&&(this._htmlAudioElement.pause(),this._htmlAudioElement.src="",document.body.removeChild(this._htmlAudioElement)),this._streamingSource&&this._streamingSource.disconnect(),this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._connectedTransformNode=null))},e.prototype.isReady=function(){return this._isReadyToPlay},e.prototype._soundLoaded=function(e){var t=this;s.Engine.audioEngine.audioContext&&s.Engine.audioEngine.audioContext.decodeAudioData(e,(function(e){t._audioBuffer=e,t._isReadyToPlay=!0,t.autoplay&&t.play(0,t._offset,t._length),t._readyToPlayCallback&&t._readyToPlayCallback()}),(function(e){a.Logger.Error("Error while decoding audio data for: "+t.name+" / Error: "+e)}))},e.prototype.setAudioBuffer=function(e){s.Engine.audioEngine.canUseWebAudio&&(this._audioBuffer=e,this._isReadyToPlay=!0)},e.prototype.updateOptions=function(e){var t,r,n,i,o,s,a,l,c;e&&(this.loop=null!==(t=e.loop)&&void 0!==t?t:this.loop,this.maxDistance=null!==(r=e.maxDistance)&&void 0!==r?r:this.maxDistance,this.useCustomAttenuation=null!==(n=e.useCustomAttenuation)&&void 0!==n?n:this.useCustomAttenuation,this.rolloffFactor=null!==(i=e.rolloffFactor)&&void 0!==i?i:this.rolloffFactor,this.refDistance=null!==(o=e.refDistance)&&void 0!==o?o:this.refDistance,this.distanceModel=null!==(s=e.distanceModel)&&void 0!==s?s:this.distanceModel,this._playbackRate=null!==(a=e.playbackRate)&&void 0!==a?a:this._playbackRate,this._length=null!==(l=e.length)&&void 0!==l?l:void 0,this._offset=null!==(c=e.offset)&&void 0!==c?c:void 0,this._updateSpatialParameters(),this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate)))},e.prototype._createSpatialParameters=function(){s.Engine.audioEngine.canUseWebAudio&&s.Engine.audioEngine.audioContext&&(this._scene.headphone&&(this._panningModel="HRTF"),this._soundPanner=s.Engine.audioEngine.audioContext.createPanner(),this._updateSpatialParameters(),this._soundPanner.connect(this._outputAudioNode),this._inputAudioNode=this._soundPanner)},e.prototype._updateSpatialParameters=function(){this.spatialSound&&this._soundPanner&&(this.useCustomAttenuation?(this._soundPanner.distanceModel="linear",this._soundPanner.maxDistance=Number.MAX_VALUE,this._soundPanner.refDistance=1,this._soundPanner.rolloffFactor=1,this._soundPanner.panningModel=this._panningModel):(this._soundPanner.distanceModel=this.distanceModel,this._soundPanner.maxDistance=this.maxDistance,this._soundPanner.refDistance=this.refDistance,this._soundPanner.rolloffFactor=this.rolloffFactor,this._soundPanner.panningModel=this._panningModel))},e.prototype.switchPanningModelToHRTF=function(){this._panningModel="HRTF",this._switchPanningModel()},e.prototype.switchPanningModelToEqualPower=function(){this._panningModel="equalpower",this._switchPanningModel()},e.prototype._switchPanningModel=function(){s.Engine.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&(this._soundPanner.panningModel=this._panningModel)},e.prototype.connectToSoundTrackAudioNode=function(e){s.Engine.audioEngine.canUseWebAudio&&(this._isOutputConnected&&this._outputAudioNode.disconnect(),this._outputAudioNode.connect(e),this._isOutputConnected=!0)},e.prototype.setDirectionalCone=function(e,t,r){t<e?a.Logger.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."):(this._coneInnerAngle=e,this._coneOuterAngle=t,this._coneOuterGain=r,this._isDirectional=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length)))},Object.defineProperty(e.prototype,"directionalConeInnerAngle",{get:function(){return this._coneInnerAngle},set:function(e){if(e!=this._coneInnerAngle){if(this._coneOuterAngle<e)return void a.Logger.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle=e,s.Engine.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&(this._soundPanner.coneInnerAngle=this._coneInnerAngle)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"directionalConeOuterAngle",{get:function(){return this._coneOuterAngle},set:function(e){if(e!=this._coneOuterAngle){if(e<this._coneInnerAngle)return void a.Logger.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle=e,s.Engine.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&(this._soundPanner.coneOuterAngle=this._coneOuterAngle)}},enumerable:!1,configurable:!0}),e.prototype.setPosition=function(e){this._position=e,s.Engine.audioEngine.canUseWebAudio&&this.spatialSound&&this._soundPanner&&!isNaN(this._position.x)&&!isNaN(this._position.y)&&!isNaN(this._position.z)&&this._soundPanner.setPosition(this._position.x,this._position.y,this._position.z)},e.prototype.setLocalDirectionToMesh=function(e){this._localDirection=e,s.Engine.audioEngine.canUseWebAudio&&this._connectedTransformNode&&this.isPlaying&&this._updateDirection()},e.prototype._updateDirection=function(){if(this._connectedTransformNode&&this._soundPanner){var e=this._connectedTransformNode.getWorldMatrix(),t=o.Vector3.TransformNormal(this._localDirection,e);t.normalize(),this._soundPanner.setOrientation(t.x,t.y,t.z)}},e.prototype.updateDistanceFromListener=function(){if(s.Engine.audioEngine.canUseWebAudio&&this._connectedTransformNode&&this.useCustomAttenuation&&this._soundGain&&this._scene.activeCamera){var e=this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);this._soundGain.gain.value=this._customAttenuationFunction(this._volume,e,this.maxDistance,this.refDistance,this.rolloffFactor)}},e.prototype.setAttenuationFunction=function(e){this._customAttenuationFunction=e},e.prototype.play=function(e,t,r){var n=this;if(this._isReadyToPlay&&this._scene.audioEnabled&&s.Engine.audioEngine.audioContext)try{this._startOffset<0&&(e=-this._startOffset,this._startOffset=0);var i=e?s.Engine.audioEngine.audioContext.currentTime+e:s.Engine.audioEngine.audioContext.currentTime;if(this._soundSource&&this._streamingSource||this.spatialSound&&this._soundPanner&&(isNaN(this._position.x)||isNaN(this._position.y)||isNaN(this._position.z)||this._soundPanner.setPosition(this._position.x,this._position.y,this._position.z),this._isDirectional&&(this._soundPanner.coneInnerAngle=this._coneInnerAngle,this._soundPanner.coneOuterAngle=this._coneOuterAngle,this._soundPanner.coneOuterGain=this._coneOuterGain,this._connectedTransformNode?this._updateDirection():this._soundPanner.setOrientation(this._localDirection.x,this._localDirection.y,this._localDirection.z))),this._streaming)this._streamingSource||(this._streamingSource=s.Engine.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement),this._htmlAudioElement.onended=function(){n._onended()},this._htmlAudioElement.playbackRate=this._playbackRate),this._streamingSource.disconnect(),this._streamingSource.connect(this._inputAudioNode),this._htmlAudioElement&&(o=function(){if(s.Engine.audioEngine.unlocked){var e=n._htmlAudioElement.play();void 0!==e&&e.catch((function(e){s.Engine.audioEngine.lock(),(n.loop||n.autoplay)&&s.Engine.audioEngine.onAudioUnlockedObservable.addOnce((function(){o()}))}))}else(n.loop||n.autoplay)&&s.Engine.audioEngine.onAudioUnlockedObservable.addOnce((function(){o()}))})();else{var o=function(){if(s.Engine.audioEngine.audioContext){if(r=r||n._length,t=t||n._offset,n._soundSource){var o=n._soundSource;o.onended=function(){o.disconnect()}}n._soundSource=s.Engine.audioEngine.audioContext.createBufferSource(),n._soundSource.buffer=n._audioBuffer,n._soundSource.connect(n._inputAudioNode),n._soundSource.loop=n.loop,void 0!==t&&(n._soundSource.loopStart=t),void 0!==r&&(n._soundSource.loopEnd=(0|t)+r),n._soundSource.playbackRate.value=n._playbackRate,n._soundSource.onended=function(){n._onended()},i=e?s.Engine.audioEngine.audioContext.currentTime+e:s.Engine.audioEngine.audioContext.currentTime;var a=n.isPaused?n._startOffset%n._soundSource.buffer.duration:t||0;n._soundSource.start(i,a,n.loop?void 0:r)}};"suspended"===s.Engine.audioEngine.audioContext.state?setTimeout((function(){"suspended"===s.Engine.audioEngine.audioContext.state?(s.Engine.audioEngine.lock(),(n.loop||n.autoplay)&&s.Engine.audioEngine.onAudioUnlockedObservable.addOnce((function(){o()}))):o()}),500):o()}this._startTime=i,this.isPlaying=!0,this.isPaused=!1}catch(e){a.Logger.Error("Error while trying to play audio: "+this.name+", "+e.message)}},e.prototype._onended=function(){this.isPlaying=!1,this.onended&&this.onended(),this.onEndedObservable.notifyObservers(this)},e.prototype.stop=function(e){var t=this;if(this.isPlaying)if(this._streaming)this._htmlAudioElement?(this._htmlAudioElement.pause(),this._htmlAudioElement.currentTime>0&&(this._htmlAudioElement.currentTime=0)):this._streamingSource.disconnect(),this.isPlaying=!1;else if(s.Engine.audioEngine.audioContext&&this._soundSource){var r=e?s.Engine.audioEngine.audioContext.currentTime+e:s.Engine.audioEngine.audioContext.currentTime;this._soundSource.stop(r),this._soundSource.onended=function(){t.isPlaying=!1},this.isPaused||(this._startOffset=0)}},e.prototype.pause=function(){this.isPlaying&&(this.isPaused=!0,this._streaming?this._htmlAudioElement?this._htmlAudioElement.pause():this._streamingSource.disconnect():s.Engine.audioEngine.audioContext&&(this.stop(0),this._startOffset+=s.Engine.audioEngine.audioContext.currentTime-this._startTime))},e.prototype.setVolume=function(e,t){s.Engine.audioEngine.canUseWebAudio&&this._soundGain&&(t&&s.Engine.audioEngine.audioContext?(this._soundGain.gain.cancelScheduledValues(s.Engine.audioEngine.audioContext.currentTime),this._soundGain.gain.setValueAtTime(this._soundGain.gain.value,s.Engine.audioEngine.audioContext.currentTime),this._soundGain.gain.linearRampToValueAtTime(e,s.Engine.audioEngine.audioContext.currentTime+t)):this._soundGain.gain.value=e),this._volume=e},e.prototype.setPlaybackRate=function(e){this._playbackRate=e,this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate))},e.prototype.getVolume=function(){return this._volume},e.prototype.attachToMesh=function(e){var t=this;this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this.spatialSound||(this.spatialSound=!0,this._createSpatialParameters(),this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=function(e){return t._onRegisterAfterWorldMatrixUpdate(e)},this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)},e.prototype.detachFromMesh=function(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)},e.prototype._onRegisterAfterWorldMatrixUpdate=function(e){if(this._positionInEmitterSpace)e.worldMatrixFromCache.invertToRef(o.TmpVectors.Matrix[0]),this.setPosition(o.TmpVectors.Matrix[0].getTranslation());else if(e.getBoundingInfo){var t=e.getBoundingInfo();this.setPosition(t.boundingSphere.centerWorld)}else this.setPosition(e.absolutePosition);s.Engine.audioEngine.canUseWebAudio&&this._isDirectional&&this.isPlaying&&this._updateDirection()},e.prototype.clone=function(){var t=this;if(this._streaming)return null;var r=function(){t._isReadyToPlay?(i._audioBuffer=t.getAudioBuffer(),i._isReadyToPlay=!0,i.autoplay&&i.play(0,t._offset,t._length)):window.setTimeout(r,300)},n={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},i=new e(this.name+"_cloned",new ArrayBuffer(0),this._scene,null,n);return this.useCustomAttenuation&&i.setAttenuationFunction(this._customAttenuationFunction),i.setPosition(this._position),i.setPlaybackRate(this._playbackRate),r(),i},e.prototype.getAudioBuffer=function(){return this._audioBuffer},e.prototype.getSoundSource=function(){return this._soundSource},e.prototype.getSoundGain=function(){return this._soundGain},e.prototype.serialize=function(){var e={name:this.name,url:this.name,autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel,playbackRate:this._playbackRate,panningModel:this._panningModel,soundTrackId:this.soundTrackId,metadata:this.metadata};return this.spatialSound&&(this._connectedTransformNode&&(e.connectedMeshId=this._connectedTransformNode.id),e.position=this._position.asArray(),e.refDistance=this.refDistance,e.distanceModel=this.distanceModel,e.isDirectional=this._isDirectional,e.localDirectionToMesh=this._localDirection.asArray(),e.coneInnerAngle=this._coneInnerAngle,e.coneOuterAngle=this._coneOuterAngle,e.coneOuterGain=this._coneOuterGain),e},e.Parse=function(t,r,n,i){var s,a=t.name;s=t.url?n+t.url:n+a;var l,c={autoplay:t.autoplay,loop:t.loop,volume:t.volume,spatialSound:t.spatialSound,maxDistance:t.maxDistance,rolloffFactor:t.rolloffFactor,refDistance:t.refDistance,distanceModel:t.distanceModel,playbackRate:t.playbackRate};if(i){var u=function(){i._isReadyToPlay?(l._audioBuffer=i.getAudioBuffer(),l._isReadyToPlay=!0,l.autoplay&&l.play(0,l._offset,l._length)):window.setTimeout(u,300)};l=new e(a,new ArrayBuffer(0),r,null,c),u()}else l=new e(a,s,r,(function(){r._removePendingData(l)}),c),r._addPendingData(l);if(t.position){var d=o.Vector3.FromArray(t.position);l.setPosition(d)}if(t.isDirectional&&(l.setDirectionalCone(t.coneInnerAngle||360,t.coneOuterAngle||360,t.coneOuterGain||0),t.localDirectionToMesh)){var h=o.Vector3.FromArray(t.localDirectionToMesh);l.setLocalDirectionToMesh(h)}if(t.connectedMeshId){var f=r.getMeshByID(t.connectedMeshId);f&&l.attachToMesh(f)}return t.metadata&&(l.metadata=t.metadata),l},e._SceneComponentInitialization=function(e){throw l._DevTools.WarnImport("AudioSceneComponent")},e}()},"./Audio/soundTrack.ts":
- /*!*****************************!*\
- !*** ./Audio/soundTrack.ts ***!
- \*****************************/
- /*! exports provided: SoundTrack */function(e,t,r){"use strict";r.r(t),r.d(t,"SoundTrack",(function(){return i}));var n=r(/*! ../Engines/engine */"./Engines/engine.ts"),i=function(){function e(e,t){void 0===t&&(t={}),this.id=-1,this._isInitialized=!1,this._scene=e,this.soundCollection=new Array,this._options=t,!this._options.mainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1)}return e.prototype._initializeSoundTrackAudioGraph=function(){n.Engine.audioEngine.canUseWebAudio&&n.Engine.audioEngine.audioContext&&(this._outputAudioNode=n.Engine.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(n.Engine.audioEngine.masterGain),this._options&&this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._isInitialized=!0)},e.prototype.dispose=function(){if(n.Engine.audioEngine&&n.Engine.audioEngine.canUseWebAudio){for(this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas();this.soundCollection.length;)this.soundCollection[0].dispose();this._outputAudioNode&&this._outputAudioNode.disconnect(),this._outputAudioNode=null}},e.prototype.AddSound=function(e){this._isInitialized||this._initializeSoundTrackAudioGraph(),n.Engine.audioEngine.canUseWebAudio&&this._outputAudioNode&&e.connectToSoundTrackAudioNode(this._outputAudioNode),e.soundTrackId&&(-1===e.soundTrackId?this._scene.mainSoundTrack.RemoveSound(e):this._scene.soundTracks&&this._scene.soundTracks[e.soundTrackId].RemoveSound(e)),this.soundCollection.push(e),e.soundTrackId=this.id},e.prototype.RemoveSound=function(e){var t=this.soundCollection.indexOf(e);-1!==t&&this.soundCollection.splice(t,1)},e.prototype.setVolume=function(e){n.Engine.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)},e.prototype.switchPanningModelToHRTF=function(){if(n.Engine.audioEngine.canUseWebAudio)for(var e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToHRTF()},e.prototype.switchPanningModelToEqualPower=function(){if(n.Engine.audioEngine.canUseWebAudio)for(var e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToEqualPower()},e.prototype.connectToAnalyser=function(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=e,n.Engine.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.disconnect(),this._connectedAnalyser.connectAudioNodes(this._outputAudioNode,n.Engine.audioEngine.masterGain))},e}()},"./Audio/weightedsound.ts":
- /*!********************************!*\
- !*** ./Audio/weightedsound.ts ***!
- \********************************/
- /*! exports provided: WeightedSound */function(e,t,r){"use strict";r.r(t),r.d(t,"WeightedSound",(function(){return i}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=function(){function e(e,t,r){var n=this;if(this.loop=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._volume=1,this.isPlaying=!1,this.isPaused=!1,this._sounds=[],this._weights=[],t.length!==r.length)throw new Error("Sounds length does not equal weights length");this.loop=e,this._weights=r;for(var i=0,o=0,s=r;o<s.length;o++)i+=s[o];for(var a=i>0?1/i:0,l=0;l<this._weights.length;l++)this._weights[l]*=a;this._sounds=t;for(var c=0,u=this._sounds;c<u.length;c++)u[c].onEndedObservable.add((function(){n._onended()}))}return Object.defineProperty(e.prototype,"directionalConeInnerAngle",{get:function(){return this._coneInnerAngle},set:function(e){if(e!==this._coneInnerAngle){if(this._coneOuterAngle<e)return void n.Logger.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneInnerAngle=e;for(var t=0,r=this._sounds;t<r.length;t++)r[t].directionalConeInnerAngle=e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"directionalConeOuterAngle",{get:function(){return this._coneOuterAngle},set:function(e){if(e!==this._coneOuterAngle){if(e<this._coneInnerAngle)return void n.Logger.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");this._coneOuterAngle=e;for(var t=0,r=this._sounds;t<r.length;t++)r[t].directionalConeOuterAngle=e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(e){if(e!==this._volume)for(var t=0,r=this._sounds;t<r.length;t++)r[t].setVolume(e)},enumerable:!1,configurable:!0}),e.prototype._onended=function(){void 0!==this._currentIndex&&(this._sounds[this._currentIndex].autoplay=!1),this.loop&&this.isPlaying?this.play():this.isPlaying=!1},e.prototype.pause=function(){this.isPaused=!0,void 0!==this._currentIndex&&this._sounds[this._currentIndex].pause()},e.prototype.stop=function(){this.isPlaying=!1,void 0!==this._currentIndex&&this._sounds[this._currentIndex].stop()},e.prototype.play=function(e){if(!this.isPaused){this.stop();for(var t=Math.random(),r=0,n=0;n<this._weights.length;n++)if(t<=(r+=this._weights[n])){this._currentIndex=n;break}}var i=this._sounds[this._currentIndex];i.isReady()?i.play(0,this.isPaused?void 0:e):i.autoplay=!0,this.isPlaying=!0,this.isPaused=!1},e}()},"./Behaviors/Cameras/autoRotationBehavior.ts":
- /*!***************************************************!*\
- !*** ./Behaviors/Cameras/autoRotationBehavior.ts ***!
- \***************************************************/
- /*! exports provided: AutoRotationBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"AutoRotationBehavior",(function(){return o}));var n=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),i=r(/*! ../../Misc/precisionDate */"./Misc/precisionDate.ts"),o=function(){function e(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}return Object.defineProperty(e.prototype,"name",{get:function(){return"AutoRotation"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomStopsAnimation",{get:function(){return this._zoomStopsAnimation},set:function(e){this._zoomStopsAnimation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationSpeed",{get:function(){return this._idleRotationSpeed},set:function(e){this._idleRotationSpeed=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationWaitTime",{get:function(){return this._idleRotationWaitTime},set:function(e){this._idleRotationWaitTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationSpinupTime",{get:function(){return this._idleRotationSpinupTime},set:function(e){this._idleRotationSpinupTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationInProgress",{get:function(){return Math.abs(this._cameraRotationSpeed)>0},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){var t=this;this._attachedCamera=e;var r=this._attachedCamera.getScene();this._onPrePointerObservableObserver=r.onPrePointerObservable.add((function(e){e.type!==n.PointerEventTypes.POINTERDOWN?e.type===n.PointerEventTypes.POINTERUP&&(t._isPointerDown=!1):t._isPointerDown=!0})),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add((function(){var e=i.PrecisionDate.Now,r=0;null!=t._lastFrameTime&&(r=e-t._lastFrameTime),t._lastFrameTime=e,t._applyUserInteraction();var n=e-t._lastInteractionTime-t._idleRotationWaitTime,o=Math.max(Math.min(n/t._idleRotationSpinupTime,1),0);t._cameraRotationSpeed=t._idleRotationSpeed*o,t._attachedCamera&&(t._attachedCamera.alpha-=t._cameraRotationSpeed*(r/1e3))}))},e.prototype.detach=function(){if(this._attachedCamera){var e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null}},e.prototype._userIsZooming=function(){return!!this._attachedCamera&&0!==this._attachedCamera.inertialRadiusOffset},e.prototype._shouldAnimationStopForInteraction=function(){if(!this._attachedCamera)return!1;var e=!1;return this._lastFrameRadius===this._attachedCamera.radius&&0!==this._attachedCamera.inertialRadiusOffset&&(e=!0),this._lastFrameRadius=this._attachedCamera.radius,this._zoomStopsAnimation?e:this._userIsZooming()},e.prototype._applyUserInteraction=function(){this._userIsMoving()&&!this._shouldAnimationStopForInteraction()&&(this._lastInteractionTime=i.PrecisionDate.Now)},e.prototype._userIsMoving=function(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)},e}()},"./Behaviors/Cameras/bouncingBehavior.ts":
- /*!***********************************************!*\
- !*** ./Behaviors/Cameras/bouncingBehavior.ts ***!
- \***********************************************/
- /*! exports provided: BouncingBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"BouncingBehavior",(function(){return o}));var n=r(/*! ../../Animations/easing */"./Animations/easing.ts"),i=r(/*! ../../Animations/animation */"./Animations/animation.ts"),o=function(){function e(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}return Object.defineProperty(e.prototype,"name",{get:function(){return"Bouncing"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoTransitionRange",{get:function(){return this._autoTransitionRange},set:function(e){var t=this;if(this._autoTransitionRange!==e){this._autoTransitionRange=e;var r=this._attachedCamera;r&&(e?this._onMeshTargetChangedObserver=r.onMeshTargetChangedObservable.add((function(e){if(e){e.computeWorldMatrix(!0);var r=e.getBoundingInfo().diagonalLength;t.lowerRadiusTransitionRange=.05*r,t.upperRadiusTransitionRange=.05*r}})):this._onMeshTargetChangedObserver&&r.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){var t=this;this._attachedCamera=e,this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add((function(){t._attachedCamera&&(t._isRadiusAtLimit(t._attachedCamera.lowerRadiusLimit)&&t._applyBoundRadiusAnimation(t.lowerRadiusTransitionRange),t._isRadiusAtLimit(t._attachedCamera.upperRadiusLimit)&&t._applyBoundRadiusAnimation(t.upperRadiusTransitionRange))}))},e.prototype.detach=function(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)},e.prototype._isRadiusAtLimit=function(e){return!!this._attachedCamera&&this._attachedCamera.radius===e&&!this._radiusIsAnimating},e.prototype._applyBoundRadiusAnimation=function(t){var r=this;if(this._attachedCamera){this._radiusBounceTransition||(e.EasingFunction.setEasingMode(e.EasingMode),this._radiusBounceTransition=i.Animation.CreateAnimation("radius",i.Animation.ANIMATIONTYPE_FLOAT,60,e.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;var n=i.Animation.TransitionTo("radius",this._attachedCamera.radius+t,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,(function(){return r._clearAnimationLocks()}));n&&this._animatables.push(n)}},e.prototype._clearAnimationLocks=function(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)},e.prototype.stopAllAnimations=function(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()},e.EasingFunction=new n.BackEase(.3),e.EasingMode=n.EasingFunction.EASINGMODE_EASEOUT,e}()},"./Behaviors/Cameras/framingBehavior.ts":
- /*!**********************************************!*\
- !*** ./Behaviors/Cameras/framingBehavior.ts ***!
- \**********************************************/
- /*! exports provided: FramingBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"FramingBehavior",(function(){return l}));var n=r(/*! ../../Animations/easing */"./Animations/easing.ts"),i=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),o=r(/*! ../../Misc/precisionDate */"./Misc/precisionDate.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Animations/animation */"./Animations/animation.ts"),l=function(){function e(){this._mode=e.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}return Object.defineProperty(e.prototype,"name",{get:function(){return"Framing"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(e){this._mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radiusScale",{get:function(){return this._radiusScale},set:function(e){this._radiusScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"positionScale",{get:function(){return this._positionScale},set:function(e){this._positionScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultElevation",{get:function(){return this._defaultElevation},set:function(e){this._defaultElevation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elevationReturnTime",{get:function(){return this._elevationReturnTime},set:function(e){this._elevationReturnTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elevationReturnWaitTime",{get:function(){return this._elevationReturnWaitTime},set:function(e){this._elevationReturnWaitTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomStopsAnimation",{get:function(){return this._zoomStopsAnimation},set:function(e){this._zoomStopsAnimation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"framingTime",{get:function(){return this._framingTime},set:function(e){this._framingTime=e},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var r=this;this._attachedCamera=t;var n=this._attachedCamera.getScene();e.EasingFunction.setEasingMode(e.EasingMode),this._onPrePointerObservableObserver=n.onPrePointerObservable.add((function(e){e.type!==i.PointerEventTypes.POINTERDOWN?e.type===i.PointerEventTypes.POINTERUP&&(r._isPointerDown=!1):r._isPointerDown=!0})),this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add((function(e){e&&r.zoomOnMesh(e)})),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add((function(){r._applyUserInteraction(),r._maintainCameraAboveGround()}))},e.prototype.detach=function(){if(this._attachedCamera){var e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}},e.prototype.zoomOnMesh=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=null),e.computeWorldMatrix(!0);var n=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(n.minimumWorld,n.maximumWorld,t,r)},e.prototype.zoomOnMeshHierarchy=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=null),e.computeWorldMatrix(!0);var n=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(n.min,n.max,t,r)},e.prototype.zoomOnMeshesHierarchy=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=null);for(var n=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new s.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),o=0;o<e.length;o++){var a=e[o].getHierarchyBoundingVectors(!0);s.Vector3.CheckExtends(a.min,n,i),s.Vector3.CheckExtends(a.max,n,i)}this.zoomOnBoundingInfo(n,i,t,r)},e.prototype.zoomOnBoundingInfo=function(t,r,n,i){var o,l=this;if(void 0===n&&(n=!1),void 0===i&&(i=null),this._attachedCamera){var c=t.y,u=c+(r.y-c)*this._positionScale,d=r.subtract(t).scale(.5);if(n)o=new s.Vector3(0,u,0);else{var h=t.add(d);o=new s.Vector3(h.x,u,h.z)}this._vectorTransition||(this._vectorTransition=a.Animation.CreateAnimation("target",a.Animation.ANIMATIONTYPE_VECTOR3,60,e.EasingFunction)),this._betaIsAnimating=!0;var f=a.Animation.TransitionTo("target",o,this._attachedCamera,this._attachedCamera.getScene(),60,this._vectorTransition,this._framingTime);f&&this._animatables.push(f);var p=0;if(this._mode===e.FitFrustumSidesMode){var m=this._calculateLowerRadiusFromModelBoundingSphere(t,r);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=d.length()+this._attachedCamera.minZ),p=m}else this._mode===e.IgnoreBoundsSizeMode&&(p=this._calculateLowerRadiusFromModelBoundingSphere(t,r),this.autoCorrectCameraLimitsAndSensibility&&null===this._attachedCamera.lowerRadiusLimit&&(this._attachedCamera.lowerRadiusLimit=this._attachedCamera.minZ));if(this.autoCorrectCameraLimitsAndSensibility){var g=r.subtract(t).length();this._attachedCamera.panningSensibility=5e3/g,this._attachedCamera.wheelPrecision=100/p}this._radiusTransition||(this._radiusTransition=a.Animation.CreateAnimation("radius",a.Animation.ANIMATIONTYPE_FLOAT,60,e.EasingFunction)),(f=a.Animation.TransitionTo("radius",p,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,(function(){l.stopAllAnimations(),i&&i(),l._attachedCamera&&l._attachedCamera.useInputToRestoreState&&l._attachedCamera.storeState()})))&&this._animatables.push(f)}},e.prototype._calculateLowerRadiusFromModelBoundingSphere=function(t,r){var n=r.subtract(t).length(),i=this._getFrustumSlope(),o=.5*n*this._radiusScale,s=o*Math.sqrt(1+1/(i.x*i.x)),a=o*Math.sqrt(1+1/(i.y*i.y)),l=Math.max(s,a),c=this._attachedCamera;return c?(c.lowerRadiusLimit&&this._mode===e.IgnoreBoundsSizeMode&&(l=l<c.lowerRadiusLimit?c.lowerRadiusLimit:l),c.upperRadiusLimit&&(l=l>c.upperRadiusLimit?c.upperRadiusLimit:l),l):0},e.prototype._maintainCameraAboveGround=function(){var t=this;if(!(this._elevationReturnTime<0)){var r=o.PrecisionDate.Now-this._lastInteractionTime,n=.5*Math.PI-this._defaultElevation,i=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&r>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=a.Animation.CreateAnimation("beta",a.Animation.ANIMATIONTYPE_FLOAT,60,e.EasingFunction));var s=a.Animation.TransitionTo("beta",n,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,(function(){t._clearAnimationLocks(),t.stopAllAnimations()}));s&&this._animatables.push(s)}}},e.prototype._getFrustumSlope=function(){var e=this._attachedCamera;if(!e)return s.Vector2.Zero();var t=e.getScene().getEngine().getAspectRatio(e),r=Math.tan(e.fov/2),n=r*t;return new s.Vector2(n,r)},e.prototype._clearAnimationLocks=function(){this._betaIsAnimating=!1},e.prototype._applyUserInteraction=function(){this.isUserIsMoving&&(this._lastInteractionTime=o.PrecisionDate.Now,this.stopAllAnimations(),this._clearAnimationLocks())},e.prototype.stopAllAnimations=function(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()},Object.defineProperty(e.prototype,"isUserIsMoving",{get:function(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)},enumerable:!1,configurable:!0}),e.EasingFunction=new n.ExponentialEase,e.EasingMode=n.EasingFunction.EASINGMODE_EASEINOUT,e.IgnoreBoundsSizeMode=0,e.FitFrustumSidesMode=1,e}()},"./Behaviors/Cameras/index.ts":
- /*!************************************!*\
- !*** ./Behaviors/Cameras/index.ts ***!
- \************************************/
- /*! exports provided: AutoRotationBehavior, BouncingBehavior, FramingBehavior */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./autoRotationBehavior */"./Behaviors/Cameras/autoRotationBehavior.ts");r.d(t,"AutoRotationBehavior",(function(){return n.AutoRotationBehavior}));var i=r(/*! ./bouncingBehavior */"./Behaviors/Cameras/bouncingBehavior.ts");r.d(t,"BouncingBehavior",(function(){return i.BouncingBehavior}));var o=r(/*! ./framingBehavior */"./Behaviors/Cameras/framingBehavior.ts");r.d(t,"FramingBehavior",(function(){return o.FramingBehavior}))},"./Behaviors/Meshes/attachToBoxBehavior.ts":
- /*!*************************************************!*\
- !*** ./Behaviors/Meshes/attachToBoxBehavior.ts ***!
- \*************************************************/
- /*! exports provided: AttachToBoxBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"AttachToBoxBehavior",(function(){return o}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=function(e,t,r,i){void 0===t&&(t=new n.Vector3),void 0===r&&(r=0),void 0===i&&(i=!1),this.direction=e,this.rotatedDirection=t,this.diff=r,this.ignore=i},o=function(){function e(e){this.ui=e,this.name="AttachToBoxBehavior",this.distanceAwayFromFace=.15,this.distanceAwayFromBottomOfFace=.15,this._faceVectors=[new i(n.Vector3.Up()),new i(n.Vector3.Down()),new i(n.Vector3.Left()),new i(n.Vector3.Right()),new i(n.Vector3.Forward()),new i(n.Vector3.Forward().scaleInPlace(-1))],this._tmpMatrix=new n.Matrix,this._tmpVector=new n.Vector3,this._zeroVector=n.Vector3.Zero(),this._lookAtTmpMatrix=new n.Matrix}return e.prototype.init=function(){},e.prototype._closestFace=function(e){var t=this;return this._faceVectors.forEach((function(r){t._target.rotationQuaternion||(t._target.rotationQuaternion=n.Quaternion.RotationYawPitchRoll(t._target.rotation.y,t._target.rotation.x,t._target.rotation.z)),t._target.rotationQuaternion.toRotationMatrix(t._tmpMatrix),n.Vector3.TransformCoordinatesToRef(r.direction,t._tmpMatrix,r.rotatedDirection),r.diff=n.Vector3.GetAngleBetweenVectors(r.rotatedDirection,e,n.Vector3.Cross(r.rotatedDirection,e))})),this._faceVectors.reduce((function(e,t){return e.ignore?t:t.ignore||e.diff<t.diff?e:t}),this._faceVectors[0])},e.prototype._lookAtToRef=function(e,t,r){void 0===t&&(t=new n.Vector3(0,1,0)),n.Matrix.LookAtLHToRef(this._zeroVector,e,t,this._lookAtTmpMatrix),this._lookAtTmpMatrix.invert(),n.Quaternion.FromRotationMatrixToRef(this._lookAtTmpMatrix,r)},e.prototype.attach=function(e){var t=this;this._target=e,this._scene=this._target.getScene(),this._onRenderObserver=this._scene.onBeforeRenderObservable.add((function(){if(t._scene.activeCamera){var r=t._scene.activeCamera.position;t._scene.activeCamera.devicePosition&&(r=t._scene.activeCamera.devicePosition);var i=t._closestFace(r.subtract(e.position));t._scene.activeCamera.leftCamera?t._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(t._tmpMatrix):t._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(t._tmpMatrix),n.Vector3.TransformCoordinatesToRef(n.Vector3.Up(),t._tmpMatrix,t._tmpVector),t._faceVectors.forEach((function(e){i.direction.x&&e.direction.x&&(e.ignore=!0),i.direction.y&&e.direction.y&&(e.ignore=!0),i.direction.z&&e.direction.z&&(e.ignore=!0)}));var o=t._closestFace(t._tmpVector);t._faceVectors.forEach((function(e){e.ignore=!1})),t.ui.position.copyFrom(e.position),i.direction.x&&(i.rotatedDirection.scaleToRef(e.scaling.x/2+t.distanceAwayFromFace,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)),i.direction.y&&(i.rotatedDirection.scaleToRef(e.scaling.y/2+t.distanceAwayFromFace,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)),i.direction.z&&(i.rotatedDirection.scaleToRef(e.scaling.z/2+t.distanceAwayFromFace,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)),t.ui.rotationQuaternion||(t.ui.rotationQuaternion=n.Quaternion.RotationYawPitchRoll(t.ui.rotation.y,t.ui.rotation.x,t.ui.rotation.z)),i.rotatedDirection.scaleToRef(-1,t._tmpVector),t._lookAtToRef(t._tmpVector,o.rotatedDirection,t.ui.rotationQuaternion),o.direction.x&&t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace-e.scaling.x/2,t._tmpVector),o.direction.y&&t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace-e.scaling.y/2,t._tmpVector),o.direction.z&&t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace-e.scaling.z/2,t._tmpVector),t.ui.position.addInPlace(t._tmpVector)}}))},e.prototype.detach=function(){this._scene.onBeforeRenderObservable.remove(this._onRenderObserver)},e}()},"./Behaviors/Meshes/fadeInOutBehavior.ts":
- /*!***********************************************!*\
- !*** ./Behaviors/Meshes/fadeInOutBehavior.ts ***!
- \***********************************************/
- /*! exports provided: FadeInOutBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"FadeInOutBehavior",(function(){return n}));var n=function(){function e(){var e=this;this.delay=0,this.fadeInTime=300,this._millisecondsPerFrame=1e3/60,this._hovered=!1,this._hoverValue=0,this._ownerNode=null,this._update=function(){if(e._ownerNode){if(e._hoverValue+=e._hovered?e._millisecondsPerFrame:-e._millisecondsPerFrame,e._setAllVisibility(e._ownerNode,(e._hoverValue-e.delay)/e.fadeInTime),e._ownerNode.visibility>1)return e._setAllVisibility(e._ownerNode,1),void(e._hoverValue=e.fadeInTime+e.delay);if(e._ownerNode.visibility<0&&(e._setAllVisibility(e._ownerNode,0),e._hoverValue<0))return void(e._hoverValue=0);setTimeout(e._update,e._millisecondsPerFrame)}}}return Object.defineProperty(e.prototype,"name",{get:function(){return"FadeInOut"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){this._ownerNode=e,this._setAllVisibility(this._ownerNode,0)},e.prototype.detach=function(){this._ownerNode=null},e.prototype.fadeIn=function(e){this._hovered=e,this._update()},e.prototype._setAllVisibility=function(e,t){var r=this;e.visibility=t,e.getChildMeshes().forEach((function(e){r._setAllVisibility(e,t)}))},e}()},"./Behaviors/Meshes/index.ts":
- /*!***********************************!*\
- !*** ./Behaviors/Meshes/index.ts ***!
- \***********************************/
- /*! exports provided: AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./attachToBoxBehavior */"./Behaviors/Meshes/attachToBoxBehavior.ts");r.d(t,"AttachToBoxBehavior",(function(){return n.AttachToBoxBehavior}));var i=r(/*! ./fadeInOutBehavior */"./Behaviors/Meshes/fadeInOutBehavior.ts");r.d(t,"FadeInOutBehavior",(function(){return i.FadeInOutBehavior}));var o=r(/*! ./multiPointerScaleBehavior */"./Behaviors/Meshes/multiPointerScaleBehavior.ts");r.d(t,"MultiPointerScaleBehavior",(function(){return o.MultiPointerScaleBehavior}));var s=r(/*! ./pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts");r.d(t,"PointerDragBehavior",(function(){return s.PointerDragBehavior}));var a=r(/*! ./sixDofDragBehavior */"./Behaviors/Meshes/sixDofDragBehavior.ts");r.d(t,"SixDofDragBehavior",(function(){return a.SixDofDragBehavior}))},"./Behaviors/Meshes/multiPointerScaleBehavior.ts":
- /*!*******************************************************!*\
- !*** ./Behaviors/Meshes/multiPointerScaleBehavior.ts ***!
- \*******************************************************/
- /*! exports provided: MultiPointerScaleBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiPointerScaleBehavior",(function(){return o}));var n=r(/*! ./pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=function(){function e(){this._startDistance=0,this._initialScale=new i.Vector3(0,0,0),this._targetScale=new i.Vector3(0,0,0),this._sceneRenderObserver=null,this._dragBehaviorA=new n.PointerDragBehavior({}),this._dragBehaviorA.moveAttached=!1,this._dragBehaviorB=new n.PointerDragBehavior({}),this._dragBehaviorB.moveAttached=!1}return Object.defineProperty(e.prototype,"name",{get:function(){return"MultiPointerScale"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype._getCurrentDistance=function(){return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length()},e.prototype.attach=function(e){var t=this;this._ownerNode=e,this._dragBehaviorA.onDragStartObservable.add((function(r){t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging&&(t._dragBehaviorA.currentDraggingPointerID==t._dragBehaviorB.currentDraggingPointerID?t._dragBehaviorA.releaseDrag():(t._initialScale.copyFrom(e.scaling),t._startDistance=t._getCurrentDistance()))})),this._dragBehaviorB.onDragStartObservable.add((function(r){t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging&&(t._dragBehaviorA.currentDraggingPointerID==t._dragBehaviorB.currentDraggingPointerID?t._dragBehaviorB.releaseDrag():(t._initialScale.copyFrom(e.scaling),t._startDistance=t._getCurrentDistance()))})),[this._dragBehaviorA,this._dragBehaviorB].forEach((function(e){e.onDragObservable.add((function(){if(t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging){var e=t._getCurrentDistance()/t._startDistance;t._initialScale.scaleToRef(e,t._targetScale)}}))})),e.addBehavior(this._dragBehaviorA),e.addBehavior(this._dragBehaviorB),this._sceneRenderObserver=e.getScene().onBeforeRenderObservable.add((function(){if(t._dragBehaviorA.dragging&&t._dragBehaviorB.dragging){var r=t._targetScale.subtract(e.scaling).scaleInPlace(.1);r.length()>.01&&e.scaling.addInPlace(r)}}))},e.prototype.detach=function(){var e=this;this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver),[this._dragBehaviorA,this._dragBehaviorB].forEach((function(t){t.onDragStartObservable.clear(),t.onDragObservable.clear(),e._ownerNode.removeBehavior(t)}))},e}()},"./Behaviors/Meshes/pointerDragBehavior.ts":
- /*!*************************************************!*\
- !*** ./Behaviors/Meshes/pointerDragBehavior.ts ***!
- \*************************************************/
- /*! exports provided: PointerDragBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"PointerDragBehavior",(function(){return u}));var n=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),i=r(/*! ../../scene */"./scene.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),l=r(/*! ../../Culling/ray */"./Culling/ray.ts"),c=r(/*! ../../Misc/pivotTools */"./Misc/pivotTools.ts"),u=(r(/*! ../../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),function(){function e(e){this._useAlternatePickedPointAboveMaxDragAngleDragSpeed=-1.1,this.maxDragAngle=0,this._useAlternatePickedPointAboveMaxDragAngle=!1,this.currentDraggingPointerID=-1,this.dragging=!1,this.dragDeltaRatio=.2,this.updateDragPlane=!0,this._debugMode=!1,this._moving=!1,this.onDragObservable=new o.Observable,this.onDragStartObservable=new o.Observable,this.onDragEndObservable=new o.Observable,this.moveAttached=!0,this.enabled=!0,this.startAndReleaseDragOnPointerEvents=!0,this.detachCameraControls=!0,this.useObjectOrientationForDragging=!0,this.validateDrag=function(e){return!0},this._tmpVector=new s.Vector3(0,0,0),this._alternatePickedPoint=new s.Vector3(0,0,0),this._worldDragAxis=new s.Vector3(0,0,0),this._targetPosition=new s.Vector3(0,0,0),this._attachedElement=null,this._startDragRay=new l.Ray(new s.Vector3,new s.Vector3),this._lastPointerRay={},this._dragDelta=new s.Vector3,this._pointA=new s.Vector3(0,0,0),this._pointC=new s.Vector3(0,0,0),this._localAxis=new s.Vector3(0,0,0),this._lookAt=new s.Vector3(0,0,0),this._options=e||{};var t=0;if(this._options.dragAxis&&t++,this._options.dragPlaneNormal&&t++,t>1)throw"Multiple drag modes specified in dragBehavior options. Only one expected"}return Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return"PointerDrag"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t,r){var o=this;this._scene=t.getScene(),this.attachedNode=t,e._planeScene||(this._debugMode?e._planeScene=this._scene:(e._planeScene=new i.Scene(this._scene.getEngine(),{virtual:!0}),e._planeScene.detachControl(),this._scene.onDisposeObservable.addOnce((function(){e._planeScene.dispose(),e._planeScene=null})))),this._dragPlane=n.Mesh.CreatePlane("pointerDragPlane",this._debugMode?1:1e4,e._planeScene,!1,n.Mesh.DOUBLESIDE),this.lastDragPosition=new s.Vector3(0,0,0);var u=r||function(e){return o.attachedNode==e||e.isDescendantOf(o.attachedNode)};this._pointerObserver=this._scene.onPointerObservable.add((function(t,r){if(o.enabled)if(t.type==a.PointerEventTypes.POINTERDOWN)o.startAndReleaseDragOnPointerEvents&&!o.dragging&&t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh&&t.pickInfo.pickedPoint&&t.pickInfo.ray&&u(t.pickInfo.pickedMesh)&&o._startDrag(t.event.pointerId,t.pickInfo.ray,t.pickInfo.pickedPoint);else if(t.type==a.PointerEventTypes.POINTERUP)o.startAndReleaseDragOnPointerEvents&&o.currentDraggingPointerID==t.event.pointerId&&o.releaseDrag();else if(t.type==a.PointerEventTypes.POINTERMOVE){var n=t.event.pointerId;o.currentDraggingPointerID===e._AnyMouseID&&n!==e._AnyMouseID&&"mouse"==t.event.pointerType&&(o._lastPointerRay[o.currentDraggingPointerID]&&(o._lastPointerRay[n]=o._lastPointerRay[o.currentDraggingPointerID],delete o._lastPointerRay[o.currentDraggingPointerID]),o.currentDraggingPointerID=n),o._lastPointerRay[n]||(o._lastPointerRay[n]=new l.Ray(new s.Vector3,new s.Vector3)),t.pickInfo&&t.pickInfo.ray&&(o._lastPointerRay[n].origin.copyFrom(t.pickInfo.ray.origin),o._lastPointerRay[n].direction.copyFrom(t.pickInfo.ray.direction),o.currentDraggingPointerID==n&&o.dragging&&o._moveDrag(t.pickInfo.ray))}})),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add((function(){o._moving&&o.moveAttached&&(c.PivotTools._RemoveAndStorePivotPoint(o.attachedNode),o._targetPosition.subtractToRef(o.attachedNode.absolutePosition,o._tmpVector),o._tmpVector.scaleInPlace(o.dragDeltaRatio),o.attachedNode.getAbsolutePosition().addToRef(o._tmpVector,o._tmpVector),o.validateDrag(o._tmpVector)&&o.attachedNode.setAbsolutePosition(o._tmpVector),c.PivotTools._RestorePivotPoint(o.attachedNode))}))},e.prototype.releaseDrag=function(){if(this.dragging&&(this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerID}),this.dragging=!1),this.currentDraggingPointerID=-1,this._moving=!1,this.detachCameraControls&&this._attachedElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera)if("ArcRotateCamera"===this._scene.activeCamera.getClassName()){var e=this._scene.activeCamera;e.attachControl(this._attachedElement,!e.inputs||e.inputs.noPreventDefault,e._useCtrlForPanning,e._panningMouseButton)}else this._scene.activeCamera.attachControl(this._attachedElement,!this._scene.activeCamera.inputs||this._scene.activeCamera.inputs.noPreventDefault)},e.prototype.startDrag=function(t,r,n){void 0===t&&(t=e._AnyMouseID),this._startDrag(t,r,n);var i=this._lastPointerRay[t];t===e._AnyMouseID&&(i=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),i&&this._moveDrag(i)},e.prototype._startDrag=function(e,t,r){if(this._scene.activeCamera&&!this.dragging&&this.attachedNode){c.PivotTools._RemoveAndStorePivotPoint(this.attachedNode),t?(this._startDragRay.direction.copyFrom(t.direction),this._startDragRay.origin.copyFrom(t.origin)):(this._startDragRay.origin.copyFrom(this._scene.activeCamera.position),this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector),this._tmpVector.subtractToRef(this._scene.activeCamera.position,this._startDragRay.direction)),this._updateDragPlanePosition(this._startDragRay,r||this._tmpVector);var n=this._pickWithRayOnDragPlane(this._startDragRay);n&&(this.dragging=!0,this.currentDraggingPointerID=e,this.lastDragPosition.copyFrom(n),this.onDragStartObservable.notifyObservers({dragPlanePoint:n,pointerId:this.currentDraggingPointerID}),this._targetPosition.copyFrom(this.attachedNode.absolutePosition),this.detachCameraControls&&this._scene.activeCamera&&this._scene.activeCamera.inputs&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedElement?(this._attachedElement=this._scene.activeCamera.inputs.attachedElement,this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement)):this._attachedElement=null)),c.PivotTools._RestorePivotPoint(this.attachedNode)}},e.prototype._moveDrag=function(e){this._moving=!0;var t=this._pickWithRayOnDragPlane(e);if(t){this.updateDragPlane&&this._updateDragPlanePosition(e,t);var r=0;this._options.dragAxis?(this.useObjectOrientationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis):this._worldDragAxis.copyFrom(this._options.dragAxis),t.subtractToRef(this.lastDragPosition,this._tmpVector),r=s.Vector3.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(r,this._dragDelta)):(r=this._dragDelta.length(),t.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:r,delta:this._dragDelta,dragPlanePoint:t,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerID}),this.lastDragPosition.copyFrom(t)}},e.prototype._pickWithRayOnDragPlane=function(t){var r=this;if(!t)return null;var n=Math.acos(s.Vector3.Dot(this._dragPlane.forward,t.direction));if(n>Math.PI/2&&(n=Math.PI-n),this.maxDragAngle>0&&n>this.maxDragAngle){if(this._useAlternatePickedPointAboveMaxDragAngle){this._tmpVector.copyFrom(t.direction),this.attachedNode.absolutePosition.subtractToRef(t.origin,this._alternatePickedPoint),this._alternatePickedPoint.normalize(),this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed*s.Vector3.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);var i=s.Vector3.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-i,this._alternatePickedPoint),this._alternatePickedPoint.addInPlace(this._tmpVector),this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition),this._alternatePickedPoint}return null}var o=e._planeScene.pickWithRay(t,(function(e){return e==r._dragPlane}));return o&&o.hit&&o.pickedMesh&&o.pickedPoint?o.pickedPoint:null},e.prototype._updateDragPlanePosition=function(e,t){this._pointA.copyFrom(t),this._options.dragAxis?(this.useObjectOrientationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragAxis),e.origin.subtractToRef(this._pointA,this._pointC),this._pointC.normalize(),Math.abs(s.Vector3.Dot(this._localAxis,this._pointC))>.999?Math.abs(s.Vector3.Dot(s.Vector3.UpReadOnly,this._pointC))>.999?this._lookAt.copyFrom(s.Vector3.Right()):this._lookAt.copyFrom(s.Vector3.UpReadOnly):(s.Vector3.CrossToRef(this._localAxis,this._pointC,this._lookAt),s.Vector3.CrossToRef(this._localAxis,this._lookAt,this._lookAt),this._lookAt.normalize()),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._lookAt,this._lookAt),this._dragPlane.lookAt(this._lookAt)):this._options.dragPlaneNormal?(this.useObjectOrientationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragPlaneNormal,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragPlaneNormal),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._localAxis,this._lookAt),this._dragPlane.lookAt(this._lookAt)):(this._dragPlane.position.copyFrom(this._pointA),this._dragPlane.lookAt(e.origin)),this._dragPlane.position.copyFrom(this.attachedNode.absolutePosition),this._dragPlane.computeWorldMatrix(!0)},e.prototype.detach=function(){this._pointerObserver&&this._scene.onPointerObservable.remove(this._pointerObserver),this._beforeRenderObserver&&this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver),this.releaseDrag()},e._AnyMouseID=-2,e}())},"./Behaviors/Meshes/sixDofDragBehavior.ts":
- /*!************************************************!*\
- !*** ./Behaviors/Meshes/sixDofDragBehavior.ts ***!
- \************************************************/
- /*! exports provided: SixDofDragBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"SixDofDragBehavior",(function(){return u}));var n=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),i=r(/*! ../../scene */"./scene.ts"),o=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Misc/observable */"./Misc/observable.ts"),l=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),c=r(/*! ../../Misc/pivotTools */"./Misc/pivotTools.ts"),u=function(){function e(){this._sceneRenderObserver=null,this._targetPosition=new s.Vector3(0,0,0),this._moving=!1,this._startingOrientation=new s.Quaternion,this._attachedElement=null,this.zDragFactor=3,this.rotateDraggedObject=!0,this.dragging=!1,this.dragDeltaRatio=.2,this.currentDraggingPointerID=-1,this.detachCameraControls=!0,this.onDragStartObservable=new a.Observable,this.onDragEndObservable=new a.Observable}return Object.defineProperty(e.prototype,"name",{get:function(){return"SixDofDrag"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},Object.defineProperty(e.prototype,"_pointerCamera",{get:function(){return this._scene.cameraToUseForPointers?this._scene.cameraToUseForPointers:this._scene.activeCamera},enumerable:!1,configurable:!0}),e.prototype.attach=function(t){var r=this;this._ownerNode=t,this._scene=this._ownerNode.getScene(),e._virtualScene||(e._virtualScene=new i.Scene(this._scene.getEngine()),e._virtualScene.detachControl(),this._scene.getEngine().scenes.pop());var a=null,u=new s.Vector3(0,0,0);this._virtualOriginMesh=new n.AbstractMesh("",e._virtualScene),this._virtualOriginMesh.rotationQuaternion=new s.Quaternion,this._virtualDragMesh=new n.AbstractMesh("",e._virtualScene),this._virtualDragMesh.rotationQuaternion=new s.Quaternion,this._pointerObserver=this._scene.onPointerObservable.add((function(e,t){if(e.type==o.PointerEventTypes.POINTERDOWN){if(!r.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.ray&&(f=e.pickInfo.pickedMesh,r._ownerNode==f||f.isDescendantOf(r._ownerNode))){r._pointerCamera&&r._pointerCamera.cameraRigMode==l.Camera.RIG_MODE_NONE&&e.pickInfo.ray.origin.copyFrom(r._pointerCamera.globalPosition),a=r._ownerNode,c.PivotTools._RemoveAndStorePivotPoint(a),u.copyFrom(e.pickInfo.ray.origin),r._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),r._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),r._virtualOriginMesh.removeChild(r._virtualDragMesh),a.computeWorldMatrix(),r._virtualDragMesh.position.copyFrom(a.absolutePosition),a.rotationQuaternion||(a.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(a.rotation.y,a.rotation.x,a.rotation.z));var n=a.parent;a.setParent(null),r._virtualDragMesh.rotationQuaternion.copyFrom(a.rotationQuaternion),a.setParent(n),r._virtualOriginMesh.addChild(r._virtualDragMesh),r._targetPosition.copyFrom(r._virtualDragMesh.absolutePosition),r.dragging=!0,r.currentDraggingPointerID=e.event.pointerId,r.detachCameraControls&&r._pointerCamera&&!r._pointerCamera.leftCamera&&(r._pointerCamera.inputs.attachedElement?(r._attachedElement=r._pointerCamera.inputs.attachedElement,r._pointerCamera.detachControl(r._pointerCamera.inputs.attachedElement)):r._attachedElement=null),c.PivotTools._RestorePivotPoint(a),r.onDragStartObservable.notifyObservers({})}}else if(e.type==o.PointerEventTypes.POINTERUP||e.type==o.PointerEventTypes.POINTERDOUBLETAP)r.currentDraggingPointerID==e.event.pointerId&&(r.dragging=!1,r._moving=!1,r.currentDraggingPointerID=-1,a=null,r._virtualOriginMesh.removeChild(r._virtualDragMesh),r.detachCameraControls&&r._attachedElement&&r._pointerCamera&&!r._pointerCamera.leftCamera&&r._pointerCamera.attachControl(r._attachedElement,!0),r.onDragEndObservable.notifyObservers({}));else if(e.type==o.PointerEventTypes.POINTERMOVE&&r.currentDraggingPointerID==e.event.pointerId&&r.dragging&&e.pickInfo&&e.pickInfo.ray&&a){var i=r.zDragFactor;r._pointerCamera&&r._pointerCamera.cameraRigMode==l.Camera.RIG_MODE_NONE&&(e.pickInfo.ray.origin.copyFrom(r._pointerCamera.globalPosition),i=0);var d=e.pickInfo.ray.origin.subtract(u);u.copyFrom(e.pickInfo.ray.origin);var h=-s.Vector3.Dot(d,e.pickInfo.ray.direction);r._virtualOriginMesh.addChild(r._virtualDragMesh),r._virtualDragMesh.position.z-=r._virtualDragMesh.position.z<1?h*r.zDragFactor:h*i*r._virtualDragMesh.position.z,r._virtualDragMesh.position.z<0&&(r._virtualDragMesh.position.z=0),r._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),r._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),r._virtualOriginMesh.removeChild(r._virtualDragMesh),r._targetPosition.copyFrom(r._virtualDragMesh.absolutePosition),a.parent&&s.Vector3.TransformCoordinatesToRef(r._targetPosition,s.Matrix.Invert(a.parent.getWorldMatrix()),r._targetPosition),r._moving||r._startingOrientation.copyFrom(r._virtualDragMesh.rotationQuaternion),r._moving=!0}var f}));var d=new s.Quaternion;this._sceneRenderObserver=t.getScene().onBeforeRenderObservable.add((function(){if(r.dragging&&r._moving&&a){if(c.PivotTools._RemoveAndStorePivotPoint(a),a.position.addInPlace(r._targetPosition.subtract(a.position).scale(r.dragDeltaRatio)),r.rotateDraggedObject){d.copyFrom(r._startingOrientation),d.x=-d.x,d.y=-d.y,d.z=-d.z,r._virtualDragMesh.rotationQuaternion.multiplyToRef(d,d),s.Quaternion.RotationYawPitchRollToRef(d.toEulerAngles("xyz").y,0,0,d),d.multiplyToRef(r._startingOrientation,d);var e=a.parent;(!e||e.scaling&&!e.scaling.isNonUniformWithinEpsilon(.001))&&(a.setParent(null),s.Quaternion.SlerpToRef(a.rotationQuaternion,d,r.dragDeltaRatio,a.rotationQuaternion),a.setParent(e))}c.PivotTools._RestorePivotPoint(a)}}))},e.prototype.detach=function(){this._scene&&(this.detachCameraControls&&this._attachedElement&&this._pointerCamera&&!this._pointerCamera.leftCamera&&this._pointerCamera.attachControl(this._attachedElement,!0),this._scene.onPointerObservable.remove(this._pointerObserver)),this._ownerNode&&this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver),this._virtualOriginMesh&&this._virtualOriginMesh.dispose(),this._virtualDragMesh&&this._virtualDragMesh.dispose(),this.onDragEndObservable.clear(),this.onDragStartObservable.clear()},e}()},"./Behaviors/behavior.ts":
- /*!*******************************!*\
- !*** ./Behaviors/behavior.ts ***!
- \*******************************/
- /*! no static exports found */function(e,t){},"./Behaviors/index.ts":
- /*!****************************!*\
- !*** ./Behaviors/index.ts ***!
- \****************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./behavior */"./Behaviors/behavior.ts");for(var i in n)"default"!==i&&function(e){r.d(t,e,(function(){return n[e]}))}(i);var o=r(/*! ./Cameras/index */"./Behaviors/Cameras/index.ts");r.d(t,"AutoRotationBehavior",(function(){return o.AutoRotationBehavior})),r.d(t,"BouncingBehavior",(function(){return o.BouncingBehavior})),r.d(t,"FramingBehavior",(function(){return o.FramingBehavior}));var s=r(/*! ./Meshes/index */"./Behaviors/Meshes/index.ts");r.d(t,"AttachToBoxBehavior",(function(){return s.AttachToBoxBehavior})),r.d(t,"FadeInOutBehavior",(function(){return s.FadeInOutBehavior})),r.d(t,"MultiPointerScaleBehavior",(function(){return s.MultiPointerScaleBehavior})),r.d(t,"PointerDragBehavior",(function(){return s.PointerDragBehavior})),r.d(t,"SixDofDragBehavior",(function(){return s.SixDofDragBehavior}))},"./Bones/bone.ts":
- /*!***********************!*\
- !*** ./Bones/bone.ts ***!
- \***********************/
- /*! exports provided: Bone */function(e,t,r){"use strict";r.r(t),r.d(t,"Bone",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),l=function(e){function t(t,r,n,o,s,a,l){void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===l&&(l=null);var c=e.call(this,t,r.getScene())||this;return c.name=t,c.children=new Array,c.animations=new Array,c._index=null,c._absoluteTransform=new i.Matrix,c._invertedAbsoluteTransform=new i.Matrix,c._scalingDeterminant=1,c._worldTransform=new i.Matrix,c._needToDecompose=!0,c._needToCompose=!1,c._linkedTransformNode=null,c._waitingTransformNodeId=null,c._skeleton=r,c._localMatrix=o?o.clone():i.Matrix.Identity(),c._restPose=s||c._localMatrix.clone(),c._baseMatrix=a||c._localMatrix.clone(),c._index=l,r.bones.push(c),c.setParent(n,!1),(a||o)&&c._updateDifferenceMatrix(),c}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"_matrix",{get:function(){return this._compose(),this._localMatrix},set:function(e){this._localMatrix.copyFrom(e),this._needToDecompose=!0},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"Bone"},t.prototype.getSkeleton=function(){return this._skeleton},t.prototype.getParent=function(){return this._parent},t.prototype.getChildren=function(){return this.children},t.prototype.getIndex=function(){return null===this._index?this.getSkeleton().bones.indexOf(this):this._index},t.prototype.setParent=function(e,t){if(void 0===t&&(t=!0),this._parent!==e){if(this._parent){var r=this._parent.children.indexOf(this);-1!==r&&this._parent.children.splice(r,1)}this._parent=e,this._parent&&this._parent.children.push(this),t&&this._updateDifferenceMatrix(),this.markAsDirty()}},t.prototype.getLocalMatrix=function(){return this._compose(),this._localMatrix},t.prototype.getBaseMatrix=function(){return this._baseMatrix},t.prototype.getRestPose=function(){return this._restPose},t.prototype.setRestPose=function(e){this._restPose.copyFrom(e)},t.prototype.getWorldMatrix=function(){return this._worldTransform},t.prototype.returnToRest=function(){this.updateMatrix(this._restPose.clone(),!1,!1)},t.prototype.getInvertedAbsoluteTransform=function(){return this._invertedAbsoluteTransform},t.prototype.getAbsoluteTransform=function(){return this._absoluteTransform},t.prototype.linkTransformNode=function(e){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++},t.prototype.getTransformNode=function(){return this._linkedTransformNode},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.getRotation()},set:function(e){this.setRotation(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._decompose(),this._localRotation},set:function(e){this.setRotationQuaternion(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this.getScale()},set:function(e){this.setScale(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._skeleton.animationPropertiesOverride},enumerable:!1,configurable:!0}),t.prototype._decompose=function(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=i.Vector3.Zero(),this._localRotation=i.Quaternion.Zero(),this._localPosition=i.Vector3.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))},t.prototype._compose=function(){this._needToCompose&&(this._localScaling?(this._needToCompose=!1,i.Matrix.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)):this._needToCompose=!1)},t.prototype.updateMatrix=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0),this._baseMatrix.copyFrom(e),t&&this._updateDifferenceMatrix(),r?(this._localMatrix.copyFrom(e),this._markAsDirtyAndDecompose()):this.markAsDirty()},t.prototype._updateDifferenceMatrix=function(e,t){if(void 0===t&&(t=!0),e||(e=this._baseMatrix),this._parent?e.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform):this._absoluteTransform.copyFrom(e),this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform),t)for(var r=0;r<this.children.length;r++)this.children[r]._updateDifferenceMatrix();this._scalingDeterminant=this._absoluteTransform.determinant()<0?-1:1},t.prototype.markAsDirty=function(){this._currentRenderId++,this._childUpdateId++,this._skeleton._markAsDirty()},t.prototype._markAsDirtyAndCompose=function(){this.markAsDirty(),this._needToCompose=!0},t.prototype._markAsDirtyAndDecompose=function(){this.markAsDirty(),this._needToDecompose=!0},t.prototype.translate=function(e,r,n){void 0===r&&(r=a.Space.LOCAL);var o=this.getLocalMatrix();if(r==a.Space.LOCAL)o.addAtIndex(12,e.x),o.addAtIndex(13,e.y),o.addAtIndex(14,e.z);else{var s=null;n&&(s=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var l=t._tmpMats[0],c=t._tmpVecs[0];this._parent?n&&s?(l.copyFrom(this._parent.getAbsoluteTransform()),l.multiplyToRef(s,l)):l.copyFrom(this._parent.getAbsoluteTransform()):i.Matrix.IdentityToRef(l),l.setTranslationFromFloats(0,0,0),l.invert(),i.Vector3.TransformCoordinatesToRef(e,l,c),o.addAtIndex(12,c.x),o.addAtIndex(13,c.y),o.addAtIndex(14,c.z)}this._markAsDirtyAndDecompose()},t.prototype.setPosition=function(e,r,n){void 0===r&&(r=a.Space.LOCAL);var o=this.getLocalMatrix();if(r==a.Space.LOCAL)o.setTranslationFromFloats(e.x,e.y,e.z);else{var s=null;n&&(s=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var l=t._tmpMats[0],c=t._tmpVecs[0];this._parent?(n&&s?(l.copyFrom(this._parent.getAbsoluteTransform()),l.multiplyToRef(s,l)):l.copyFrom(this._parent.getAbsoluteTransform()),l.invert()):i.Matrix.IdentityToRef(l),i.Vector3.TransformCoordinatesToRef(e,l,c),o.setTranslationFromFloats(c.x,c.y,c.z)}this._markAsDirtyAndDecompose()},t.prototype.setAbsolutePosition=function(e,t){this.setPosition(e,a.Space.WORLD,t)},t.prototype.scale=function(e,r,n,o){void 0===o&&(o=!1);var s=this.getLocalMatrix(),a=t._tmpMats[0];i.Matrix.ScalingToRef(e,r,n,a),a.multiplyToRef(s,s),a.invert();for(var l=0,c=this.children;l<c.length;l++){var u=(f=c[l]).getLocalMatrix();u.multiplyToRef(a,u),u.multiplyAtIndex(12,e),u.multiplyAtIndex(13,r),u.multiplyAtIndex(14,n),f._markAsDirtyAndDecompose()}if(this._markAsDirtyAndDecompose(),o)for(var d=0,h=this.children;d<h.length;d++){var f;(f=h[d]).scale(e,r,n,o)}},t.prototype.setScale=function(e){this._decompose(),this._localScaling.copyFrom(e),this._markAsDirtyAndCompose()},t.prototype.getScale=function(){return this._decompose(),this._localScaling},t.prototype.getScaleToRef=function(e){this._decompose(),e.copyFrom(this._localScaling)},t.prototype.setYawPitchRoll=function(e,r,n,o,s){if(void 0===o&&(o=a.Space.LOCAL),o===a.Space.LOCAL){var l=t._tmpQuat;return i.Quaternion.RotationYawPitchRollToRef(e,r,n,l),void this.setRotationQuaternion(l,o,s)}var c=t._tmpMats[0];if(this._getNegativeRotationToRef(c,s)){var u=t._tmpMats[1];i.Matrix.RotationYawPitchRollToRef(e,r,n,u),c.multiplyToRef(u,u),this._rotateWithMatrix(u,o,s)}},t.prototype.rotate=function(e,r,n,o){void 0===n&&(n=a.Space.LOCAL);var s=t._tmpMats[0];s.setTranslationFromFloats(0,0,0),i.Matrix.RotationAxisToRef(e,r,s),this._rotateWithMatrix(s,n,o)},t.prototype.setAxisAngle=function(e,r,n,o){if(void 0===n&&(n=a.Space.LOCAL),n===a.Space.LOCAL){var s=t._tmpQuat;return i.Quaternion.RotationAxisToRef(e,r,s),void this.setRotationQuaternion(s,n,o)}var l=t._tmpMats[0];if(this._getNegativeRotationToRef(l,o)){var c=t._tmpMats[1];i.Matrix.RotationAxisToRef(e,r,c),l.multiplyToRef(c,c),this._rotateWithMatrix(c,n,o)}},t.prototype.setRotation=function(e,t,r){void 0===t&&(t=a.Space.LOCAL),this.setYawPitchRoll(e.y,e.x,e.z,t,r)},t.prototype.setRotationQuaternion=function(e,r,n){if(void 0===r&&(r=a.Space.LOCAL),r===a.Space.LOCAL)return this._decompose(),this._localRotation.copyFrom(e),void this._markAsDirtyAndCompose();var o=t._tmpMats[0];if(this._getNegativeRotationToRef(o,n)){var s=t._tmpMats[1];i.Matrix.FromQuaternionToRef(e,s),o.multiplyToRef(s,s),this._rotateWithMatrix(s,r,n)}},t.prototype.setRotationMatrix=function(e,r,n){if(void 0===r&&(r=a.Space.LOCAL),r===a.Space.LOCAL){var o=t._tmpQuat;return i.Quaternion.FromRotationMatrixToRef(e,o),void this.setRotationQuaternion(o,r,n)}var s=t._tmpMats[0];if(this._getNegativeRotationToRef(s,n)){var l=t._tmpMats[1];l.copyFrom(e),s.multiplyToRef(e,l),this._rotateWithMatrix(l,r,n)}},t.prototype._rotateWithMatrix=function(e,r,n){void 0===r&&(r=a.Space.LOCAL);var i=this.getLocalMatrix(),o=i.m[12],s=i.m[13],l=i.m[14],c=this.getParent(),u=t._tmpMats[3],d=t._tmpMats[4];c&&r==a.Space.WORLD?(n?(u.copyFrom(n.getWorldMatrix()),c.getAbsoluteTransform().multiplyToRef(u,u)):u.copyFrom(c.getAbsoluteTransform()),d.copyFrom(u),d.invert(),i.multiplyToRef(u,i),i.multiplyToRef(e,i),i.multiplyToRef(d,i)):r==a.Space.WORLD&&n?(u.copyFrom(n.getWorldMatrix()),d.copyFrom(u),d.invert(),i.multiplyToRef(u,i),i.multiplyToRef(e,i),i.multiplyToRef(d,i)):i.multiplyToRef(e,i),i.setTranslationFromFloats(o,s,l),this.computeAbsoluteTransforms(),this._markAsDirtyAndDecompose()},t.prototype._getNegativeRotationToRef=function(e,r){var n=t._tmpMats[2];return e.copyFrom(this.getAbsoluteTransform()),r&&(e.multiplyToRef(r.getWorldMatrix(),e),i.Matrix.ScalingToRef(r.scaling.x,r.scaling.y,r.scaling.z,n)),e.invert(),!isNaN(e.m[0])&&(n.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyToRef(n,e),!0)},t.prototype.getPosition=function(e,t){void 0===e&&(e=a.Space.LOCAL),void 0===t&&(t=null);var r=i.Vector3.Zero();return this.getPositionToRef(e,t,r),r},t.prototype.getPositionToRef=function(e,r,n){if(void 0===e&&(e=a.Space.LOCAL),e==a.Space.LOCAL){var i=this.getLocalMatrix();n.x=i.m[12],n.y=i.m[13],n.z=i.m[14]}else{var o=null;r&&(o=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var s=t._tmpMats[0];r&&o?(s.copyFrom(this.getAbsoluteTransform()),s.multiplyToRef(o,s)):s=this.getAbsoluteTransform(),n.x=s.m[12],n.y=s.m[13],n.z=s.m[14]}},t.prototype.getAbsolutePosition=function(e){void 0===e&&(e=null);var t=i.Vector3.Zero();return this.getPositionToRef(a.Space.WORLD,e,t),t},t.prototype.getAbsolutePositionToRef=function(e,t){this.getPositionToRef(a.Space.WORLD,e,t)},t.prototype.computeAbsoluteTransforms=function(){if(this._compose(),this._parent)this._localMatrix.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform);else{this._absoluteTransform.copyFrom(this._localMatrix);var e=this._skeleton.getPoseMatrix();e&&this._absoluteTransform.multiplyToRef(e,this._absoluteTransform)}for(var t=this.children,r=t.length,n=0;n<r;n++)t[n].computeAbsoluteTransforms()},t.prototype.getDirection=function(e,t){void 0===t&&(t=null);var r=i.Vector3.Zero();return this.getDirectionToRef(e,t,r),r},t.prototype.getDirectionToRef=function(e,r,n){void 0===r&&(r=null);var o=null;r&&(o=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var s=t._tmpMats[0];s.copyFrom(this.getAbsoluteTransform()),r&&o&&s.multiplyToRef(o,s),i.Vector3.TransformNormalToRef(e,s,n),n.normalize()},t.prototype.getRotation=function(e,t){void 0===e&&(e=a.Space.LOCAL),void 0===t&&(t=null);var r=i.Vector3.Zero();return this.getRotationToRef(e,t,r),r},t.prototype.getRotationToRef=function(e,r,n){void 0===e&&(e=a.Space.LOCAL),void 0===r&&(r=null);var i=t._tmpQuat;this.getRotationQuaternionToRef(e,r,i),i.toEulerAnglesToRef(n)},t.prototype.getRotationQuaternion=function(e,t){void 0===e&&(e=a.Space.LOCAL),void 0===t&&(t=null);var r=i.Quaternion.Identity();return this.getRotationQuaternionToRef(e,t,r),r},t.prototype.getRotationQuaternionToRef=function(e,r,n){if(void 0===e&&(e=a.Space.LOCAL),void 0===r&&(r=null),e==a.Space.LOCAL)this._decompose(),n.copyFrom(this._localRotation);else{var i=t._tmpMats[0],o=this.getAbsoluteTransform();r?o.multiplyToRef(r.getWorldMatrix(),i):i.copyFrom(o),i.multiplyAtIndex(0,this._scalingDeterminant),i.multiplyAtIndex(1,this._scalingDeterminant),i.multiplyAtIndex(2,this._scalingDeterminant),i.decompose(void 0,n,void 0)}},t.prototype.getRotationMatrix=function(e,t){void 0===e&&(e=a.Space.LOCAL);var r=i.Matrix.Identity();return this.getRotationMatrixToRef(e,t,r),r},t.prototype.getRotationMatrixToRef=function(e,r,n){if(void 0===e&&(e=a.Space.LOCAL),e==a.Space.LOCAL)this.getLocalMatrix().getRotationMatrixToRef(n);else{var i=t._tmpMats[0],o=this.getAbsoluteTransform();r?o.multiplyToRef(r.getWorldMatrix(),i):i.copyFrom(o),i.multiplyAtIndex(0,this._scalingDeterminant),i.multiplyAtIndex(1,this._scalingDeterminant),i.multiplyAtIndex(2,this._scalingDeterminant),i.getRotationMatrixToRef(n)}},t.prototype.getAbsolutePositionFromLocal=function(e,t){void 0===t&&(t=null);var r=i.Vector3.Zero();return this.getAbsolutePositionFromLocalToRef(e,t,r),r},t.prototype.getAbsolutePositionFromLocalToRef=function(e,r,n){void 0===r&&(r=null);var o=null;r&&(o=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var s=t._tmpMats[0];r&&o?(s.copyFrom(this.getAbsoluteTransform()),s.multiplyToRef(o,s)):s=this.getAbsoluteTransform(),i.Vector3.TransformCoordinatesToRef(e,s,n)},t.prototype.getLocalPositionFromAbsolute=function(e,t){void 0===t&&(t=null);var r=i.Vector3.Zero();return this.getLocalPositionFromAbsoluteToRef(e,t,r),r},t.prototype.getLocalPositionFromAbsoluteToRef=function(e,r,n){void 0===r&&(r=null);var o=null;r&&(o=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var s=t._tmpMats[0];s.copyFrom(this.getAbsoluteTransform()),r&&o&&s.multiplyToRef(o,s),s.invert(),i.Vector3.TransformCoordinatesToRef(e,s,n)},t._tmpVecs=o.ArrayTools.BuildArray(2,i.Vector3.Zero),t._tmpQuat=i.Quaternion.Identity(),t._tmpMats=o.ArrayTools.BuildArray(5,i.Matrix.Identity),t}(s.Node)},"./Bones/boneIKController.ts":
- /*!***********************************!*\
- !*** ./Bones/boneIKController.ts ***!
- \***********************************/
- /*! exports provided: BoneIKController */function(e,t,r){"use strict";r.r(t),r.d(t,"BoneIKController",(function(){return o}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),o=function(){function e(e,t,r){if(this.targetPosition=n.Vector3.Zero(),this.poleTargetPosition=n.Vector3.Zero(),this.poleTargetLocalOffset=n.Vector3.Zero(),this.poleAngle=0,this.slerpAmount=1,this._bone1Quat=n.Quaternion.Identity(),this._bone1Mat=n.Matrix.Identity(),this._bone2Ang=Math.PI,this._maxAngle=Math.PI,this._rightHandedSystem=!1,this._bendAxis=n.Vector3.Right(),this._slerping=!1,this._adjustRoll=0,this._bone2=t,this._bone1=t.getParent(),this._bone1){this.mesh=e;var o=t.getPosition();if(t.getAbsoluteTransform().determinant()>0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,o.x>o.y&&o.x>o.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length){var s=this._bone1.getScale(),a=this._bone2.getScale();this._bone1Length=this._bone1.length*s.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*a.y*this.mesh.scaling.y}else if(this._bone1.children[0]){e.computeWorldMatrix(!0);var l=this._bone2.children[0].getAbsolutePosition(e),c=this._bone2.getAbsolutePosition(e),u=this._bone1.getAbsolutePosition(e);this._bone1Length=n.Vector3.Distance(l,c),this._bone2Length=n.Vector3.Distance(c,u)}this._bone1.getRotationMatrixToRef(i.Space.WORLD,e,this._bone1Mat),this.maxAngle=Math.PI,r&&(r.targetMesh&&(this.targetMesh=r.targetMesh,this.targetMesh.computeWorldMatrix(!0)),r.poleTargetMesh?(this.poleTargetMesh=r.poleTargetMesh,this.poleTargetMesh.computeWorldMatrix(!0)):r.poleTargetBone?this.poleTargetBone=r.poleTargetBone:this._bone1.getParent()&&(this.poleTargetBone=this._bone1.getParent()),r.poleTargetLocalOffset&&this.poleTargetLocalOffset.copyFrom(r.poleTargetLocalOffset),r.poleAngle&&(this.poleAngle=r.poleAngle),r.bendAxis&&this._bendAxis.copyFrom(r.bendAxis),r.maxAngle&&(this.maxAngle=r.maxAngle),r.slerpAmount&&(this.slerpAmount=r.slerpAmount))}}return Object.defineProperty(e.prototype,"maxAngle",{get:function(){return this._maxAngle},set:function(e){this._setMaxAngle(e)},enumerable:!1,configurable:!0}),e.prototype._setMaxAngle=function(e){e<0&&(e=0),(e>Math.PI||null==e)&&(e=Math.PI),this._maxAngle=e;var t=this._bone1Length,r=this._bone2Length;this._maxReach=Math.sqrt(t*t+r*r-2*t*r*Math.cos(e))},e.prototype.update=function(){var t=this._bone1;if(t){var r=this.targetPosition,o=this.poleTargetPosition,s=e._tmpMats[0],a=e._tmpMats[1];this.targetMesh&&r.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,o):this.poleTargetMesh&&n.Vector3.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),o);var l=e._tmpVecs[0],c=e._tmpVecs[1],u=e._tmpVecs[2],d=e._tmpVecs[3],h=e._tmpVecs[4],f=e._tmpQuat;t.getAbsolutePositionToRef(this.mesh,l),o.subtractToRef(l,h),0==h.x&&0==h.y&&0==h.z?h.y=1:h.normalize(),r.subtractToRef(l,d),d.normalize(),n.Vector3.CrossToRef(d,h,c),c.normalize(),n.Vector3.CrossToRef(d,c,u),u.normalize(),n.Matrix.FromXYZAxesToRef(u,d,c,s);var p=this._bone1Length,m=this._bone2Length,g=n.Vector3.Distance(l,r);this._maxReach>0&&(g=Math.min(this._maxReach,g));var _=(m*m+g*g-p*p)/(2*m*g),v=(g*g+p*p-m*m)/(2*g*p);_>1&&(_=1),v>1&&(v=1),_<-1&&(_=-1),v<-1&&(v=-1);var y=Math.acos(_),b=Math.acos(v),A=-y-b;if(this._rightHandedSystem)n.Matrix.RotationYawPitchRollToRef(0,0,this._adjustRoll,a),a.multiplyToRef(s,s),n.Matrix.RotationAxisToRef(this._bendAxis,b,a),a.multiplyToRef(s,s);else{var T=e._tmpVecs[5];T.copyFrom(this._bendAxis),T.x*=-1,n.Matrix.RotationAxisToRef(T,-b,a),a.multiplyToRef(s,s)}this.poleAngle&&(n.Matrix.RotationAxisToRef(d,this.poleAngle,a),s.multiplyToRef(a,s)),this._bone1&&(this.slerpAmount<1?(this._slerping||n.Quaternion.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),n.Quaternion.FromRotationMatrixToRef(s,f),n.Quaternion.SlerpToRef(this._bone1Quat,f,this.slerpAmount,this._bone1Quat),A=this._bone2Ang*(1-this.slerpAmount)+A*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,i.Space.WORLD,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(s,i.Space.WORLD,this.mesh),this._bone1Mat.copyFrom(s),this._slerping=!1)),this._bone2.setAxisAngle(this._bendAxis,A,i.Space.LOCAL),this._bone2Ang=A}},e._tmpVecs=[n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero()],e._tmpQuat=n.Quaternion.Identity(),e._tmpMats=[n.Matrix.Identity(),n.Matrix.Identity()],e}()},"./Bones/boneLookController.ts":
- /*!*************************************!*\
- !*** ./Bones/boneLookController.ts ***!
- \*************************************/
- /*! exports provided: BoneLookController */function(e,t,r){"use strict";r.r(t),r.d(t,"BoneLookController",(function(){return s}));var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),s=function(){function e(e,t,r,n){if(this.upAxis=i.Vector3.Up(),this.upAxisSpace=o.Space.LOCAL,this.adjustYaw=0,this.adjustPitch=0,this.adjustRoll=0,this.slerpAmount=1,this._boneQuat=i.Quaternion.Identity(),this._slerping=!1,this._firstFrameSkipped=!1,this._fowardAxis=i.Vector3.Forward(),this.mesh=e,this.bone=t,this.target=r,n&&(n.adjustYaw&&(this.adjustYaw=n.adjustYaw),n.adjustPitch&&(this.adjustPitch=n.adjustPitch),n.adjustRoll&&(this.adjustRoll=n.adjustRoll),null!=n.maxYaw?this.maxYaw=n.maxYaw:this.maxYaw=Math.PI,null!=n.minYaw?this.minYaw=n.minYaw:this.minYaw=-Math.PI,null!=n.maxPitch?this.maxPitch=n.maxPitch:this.maxPitch=Math.PI,null!=n.minPitch?this.minPitch=n.minPitch:this.minPitch=-Math.PI,null!=n.slerpAmount&&(this.slerpAmount=n.slerpAmount),null!=n.upAxis&&(this.upAxis=n.upAxis),null!=n.upAxisSpace&&(this.upAxisSpace=n.upAxisSpace),null!=n.yawAxis||null!=n.pitchAxis)){var s=o.Axis.Y,a=o.Axis.X;null!=n.yawAxis&&(s=n.yawAxis.clone()).normalize(),null!=n.pitchAxis&&(a=n.pitchAxis.clone()).normalize();var l=i.Vector3.Cross(a,s);this._transformYawPitch=i.Matrix.Identity(),i.Matrix.FromXYZAxesToRef(a,s,l,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}t.getParent()||this.upAxisSpace!=o.Space.BONE||(this.upAxisSpace=o.Space.LOCAL)}return Object.defineProperty(e.prototype,"minYaw",{get:function(){return this._minYaw},set:function(e){this._minYaw=e,this._minYawSin=Math.sin(e),this._minYawCos=Math.cos(e),null!=this._maxYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxYaw",{get:function(){return this._maxYaw},set:function(e){this._maxYaw=e,this._maxYawSin=Math.sin(e),this._maxYawCos=Math.cos(e),null!=this._minYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minPitch",{get:function(){return this._minPitch},set:function(e){this._minPitch=e,this._minPitchTan=Math.tan(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxPitch",{get:function(){return this._maxPitch},set:function(e){this._maxPitch=e,this._maxPitchTan=Math.tan(e)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this.slerpAmount<1&&!this._firstFrameSkipped)this._firstFrameSkipped=!0;else{var t=this.bone,r=e._tmpVecs[0];t.getAbsolutePositionToRef(this.mesh,r);var n=this.target,s=e._tmpMats[0],a=e._tmpMats[1],l=this.mesh,c=t.getParent(),u=e._tmpVecs[1];u.copyFrom(this.upAxis),this.upAxisSpace==o.Space.BONE&&c?(this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(u,this._transformYawPitchInv,u),c.getDirectionToRef(u,this.mesh,u)):this.upAxisSpace==o.Space.LOCAL&&(l.getDirectionToRef(u,u),1==l.scaling.x&&1==l.scaling.y&&1==l.scaling.z||u.normalize());var d=!1,h=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(d=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(h=!0),d||h){var f=e._tmpMats[2],p=e._tmpMats[3];if(this.upAxisSpace==o.Space.BONE&&1==u.y&&c)c.getRotationMatrixToRef(o.Space.WORLD,this.mesh,f);else if(this.upAxisSpace!=o.Space.LOCAL||1!=u.y||c){(g=e._tmpVecs[2]).copyFrom(this._fowardAxis),this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(g,this._transformYawPitchInv,g),c?c.getDirectionToRef(g,this.mesh,g):l.getDirectionToRef(g,g);var m=i.Vector3.Cross(u,g);m.normalize();var g=i.Vector3.Cross(m,u);i.Matrix.FromXYZAxesToRef(m,u,g,f)}else f.copyFrom(l.getWorldMatrix());f.invertToRef(p);var _=null;if(h){var v=e._tmpVecs[3];n.subtractToRef(r,v),i.Vector3.TransformCoordinatesToRef(v,p,v),_=Math.sqrt(v.x*v.x+v.z*v.z);var y=Math.atan2(v.y,_),b=y;y>this._maxPitch?(v.y=this._maxPitchTan*_,b=this._maxPitch):y<this._minPitch&&(v.y=this._minPitchTan*_,b=this._minPitch),y!=b&&(i.Vector3.TransformCoordinatesToRef(v,f,v),v.addInPlace(r),n=v)}if(d){v=e._tmpVecs[4],n.subtractToRef(r,v),i.Vector3.TransformCoordinatesToRef(v,p,v);var A=Math.atan2(v.x,v.z),T=A;if((A>this._maxYaw||A<this._minYaw)&&(null==_&&(_=Math.sqrt(v.x*v.x+v.z*v.z)),this._yawRange>Math.PI?this._isAngleBetween(A,this._maxYaw,this._midYawConstraint)?(v.z=this._maxYawCos*_,v.x=this._maxYawSin*_,T=this._maxYaw):this._isAngleBetween(A,this._midYawConstraint,this._minYaw)&&(v.z=this._minYawCos*_,v.x=this._minYawSin*_,T=this._minYaw):A>this._maxYaw?(v.z=this._maxYawCos*_,v.x=this._maxYawSin*_,T=this._maxYaw):A<this._minYaw&&(v.z=this._minYawCos*_,v.x=this._minYawSin*_,T=this._minYaw)),this._slerping&&this._yawRange>Math.PI){var M=e._tmpVecs[8];M.copyFrom(o.Axis.Z),this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(M,this._transformYawPitchInv,M);var P=e._tmpMats[4];this._boneQuat.toRotationMatrix(P),this.mesh.getWorldMatrix().multiplyToRef(P,P),i.Vector3.TransformCoordinatesToRef(M,P,M),i.Vector3.TransformCoordinatesToRef(M,p,M);var S=Math.atan2(M.x,M.z);if(this._getAngleBetween(S,A)>this._getAngleBetween(S,this._midYawConstraint)){null==_&&(_=Math.sqrt(v.x*v.x+v.z*v.z));var E=this._getAngleBetween(S,this._maxYaw);this._getAngleBetween(S,this._minYaw)<E?(T=S+.75*Math.PI,v.z=Math.cos(T)*_,v.x=Math.sin(T)*_):(T=S-.75*Math.PI,v.z=Math.cos(T)*_,v.x=Math.sin(T)*_)}}A!=T&&(i.Vector3.TransformCoordinatesToRef(v,f,v),v.addInPlace(r),n=v)}}var C=e._tmpVecs[5],x=e._tmpVecs[6],R=e._tmpVecs[7],O=e._tmpQuat;n.subtractToRef(r,C),C.normalize(),i.Vector3.CrossToRef(u,C,x),x.normalize(),i.Vector3.CrossToRef(C,x,R),R.normalize(),i.Matrix.FromXYZAxesToRef(x,R,C,s),0===x.x&&0===x.y&&0===x.z||0===R.x&&0===R.y&&0===R.z||0===C.x&&0===C.y&&0===C.z||((this.adjustYaw||this.adjustPitch||this.adjustRoll)&&(i.Matrix.RotationYawPitchRollToRef(this.adjustYaw,this.adjustPitch,this.adjustRoll,a),a.multiplyToRef(s,s)),this.slerpAmount<1?(this._slerping||this.bone.getRotationQuaternionToRef(o.Space.WORLD,this.mesh,this._boneQuat),this._transformYawPitch&&this._transformYawPitch.multiplyToRef(s,s),i.Quaternion.FromRotationMatrixToRef(s,O),i.Quaternion.SlerpToRef(this._boneQuat,O,this.slerpAmount,this._boneQuat),this.bone.setRotationQuaternion(this._boneQuat,o.Space.WORLD,this.mesh),this._slerping=!0):(this._transformYawPitch&&this._transformYawPitch.multiplyToRef(s,s),this.bone.setRotationMatrix(s,o.Space.WORLD,this.mesh),this._slerping=!1))}},e.prototype._getAngleDiff=function(e,t){var r=t-e;return(r%=2*Math.PI)>Math.PI?r-=2*Math.PI:r<-Math.PI&&(r+=2*Math.PI),r},e.prototype._getAngleBetween=function(e,t){var r=0;return(r=(e=(e%=2*Math.PI)<0?e+2*Math.PI:e)<(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)?t-e:e-t)>Math.PI&&(r=2*Math.PI-r),r},e.prototype._isAngleBetween=function(e,t,r){if(e=(e%=2*Math.PI)<0?e+2*Math.PI:e,(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)<(r=(r%=2*Math.PI)<0?r+2*Math.PI:r)){if(e>t&&e<r)return!0}else if(e>r&&e<t)return!0;return!1},e._tmpVecs=n.ArrayTools.BuildArray(10,i.Vector3.Zero),e._tmpQuat=i.Quaternion.Identity(),e._tmpMats=n.ArrayTools.BuildArray(5,i.Matrix.Identity),e}()},"./Bones/index.ts":
- /*!************************!*\
- !*** ./Bones/index.ts ***!
- \************************/
- /*! exports provided: Bone, BoneIKController, BoneLookController, Skeleton */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./bone */"./Bones/bone.ts");r.d(t,"Bone",(function(){return n.Bone}));var i=r(/*! ./boneIKController */"./Bones/boneIKController.ts");r.d(t,"BoneIKController",(function(){return i.BoneIKController}));var o=r(/*! ./boneLookController */"./Bones/boneLookController.ts");r.d(t,"BoneLookController",(function(){return o.BoneLookController}));var s=r(/*! ./skeleton */"./Bones/skeleton.ts");r.d(t,"Skeleton",(function(){return s.Skeleton}))},"./Bones/skeleton.ts":
- /*!***************************!*\
- !*** ./Bones/skeleton.ts ***!
- \***************************/
- /*! exports provided: Skeleton */function(e,t,r){"use strict";r.r(t),r.d(t,"Skeleton",(function(){return f}));var n=r(/*! ./bone */"./Bones/bone.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),a=r(/*! ../Animations/animation */"./Animations/animation.ts"),l=r(/*! ../Animations/animationRange */"./Animations/animationRange.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),h=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),f=function(){function e(e,t,r){this.name=e,this.id=t,this.bones=new Array,this.needInitialSkinMatrix=!1,this.overrideMesh=null,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=o.Matrix.Identity(),this._ranges={},this._lastAbsoluteTransformsUpdateId=-1,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new i.Observable,this.bones=[],this._scene=r||c.EngineStore.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;var n=this._scene.getEngine().getCaps();this._canUseTextureForBones=n.textureFloat&&n.maxVertexTextureImageUnits>0}return Object.defineProperty(e.prototype,"useTextureToStoreBoneMatrices",{get:function(){return this._useTextureToStoreBoneMatrices},set:function(e){this._useTextureToStoreBoneMatrices=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTextureForMatrices",{get:function(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"Skeleton"},e.prototype.getChildren=function(){return this.bones.filter((function(e){return!e.getParent()}))},e.prototype.getTransformMatrices=function(e){return this.needInitialSkinMatrix&&e._bonesTransformMatrices?e._bonesTransformMatrices:(this._transformMatrices||this.prepare(),this._transformMatrices)},e.prototype.getTransformMatrixTexture=function(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture},e.prototype.getScene=function(){return this._scene},e.prototype.toString=function(e){var t="Name: "+this.name+", nBones: "+this.bones.length;if(t+=", nAnimationRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var r=!0;for(var n in this._ranges)r&&(t+=", ",r=!1),t+=n;t+="}"}return t},e.prototype.getBoneIndexByName=function(e){for(var t=0,r=this.bones.length;t<r;t++)if(this.bones[t].name===e)return t;return-1},e.prototype.createAnimationRange=function(e,t,r){if(!this._ranges[e]){this._ranges[e]=new l.AnimationRange(e,t,r);for(var n=0,i=this.bones.length;n<i;n++)this.bones[n].animations[0]&&this.bones[n].animations[0].createRange(e,t,r)}},e.prototype.deleteAnimationRange=function(e,t){void 0===t&&(t=!0);for(var r=0,n=this.bones.length;r<n;r++)this.bones[r].animations[0]&&this.bones[r].animations[0].deleteRange(e,t);this._ranges[e]=null},e.prototype.getAnimationRange=function(e){return this._ranges[e]||null},e.prototype.getAnimationRanges=function(){var e,t=[];for(e in this._ranges)t.push(this._ranges[e]);return t},e.prototype.copyAnimationRange=function(e,t,r){if(void 0===r&&(r=!1),this._ranges[t]||!e.getAnimationRange(t))return!1;var n,i,o=!0,s=this._getHighestAnimationFrame()+1,a={},c=e.bones;for(i=0,n=c.length;i<n;i++)a[c[i].name]=c[i];this.bones.length!==c.length&&(d.Logger.Warn("copyAnimationRange: this rig has "+this.bones.length+" bones, while source as "+c.length),o=!1);var u=r&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(i=0,n=this.bones.length;i<n;i++){var h=this.bones[i].name,f=a[h];f?o=o&&this.bones[i].copyAnimationRange(f,t,s,r,u):(d.Logger.Warn("copyAnimationRange: not same rig, missing source bone "+h),o=!1)}var p=e.getAnimationRange(t);return p&&(this._ranges[t]=new l.AnimationRange(t,p.from+s,p.to+s)),o},e.prototype.returnToRest=function(){for(var e=o.TmpVectors.Vector3[0],t=o.TmpVectors.Quaternion[0],r=o.TmpVectors.Vector3[1],n=0;n<this.bones.length;n++){var i=this.bones[n];-1!==i._index&&(i.returnToRest(),i._linkedTransformNode&&(i.getRestPose().decompose(e,t,r),i._linkedTransformNode.position=r.clone(),i._linkedTransformNode.rotationQuaternion=t.clone(),i._linkedTransformNode.scaling=e.clone()))}},e.prototype._getHighestAnimationFrame=function(){for(var e=0,t=0,r=this.bones.length;t<r;t++)if(this.bones[t].animations[0]){var n=this.bones[t].animations[0].getHighestFrame();e<n&&(e=n)}return e},e.prototype.beginAnimation=function(e,t,r,n){var i=this.getAnimationRange(e);return i?this._scene.beginAnimation(this,i.from,i.to,t,r,n):null},e.MakeAnimationAdditive=function(e,t,r){void 0===t&&(t=0);var n=e.getAnimationRange(name);if(!n)return null;for(var i=e._scene.getAllAnimatablesByTarget(e),o=null,s=0;s<i.length;s++){var l=i[s];if(l.fromFrame===(null==n?void 0:n.from)&&l.toFrame===(null==n?void 0:n.to)){o=l;break}}var c=e.getAnimatables();for(s=0;s<c.length;s++){var u=c[s].animations;if(u)for(var d=0;d<u.length;d++)a.Animation.MakeAnimationAdditive(u[d],t,r)}return o&&(o.isAdditive=!0),e},e.prototype._markAsDirty=function(){this._isDirty=!0},e.prototype._registerMeshWithPoseMatrix=function(e){this._meshesWithPoseMatrix.push(e)},e.prototype._unregisterMeshWithPoseMatrix=function(e){var t=this._meshesWithPoseMatrix.indexOf(e);t>-1&&this._meshesWithPoseMatrix.splice(t,1)},e.prototype._computeTransformMatrices=function(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(var r=0;r<this.bones.length;r++){var n=this.bones[r];n._childUpdateId++;var i=n.getParent();if(i?n.getLocalMatrix().multiplyToRef(i.getWorldMatrix(),n.getWorldMatrix()):t?n.getLocalMatrix().multiplyToRef(t,n.getWorldMatrix()):n.getWorldMatrix().copyFrom(n.getLocalMatrix()),-1!==n._index){var o=null===n._index?r:n._index;n.getInvertedAbsoluteTransform().multiplyToArray(n.getWorldMatrix(),e,16*o)}}this._identity.copyToArray(e,16*this.bones.length)},e.prototype.prepare=function(){if(this._numBonesWithLinkedTransformNode>0)for(var e=0,t=this.bones;e<t.length;e++){var r=t[e];r._linkedTransformNode&&(r._linkedTransformNode.computeWorldMatrix(),r._matrix=r._linkedTransformNode._localMatrix,r.markAsDirty())}if(this._isDirty){if(this.needInitialSkinMatrix)for(var n=0;n<this._meshesWithPoseMatrix.length;n++){var i=this._meshesWithPoseMatrix[n],a=i.getPoseMatrix();if(i._bonesTransformMatrices&&i._bonesTransformMatrices.length===16*(this.bones.length+1)||(i._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1))),this._synchronizedWithMesh!==i){this._synchronizedWithMesh=i;for(var l=0;l<this.bones.length;l++){var c=this.bones[l];c.getParent()||(c.getBaseMatrix().multiplyToRef(a,o.TmpVectors.Matrix[1]),c._updateDifferenceMatrix(o.TmpVectors.Matrix[1]))}if(this.isUsingTextureForMatrices){var d=4*(this.bones.length+1);i._transformMatrixTexture&&i._transformMatrixTexture.getSize().width===d||(i._transformMatrixTexture&&i._transformMatrixTexture.dispose(),i._transformMatrixTexture=s.RawTexture.CreateRGBATexture(i._bonesTransformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE,u.Constants.TEXTURETYPE_FLOAT))}}this._computeTransformMatrices(i._bonesTransformMatrices,a),this.isUsingTextureForMatrices&&i._transformMatrixTexture&&i._transformMatrixTexture.update(i._bonesTransformMatrices)}else this._transformMatrices&&this._transformMatrices.length===16*(this.bones.length+1)||(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=s.RawTexture.CreateRGBATexture(this._transformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE,u.Constants.TEXTURETYPE_FLOAT))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices);this._isDirty=!1,this._scene._activeBones.addCount(this.bones.length,!1)}},e.prototype.getAnimatables=function(){if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(var e=0;e<this.bones.length;e++)this._animatables.push(this.bones[e])}return this._animatables},e.prototype.clone=function(t,r){var i=new e(t,r||t,this._scene);i.needInitialSkinMatrix=this.needInitialSkinMatrix,i.overrideMesh=this.overrideMesh;for(var o=0;o<this.bones.length;o++){var s=this.bones[o],a=null,l=s.getParent();if(l){var c=this.bones.indexOf(l);a=i.bones[c]}var u=new n.Bone(s.name,i,a,s.getBaseMatrix().clone(),s.getRestPose().clone());u._index=s._index,s._linkedTransformNode&&u.linkTransformNode(s._linkedTransformNode),h.DeepCopier.DeepCopy(s.animations,u.animations)}if(this._ranges)for(var d in i._ranges={},this._ranges){var f=this._ranges[d];f&&(i._ranges[d]=f.clone())}return this._isDirty=!0,i},e.prototype.enableBlending=function(e){void 0===e&&(e=.01),this.bones.forEach((function(t){t.animations.forEach((function(t){t.enableBlending=!0,t.blendingSpeed=e}))}))},e.prototype.dispose=function(){this._meshesWithPoseMatrix=[],this.getScene().stopAnimation(this),this.getScene().removeSkeleton(this),this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)},e.prototype.serialize=function(){var e={};e.name=this.name,e.id=this.id,this.dimensionsAtRest&&(e.dimensionsAtRest=this.dimensionsAtRest.asArray()),e.bones=[],e.needInitialSkinMatrix=this.needInitialSkinMatrix;for(var t=0;t<this.bones.length;t++){var r=this.bones[t],n=r.getParent(),i={parentBoneIndex:n?this.bones.indexOf(n):-1,name:r.name,matrix:r.getBaseMatrix().toArray(),rest:r.getRestPose().toArray()};for(var o in e.bones.push(i),r.length&&(i.length=r.length),r.metadata&&(i.metadata=r.metadata),r.animations&&r.animations.length>0&&(i.animation=r.animations[0].serialize()),e.ranges=[],this._ranges){var s=this._ranges[o];if(s){var a={};a.name=o,a.from=s.from,a.to=s.to,e.ranges.push(a)}}}return e},e.Parse=function(t,r){var i,s=new e(t.name,t.id,r);for(t.dimensionsAtRest&&(s.dimensionsAtRest=o.Vector3.FromArray(t.dimensionsAtRest)),s.needInitialSkinMatrix=t.needInitialSkinMatrix,i=0;i<t.bones.length;i++){var l=t.bones[i],c=null;l.parentBoneIndex>-1&&(c=s.bones[l.parentBoneIndex]);var u=l.rest?o.Matrix.FromArray(l.rest):null,d=new n.Bone(l.name,s,c,o.Matrix.FromArray(l.matrix),u);void 0!==l.id&&null!==l.id&&(d.id=l.id),l.length&&(d.length=l.length),l.metadata&&(d.metadata=l.metadata),l.animation&&d.animations.push(a.Animation.Parse(l.animation)),void 0!==l.linkedTransformNodeId&&null!==l.linkedTransformNodeId&&(s._hasWaitingData=!0,d._waitingTransformNodeId=l.linkedTransformNodeId)}if(t.ranges)for(i=0;i<t.ranges.length;i++){var h=t.ranges[i];s.createAnimationRange(h.name,h.from,h.to)}return s},e.prototype.computeAbsoluteTransforms=function(e){void 0===e&&(e=!1);var t=this._scene.getRenderId();(this._lastAbsoluteTransformsUpdateId!=t||e)&&(this.bones[0].computeAbsoluteTransforms(),this._lastAbsoluteTransformsUpdateId=t)},e.prototype.getPoseMatrix=function(){var e=null;return this._meshesWithPoseMatrix.length>0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e},e.prototype.sortBones=function(){for(var e=new Array,t=new Array(this.bones.length),r=0;r<this.bones.length;r++)this._sortBones(r,e,t);this.bones=e},e.prototype._sortBones=function(e,t,r){if(!r[e]){r[e]=!0;var n=this.bones[e];void 0===n._index&&(n._index=e);var i=n.getParent();i&&this._sortBones(this.bones.indexOf(i),t,r),t.push(n)}},e}()},"./Cameras/Inputs/BaseCameraPointersInput.ts":
- /*!***************************************************!*\
- !*** ./Cameras/Inputs/BaseCameraPointersInput.ts ***!
- \***************************************************/
- /*! exports provided: BaseCameraPointersInput */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseCameraPointersInput",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),a=function(){function e(){this.buttons=[0,1,2]}return e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getEngine(),i=0,a=null;this.pointA=null,this.pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=function(o,l){var c=o.event,u="touch"===c.pointerType;if(!n.isInVRExclusivePointerMode&&(o.type===s.PointerEventTypes.POINTERMOVE||-1!==r.buttons.indexOf(c.button))){var d=c.srcElement||c.target;if(r._altKey=c.altKey,r._ctrlKey=c.ctrlKey,r._metaKey=c.metaKey,r._shiftKey=c.shiftKey,r._buttonsPressed=c.buttons,n.isPointerLock){var h=c.movementX||c.mozMovementX||c.webkitMovementX||c.msMovementX||0,f=c.movementY||c.mozMovementY||c.webkitMovementY||c.msMovementY||0;r.onTouch(null,h,f),r.pointA=null,r.pointB=null}else if(o.type===s.PointerEventTypes.POINTERDOWN&&d){try{d.setPointerCapture(c.pointerId)}catch(e){}null===r.pointA?r.pointA={x:c.clientX,y:c.clientY,pointerId:c.pointerId,type:c.pointerType}:null===r.pointB&&(r.pointB={x:c.clientX,y:c.clientY,pointerId:c.pointerId,type:c.pointerType}),r.onButtonDown(c),t||(c.preventDefault(),e.focus())}else if(o.type===s.PointerEventTypes.POINTERDOUBLETAP)r.onDoubleTap(c.pointerType);else if(o.type===s.PointerEventTypes.POINTERUP&&d){try{d.releasePointerCapture(c.pointerId)}catch(e){}u||(r.pointB=null),n._badOS?r.pointA=r.pointB=null:r.pointB&&r.pointA&&r.pointA.pointerId==c.pointerId?(r.pointA=r.pointB,r.pointB=null):r.pointA&&r.pointB&&r.pointB.pointerId==c.pointerId?r.pointB=null:r.pointA=r.pointB=null,(0!==i||a)&&(r.onMultiTouch(r.pointA,r.pointB,i,0,a,null),i=0,a=null),r.onButtonUp(c),t||c.preventDefault()}else if(o.type===s.PointerEventTypes.POINTERMOVE)if(t||c.preventDefault(),r.pointA&&null===r.pointB)h=c.clientX-r.pointA.x,f=c.clientY-r.pointA.y,r.onTouch(r.pointA,h,f),r.pointA.x=c.clientX,r.pointA.y=c.clientY;else if(r.pointA&&r.pointB){var p=r.pointA.pointerId===c.pointerId?r.pointA:r.pointB;p.x=c.clientX,p.y=c.clientY;var m=r.pointA.x-r.pointB.x,g=r.pointA.y-r.pointB.y,_=m*m+g*g,v={x:(r.pointA.x+r.pointB.x)/2,y:(r.pointA.y+r.pointB.y)/2,pointerId:c.pointerId,type:o.type};r.onMultiTouch(r.pointA,r.pointB,i,_,a,v),a=v,i=_}}},this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,s.PointerEventTypes.POINTERDOWN|s.PointerEventTypes.POINTERUP|s.PointerEventTypes.POINTERMOVE),this._onLostFocus=function(){r.pointA=r.pointB=null,i=0,a=null,r.onLostFocus()},e.addEventListener("contextmenu",this.onContextMenu.bind(this),!1);var l=this.camera.getScene().getEngine().getHostWindow();l&&o.Tools.RegisterTopRootEvents(l,[{name:"blur",handler:this._onLostFocus}])},e.prototype.detachControl=function(e){if(this._onLostFocus){var t=this.camera.getScene().getEngine().getHostWindow();t&&o.Tools.UnregisterTopRootEvents(t,[{name:"blur",handler:this._onLostFocus}])}e&&this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this.onContextMenu&&e.removeEventListener("contextmenu",this.onContextMenu),this._onLostFocus=null),this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0},e.prototype.getClassName=function(){return"BaseCameraPointersInput"},e.prototype.getSimpleName=function(){return"pointers"},e.prototype.onDoubleTap=function(e){},e.prototype.onTouch=function(e,t,r){},e.prototype.onMultiTouch=function(e,t,r,n,i,o){},e.prototype.onContextMenu=function(e){e.preventDefault()},e.prototype.onButtonDown=function(e){},e.prototype.onButtonUp=function(e){},e.prototype.onLostFocus=function(){},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"buttons",void 0),e}()},"./Cameras/Inputs/arcRotateCameraGamepadInput.ts":
- /*!*******************************************************!*\
- !*** ./Cameras/Inputs/arcRotateCameraGamepadInput.ts ***!
- \*******************************************************/
- /*! exports provided: ArcRotateCameraGamepadInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraGamepadInput",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),a=function(){function e(){this.gamepadRotationSensibility=80,this.gamepadMoveSensibility=40,this._yAxisScale=1}return Object.defineProperty(e.prototype,"invertYAxis",{get:function(){return 1!==this._yAxisScale},set:function(e){this._yAxisScale=e?-1:1},enumerable:!1,configurable:!0}),e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=n.onGamepadConnectedObservable.add((function(e){e.type!==s.Gamepad.POSE_ENABLED&&(r.gamepad&&e.type!==s.Gamepad.XBOX||(r.gamepad=e))})),this._onGamepadDisconnectedObserver=n.onGamepadDisconnectedObservable.add((function(e){r.gamepad===e&&(r.gamepad=null)})),this.gamepad=n.getGamepadByType(s.Gamepad.XBOX)},e.prototype.detachControl=function(e){this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null},e.prototype.checkInputs=function(){if(this.gamepad){var e=this.camera,t=this.gamepad.rightStick;if(t){if(0!=t.x){var r=t.x/this.gamepadRotationSensibility;0!=r&&Math.abs(r)>.005&&(e.inertialAlphaOffset+=r)}if(0!=t.y){var n=t.y/this.gamepadRotationSensibility*this._yAxisScale;0!=n&&Math.abs(n)>.005&&(e.inertialBetaOffset+=n)}}var i=this.gamepad.leftStick;if(i&&0!=i.y){var o=i.y/this.gamepadMoveSensibility;0!=o&&Math.abs(o)>.005&&(this.camera.inertialRadiusOffset-=o)}}},e.prototype.getClassName=function(){return"ArcRotateCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadRotationSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadMoveSensibility",void 0),e}();o.CameraInputTypes.ArcRotateCameraGamepadInput=a},"./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts":
- /*!************************************************************!*\
- !*** ./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts ***!
- \************************************************************/
- /*! exports provided: ArcRotateCameraKeyboardMoveInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraKeyboardMoveInput",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/keyboardEvents */"./Events/keyboardEvents.ts"),a=function(){function e(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}return e.prototype.attachControl=function(e,t){var r=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add((function(){r._keys=[]})),this._onKeyboardObserver=this._scene.onKeyboardObservable.add((function(e){var n,i=e.event;i.metaKey||(e.type===s.KeyboardEventTypes.KEYDOWN?(r._ctrlPressed=i.ctrlKey,r._altPressed=i.altKey,(-1!==r.keysUp.indexOf(i.keyCode)||-1!==r.keysDown.indexOf(i.keyCode)||-1!==r.keysLeft.indexOf(i.keyCode)||-1!==r.keysRight.indexOf(i.keyCode)||-1!==r.keysReset.indexOf(i.keyCode))&&(-1===(n=r._keys.indexOf(i.keyCode))&&r._keys.push(i.keyCode),i.preventDefault&&(t||i.preventDefault()))):-1===r.keysUp.indexOf(i.keyCode)&&-1===r.keysDown.indexOf(i.keyCode)&&-1===r.keysLeft.indexOf(i.keyCode)&&-1===r.keysRight.indexOf(i.keyCode)&&-1===r.keysReset.indexOf(i.keyCode)||((n=r._keys.indexOf(i.keyCode))>=0&&r._keys.splice(n,1),i.preventDefault&&(t||i.preventDefault())))})))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t<this._keys.length;t++){var r=this._keys[t];-1!==this.keysLeft.indexOf(r)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningX-=1/this.panningSensibility:e.inertialAlphaOffset-=this.angularSpeed:-1!==this.keysUp.indexOf(r)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningY+=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?e.inertialRadiusOffset+=1/this.zoomingSensibility:e.inertialBetaOffset-=this.angularSpeed:-1!==this.keysRight.indexOf(r)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningX+=1/this.panningSensibility:e.inertialAlphaOffset+=this.angularSpeed:-1!==this.keysDown.indexOf(r)?this._ctrlPressed&&this.camera._useCtrlForPanning?e.inertialPanningY-=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?e.inertialRadiusOffset-=1/this.zoomingSensibility:e.inertialBetaOffset+=this.angularSpeed:-1!==this.keysReset.indexOf(r)&&e.useInputToRestoreState&&e.restoreState()}},e.prototype.getClassName=function(){return"ArcRotateCameraKeyboardMoveInput"},e.prototype.getSimpleName=function(){return"keyboard"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysUp",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysDown",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysLeft",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysRight",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysReset",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"panningSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"zoomingSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"useAltToZoom",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"angularSpeed",void 0),e}();o.CameraInputTypes.ArcRotateCameraKeyboardMoveInput=a},"./Cameras/Inputs/arcRotateCameraMouseWheelInput.ts":
- /*!**********************************************************!*\
- !*** ./Cameras/Inputs/arcRotateCameraMouseWheelInput.ts ***!
- \**********************************************************/
- /*! exports provided: ArcRotateCameraMouseWheelInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraMouseWheelInput",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),a=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),l=function(){function e(){this.wheelPrecision=3,this.wheelDeltaPercentage=0}return e.prototype.computeDeltaFromMouseWheelLegacyEvent=function(e,t){var r=.01*e*this.wheelDeltaPercentage*t;return e>0?r/(1+this.wheelDeltaPercentage):r*(1+this.wheelDeltaPercentage)},e.prototype.attachControl=function(e,t){var r=this;this._wheel=function(e,n){if(e.type===s.PointerEventTypes.POINTERWHEEL){var i=e.event,o=0,l=i,c=0;if(c=l.wheelDelta?l.wheelDelta:60*-(i.deltaY||i.detail),r.wheelDeltaPercentage){if((o=r.computeDeltaFromMouseWheelLegacyEvent(c,r.camera.radius))>0){for(var u=r.camera.radius,d=r.camera.inertialRadiusOffset+o,h=0;h<20&&Math.abs(d)>.001;h++)u-=d,d*=r.camera.inertia;u=a.Scalar.Clamp(u,0,Number.MAX_VALUE),o=r.computeDeltaFromMouseWheelLegacyEvent(c,u)}}else o=c/(40*r.wheelPrecision);o&&(r.camera.inertialRadiusOffset+=o),i.preventDefault&&(t||i.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,s.PointerEventTypes.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&e&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null)},e.prototype.getClassName=function(){return"ArcRotateCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelDeltaPercentage",void 0),e}();o.CameraInputTypes.ArcRotateCameraMouseWheelInput=l},"./Cameras/Inputs/arcRotateCameraPointersInput.ts":
- /*!********************************************************!*\
- !*** ./Cameras/Inputs/arcRotateCameraPointersInput.ts ***!
- \********************************************************/
- /*! exports provided: ArcRotateCameraPointersInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraPointersInput",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[0,1,2],t.angularSensibilityX=1e3,t.angularSensibilityY=1e3,t.pinchPrecision=12,t.pinchDeltaPercentage=0,t.useNaturalPinchZoom=!1,t.panningSensibility=1e3,t.multiTouchPanning=!0,t.multiTouchPanAndZoom=!0,t.pinchInwards=!0,t._isPanClick=!1,t._twoFingerActivityCount=0,t._isPinching=!1,t}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ArcRotateCameraPointersInput"},t.prototype.onTouch=function(e,t,r){0!==this.panningSensibility&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-t/this.panningSensibility,this.camera.inertialPanningY+=r/this.panningSensibility):(this.camera.inertialAlphaOffset-=t/this.angularSensibilityX,this.camera.inertialBetaOffset-=r/this.angularSensibilityY)},t.prototype.onDoubleTap=function(e){this.camera.useInputToRestoreState&&this.camera.restoreState()},t.prototype.onMultiTouch=function(e,t,r,n,i,o){if(!(0===r&&null===i||0===n&&null===o)){var s=this.pinchInwards?1:-1;if(this.multiTouchPanAndZoom){if(this.useNaturalPinchZoom?this.camera.radius=this.camera.radius*Math.sqrt(r)/Math.sqrt(n):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=.001*(n-r)*this.camera.radius*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(n-r)/(this.pinchPrecision*s*(this.angularSensibilityX+this.angularSensibilityY)/2),0!==this.panningSensibility&&i&&o){var a=o.x-i.x,l=o.y-i.y;this.camera.inertialPanningX+=-a/this.panningSensibility,this.camera.inertialPanningY+=l/this.panningSensibility}}else{this._twoFingerActivityCount++;var c=Math.sqrt(r),u=Math.sqrt(n);this._isPinching||this._twoFingerActivityCount<20&&Math.abs(u-c)>this.camera.pinchToPanMaxDistance?(this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=.001*(n-r)*this.camera.radius*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(n-r)/(this.pinchPrecision*s*(this.angularSensibilityX+this.angularSensibilityY)/2),this._isPinching=!0):0!==this.panningSensibility&&this.multiTouchPanning&&o&&i&&(a=o.x-i.x,l=o.y-i.y,this.camera.inertialPanningX+=-a/this.panningSensibility,this.camera.inertialPanningY+=l/this.panningSensibility)}}},t.prototype.onButtonDown=function(e){this._isPanClick=e.button===this.camera._panningMouseButton},t.prototype.onButtonUp=function(e){this._twoFingerActivityCount=0,this._isPinching=!1},t.prototype.onLostFocus=function(){this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"buttons",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityX",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchDeltaPercentage",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useNaturalPinchZoom",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"panningSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"multiTouchPanning",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"multiTouchPanAndZoom",void 0),t}(r(/*! ../../Cameras/Inputs/BaseCameraPointersInput */"./Cameras/Inputs/BaseCameraPointersInput.ts").BaseCameraPointersInput);o.CameraInputTypes.ArcRotateCameraPointersInput=s},"./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts":
- /*!*******************************************************************!*\
- !*** ./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts ***!
- \*******************************************************************/
- /*! exports provided: ArcRotateCameraVRDeviceOrientationInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraVRDeviceOrientationInput",(function(){return s}));var n=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),i=r(/*! ../../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts");i.ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation=function(){return this.add(new s),this};var s=function(){function e(){this.alphaCorrection=1,this.gammaCorrection=1,this._alpha=0,this._gamma=0,this._dirty=!1,this._deviceOrientationHandler=this._onOrientationEvent.bind(this)}return e.prototype.attachControl=function(e,t){var r=this;this.camera.attachControl(e,t);var n=this.camera.getScene().getEngine().getHostWindow();n&&("undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){"granted"===e?n.addEventListener("deviceorientation",r._deviceOrientationHandler):o.Tools.Warn("Permission not granted.")})).catch((function(e){o.Tools.Error(e)})):n.addEventListener("deviceorientation",this._deviceOrientationHandler))},e.prototype._onOrientationEvent=function(e){null!==e.alpha&&(this._alpha=(0|+e.alpha)*this.alphaCorrection),null!==e.gamma&&(this._gamma=(0|+e.gamma)*this.gammaCorrection),this._dirty=!0},e.prototype.checkInputs=function(){this._dirty&&(this._dirty=!1,this._gamma<0&&(this._gamma=180+this._gamma),this.camera.alpha=-this._alpha/180*Math.PI%Math.PI*2,this.camera.beta=this._gamma/180*Math.PI)},e.prototype.detachControl=function(e){window.removeEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype.getClassName=function(){return"ArcRotateCameraVRDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"VRDeviceOrientation"},e}();n.CameraInputTypes.ArcRotateCameraVRDeviceOrientationInput=s},"./Cameras/Inputs/flyCameraKeyboardInput.ts":
- /*!**************************************************!*\
- !*** ./Cameras/Inputs/flyCameraKeyboardInput.ts ***!
- \**************************************************/
- /*! exports provided: FlyCameraKeyboardInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FlyCameraKeyboardInput",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/keyboardEvents */"./Events/keyboardEvents.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=function(){function e(){this.keysForward=[87],this.keysBackward=[83],this.keysUp=[69],this.keysDown=[81],this.keysRight=[68],this.keysLeft=[65],this._keys=new Array}return e.prototype.attachControl=function(e,t){var r=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add((function(){r._keys=[]})),this._onKeyboardObserver=this._scene.onKeyboardObservable.add((function(e){var n,i=e.event;e.type===s.KeyboardEventTypes.KEYDOWN?-1===r.keysForward.indexOf(i.keyCode)&&-1===r.keysBackward.indexOf(i.keyCode)&&-1===r.keysUp.indexOf(i.keyCode)&&-1===r.keysDown.indexOf(i.keyCode)&&-1===r.keysLeft.indexOf(i.keyCode)&&-1===r.keysRight.indexOf(i.keyCode)||(-1===(n=r._keys.indexOf(i.keyCode))&&r._keys.push(i.keyCode),t||i.preventDefault()):-1===r.keysForward.indexOf(i.keyCode)&&-1===r.keysBackward.indexOf(i.keyCode)&&-1===r.keysUp.indexOf(i.keyCode)&&-1===r.keysDown.indexOf(i.keyCode)&&-1===r.keysLeft.indexOf(i.keyCode)&&-1===r.keysRight.indexOf(i.keyCode)||((n=r._keys.indexOf(i.keyCode))>=0&&r._keys.splice(n,1),t||i.preventDefault())})))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.getClassName=function(){return"FlyCameraKeyboardInput"},e.prototype._onLostFocus=function(e){this._keys=[]},e.prototype.getSimpleName=function(){return"keyboard"},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t<this._keys.length;t++){var r=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysForward.indexOf(r)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysBackward.indexOf(r)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUp.indexOf(r)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDown.indexOf(r)?e._localDirection.copyFromFloats(0,-n,0):-1!==this.keysRight.indexOf(r)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysLeft.indexOf(r)&&e._localDirection.copyFromFloats(-n,0,0),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),a.Vector3.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysForward",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysBackward",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysUp",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysDown",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysRight",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysLeft",void 0),e}();o.CameraInputTypes.FlyCameraKeyboardInput=l},"./Cameras/Inputs/flyCameraMouseInput.ts":
- /*!***********************************************!*\
- !*** ./Cameras/Inputs/flyCameraMouseInput.ts ***!
- \***********************************************/
- /*! exports provided: FlyCameraMouseInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FlyCameraMouseInput",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts"),c=function(){function e(e){void 0===e&&(e=!0),this.buttons=[0,1,2],this.buttonsYaw=[-1,0,1],this.buttonsPitch=[-1,0,1],this.buttonsRoll=[2],this.activeButton=-1,this.angularSensibility=1e3,this.previousPosition=null}return e.prototype.attachControl=function(e,t){var r=this;this.element=e,this.noPreventDefault=t,this._observer=this.camera.getScene().onPointerObservable.add((function(e,t){r._pointerInput(e,t)}),s.PointerEventTypes.POINTERDOWN|s.PointerEventTypes.POINTERUP|s.PointerEventTypes.POINTERMOVE),this._rollObserver=this.camera.getScene().onBeforeRenderObservable.add((function(){r.camera.rollCorrect&&r.camera.restoreRoll(r.camera.rollCorrect)})),this._mousemoveCallback=function(e){r._onMouseMove(e)},e.addEventListener("mousemove",this._mousemoveCallback,!1)},e.prototype.detachControl=function(e){this._observer&&e&&(this.camera.getScene().onPointerObservable.remove(this._observer),this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver),this._mousemoveCallback&&e.removeEventListener("mousemove",this._mousemoveCallback),this._observer=null,this._rollObserver=null,this.previousPosition=null,this.noPreventDefault=void 0)},e.prototype.getClassName=function(){return"FlyCameraMouseInput"},e.prototype.getSimpleName=function(){return"mouse"},e.prototype._pointerInput=function(e,t){var r=e.event,n=this.camera.getEngine();if(!n.isInVRExclusivePointerMode&&(this.touchEnabled||"touch"!==r.pointerType)&&(e.type===s.PointerEventTypes.POINTERMOVE||-1!==this.buttons.indexOf(r.button))){var i=r.srcElement||r.target;if(e.type===s.PointerEventTypes.POINTERDOWN&&i){try{i.setPointerCapture(r.pointerId)}catch(r){}this.previousPosition={x:r.clientX,y:r.clientY},this.activeButton=r.button,this.noPreventDefault||(r.preventDefault(),this.element.focus())}else if(e.type===s.PointerEventTypes.POINTERUP&&i){try{i.releasePointerCapture(r.pointerId)}catch(r){}this.activeButton=-1,this.previousPosition=null,this.noPreventDefault||r.preventDefault()}else if(e.type===s.PointerEventTypes.POINTERMOVE){if(!this.previousPosition||n.isPointerLock)return;var o=r.clientX-this.previousPosition.x,a=r.clientY-this.previousPosition.y;this.rotateCamera(o,a),this.previousPosition={x:r.clientX,y:r.clientY},this.noPreventDefault||r.preventDefault()}}},e.prototype._onMouseMove=function(e){var t=this.camera.getEngine();if(t.isPointerLock&&!t.isInVRExclusivePointerMode){var r=e.movementX||e.mozMovementX||e.webkitMovementX||e.msMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||e.msMovementY||0;this.rotateCamera(r,n),this.previousPosition=null,this.noPreventDefault||e.preventDefault()}},e.prototype.rotateCamera=function(e,t){var r=this,n=this.camera;this.camera.getScene().useRightHandedSystem&&(e*=-1),n.parent&&n.parent._getWorldMatrixDeterminant()<0&&(e*=-1);var i,o=e/this.angularSensibility,s=t/this.angularSensibility,c=a.Quaternion.RotationYawPitchRoll(n.rotation.y,n.rotation.x,n.rotation.z);if(this.buttonsPitch.some((function(e){return e===r.activeButton}))&&(i=a.Quaternion.RotationAxis(l.Axis.X,s),c.multiplyInPlace(i)),this.buttonsYaw.some((function(e){return e===r.activeButton}))){i=a.Quaternion.RotationAxis(l.Axis.Y,o),c.multiplyInPlace(i);var u=n.bankedTurnLimit+n._trackRoll;if(n.bankedTurn&&-u<n.rotation.z&&n.rotation.z<u){var d=n.bankedTurnMultiplier*-o;i=a.Quaternion.RotationAxis(l.Axis.Z,d),c.multiplyInPlace(i)}}this.buttonsRoll.some((function(e){return e===r.activeButton}))&&(i=a.Quaternion.RotationAxis(l.Axis.Z,-o),n._trackRoll-=o,c.multiplyInPlace(i)),c.toEulerAnglesToRef(n.rotation)},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"buttons",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"angularSensibility",void 0),e}();o.CameraInputTypes.FlyCameraMouseInput=c},"./Cameras/Inputs/followCameraKeyboardMoveInput.ts":
- /*!*********************************************************!*\
- !*** ./Cameras/Inputs/followCameraKeyboardMoveInput.ts ***!
- \*********************************************************/
- /*! exports provided: FollowCameraKeyboardMoveInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraKeyboardMoveInput",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),o=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ../../Events/keyboardEvents */"./Events/keyboardEvents.ts"),a=function(){function e(){this.keysHeightOffsetIncr=[38],this.keysHeightOffsetDecr=[40],this.keysHeightOffsetModifierAlt=!1,this.keysHeightOffsetModifierCtrl=!1,this.keysHeightOffsetModifierShift=!1,this.keysRotationOffsetIncr=[37],this.keysRotationOffsetDecr=[39],this.keysRotationOffsetModifierAlt=!1,this.keysRotationOffsetModifierCtrl=!1,this.keysRotationOffsetModifierShift=!1,this.keysRadiusIncr=[40],this.keysRadiusDecr=[38],this.keysRadiusModifierAlt=!0,this.keysRadiusModifierCtrl=!1,this.keysRadiusModifierShift=!1,this.heightSensibility=1,this.rotationSensibility=1,this.radiusSensibility=1,this._keys=new Array}return e.prototype.attachControl=function(e,t){var r=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add((function(){r._keys=[]})),this._onKeyboardObserver=this._scene.onKeyboardObservable.add((function(e){var n,i=e.event;i.metaKey||(e.type===s.KeyboardEventTypes.KEYDOWN?(r._ctrlPressed=i.ctrlKey,r._altPressed=i.altKey,r._shiftPressed=i.shiftKey,(-1!==r.keysHeightOffsetIncr.indexOf(i.keyCode)||-1!==r.keysHeightOffsetDecr.indexOf(i.keyCode)||-1!==r.keysRotationOffsetIncr.indexOf(i.keyCode)||-1!==r.keysRotationOffsetDecr.indexOf(i.keyCode)||-1!==r.keysRadiusIncr.indexOf(i.keyCode)||-1!==r.keysRadiusDecr.indexOf(i.keyCode))&&(-1===(n=r._keys.indexOf(i.keyCode))&&r._keys.push(i.keyCode),i.preventDefault&&(t||i.preventDefault()))):-1===r.keysHeightOffsetIncr.indexOf(i.keyCode)&&-1===r.keysHeightOffsetDecr.indexOf(i.keyCode)&&-1===r.keysRotationOffsetIncr.indexOf(i.keyCode)&&-1===r.keysRotationOffsetDecr.indexOf(i.keyCode)&&-1===r.keysRadiusIncr.indexOf(i.keyCode)&&-1===r.keysRadiusDecr.indexOf(i.keyCode)||((n=r._keys.indexOf(i.keyCode))>=0&&r._keys.splice(n,1),i.preventDefault&&(t||i.preventDefault())))})))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){var e=this;this._onKeyboardObserver&&this._keys.forEach((function(t){-1!==e.keysHeightOffsetIncr.indexOf(t)&&e._modifierHeightOffset()?e.camera.heightOffset+=e.heightSensibility:-1!==e.keysHeightOffsetDecr.indexOf(t)&&e._modifierHeightOffset()?e.camera.heightOffset-=e.heightSensibility:-1!==e.keysRotationOffsetIncr.indexOf(t)&&e._modifierRotationOffset()?(e.camera.rotationOffset+=e.rotationSensibility,e.camera.rotationOffset%=360):-1!==e.keysRotationOffsetDecr.indexOf(t)&&e._modifierRotationOffset()?(e.camera.rotationOffset-=e.rotationSensibility,e.camera.rotationOffset%=360):-1!==e.keysRadiusIncr.indexOf(t)&&e._modifierRadius()?e.camera.radius+=e.radiusSensibility:-1!==e.keysRadiusDecr.indexOf(t)&&e._modifierRadius()&&(e.camera.radius-=e.radiusSensibility)}))},e.prototype.getClassName=function(){return"FollowCameraKeyboardMoveInput"},e.prototype.getSimpleName=function(){return"keyboard"},e.prototype._modifierHeightOffset=function(){return this.keysHeightOffsetModifierAlt===this._altPressed&&this.keysHeightOffsetModifierCtrl===this._ctrlPressed&&this.keysHeightOffsetModifierShift===this._shiftPressed},e.prototype._modifierRotationOffset=function(){return this.keysRotationOffsetModifierAlt===this._altPressed&&this.keysRotationOffsetModifierCtrl===this._ctrlPressed&&this.keysRotationOffsetModifierShift===this._shiftPressed},e.prototype._modifierRadius=function(){return this.keysRadiusModifierAlt===this._altPressed&&this.keysRadiusModifierCtrl===this._ctrlPressed&&this.keysRadiusModifierShift===this._shiftPressed},Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetIncr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetDecr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierAlt",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierCtrl",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierShift",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetIncr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetDecr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierAlt",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierCtrl",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierShift",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusIncr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusDecr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusModifierAlt",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusModifierCtrl",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusModifierShift",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"heightSensibility",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"rotationSensibility",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"radiusSensibility",void 0),e}();i.CameraInputTypes.FollowCameraKeyboardMoveInput=a},"./Cameras/Inputs/followCameraMouseWheelInput.ts":
- /*!*******************************************************!*\
- !*** ./Cameras/Inputs/followCameraMouseWheelInput.ts ***!
- \*******************************************************/
- /*! exports provided: FollowCameraMouseWheelInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraMouseWheelInput",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),a=function(){function e(){this.axisControlRadius=!0,this.axisControlHeight=!1,this.axisControlRotation=!1,this.wheelPrecision=3,this.wheelDeltaPercentage=0}return e.prototype.attachControl=function(e,t){var r=this;this._wheel=function(e,n){if(e.type===s.PointerEventTypes.POINTERWHEEL){var i=e.event,o=0,a=Math.max(-1,Math.min(1,i.deltaY||i.wheelDelta||-i.detail));r.wheelDeltaPercentage?(console.assert(r.axisControlRadius+r.axisControlHeight+r.axisControlRotation<=1,"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: "+r.axisControlRadius+", axisControlHeightOffset: "+r.axisControlHeight+", axisControlRotationOffset: "+r.axisControlRotation),r.axisControlRadius?o=.01*a*r.wheelDeltaPercentage*r.camera.radius:r.axisControlHeight?o=.01*a*r.wheelDeltaPercentage*r.camera.heightOffset:r.axisControlRotation&&(o=.01*a*r.wheelDeltaPercentage*r.camera.rotationOffset)):o=a*r.wheelPrecision,o&&(r.axisControlRadius?r.camera.radius+=o:r.axisControlHeight?r.camera.heightOffset-=o:r.axisControlRotation&&(r.camera.rotationOffset-=o)),i.preventDefault&&(t||i.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,s.PointerEventTypes.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&e&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null)},e.prototype.getClassName=function(){return"ArcRotateCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"axisControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"axisControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"axisControlRotation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelDeltaPercentage",void 0),e}();o.CameraInputTypes.FollowCameraMouseWheelInput=a},"./Cameras/Inputs/followCameraPointersInput.ts":
- /*!*****************************************************!*\
- !*** ./Cameras/Inputs/followCameraPointersInput.ts ***!
- \*****************************************************/
- /*! exports provided: FollowCameraPointersInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraPointersInput",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.angularSensibilityX=1,t.angularSensibilityY=1,t.pinchPrecision=1e4,t.pinchDeltaPercentage=0,t.axisXControlRadius=!1,t.axisXControlHeight=!1,t.axisXControlRotation=!0,t.axisYControlRadius=!1,t.axisYControlHeight=!0,t.axisYControlRotation=!1,t.axisPinchControlRadius=!0,t.axisPinchControlHeight=!1,t.axisPinchControlRotation=!1,t.warningEnable=!0,t._warningCounter=0,t}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FollowCameraPointersInput"},t.prototype.onTouch=function(e,t,r){this._warning(),this.axisXControlRotation?this.camera.rotationOffset+=t/this.angularSensibilityX:this.axisYControlRotation&&(this.camera.rotationOffset+=r/this.angularSensibilityX),this.axisXControlHeight?this.camera.heightOffset+=t/this.angularSensibilityY:this.axisYControlHeight&&(this.camera.heightOffset+=r/this.angularSensibilityY),this.axisXControlRadius?this.camera.radius-=t/this.angularSensibilityY:this.axisYControlRadius&&(this.camera.radius-=r/this.angularSensibilityY)},t.prototype.onMultiTouch=function(e,t,r,n,i,o){if(!(0===r&&null===i||0===n&&null===o)){var s=(n-r)/(this.pinchPrecision*(this.angularSensibilityX+this.angularSensibilityY)/2);this.pinchDeltaPercentage?(s*=.01*this.pinchDeltaPercentage,this.axisPinchControlRotation&&(this.camera.rotationOffset+=s*this.camera.rotationOffset),this.axisPinchControlHeight&&(this.camera.heightOffset+=s*this.camera.heightOffset),this.axisPinchControlRadius&&(this.camera.radius-=s*this.camera.radius)):(this.axisPinchControlRotation&&(this.camera.rotationOffset+=s),this.axisPinchControlHeight&&(this.camera.heightOffset+=s),this.axisPinchControlRadius&&(this.camera.radius-=s))}},t.prototype._warning=function(){if(this.warningEnable&&this._warningCounter++%100==0){var e="It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: ";console.assert(this.axisXControlRotation+this.axisXControlHeight+this.axisXControlRadius<=1,e+"axisXControlRotation: "+this.axisXControlRotation+", axisXControlHeight: "+this.axisXControlHeight+", axisXControlRadius: "+this.axisXControlRadius),console.assert(this.axisYControlRotation+this.axisYControlHeight+this.axisYControlRadius<=1,e+"axisYControlRotation: "+this.axisYControlRotation+", axisYControlHeight: "+this.axisYControlHeight+", axisYControlRadius: "+this.axisYControlRadius),console.assert(this.axisPinchControlRotation+this.axisPinchControlHeight+this.axisPinchControlRadius<=1,e+"axisPinchControlRotation: "+this.axisPinchControlRotation+", axisPinchControlHeight: "+this.axisPinchControlHeight+", axisPinchControlRadius: "+this.axisPinchControlRadius)}},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityX",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchDeltaPercentage",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisXControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisXControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisXControlRotation",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisYControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisYControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisYControlRotation",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisPinchControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisPinchControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisPinchControlRotation",void 0),t}(r(/*! ../../Cameras/Inputs/BaseCameraPointersInput */"./Cameras/Inputs/BaseCameraPointersInput.ts").BaseCameraPointersInput);o.CameraInputTypes.FollowCameraPointersInput=s},"./Cameras/Inputs/freeCameraDeviceOrientationInput.ts":
- /*!************************************************************!*\
- !*** ./Cameras/Inputs/freeCameraDeviceOrientationInput.ts ***!
- \************************************************************/
- /*! exports provided: FreeCameraDeviceOrientationInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraDeviceOrientationInput",(function(){return l}));var n=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Cameras/freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts"),a=r(/*! ../../Misc/observable */"./Misc/observable.ts");s.FreeCameraInputsManager.prototype.addDeviceOrientation=function(){return this._deviceOrientationInput||(this._deviceOrientationInput=new l,this.add(this._deviceOrientationInput)),this};var l=function(){function e(){var e=this;this._screenOrientationAngle=0,this._screenQuaternion=new i.Quaternion,this._alpha=0,this._beta=0,this._gamma=0,this._onDeviceOrientationChangedObservable=new a.Observable,this._orientationChanged=function(){e._screenOrientationAngle=void 0!==window.orientation?+window.orientation:window.screen.orientation&&window.screen.orientation.angle?window.screen.orientation.angle:0,e._screenOrientationAngle=-o.Tools.ToRadians(e._screenOrientationAngle/2),e._screenQuaternion.copyFromFloats(0,Math.sin(e._screenOrientationAngle),0,Math.cos(e._screenOrientationAngle))},this._deviceOrientation=function(t){e._alpha=null!==t.alpha?t.alpha:0,e._beta=null!==t.beta?t.beta:0,e._gamma=null!==t.gamma?t.gamma:0,null!==t.alpha&&e._onDeviceOrientationChangedObservable.notifyObservers()},this._constantTranform=new i.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}return e.WaitForOrientationChangeAsync=function(e){return new Promise((function(t,r){var n=!1,i=function(){window.removeEventListener("deviceorientation",i),n=!0,t()};e&&setTimeout((function(){n||(window.removeEventListener("deviceorientation",i),r("WaitForOrientationChangeAsync timed out"))}),e),"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){"granted"==e?window.addEventListener("deviceorientation",i):o.Tools.Warn("Permission not granted.")})).catch((function(e){o.Tools.Error(e)})):window.addEventListener("deviceorientation",i)}))},Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},set:function(e){var t=this;this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new i.Quaternion),this._camera&&this._camera.onDisposeObservable.add((function(){t._onDeviceOrientationChangedObservable.clear()}))},enumerable:!1,configurable:!0}),e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getScene().getEngine().getHostWindow();if(n){var i=function(){n.addEventListener("orientationchange",r._orientationChanged),n.addEventListener("deviceorientation",r._deviceOrientation),r._orientationChanged()};"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){"granted"===e?i():o.Tools.Warn("Permission not granted.")})).catch((function(e){o.Tools.Error(e)})):i()}},e.prototype.detachControl=function(e){window.removeEventListener("orientationchange",this._orientationChanged),window.removeEventListener("deviceorientation",this._deviceOrientation),this._alpha=0},e.prototype.checkInputs=function(){this._alpha&&(i.Quaternion.RotationYawPitchRollToRef(o.Tools.ToRadians(this._alpha),o.Tools.ToRadians(this._beta),-o.Tools.ToRadians(this._gamma),this.camera.rotationQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform),this._camera.rotationQuaternion.z*=-1,this._camera.rotationQuaternion.w*=-1)},e.prototype.getClassName=function(){return"FreeCameraDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"deviceOrientation"},e}();n.CameraInputTypes.FreeCameraDeviceOrientationInput=l},"./Cameras/Inputs/freeCameraGamepadInput.ts":
- /*!**************************************************!*\
- !*** ./Cameras/Inputs/freeCameraGamepadInput.ts ***!
- \**************************************************/
- /*! exports provided: FreeCameraGamepadInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraGamepadInput",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),l=function(){function e(){this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this._yAxisScale=1,this._cameraTransform=s.Matrix.Identity(),this._deltaTransform=s.Vector3.Zero(),this._vector3=s.Vector3.Zero(),this._vector2=s.Vector2.Zero()}return Object.defineProperty(e.prototype,"invertYAxis",{get:function(){return 1!==this._yAxisScale},set:function(e){this._yAxisScale=e?-1:1},enumerable:!1,configurable:!0}),e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=n.onGamepadConnectedObservable.add((function(e){e.type!==a.Gamepad.POSE_ENABLED&&(r.gamepad&&e.type!==a.Gamepad.XBOX||(r.gamepad=e))})),this._onGamepadDisconnectedObserver=n.onGamepadDisconnectedObservable.add((function(e){r.gamepad===e&&(r.gamepad=null)})),this.gamepad=n.getGamepadByType(a.Gamepad.XBOX)},e.prototype.detachControl=function(e){this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null},e.prototype.checkInputs=function(){if(this.gamepad&&this.gamepad.leftStick){var e=this.camera,t=this.gamepad.leftStick,r=t.x/this.gamepadMoveSensibility,n=t.y/this.gamepadMoveSensibility;t.x=Math.abs(r)>.005?0+r:0,t.y=Math.abs(n)>.005?0+n:0;var i=this.gamepad.rightStick;if(i){var o=i.x/this.gamepadAngularSensibility,a=i.y/this.gamepadAngularSensibility*this._yAxisScale;i.x=Math.abs(o)>.001?0+o:0,i.y=Math.abs(a)>.001?0+a:0}else i={x:0,y:0};e.rotationQuaternion?e.rotationQuaternion.toRotationMatrix(this._cameraTransform):s.Matrix.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,this._cameraTransform);var l=50*e._computeLocalCameraSpeed();this._vector3.copyFromFloats(t.x*l,0,-t.y*l),s.Vector3.TransformCoordinatesToRef(this._vector3,this._cameraTransform,this._deltaTransform),e.cameraDirection.addInPlace(this._deltaTransform),this._vector2.copyFromFloats(i.y,i.x),e.cameraRotation.addInPlace(this._vector2)}},e.prototype.getClassName=function(){return"FreeCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadAngularSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadMoveSensibility",void 0),e}();o.CameraInputTypes.FreeCameraGamepadInput=l},"./Cameras/Inputs/freeCameraKeyboardMoveInput.ts":
- /*!*******************************************************!*\
- !*** ./Cameras/Inputs/freeCameraKeyboardMoveInput.ts ***!
- \*******************************************************/
- /*! exports provided: FreeCameraKeyboardMoveInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraKeyboardMoveInput",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/keyboardEvents */"./Events/keyboardEvents.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=function(){function e(){this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this._keys=new Array}return e.prototype.attachControl=function(e,t){var r=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add((function(){r._keys=[]})),this._onKeyboardObserver=this._scene.onKeyboardObservable.add((function(e){var n,i=e.event;i.metaKey||(e.type===s.KeyboardEventTypes.KEYDOWN?-1===r.keysUp.indexOf(i.keyCode)&&-1===r.keysDown.indexOf(i.keyCode)&&-1===r.keysLeft.indexOf(i.keyCode)&&-1===r.keysRight.indexOf(i.keyCode)&&-1===r.keysUpward.indexOf(i.keyCode)&&-1===r.keysDownward.indexOf(i.keyCode)||(-1===(n=r._keys.indexOf(i.keyCode))&&r._keys.push(i.keyCode),t||i.preventDefault()):-1===r.keysUp.indexOf(i.keyCode)&&-1===r.keysDown.indexOf(i.keyCode)&&-1===r.keysLeft.indexOf(i.keyCode)&&-1===r.keysRight.indexOf(i.keyCode)&&-1===r.keysUpward.indexOf(i.keyCode)&&-1===r.keysDownward.indexOf(i.keyCode)||((n=r._keys.indexOf(i.keyCode))>=0&&r._keys.splice(n,1),t||i.preventDefault()))})))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t<this._keys.length;t++){var r=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysLeft.indexOf(r)?e._localDirection.copyFromFloats(-n,0,0):-1!==this.keysUp.indexOf(r)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysRight.indexOf(r)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysDown.indexOf(r)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUpward.indexOf(r)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDownward.indexOf(r)&&e._localDirection.copyFromFloats(0,-n,0),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),a.Vector3.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}},e.prototype.getClassName=function(){return"FreeCameraKeyboardMoveInput"},e.prototype._onLostFocus=function(){this._keys=[]},e.prototype.getSimpleName=function(){return"keyboard"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysUp",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysUpward",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysDown",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysDownward",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysLeft",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"keysRight",void 0),e}();o.CameraInputTypes.FreeCameraKeyboardMoveInput=l},"./Cameras/Inputs/freeCameraMouseInput.ts":
- /*!************************************************!*\
- !*** ./Cameras/Inputs/freeCameraMouseInput.ts ***!
- \************************************************/
- /*! exports provided: FreeCameraMouseInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraMouseInput",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),a=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),l=function(){function e(e){void 0===e&&(e=!0),this.touchEnabled=e,this.buttons=[0,1,2],this.angularSensibility=2e3,this.previousPosition=null,this.onPointerMovedObservable=new i.Observable,this._allowCameraRotation=!0}return e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getEngine();this._pointerInput||(this._pointerInput=function(i){var o=i.event;if(!n.isInVRExclusivePointerMode&&(r.touchEnabled||"touch"!==o.pointerType)&&(i.type===a.PointerEventTypes.POINTERMOVE||-1!==r.buttons.indexOf(o.button))){var s=o.srcElement||o.target;if(i.type===a.PointerEventTypes.POINTERDOWN&&s){try{s.setPointerCapture(o.pointerId)}catch(e){}r.previousPosition={x:o.clientX,y:o.clientY},t||(o.preventDefault(),e.focus())}else if(i.type===a.PointerEventTypes.POINTERUP&&s){try{s.releasePointerCapture(o.pointerId)}catch(e){}r.previousPosition=null,t||o.preventDefault()}else if(i.type===a.PointerEventTypes.POINTERMOVE){if(!r.previousPosition||n.isPointerLock)return;var l=o.clientX-r.previousPosition.x,c=o.clientY-r.previousPosition.y;r.camera.getScene().useRightHandedSystem&&(l*=-1),r.camera.parent&&r.camera.parent._getWorldMatrixDeterminant()<0&&(l*=-1),r._allowCameraRotation&&(r.camera.cameraRotation.y+=l/r.angularSensibility,r.camera.cameraRotation.x+=c/r.angularSensibility),r.onPointerMovedObservable.notifyObservers({offsetX:l,offsetY:c}),r.previousPosition={x:o.clientX,y:o.clientY},t||o.preventDefault()}}}),this._onMouseMove=function(e){if(n.isPointerLock&&!n.isInVRExclusivePointerMode){var i=e.movementX||e.mozMovementX||e.webkitMovementX||e.msMovementX||0;r.camera.getScene().useRightHandedSystem&&(i*=-1),r.camera.parent&&r.camera.parent._getWorldMatrixDeterminant()<0&&(i*=-1),r.camera.cameraRotation.y+=i/r.angularSensibility;var o=e.movementY||e.mozMovementY||e.webkitMovementY||e.msMovementY||0;r.camera.cameraRotation.x+=o/r.angularSensibility,r.previousPosition=null,t||e.preventDefault()}},this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,a.PointerEventTypes.POINTERDOWN|a.PointerEventTypes.POINTERUP|a.PointerEventTypes.POINTERMOVE),e.addEventListener("mousemove",this._onMouseMove,!1),e.addEventListener("contextmenu",this.onContextMenu.bind(this),!1)},e.prototype.onContextMenu=function(e){e.preventDefault()},e.prototype.detachControl=function(e){this._observer&&e&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._onMouseMove&&e.removeEventListener("mousemove",this._onMouseMove),this.onContextMenu&&e.removeEventListener("contextmenu",this.onContextMenu),this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this.previousPosition=null)},e.prototype.getClassName=function(){return"FreeCameraMouseInput"},e.prototype.getSimpleName=function(){return"mouse"},Object(n.__decorate)([Object(o.serialize)()],e.prototype,"buttons",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"angularSensibility",void 0),e}();s.CameraInputTypes.FreeCameraMouseInput=l},"./Cameras/Inputs/freeCameraTouchInput.ts":
- /*!************************************************!*\
- !*** ./Cameras/Inputs/freeCameraTouchInput.ts ***!
- \************************************************/
- /*! exports provided: FreeCameraTouchInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraTouchInput",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=function(){function e(){this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array}return e.prototype.attachControl=function(e,t){var r=this,n=null;void 0===this._pointerInput&&(this._onLostFocus=function(){r._offsetX=null,r._offsetY=null},this._pointerInput=function(e){var i=e.event;if("mouse"!==i.pointerType)if(e.type===s.PointerEventTypes.POINTERDOWN){if(t||i.preventDefault(),r._pointerPressed.push(i.pointerId),1!==r._pointerPressed.length)return;n={x:i.clientX,y:i.clientY}}else if(e.type===s.PointerEventTypes.POINTERUP){if(t||i.preventDefault(),-1===(o=r._pointerPressed.indexOf(i.pointerId)))return;if(r._pointerPressed.splice(o,1),0!=o)return;n=null,r._offsetX=null,r._offsetY=null}else if(e.type===s.PointerEventTypes.POINTERMOVE){if(t||i.preventDefault(),!n)return;var o;if(0!=(o=r._pointerPressed.indexOf(i.pointerId)))return;r._offsetX=i.clientX-n.x,r._offsetY=-(i.clientY-n.y)}}),this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,s.PointerEventTypes.POINTERDOWN|s.PointerEventTypes.POINTERUP|s.PointerEventTypes.POINTERMOVE),this._onLostFocus&&e.addEventListener("blur",this._onLostFocus)},e.prototype.detachControl=function(e){this._pointerInput&&e&&(this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null),this._onLostFocus&&(e.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null),this._pointerPressed=[],this._offsetX=null,this._offsetY=null)},e.prototype.checkInputs=function(){if(this._offsetX&&this._offsetY){var e=this.camera;if(e.cameraRotation.y+=this._offsetX/this.touchAngularSensibility,this._pointerPressed.length>1)e.cameraRotation.x+=-this._offsetY/this.touchAngularSensibility;else{var t=e._computeLocalCameraSpeed(),r=new a.Vector3(0,0,t*this._offsetY/this.touchMoveSensibility);a.Matrix.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(a.Vector3.TransformCoordinates(r,e._cameraRotationMatrix))}}},e.prototype.getClassName=function(){return"FreeCameraTouchInput"},e.prototype.getSimpleName=function(){return"touch"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"touchAngularSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"touchMoveSensibility",void 0),e}();o.CameraInputTypes.FreeCameraTouchInput=l},"./Cameras/Inputs/freeCameraVirtualJoystickInput.ts":
- /*!**********************************************************!*\
- !*** ./Cameras/Inputs/freeCameraVirtualJoystickInput.ts ***!
- \**********************************************************/
- /*! exports provided: FreeCameraVirtualJoystickInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraVirtualJoystickInput",(function(){return s}));var n=r(/*! ../../Misc/virtualJoystick */"./Misc/virtualJoystick.ts"),i=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),o=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts");r(/*! ../../Cameras/freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts").FreeCameraInputsManager.prototype.addVirtualJoystick=function(){return this.add(new s),this};var s=function(){function e(){}return e.prototype.getLeftJoystick=function(){return this._leftjoystick},e.prototype.getRightJoystick=function(){return this._rightjoystick},e.prototype.checkInputs=function(){if(this._leftjoystick){var e=this.camera,t=50*e._computeLocalCameraSpeed(),r=o.Matrix.RotationYawPitchRoll(e.rotation.y,e.rotation.x,0),n=o.Vector3.TransformCoordinates(new o.Vector3(this._leftjoystick.deltaPosition.x*t,this._leftjoystick.deltaPosition.y*t,this._leftjoystick.deltaPosition.z*t),r);e.cameraDirection=e.cameraDirection.add(n),e.cameraRotation=e.cameraRotation.addVector3(this._rightjoystick.deltaPosition),this._leftjoystick.pressed||(this._leftjoystick.deltaPosition=this._leftjoystick.deltaPosition.scale(.9)),this._rightjoystick.pressed||(this._rightjoystick.deltaPosition=this._rightjoystick.deltaPosition.scale(.9))}},e.prototype.attachControl=function(e,t){this._leftjoystick=new n.VirtualJoystick(!0),this._leftjoystick.setAxisForUpDown(n.JoystickAxis.Z),this._leftjoystick.setAxisForLeftRight(n.JoystickAxis.X),this._leftjoystick.setJoystickSensibility(.15),this._rightjoystick=new n.VirtualJoystick(!1),this._rightjoystick.setAxisForUpDown(n.JoystickAxis.X),this._rightjoystick.setAxisForLeftRight(n.JoystickAxis.Y),this._rightjoystick.reverseUpDown=!0,this._rightjoystick.setJoystickSensibility(.05),this._rightjoystick.setJoystickColor("yellow")},e.prototype.detachControl=function(e){this._leftjoystick.releaseCanvas(),this._rightjoystick.releaseCanvas()},e.prototype.getClassName=function(){return"FreeCameraVirtualJoystickInput"},e.prototype.getSimpleName=function(){return"virtualJoystick"},e}();i.CameraInputTypes.FreeCameraVirtualJoystickInput=s},"./Cameras/Inputs/index.ts":
- /*!*********************************!*\
- !*** ./Cameras/Inputs/index.ts ***!
- \*********************************/
- /*! exports provided: ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FollowCameraKeyboardMoveInput, FollowCameraMouseWheelInput, FollowCameraPointersInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./arcRotateCameraGamepadInput */"./Cameras/Inputs/arcRotateCameraGamepadInput.ts");r.d(t,"ArcRotateCameraGamepadInput",(function(){return n.ArcRotateCameraGamepadInput}));var i=r(/*! ./arcRotateCameraKeyboardMoveInput */"./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts");r.d(t,"ArcRotateCameraKeyboardMoveInput",(function(){return i.ArcRotateCameraKeyboardMoveInput}));var o=r(/*! ./arcRotateCameraMouseWheelInput */"./Cameras/Inputs/arcRotateCameraMouseWheelInput.ts");r.d(t,"ArcRotateCameraMouseWheelInput",(function(){return o.ArcRotateCameraMouseWheelInput}));var s=r(/*! ./arcRotateCameraPointersInput */"./Cameras/Inputs/arcRotateCameraPointersInput.ts");r.d(t,"ArcRotateCameraPointersInput",(function(){return s.ArcRotateCameraPointersInput}));var a=r(/*! ./arcRotateCameraVRDeviceOrientationInput */"./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts");r.d(t,"ArcRotateCameraVRDeviceOrientationInput",(function(){return a.ArcRotateCameraVRDeviceOrientationInput}));var l=r(/*! ./flyCameraKeyboardInput */"./Cameras/Inputs/flyCameraKeyboardInput.ts");r.d(t,"FlyCameraKeyboardInput",(function(){return l.FlyCameraKeyboardInput}));var c=r(/*! ./flyCameraMouseInput */"./Cameras/Inputs/flyCameraMouseInput.ts");r.d(t,"FlyCameraMouseInput",(function(){return c.FlyCameraMouseInput}));var u=r(/*! ./followCameraKeyboardMoveInput */"./Cameras/Inputs/followCameraKeyboardMoveInput.ts");r.d(t,"FollowCameraKeyboardMoveInput",(function(){return u.FollowCameraKeyboardMoveInput}));var d=r(/*! ./followCameraMouseWheelInput */"./Cameras/Inputs/followCameraMouseWheelInput.ts");r.d(t,"FollowCameraMouseWheelInput",(function(){return d.FollowCameraMouseWheelInput}));var h=r(/*! ./followCameraPointersInput */"./Cameras/Inputs/followCameraPointersInput.ts");r.d(t,"FollowCameraPointersInput",(function(){return h.FollowCameraPointersInput}));var f=r(/*! ./freeCameraDeviceOrientationInput */"./Cameras/Inputs/freeCameraDeviceOrientationInput.ts");r.d(t,"FreeCameraDeviceOrientationInput",(function(){return f.FreeCameraDeviceOrientationInput}));var p=r(/*! ./freeCameraGamepadInput */"./Cameras/Inputs/freeCameraGamepadInput.ts");r.d(t,"FreeCameraGamepadInput",(function(){return p.FreeCameraGamepadInput}));var m=r(/*! ./freeCameraKeyboardMoveInput */"./Cameras/Inputs/freeCameraKeyboardMoveInput.ts");r.d(t,"FreeCameraKeyboardMoveInput",(function(){return m.FreeCameraKeyboardMoveInput}));var g=r(/*! ./freeCameraMouseInput */"./Cameras/Inputs/freeCameraMouseInput.ts");r.d(t,"FreeCameraMouseInput",(function(){return g.FreeCameraMouseInput}));var _=r(/*! ./freeCameraTouchInput */"./Cameras/Inputs/freeCameraTouchInput.ts");r.d(t,"FreeCameraTouchInput",(function(){return _.FreeCameraTouchInput}));var v=r(/*! ./freeCameraVirtualJoystickInput */"./Cameras/Inputs/freeCameraVirtualJoystickInput.ts");r.d(t,"FreeCameraVirtualJoystickInput",(function(){return v.FreeCameraVirtualJoystickInput}))},"./Cameras/RigModes/index.ts":
- /*!***********************************!*\
- !*** ./Cameras/RigModes/index.ts ***!
- \***********************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t),r(/*! ./stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts"),r(/*! ./stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts"),r(/*! ./vrRigMode */"./Cameras/RigModes/vrRigMode.ts"),r(/*! ./webVRRigMode */"./Cameras/RigModes/webVRRigMode.ts")},"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts":
- /*!*********************************************************!*\
- !*** ./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts ***!
- \*********************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../camera */"./Cameras/camera.ts"),i=r(/*! ../../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),o=r(/*! ../../PostProcesses/anaglyphPostProcess */"./PostProcesses/anaglyphPostProcess.ts");n.Camera._setStereoscopicAnaglyphRigMode=function(e){e._rigCameras[0]._rigPostProcess=new i.PassPostProcess(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new o.AnaglyphPostProcess(e.name+"_anaglyph",1,e._rigCameras)}},"./Cameras/RigModes/stereoscopicRigMode.ts":
- /*!*************************************************!*\
- !*** ./Cameras/RigModes/stereoscopicRigMode.ts ***!
- \*************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../camera */"./Cameras/camera.ts"),i=r(/*! ../../Maths/math.viewport */"./Maths/math.viewport.ts");n.Camera._setStereoscopicRigMode=function(e){var t=e.cameraRigMode===n.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL||e.cameraRigMode===n.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED,r=e.cameraRigMode===n.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;e._rigCameras[r?1:0].viewport=new i.Viewport(0,0,t?.5:1,t?1:.5),e._rigCameras[r?0:1].viewport=new i.Viewport(t?.5:0,t?0:.5,t?.5:1,t?1:.5)}},"./Cameras/RigModes/vrRigMode.ts":
- /*!***************************************!*\
- !*** ./Cameras/RigModes/vrRigMode.ts ***!
- \***************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../camera */"./Cameras/camera.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../PostProcesses/vrDistortionCorrectionPostProcess */"./PostProcesses/vrDistortionCorrectionPostProcess.ts"),s=r(/*! ../../PostProcesses/vrMultiviewToSingleviewPostProcess */"./PostProcesses/vrMultiviewToSingleviewPostProcess.ts"),a=r(/*! ../VR/vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),l=r(/*! ../../Misc/logger */"./Misc/logger.ts"),c=r(/*! ../../Maths/math.viewport */"./Maths/math.viewport.ts");n.Camera._setVRRigMode=function(e,t){var r=t.vrCameraMetrics||a.VRCameraMetrics.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=r,e._rigCameras[0].viewport=new c.Viewport(0,0,.5,1),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[0]._cameraRigParams.vrHMatrix=r.leftHMatrix,e._rigCameras[0]._cameraRigParams.vrPreViewMatrix=r.leftPreViewMatrix,e._rigCameras[0].getProjectionMatrix=e._rigCameras[0]._getVRProjectionMatrix,e._rigCameras[1]._cameraRigParams.vrMetrics=r,e._rigCameras[1].viewport=new c.Viewport(.5,0,.5,1),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[1]._cameraRigParams.vrHMatrix=r.rightHMatrix,e._rigCameras[1]._cameraRigParams.vrPreViewMatrix=r.rightPreViewMatrix,e._rigCameras[1].getProjectionMatrix=e._rigCameras[1]._getVRProjectionMatrix,r.multiviewEnabled&&(e.getScene().getEngine().getCaps().multiview?(e._useMultiviewToSingleView=!0,e._rigPostProcess=new s.VRMultiviewToSingleviewPostProcess("VRMultiviewToSingleview",e,r.postProcessScaleFactor)):(l.Logger.Warn("Multiview is not supported, falling back to standard rendering"),r.multiviewEnabled=!1)),r.compensateDistortion&&(e._rigCameras[0]._rigPostProcess=new o.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left",e._rigCameras[0],!1,r),e._rigCameras[1]._rigPostProcess=new o.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right",e._rigCameras[1],!0,r))}},"./Cameras/RigModes/webVRRigMode.ts":
- /*!******************************************!*\
- !*** ./Cameras/RigModes/webVRRigMode.ts ***!
- \******************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../camera */"./Cameras/camera.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.viewport */"./Maths/math.viewport.ts");n.Camera._setWebVRRigMode=function(e,t){if(t.vrDisplay){var r=t.vrDisplay.getEyeParameters("left"),n=t.vrDisplay.getEyeParameters("right");e._rigCameras[0].viewport=new o.Viewport(0,0,.5,1),e._rigCameras[0].setCameraRigParameter("left",!0),e._rigCameras[0].setCameraRigParameter("specs",t.specs),e._rigCameras[0].setCameraRigParameter("eyeParameters",r),e._rigCameras[0].setCameraRigParameter("frameData",t.frameData),e._rigCameras[0].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[0].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[0].parent=e,e._rigCameras[0]._getViewMatrix=e._getWebVRViewMatrix,e._rigCameras[1].viewport=new o.Viewport(.5,0,.5,1),e._rigCameras[1].setCameraRigParameter("eyeParameters",n),e._rigCameras[1].setCameraRigParameter("specs",t.specs),e._rigCameras[1].setCameraRigParameter("frameData",t.frameData),e._rigCameras[1].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[1].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[1].parent=e,e._rigCameras[1]._getViewMatrix=e._getWebVRViewMatrix}}},"./Cameras/Stereoscopic/anaglyphArcRotateCamera.ts":
- /*!*********************************************************!*\
- !*** ./Cameras/Stereoscopic/anaglyphArcRotateCamera.ts ***!
- \*********************************************************/
- /*! exports provided: AnaglyphArcRotateCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphArcRotateCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts"),a.Node.AddNodeConstructor("AnaglyphArcRotateCamera",(function(e,t,r){return function(){return new l(e,0,0,1,s.Vector3.Zero(),r.interaxial_distance,t)}}));var l=function(e){function t(t,r,n,o,s,a,l){var c=e.call(this,t,r,n,o,s,l)||this;return c.interaxialDistance=a,c.setCameraRigMode(i.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:a}),c}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphArcRotateCamera"},t}(o.ArcRotateCamera)},"./Cameras/Stereoscopic/anaglyphFreeCamera.ts":
- /*!****************************************************!*\
- !*** ./Cameras/Stereoscopic/anaglyphFreeCamera.ts ***!
- \****************************************************/
- /*! exports provided: AnaglyphFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphFreeCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/freeCamera */"./Cameras/freeCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts"),a.Node.AddNodeConstructor("AnaglyphFreeCamera",(function(e,t,r){return function(){return new l(e,s.Vector3.Zero(),r.interaxial_distance,t)}}));var l=function(e){function t(t,r,n,o){var s=e.call(this,t,r,o)||this;return s.interaxialDistance=n,s.setCameraRigMode(i.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:n}),s}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphFreeCamera"},t}(o.FreeCamera)},"./Cameras/Stereoscopic/anaglyphGamepadCamera.ts":
- /*!*******************************************************!*\
- !*** ./Cameras/Stereoscopic/anaglyphGamepadCamera.ts ***!
- \*******************************************************/
- /*! exports provided: AnaglyphGamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphGamepadCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/gamepadCamera */"./Cameras/gamepadCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts"),a.Node.AddNodeConstructor("AnaglyphGamepadCamera",(function(e,t,r){return function(){return new l(e,s.Vector3.Zero(),r.interaxial_distance,t)}}));var l=function(e){function t(t,r,n,o){var s=e.call(this,t,r,o)||this;return s.interaxialDistance=n,s.setCameraRigMode(i.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:n}),s}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphGamepadCamera"},t}(o.GamepadCamera)},"./Cameras/Stereoscopic/anaglyphUniversalCamera.ts":
- /*!*********************************************************!*\
- !*** ./Cameras/Stereoscopic/anaglyphUniversalCamera.ts ***!
- \*********************************************************/
- /*! exports provided: AnaglyphUniversalCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphUniversalCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/universalCamera */"./Cameras/universalCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts"),a.Node.AddNodeConstructor("AnaglyphUniversalCamera",(function(e,t,r){return function(){return new l(e,s.Vector3.Zero(),r.interaxial_distance,t)}}));var l=function(e){function t(t,r,n,o){var s=e.call(this,t,r,o)||this;return s.interaxialDistance=n,s.setCameraRigMode(i.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:n}),s}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphUniversalCamera"},t}(o.UniversalCamera)},"./Cameras/Stereoscopic/index.ts":
- /*!***************************************!*\
- !*** ./Cameras/Stereoscopic/index.ts ***!
- \***************************************/
- /*! exports provided: AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./anaglyphArcRotateCamera */"./Cameras/Stereoscopic/anaglyphArcRotateCamera.ts");r.d(t,"AnaglyphArcRotateCamera",(function(){return n.AnaglyphArcRotateCamera}));var i=r(/*! ./anaglyphFreeCamera */"./Cameras/Stereoscopic/anaglyphFreeCamera.ts");r.d(t,"AnaglyphFreeCamera",(function(){return i.AnaglyphFreeCamera}));var o=r(/*! ./anaglyphGamepadCamera */"./Cameras/Stereoscopic/anaglyphGamepadCamera.ts");r.d(t,"AnaglyphGamepadCamera",(function(){return o.AnaglyphGamepadCamera}));var s=r(/*! ./anaglyphUniversalCamera */"./Cameras/Stereoscopic/anaglyphUniversalCamera.ts");r.d(t,"AnaglyphUniversalCamera",(function(){return s.AnaglyphUniversalCamera}));var a=r(/*! ./stereoscopicArcRotateCamera */"./Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts");r.d(t,"StereoscopicArcRotateCamera",(function(){return a.StereoscopicArcRotateCamera}));var l=r(/*! ./stereoscopicFreeCamera */"./Cameras/Stereoscopic/stereoscopicFreeCamera.ts");r.d(t,"StereoscopicFreeCamera",(function(){return l.StereoscopicFreeCamera}));var c=r(/*! ./stereoscopicGamepadCamera */"./Cameras/Stereoscopic/stereoscopicGamepadCamera.ts");r.d(t,"StereoscopicGamepadCamera",(function(){return c.StereoscopicGamepadCamera}));var u=r(/*! ./stereoscopicUniversalCamera */"./Cameras/Stereoscopic/stereoscopicUniversalCamera.ts");r.d(t,"StereoscopicUniversalCamera",(function(){return u.StereoscopicUniversalCamera}))},"./Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts":
- /*!*************************************************************!*\
- !*** ./Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts ***!
- \*************************************************************/
- /*! exports provided: StereoscopicArcRotateCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicArcRotateCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts"),a.Node.AddNodeConstructor("StereoscopicArcRotateCamera",(function(e,t,r){return function(){return new l(e,0,0,1,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}}));var l=function(e){function t(t,r,n,o,s,a,l,c){var u=e.call(this,t,r,n,o,s,c)||this;return u.interaxialDistance=a,u.isStereoscopicSideBySide=l,u.setCameraRigMode(l?i.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:i.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:a}),u}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicArcRotateCamera"},t}(o.ArcRotateCamera)},"./Cameras/Stereoscopic/stereoscopicFreeCamera.ts":
- /*!********************************************************!*\
- !*** ./Cameras/Stereoscopic/stereoscopicFreeCamera.ts ***!
- \********************************************************/
- /*! exports provided: StereoscopicFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicFreeCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/freeCamera */"./Cameras/freeCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts"),a.Node.AddNodeConstructor("StereoscopicFreeCamera",(function(e,t,r){return function(){return new l(e,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}}));var l=function(e){function t(t,r,n,o,s){var a=e.call(this,t,r,s)||this;return a.interaxialDistance=n,a.isStereoscopicSideBySide=o,a.setCameraRigMode(o?i.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:i.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:n}),a}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicFreeCamera"},t}(o.FreeCamera)},"./Cameras/Stereoscopic/stereoscopicGamepadCamera.ts":
- /*!***********************************************************!*\
- !*** ./Cameras/Stereoscopic/stereoscopicGamepadCamera.ts ***!
- \***********************************************************/
- /*! exports provided: StereoscopicGamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicGamepadCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/gamepadCamera */"./Cameras/gamepadCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts"),a.Node.AddNodeConstructor("StereoscopicGamepadCamera",(function(e,t,r){return function(){return new l(e,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}}));var l=function(e){function t(t,r,n,o,s){var a=e.call(this,t,r,s)||this;return a.interaxialDistance=n,a.isStereoscopicSideBySide=o,a.setCameraRigMode(o?i.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:i.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:n}),a}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicGamepadCamera"},t}(o.GamepadCamera)},"./Cameras/Stereoscopic/stereoscopicUniversalCamera.ts":
- /*!*************************************************************!*\
- !*** ./Cameras/Stereoscopic/stereoscopicUniversalCamera.ts ***!
- \*************************************************************/
- /*! exports provided: StereoscopicUniversalCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicUniversalCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/universalCamera */"./Cameras/universalCamera.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts"),a.Node.AddNodeConstructor("StereoscopicFreeCamera",(function(e,t,r){return function(){return new l(e,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}}));var l=function(e){function t(t,r,n,o,s){var a=e.call(this,t,r,s)||this;return a.interaxialDistance=n,a.isStereoscopicSideBySide=o,a.setCameraRigMode(o?i.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:i.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:n}),a}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicUniversalCamera"},t}(o.UniversalCamera)},"./Cameras/VR/index.ts":
- /*!*****************************!*\
- !*** ./Cameras/VR/index.ts ***!
- \*****************************/
- /*! exports provided: VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, OnAfterEnteringVRObservableEvent, VRExperienceHelper, WebVRFreeCamera */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts");r.d(t,"VRCameraMetrics",(function(){return n.VRCameraMetrics}));var i=r(/*! ./vrDeviceOrientationArcRotateCamera */"./Cameras/VR/vrDeviceOrientationArcRotateCamera.ts");r.d(t,"VRDeviceOrientationArcRotateCamera",(function(){return i.VRDeviceOrientationArcRotateCamera}));var o=r(/*! ./vrDeviceOrientationFreeCamera */"./Cameras/VR/vrDeviceOrientationFreeCamera.ts");r.d(t,"VRDeviceOrientationFreeCamera",(function(){return o.VRDeviceOrientationFreeCamera}));var s=r(/*! ./vrDeviceOrientationGamepadCamera */"./Cameras/VR/vrDeviceOrientationGamepadCamera.ts");r.d(t,"VRDeviceOrientationGamepadCamera",(function(){return s.VRDeviceOrientationGamepadCamera}));var a=r(/*! ./vrExperienceHelper */"./Cameras/VR/vrExperienceHelper.ts");r.d(t,"OnAfterEnteringVRObservableEvent",(function(){return a.OnAfterEnteringVRObservableEvent})),r.d(t,"VRExperienceHelper",(function(){return a.VRExperienceHelper}));var l=r(/*! ./webVRCamera */"./Cameras/VR/webVRCamera.ts");r.d(t,"WebVRFreeCamera",(function(){return l.WebVRFreeCamera}))},"./Cameras/VR/vrCameraMetrics.ts":
- /*!***************************************!*\
- !*** ./Cameras/VR/vrCameraMetrics.ts ***!
- \***************************************/
- /*! exports provided: VRCameraMetrics */function(e,t,r){"use strict";r.r(t),r.d(t,"VRCameraMetrics",(function(){return i}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=function(){function e(){this.compensateDistortion=!0,this.multiviewEnabled=!1}return Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return this.hResolution/(2*this.vResolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatioFov",{get:function(){return 2*Math.atan(this.postProcessScaleFactor*this.vScreenSize/(2*this.eyeToScreenDistance))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftHMatrix",{get:function(){var e=4*(this.hScreenSize/4-this.lensSeparationDistance/2)/this.hScreenSize;return n.Matrix.Translation(e,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightHMatrix",{get:function(){var e=4*(this.hScreenSize/4-this.lensSeparationDistance/2)/this.hScreenSize;return n.Matrix.Translation(-e,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftPreViewMatrix",{get:function(){return n.Matrix.Translation(.5*this.interpupillaryDistance,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightPreViewMatrix",{get:function(){return n.Matrix.Translation(-.5*this.interpupillaryDistance,0,0)},enumerable:!1,configurable:!0}),e.GetDefault=function(){var t=new e;return t.hResolution=1280,t.vResolution=800,t.hScreenSize=.149759993,t.vScreenSize=.0935999975,t.vScreenCenter=.0467999987,t.eyeToScreenDistance=.0410000011,t.lensSeparationDistance=.063500002,t.interpupillaryDistance=.064000003,t.distortionK=[1,.219999999,.239999995,0],t.chromaAbCorrection=[.995999992,-.00400000019,1.01400006,0],t.postProcessScaleFactor=1.714605507808412,t.lensCenterOffset=.151976421,t},e}()},"./Cameras/VR/vrDeviceOrientationArcRotateCamera.ts":
- /*!**********************************************************!*\
- !*** ./Cameras/VR/vrDeviceOrientationArcRotateCamera.ts ***!
- \**********************************************************/
- /*! exports provided: VRDeviceOrientationArcRotateCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDeviceOrientationArcRotateCamera",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),s=r(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../node */"./node.ts");r(/*! ../Inputs/arcRotateCameraVRDeviceOrientationInput */"./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts"),r(/*! ../RigModes/vrRigMode */"./Cameras/RigModes/vrRigMode.ts"),l.Node.AddNodeConstructor("VRDeviceOrientationFreeCamera",(function(e,t){return function(){return new c(e,0,0,1,a.Vector3.Zero(),t)}}));var c=function(e){function t(t,r,n,o,a,l,c,u){void 0===c&&(c=!0),void 0===u&&(u=s.VRCameraMetrics.GetDefault());var d=e.call(this,t,r,n,o,a,l)||this;return u.compensateDistortion=c,d.setCameraRigMode(i.Camera.RIG_MODE_VR,{vrCameraMetrics:u}),d.inputs.addVRDeviceOrientation(),d}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationArcRotateCamera"},t}(o.ArcRotateCamera)},"./Cameras/VR/vrDeviceOrientationFreeCamera.ts":
- /*!*****************************************************!*\
- !*** ./Cameras/VR/vrDeviceOrientationFreeCamera.ts ***!
- \*****************************************************/
- /*! exports provided: VRDeviceOrientationFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDeviceOrientationFreeCamera",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Cameras/deviceOrientationCamera */"./Cameras/deviceOrientationCamera.ts"),s=r(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/vrRigMode */"./Cameras/RigModes/vrRigMode.ts"),l.Node.AddNodeConstructor("VRDeviceOrientationFreeCamera",(function(e,t){return function(){return new c(e,a.Vector3.Zero(),t)}}));var c=function(e){function t(t,r,n,o,a){void 0===o&&(o=!0),void 0===a&&(a=s.VRCameraMetrics.GetDefault());var l=e.call(this,t,r,n)||this;return a.compensateDistortion=o,l.setCameraRigMode(i.Camera.RIG_MODE_VR,{vrCameraMetrics:a}),l}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationFreeCamera"},t}(o.DeviceOrientationCamera)},"./Cameras/VR/vrDeviceOrientationGamepadCamera.ts":
- /*!********************************************************!*\
- !*** ./Cameras/VR/vrDeviceOrientationGamepadCamera.ts ***!
- \********************************************************/
- /*! exports provided: VRDeviceOrientationGamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDeviceOrientationGamepadCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./vrDeviceOrientationFreeCamera */"./Cameras/VR/vrDeviceOrientationFreeCamera.ts"),o=r(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../../Gamepads/gamepadSceneComponent */"./Gamepads/gamepadSceneComponent.ts"),a.Node.AddNodeConstructor("VRDeviceOrientationGamepadCamera",(function(e,t){return function(){return new l(e,s.Vector3.Zero(),t)}}));var l=function(e){function t(t,r,n,i,s){void 0===i&&(i=!0),void 0===s&&(s=o.VRCameraMetrics.GetDefault());var a=e.call(this,t,r,n,i,s)||this;return a.inputs.addGamepad(),a}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationGamepadCamera"},t}(i.VRDeviceOrientationFreeCamera)},"./Cameras/VR/vrExperienceHelper.ts":
- /*!******************************************!*\
- !*** ./Cameras/VR/vrExperienceHelper.ts ***!
- \******************************************/
- /*! exports provided: OnAfterEnteringVRObservableEvent, VRExperienceHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"OnAfterEnteringVRObservableEvent",(function(){return B})),r.d(t,"VRExperienceHelper",(function(){return N}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Cameras/freeCamera */"./Cameras/freeCamera.ts"),a=r(/*! ../../Cameras/targetCamera */"./Cameras/targetCamera.ts"),l=r(/*! ../../Cameras/deviceOrientationCamera */"./Cameras/deviceOrientationCamera.ts"),c=r(/*! ../../Cameras/VR/vrDeviceOrientationFreeCamera */"./Cameras/VR/vrDeviceOrientationFreeCamera.ts"),u=r(/*! ../../Cameras/VR/webVRCamera */"./Cameras/VR/webVRCamera.ts"),d=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),h=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),f=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),p=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),m=r(/*! ../../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),g=r(/*! ../../Gamepads/Controllers/webVRController */"./Gamepads/Controllers/webVRController.ts"),_=r(/*! ../../Gamepads/xboxGamepad */"./Gamepads/xboxGamepad.ts"),v=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),y=r(/*! ../../Culling/ray */"./Culling/ray.ts"),b=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),A=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),T=r(/*! ../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),M=r(/*! ../../PostProcesses/imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts"),P=r(/*! ../../Animations/easing */"./Animations/easing.ts"),S=r(/*! ../../Animations/animation */"./Animations/animation.ts"),E=r(/*! ../../Cameras/VR/vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),C=(r(/*! ../../Meshes/Builders/groundBuilder */"./Meshes/Builders/groundBuilder.ts"),r(/*! ../../Meshes/Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),r(/*! ../../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),r(/*! ../../Gamepads/gamepadSceneComponent */"./Gamepads/gamepadSceneComponent.ts"),r(/*! ../../Animations/animatable */"./Animations/animatable.ts"),r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts")),x=r(/*! ../../XR/webXRSessionManager */"./XR/webXRSessionManager.ts"),R=r(/*! ../../XR/webXRTypes */"./XR/webXRTypes.ts"),O=function(){function e(t,r){if(void 0===r&&(r=null),this.scene=t,this._pointerDownOnMeshAsked=!1,this._isActionableMesh=!1,this._teleportationRequestInitiated=!1,this._teleportationBackRequestInitiated=!1,this._rotationRightAsked=!1,this._rotationLeftAsked=!1,this._dpadPressed=!0,this._activePointer=!1,this._id=e._idCounter++,r)this._gazeTracker=r.clone("gazeTracker");else{this._gazeTracker=v.Mesh.CreateTorus("gazeTracker",.0035,.0025,20,t,!1),this._gazeTracker.bakeCurrentTransformIntoVertices(),this._gazeTracker.isPickable=!1,this._gazeTracker.isVisible=!1;var n=new A.StandardMaterial("targetMat",t);n.specularColor=f.Color3.Black(),n.emissiveColor=new f.Color3(.7,.7,.7),n.backFaceCulling=!1,this._gazeTracker.material=n}}return e.prototype._getForwardRay=function(e){return new y.Ray(h.Vector3.Zero(),new h.Vector3(0,0,e))},e.prototype._selectionPointerDown=function(){this._pointerDownOnMeshAsked=!0,this._currentHit&&this.scene.simulatePointerDown(this._currentHit,{pointerId:this._id})},e.prototype._selectionPointerUp=function(){this._currentHit&&this.scene.simulatePointerUp(this._currentHit,{pointerId:this._id}),this._pointerDownOnMeshAsked=!1},e.prototype._activatePointer=function(){this._activePointer=!0},e.prototype._deactivatePointer=function(){this._activePointer=!1},e.prototype._updatePointerDistance=function(e){void 0===e&&(e=100)},e.prototype.dispose=function(){this._interactionsEnabled=!1,this._teleportationEnabled=!1,this._gazeTracker&&this._gazeTracker.dispose()},e._idCounter=0,e}(),I=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;i.webVRController=t,i._laserPointer=v.Mesh.CreateCylinder("laserPointer",1,.004,2e-4,20,1,r,!1);var o=new A.StandardMaterial("laserPointerMat",r);if(o.emissiveColor=new f.Color3(.7,.7,.7),o.alpha=.6,i._laserPointer.material=o,i._laserPointer.rotation.x=Math.PI/2,i._laserPointer.position.z=-.5,i._laserPointer.isVisible=!1,i._laserPointer.isPickable=!1,!t.mesh){var s=new v.Mesh("preloadControllerMesh",r),a=new v.Mesh(m.PoseEnabledController.POINTING_POSE,r);a.rotation.x=-.7,s.addChild(a),t.attachToMesh(s)}return i._setLaserPointerParent(t.mesh),i._meshAttachedObserver=t._meshAttachedObservable.add((function(e){i._setLaserPointerParent(e)})),i}return Object(n.__extends)(t,e),t.prototype._getForwardRay=function(e){return this.webVRController.getForwardRay(e)},t.prototype._activatePointer=function(){e.prototype._activatePointer.call(this),this._laserPointer.isVisible=!0},t.prototype._deactivatePointer=function(){e.prototype._deactivatePointer.call(this),this._laserPointer.isVisible=!1},t.prototype._setLaserPointerColor=function(e){this._laserPointer.material.emissiveColor=e},t.prototype._setLaserPointerLightingDisabled=function(e){this._laserPointer.material.disableLighting=e},t.prototype._setLaserPointerParent=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach((function(e){t(e)}))};t(e);var r=e.getChildren(void 0,!1),n=e;this.webVRController._pointingPoseNode=null;for(var i=0;i<r.length;i++)if(r[i].name&&r[i].name.indexOf(m.PoseEnabledController.POINTING_POSE)>=0){n=r[i],this.webVRController._pointingPoseNode=n;break}this._laserPointer.parent=n},t.prototype._updatePointerDistance=function(e){void 0===e&&(e=100),this._laserPointer.scaling.y=e,this._laserPointer.position.z=-e/2},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._laserPointer.dispose(),this._meshAttachedObserver&&this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver)},t}(O),D=function(e){function t(t,r){var n=e.call(this,r)||this;return n.getCamera=t,n}return Object(n.__extends)(t,e),t.prototype._getForwardRay=function(e){var t=this.getCamera();return t?t.getForwardRay(e):new y.Ray(h.Vector3.Zero(),h.Vector3.Forward())},t}(O),B=function(){},N=function(){function e(t,r){var n=this;if(void 0===r&&(r={}),this.webVROptions=r,this._webVRsupported=!1,this._webVRready=!1,this._webVRrequesting=!1,this._webVRpresenting=!1,this._fullscreenVRpresenting=!1,this.enableGazeEvenWhenNoPointerLock=!1,this.exitVROnDoubleTap=!0,this.onEnteringVRObservable=new o.Observable,this.onAfterEnteringVRObservable=new o.Observable,this.onExitingVRObservable=new o.Observable,this.onControllerMeshLoadedObservable=new o.Observable,this._useCustomVRButton=!1,this._teleportationRequested=!1,this._teleportActive=!1,this._floorMeshesCollection=[],this._teleportationMode=e.TELEPORTATIONMODE_CONSTANTTIME,this._teleportationTime=122,this._teleportationSpeed=20,this._rotationAllowed=!0,this._teleportBackwardsVector=new h.Vector3(0,-1,-1),this._isDefaultTeleportationTarget=!0,this._teleportationFillColor="#444444",this._teleportationBorderColor="#FFFFFF",this._rotationAngle=0,this._haloCenter=new h.Vector3(0,0,0),this._padSensibilityUp=.65,this._padSensibilityDown=.35,this._leftController=null,this._rightController=null,this._gazeColor=new f.Color3(.7,.7,.7),this._laserColor=new f.Color3(.7,.7,.7),this._pickedLaserColor=new f.Color3(.2,.2,1),this._pickedGazeColor=new f.Color3(0,0,1),this.onNewMeshSelected=new o.Observable,this.onMeshSelectedWithController=new o.Observable,this.onNewMeshPicked=new o.Observable,this.onBeforeCameraTeleport=new o.Observable,this.onAfterCameraTeleport=new o.Observable,this.onSelectedMeshUnselected=new o.Observable,this.teleportationEnabled=!0,this._teleportationInitialized=!1,this._interactionsEnabled=!1,this._interactionsRequested=!1,this._displayGaze=!0,this._displayLaserPointer=!0,this.updateGazeTrackerScale=!0,this.updateGazeTrackerColor=!0,this.updateControllerLaserColor=!0,this.requestPointerLockOnFullScreen=!0,this.xrTestDone=!1,this._onResize=function(){n.moveButtonToBottomRight(),n._fullscreenVRpresenting&&n._webVRready&&n.exitVR()},this._onFullscreenChange=function(){var e=document;void 0!==e.fullscreen?n._fullscreenVRpresenting=document.fullscreen:void 0!==e.mozFullScreen?n._fullscreenVRpresenting=e.mozFullScreen:void 0!==e.webkitIsFullScreen?n._fullscreenVRpresenting=e.webkitIsFullScreen:void 0!==e.msIsFullScreen?n._fullscreenVRpresenting=e.msIsFullScreen:void 0!==document.msFullscreenElement&&(n._fullscreenVRpresenting=document.msFullscreenElement),!n._fullscreenVRpresenting&&n._inputElement&&(n.exitVR(),!n._useCustomVRButton&&n._btnVR&&(n._btnVR.style.top=n._inputElement.offsetTop+n._inputElement.offsetHeight-70+"px",n._btnVR.style.left=n._inputElement.offsetLeft+n._inputElement.offsetWidth-100+"px",n.updateButtonVisibility()))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this.beforeRender=function(){n._leftController&&n._leftController._activePointer&&n._castRayAndSelectObject(n._leftController),n._rightController&&n._rightController._activePointer&&n._castRayAndSelectObject(n._rightController),n._noControllerIsActive&&(n._scene.getEngine().isPointerLock||n.enableGazeEvenWhenNoPointerLock)?n._castRayAndSelectObject(n._cameraGazer):n._cameraGazer._gazeTracker.isVisible=!1},this._onNewGamepadConnected=function(e){if(e.type!==p.Gamepad.POSE_ENABLED)e.leftStick&&e.onleftstickchanged((function(e){n._teleportationInitialized&&n.teleportationEnabled&&(!n._leftController&&!n._rightController||n._leftController&&!n._leftController._activePointer&&n._rightController&&!n._rightController._activePointer)&&(n._checkTeleportWithRay(e,n._cameraGazer),n._checkTeleportBackwards(e,n._cameraGazer))})),e.rightStick&&e.onrightstickchanged((function(e){n._teleportationInitialized&&n._checkRotate(e,n._cameraGazer)})),e.type===p.Gamepad.XBOX&&(e.onbuttondown((function(e){n._interactionsEnabled&&e===_.Xbox360Button.A&&n._cameraGazer._selectionPointerDown()})),e.onbuttonup((function(e){n._interactionsEnabled&&e===_.Xbox360Button.A&&n._cameraGazer._selectionPointerUp()})));else{var t=e,r=new I(t,n._scene,n._cameraGazer._gazeTracker);"right"===t.hand||n._leftController&&n._leftController.webVRController!=t?n._rightController=r:n._leftController=r,n._tryEnableInteractionOnController(r)}},this._tryEnableInteractionOnController=function(e){n._interactionsRequested&&!e._interactionsEnabled&&n._enableInteractionOnController(e),n._teleportationRequested&&!e._teleportationEnabled&&n._enableTeleportationOnController(e)},this._onNewGamepadDisconnected=function(e){e instanceof g.WebVRController&&("left"===e.hand&&null!=n._leftController&&(n._leftController.dispose(),n._leftController=null),"right"===e.hand&&null!=n._rightController&&(n._rightController.dispose(),n._rightController=null))},this._workingVector=h.Vector3.Zero(),this._workingQuaternion=h.Quaternion.Identity(),this._workingMatrix=h.Matrix.Identity(),this._scene=t,this._inputElement=t.getEngine().getInputElement(),"getVRDisplays"in navigator||(r.useXR=!0),void 0===r.createFallbackVRDeviceOrientationFreeCamera&&(r.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===r.createDeviceOrientationCamera&&(r.createDeviceOrientationCamera=!0),void 0===r.laserToggle&&(r.laserToggle=!0),void 0===r.defaultHeight&&(r.defaultHeight=1.7),r.useCustomVRButton&&(this._useCustomVRButton=!0,r.customVRButton&&(this._btnVR=r.customVRButton)),r.rayLength&&(this._rayLength=r.rayLength),this._defaultHeight=r.defaultHeight,r.positionScale&&(this._rayLength*=r.positionScale,this._defaultHeight*=r.positionScale),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new h.Vector3(0,this._defaultHeight,0),r.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new l.DeviceOrientationCamera("deviceOrientationVRHelper",this._position.clone(),t),this._scene.activeCamera&&(this._deviceOrientationCamera.minZ=this._scene.activeCamera.minZ,this._deviceOrientationCamera.maxZ=this._scene.activeCamera.maxZ,this._scene.activeCamera instanceof a.TargetCamera&&this._scene.activeCamera.rotation)){var s=this._scene.activeCamera;s.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(s.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(h.Quaternion.RotationYawPitchRoll(s.rotation.y,s.rotation.x,s.rotation.z)),this._deviceOrientationCamera.rotation=s.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._inputElement&&this._scene.activeCamera.attachControl(this._inputElement)}else this._existingCamera=this._scene.activeCamera;this.webVROptions.useXR&&navigator.xr?x.WebXRSessionManager.IsSessionSupportedAsync("immersive-vr").then((function(e){e?(i.Logger.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly"),t.createDefaultXRExperienceAsync({floorMeshes:r.floorMeshes||[]}).then((function(e){n.xr=e,n.xrTestDone=!0,n._cameraGazer=new D((function(){return n.xr.baseExperience.camera}),t),n.xr.baseExperience.onStateChangedObservable.add((function(e){switch(e){case R.WebXRState.ENTERING_XR:n.onEnteringVRObservable.notifyObservers(n),n._interactionsEnabled||n.xr.pointerSelection.detach(),n.xr.pointerSelection.displayLaserPointer=n._displayLaserPointer;break;case R.WebXRState.EXITING_XR:n.onExitingVRObservable.notifyObservers(n),n._scene.getEngine().resize();break;case R.WebXRState.IN_XR:n._hasEnteredVR=!0;break;case R.WebXRState.NOT_IN_XR:n._hasEnteredVR=!1}}))}))):n.completeVRInit(t,r)})):this.completeVRInit(t,r)}return Object.defineProperty(e.prototype,"onEnteringVR",{get:function(){return this.onEnteringVRObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVR",{get:function(){return this.onExitingVRObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onControllerMeshLoaded",{get:function(){return this.onControllerMeshLoadedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"teleportationTarget",{get:function(){return this._teleportationTarget},set:function(e){e&&(e.name="teleportationTarget",this._isDefaultTeleportationTarget=!1,this._teleportationTarget=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gazeTrackerMesh",{get:function(){return this._cameraGazer._gazeTracker},set:function(e){e&&(this._cameraGazer._gazeTracker&&this._cameraGazer._gazeTracker.dispose(),this._leftController&&this._leftController._gazeTracker&&this._leftController._gazeTracker.dispose(),this._rightController&&this._rightController._gazeTracker&&this._rightController._gazeTracker.dispose(),this._cameraGazer._gazeTracker=e,this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(),this._cameraGazer._gazeTracker.isPickable=!1,this._cameraGazer._gazeTracker.isVisible=!1,this._cameraGazer._gazeTracker.name="gazeTracker",this._leftController&&(this._leftController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")),this._rightController&&(this._rightController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftControllerGazeTrackerMesh",{get:function(){return this._leftController?this._leftController._gazeTracker:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightControllerGazeTrackerMesh",{get:function(){return this._rightController?this._rightController._gazeTracker:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayGaze",{get:function(){return this._displayGaze},set:function(e){this._displayGaze=e,e||(this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayLaserPointer",{get:function(){return this._displayLaserPointer},set:function(e){this._displayLaserPointer=e,e?(this._rightController&&this._rightController._activatePointer(),this._leftController&&this._leftController._activatePointer()):(this._rightController&&(this._rightController._deactivatePointer(),this._rightController._gazeTracker.isVisible=!1),this._leftController&&(this._leftController._deactivatePointer(),this._leftController._gazeTracker.isVisible=!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceOrientationCamera",{get:function(){return this._deviceOrientationCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentVRCamera",{get:function(){return this._webVRready?this._webVRCamera:this._scene.activeCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"webVRCamera",{get:function(){return this._webVRCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vrDeviceOrientationCamera",{get:function(){return this._vrDeviceOrientationCamera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vrButton",{get:function(){return this._btnVR},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_teleportationRequestInitiated",{get:function(){return this._cameraGazer._teleportationRequestInitiated||null!==this._leftController&&this._leftController._teleportationRequestInitiated||null!==this._rightController&&this._rightController._teleportationRequestInitiated},enumerable:!1,configurable:!0}),e.prototype.completeVRInit=function(e,t){var r=this;if(this.xrTestDone=!0,t.createFallbackVRDeviceOrientationFreeCamera&&(t.useMultiview&&(t.vrDeviceOrientationCameraMetrics||(t.vrDeviceOrientationCameraMetrics=E.VRCameraMetrics.GetDefault()),t.vrDeviceOrientationCameraMetrics.multiviewEnabled=!0),this._vrDeviceOrientationCamera=new c.VRDeviceOrientationFreeCamera("VRDeviceOrientationVRHelper",this._position,this._scene,!0,t.vrDeviceOrientationCameraMetrics),this._vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._webVRCamera=new u.WebVRFreeCamera("WebVRHelper",this._position,this._scene,t),this._webVRCamera.useStandingMatrix(),this._cameraGazer=new D((function(){return r.currentVRCamera}),e),!this._useCustomVRButton){this._btnVR=document.createElement("BUTTON"),this._btnVR.className="babylonVRicon",this._btnVR.id="babylonVRiconbtn",this._btnVR.title="Click to switch to VR";var n=".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A":"https://cdn.babylonjs.com/Assets/vrButton.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";n+=".babylonVRicon.vrdisplaypresenting { display: none; }";var i=document.createElement("style");i.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(i),this.moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",(function(){r.isInVRMode?r._scene.getEngine().disableVR():r.enterVR()}));var o=this._scene.getEngine().getHostWindow();o&&(o.addEventListener("resize",this._onResize),document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",this._onFullscreenChange,!1),document.onmsfullscreenchange=this._onFullscreenChange,t.createFallbackVRDeviceOrientationFreeCamera?this.displayVRButton():this._scene.getEngine().onVRDisplayChangedObservable.add((function(e){e.vrDisplay&&r.displayVRButton()})),this._onKeyDown=function(e){27===e.keyCode&&r.isInVRMode&&r.exitVR()},document.addEventListener("keydown",this._onKeyDown),this._scene.onPrePointerObservable.add((function(){r._hasEnteredVR&&r.exitVROnDoubleTap&&(r.exitVR(),r._fullscreenVRpresenting&&r._scene.getEngine().exitFullscreen())}),d.PointerEventTypes.POINTERDOUBLETAP,!1),this._onVRDisplayChanged=function(e){return r.onVRDisplayChanged(e)},this._onVrDisplayPresentChange=function(){return r.onVrDisplayPresentChange()},this._onVRRequestPresentStart=function(){r._webVRrequesting=!0,r.updateButtonVisibility()},this._onVRRequestPresentComplete=function(){r._webVRrequesting=!1,r.updateButtonVisibility()},e.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged),e.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart),e.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete),o.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),e.onDisposeObservable.add((function(){r.dispose()})),this._webVRCamera.onControllerMeshLoadedObservable.add((function(e){return r._onDefaultMeshLoaded(e)})),this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected),this.updateButtonVisibility(),this._circleEase=new P.CircleEase,this._circleEase.setEasingMode(P.EasingFunction.EASINGMODE_EASEINOUT),this._teleportationEasing=this._circleEase,e.onPointerObservable.add((function(t){r._interactionsEnabled&&e.activeCamera===r.vrDeviceOrientationCamera&&"mouse"===t.event.pointerType&&(t.type===d.PointerEventTypes.POINTERDOWN?r._cameraGazer._selectionPointerDown():t.type===d.PointerEventTypes.POINTERUP&&r._cameraGazer._selectionPointerUp())})),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes}))},e.prototype._onDefaultMeshLoaded=function(e){this._leftController&&this._leftController.webVRController==e&&e.mesh&&this._leftController._setLaserPointerParent(e.mesh),this._rightController&&this._rightController.webVRController==e&&e.mesh&&this._rightController._setLaserPointerParent(e.mesh);try{this.onControllerMeshLoadedObservable.notifyObservers(e)}catch(e){i.Logger.Warn("Error in your custom logic onControllerMeshLoaded: "+e)}},Object.defineProperty(e.prototype,"isInVRMode",{get:function(){return this.xr&&this.webVROptions.useXR&&this.xr.baseExperience.state===R.WebXRState.IN_XR||this._webVRpresenting||this._fullscreenVRpresenting},enumerable:!1,configurable:!0}),e.prototype.onVrDisplayPresentChange=function(){var e=this._scene.getEngine().getVRDevice();if(e){var t=this._webVRpresenting;this._webVRpresenting=e.isPresenting,t&&!this._webVRpresenting&&this.exitVR()}else i.Logger.Warn("Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?");this.updateButtonVisibility()},e.prototype.onVRDisplayChanged=function(e){this._webVRsupported=e.vrSupported,this._webVRready=!!e.vrDisplay,this._webVRpresenting=e.vrDisplay&&e.vrDisplay.isPresenting,this.updateButtonVisibility()},e.prototype.moveButtonToBottomRight=function(){if(this._inputElement&&!this._useCustomVRButton&&this._btnVR){var e=this._inputElement.getBoundingClientRect();this._btnVR.style.top=e.top+e.height-70+"px",this._btnVR.style.left=e.left+e.width-100+"px"}},e.prototype.displayVRButton=function(){this._useCustomVRButton||this._btnVRDisplayed||!this._btnVR||(document.body.appendChild(this._btnVR),this._btnVRDisplayed=!0)},e.prototype.updateButtonVisibility=function(){this._btnVR&&!this._useCustomVRButton&&(this._btnVR.className="babylonVRicon",this.isInVRMode?this._btnVR.className+=" vrdisplaypresenting":(this._webVRready&&(this._btnVR.className+=" vrdisplayready"),this._webVRsupported&&(this._btnVR.className+=" vrdisplaysupported"),this._webVRrequesting&&(this._btnVR.className+=" vrdisplayrequesting")))},e.prototype.enterVR=function(){var e=this;if(this.xr)this.xr.baseExperience.enterXRAsync("immersive-vr","local-floor",this.xr.renderTarget);else{if(this.onEnteringVRObservable)try{this.onEnteringVRObservable.notifyObservers(this)}catch(e){i.Logger.Warn("Error in your custom logic onEnteringVR: "+e)}if(this._scene.activeCamera){if(this._position=this._scene.activeCamera.position.clone(),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.rotation=h.Quaternion.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(),this.vrDeviceOrientationCamera.angularSensibility=2e3),this.webVRCamera){var t=this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y,r=h.Quaternion.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y-t,n=this.webVRCamera.rotationQuaternion.toEulerAngles().y;this.webVRCamera.rotationQuaternion=h.Quaternion.FromEulerAngles(0,n+r,0)}this._existingCamera=this._scene.activeCamera,this._existingCamera.angularSensibilityX&&(this._cachedAngularSensibility.angularSensibilityX=this._existingCamera.angularSensibilityX,this._existingCamera.angularSensibilityX=Number.MAX_VALUE),this._existingCamera.angularSensibilityY&&(this._cachedAngularSensibility.angularSensibilityY=this._existingCamera.angularSensibilityY,this._existingCamera.angularSensibilityY=Number.MAX_VALUE),this._existingCamera.angularSensibility&&(this._cachedAngularSensibility.angularSensibility=this._existingCamera.angularSensibility,this._existingCamera.angularSensibility=Number.MAX_VALUE)}this._webVRrequesting||(this._webVRready?this._webVRpresenting||(this._scene.getEngine().onVRRequestPresentComplete.addOnce((function(t){e.onAfterEnteringVRObservable.notifyObservers({success:t})})),this._webVRCamera.position=this._position,this._scene.activeCamera=this._webVRCamera):this._vrDeviceOrientationCamera&&(this._vrDeviceOrientationCamera.position=this._position,this._scene.activeCamera&&(this._vrDeviceOrientationCamera.minZ=this._scene.activeCamera.minZ),this._scene.activeCamera=this._vrDeviceOrientationCamera,this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen),this.updateButtonVisibility(),this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce((function(){e.onAfterEnteringVRObservable.notifyObservers({success:!0})}))),this._scene.activeCamera&&this._inputElement&&this._scene.activeCamera.attachControl(this._inputElement),this._interactionsEnabled&&this._scene.registerBeforeRender(this.beforeRender),this._displayLaserPointer&&[this._leftController,this._rightController].forEach((function(e){e&&e._activatePointer()})),this._hasEnteredVR=!0)}},e.prototype.exitVR=function(){if(this.xr)this.xr.baseExperience.exitXRAsync();else if(this._hasEnteredVR){if(this.onExitingVRObservable)try{this.onExitingVRObservable.notifyObservers(this)}catch(e){i.Logger.Warn("Error in your custom logic onExitingVR: "+e)}this._webVRpresenting&&this._scene.getEngine().disableVR(),this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone()),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._deviceOrientationCamera?(this._deviceOrientationCamera.position=this._position,this._scene.activeCamera=this._deviceOrientationCamera,this._cachedAngularSensibility.angularSensibilityX&&(this._deviceOrientationCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._deviceOrientationCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._deviceOrientationCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)):this._existingCamera&&(this._existingCamera.position=this._position,this._scene.activeCamera=this._existingCamera,this._inputElement&&this._scene.activeCamera.attachControl(this._inputElement),this._cachedAngularSensibility.angularSensibilityX&&(this._existingCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._existingCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._existingCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)),this.updateButtonVisibility(),this._interactionsEnabled&&(this._scene.unregisterBeforeRender(this.beforeRender),this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1)),this._scene.getEngine().resize(),[this._leftController,this._rightController].forEach((function(e){e&&e._deactivatePointer()})),this._hasEnteredVR=!1;var e=this._scene.getEngine();e._onVrDisplayPresentChange&&e._onVrDisplayPresentChange()}},Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._scene.activeCamera&&(this._scene.activeCamera.position=e)},enumerable:!1,configurable:!0}),e.prototype.enableInteractions=function(){var e=this;if(!this._interactionsEnabled){if(this._interactionsRequested=!0,this.xr)return void(this.xr.baseExperience.state===R.WebXRState.IN_XR&&this.xr.pointerSelection.attach());this._leftController&&this._enableInteractionOnController(this._leftController),this._rightController&&this._enableInteractionOnController(this._rightController),this.raySelectionPredicate=function(t){return t.isVisible&&(t.isPickable||t.name===e._floorMeshName)},this.meshSelectionPredicate=function(){return!0},this._raySelectionPredicate=function(t){return!!(e._isTeleportationFloor(t)||-1===t.name.indexOf("gazeTracker")&&-1===t.name.indexOf("teleportationTarget")&&-1===t.name.indexOf("torusTeleportation"))&&e.raySelectionPredicate(t)},this._interactionsEnabled=!0}},Object.defineProperty(e.prototype,"_noControllerIsActive",{get:function(){return!(this._leftController&&this._leftController._activePointer||this._rightController&&this._rightController._activePointer)},enumerable:!1,configurable:!0}),e.prototype._isTeleportationFloor=function(e){for(var t=0;t<this._floorMeshesCollection.length;t++)if(this._floorMeshesCollection[t].id===e.id)return!0;return!(!this._floorMeshName||e.name!==this._floorMeshName)},e.prototype.addFloorMesh=function(e){this._floorMeshesCollection&&(this._floorMeshesCollection.indexOf(e)>-1||this._floorMeshesCollection.push(e))},e.prototype.removeFloorMesh=function(e){if(this._floorMeshesCollection){var t=this._floorMeshesCollection.indexOf(e);-1!==t&&this._floorMeshesCollection.splice(t,1)}},e.prototype.enableTeleportation=function(e){var t=this;if(void 0===e&&(e={}),!this._teleportationInitialized){if(this._teleportationRequested=!0,this.enableInteractions(),this.webVROptions.useXR&&(e.floorMeshes||e.floorMeshName)){var r=e.floorMeshes||[];if(!r.length){var n=this._scene.getMeshByName(e.floorMeshName);n&&r.push(n)}if(this.xr)return r.forEach((function(e){t.xr.teleportation.addFloorMesh(e)})),void(this.xr.teleportation.attached||this.xr.teleportation.attach());if(!this.xrTestDone){var i=function(){t.xrTestDone&&(t._scene.unregisterBeforeRender(i),t.xr?t.xr.teleportation.attached||t.xr.teleportation.attach():t.enableTeleportation(e))};return void this._scene.registerBeforeRender(i)}}e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),e.teleportationMode&&(this._teleportationMode=e.teleportationMode),e.teleportationTime&&e.teleportationTime>0&&(this._teleportationTime=e.teleportationTime),e.teleportationSpeed&&e.teleportationSpeed>0&&(this._teleportationSpeed=e.teleportationSpeed),void 0!==e.easingFunction&&(this._teleportationEasing=e.easingFunction),null!=this._leftController&&this._enableTeleportationOnController(this._leftController),null!=this._rightController&&this._enableTeleportationOnController(this._rightController);var o=new b.ImageProcessingConfiguration;o.vignetteColor=new f.Color4(0,0,0,0),o.vignetteEnabled=!0,this._postProcessMove=new M.ImageProcessingPostProcess("postProcessMove",1,this._webVRCamera,void 0,void 0,void 0,void 0,o),this._webVRCamera.detachPostProcess(this._postProcessMove),this._teleportationInitialized=!0,this._isDefaultTeleportationTarget&&(this._createTeleportationCircles(),this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor))}},e.prototype._enableInteractionOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled=!0,this.isInVRMode&&this._displayLaserPointer&&e._activatePointer(),this.webVROptions.laserToggle&&e.webVRController.onMainButtonStateChangedObservable.add((function(r){t._displayLaserPointer&&1===r.value&&(e._activePointer?e._deactivatePointer():e._activatePointer(),t.displayGaze&&(e._gazeTracker.isVisible=e._activePointer))})),e.webVRController.onTriggerStateChangedObservable.add((function(r){var n=e;t._noControllerIsActive&&(n=t._cameraGazer),n._pointerDownOnMeshAsked?r.value<t._padSensibilityDown&&n._selectionPointerUp():r.value>t._padSensibilityUp&&n._selectionPointerDown()})))},e.prototype._checkTeleportWithRay=function(e,t){this._teleportationRequestInitiated&&!t._teleportationRequestInitiated||(t._teleportationRequestInitiated?Math.sqrt(e.y*e.y+e.x*e.x)<this._padSensibilityDown&&(this._teleportActive&&this.teleportCamera(this._haloCenter),t._teleportationRequestInitiated=!1):e.y<-this._padSensibilityUp&&t._dpadPressed&&(t._activatePointer(),t._teleportationRequestInitiated=!0))},e.prototype._checkRotate=function(e,t){t._teleportationRequestInitiated||(t._rotationLeftAsked?e.x>-this._padSensibilityDown&&(t._rotationLeftAsked=!1):e.x<-this._padSensibilityUp&&t._dpadPressed&&(t._rotationLeftAsked=!0,this._rotationAllowed&&this._rotateCamera(!1)),t._rotationRightAsked?e.x<this._padSensibilityDown&&(t._rotationRightAsked=!1):e.x>this._padSensibilityUp&&t._dpadPressed&&(t._rotationRightAsked=!0,this._rotationAllowed&&this._rotateCamera(!0)))},e.prototype._checkTeleportBackwards=function(e,t){if(!t._teleportationRequestInitiated)if(e.y>this._padSensibilityUp&&t._dpadPressed){if(!t._teleportationBackRequestInitiated){if(!this.currentVRCamera)return;var r=h.Quaternion.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),n=this.currentVRCamera.position;this.currentVRCamera.devicePosition&&this.currentVRCamera.deviceRotationQuaternion&&(r=this.currentVRCamera.deviceRotationQuaternion,n=this.currentVRCamera.devicePosition),r.toEulerAnglesToRef(this._workingVector),this._workingVector.z=0,this._workingVector.x=0,h.Quaternion.RotationYawPitchRollToRef(this._workingVector.y,this._workingVector.x,this._workingVector.z,this._workingQuaternion),this._workingQuaternion.toRotationMatrix(this._workingMatrix),h.Vector3.TransformCoordinatesToRef(this._teleportBackwardsVector,this._workingMatrix,this._workingVector);var i=new y.Ray(n,this._workingVector),o=this._scene.pickWithRay(i,this._raySelectionPredicate);o&&o.pickedPoint&&o.pickedMesh&&this._isTeleportationFloor(o.pickedMesh)&&o.distance<5&&this.teleportCamera(o.pickedPoint),t._teleportationBackRequestInitiated=!0}}else t._teleportationBackRequestInitiated=!1},e.prototype._enableTeleportationOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled||this._enableInteractionOnController(e),e._interactionsEnabled=!0,e._teleportationEnabled=!0,e.webVRController.controllerType===m.PoseEnabledControllerType.VIVE&&(e._dpadPressed=!1,e.webVRController.onPadStateChangedObservable.add((function(t){e._dpadPressed=t.pressed,e._dpadPressed||(e._rotationLeftAsked=!1,e._rotationRightAsked=!1,e._teleportationBackRequestInitiated=!1)}))),e.webVRController.onPadValuesChangedObservable.add((function(r){t.teleportationEnabled&&(t._checkTeleportBackwards(r,e),t._checkTeleportWithRay(r,e)),t._checkRotate(r,e)})))},e.prototype._createTeleportationCircles=function(){this._teleportationTarget=v.Mesh.CreateGround("teleportationTarget",2,2,2,this._scene),this._teleportationTarget.isPickable=!1;var e=new T.DynamicTexture("DynamicTexture",512,this._scene,!0);e.hasAlpha=!0;var t=e.getContext();t.beginPath(),t.arc(256,256,200,0,2*Math.PI,!1),t.fillStyle=this._teleportationFillColor,t.fill(),t.lineWidth=10,t.strokeStyle=this._teleportationBorderColor,t.stroke(),t.closePath(),e.update();var r=new A.StandardMaterial("TextPlaneMaterial",this._scene);r.diffuseTexture=e,this._teleportationTarget.material=r;var n=v.Mesh.CreateTorus("torusTeleportation",.75,.1,25,this._scene,!1);n.isPickable=!1,n.parent=this._teleportationTarget;var i=new S.Animation("animationInnerCircle","position.y",30,S.Animation.ANIMATIONTYPE_FLOAT,S.Animation.ANIMATIONLOOPMODE_CYCLE),o=[];o.push({frame:0,value:0}),o.push({frame:30,value:.4}),o.push({frame:60,value:0}),i.setKeys(o);var s=new P.SineEase;s.setEasingMode(P.EasingFunction.EASINGMODE_EASEINOUT),i.setEasingFunction(s),n.animations=[],n.animations.push(i),this._scene.beginAnimation(n,0,60,!0),this._hideTeleportationTarget()},e.prototype._displayTeleportationTarget=function(){this._teleportActive=!0,this._teleportationInitialized&&(this._teleportationTarget.isVisible=!0,this._isDefaultTeleportationTarget&&(this._teleportationTarget.getChildren()[0].isVisible=!0))},e.prototype._hideTeleportationTarget=function(){this._teleportActive=!1,this._teleportationInitialized&&(this._teleportationTarget.isVisible=!1,this._isDefaultTeleportationTarget&&(this._teleportationTarget.getChildren()[0].isVisible=!1))},e.prototype._rotateCamera=function(e){var t=this;if(this.currentVRCamera instanceof s.FreeCamera){e?this._rotationAngle++:this._rotationAngle--,this.currentVRCamera.animations=[];var r=h.Quaternion.FromRotationMatrix(h.Matrix.RotationY(Math.PI/4*this._rotationAngle)),n=new S.Animation("animationRotation","rotationQuaternion",90,S.Animation.ANIMATIONTYPE_QUATERNION,S.Animation.ANIMATIONLOOPMODE_CONSTANT),i=[];i.push({frame:0,value:this.currentVRCamera.rotationQuaternion}),i.push({frame:6,value:r}),n.setKeys(i),n.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(n),this._postProcessMove.animations=[];var o=new S.Animation("animationPP","vignetteWeight",90,S.Animation.ANIMATIONTYPE_FLOAT,S.Animation.ANIMATIONLOOPMODE_CONSTANT),a=[];a.push({frame:0,value:0}),a.push({frame:3,value:4}),a.push({frame:6,value:0}),o.setKeys(a),o.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(o);var l=new S.Animation("animationPP2","vignetteStretch",90,S.Animation.ANIMATIONTYPE_FLOAT,S.Animation.ANIMATIONLOOPMODE_CONSTANT),c=[];c.push({frame:0,value:0}),c.push({frame:3,value:10}),c.push({frame:6,value:0}),l.setKeys(c),l.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(l),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._postProcessMove.samples=4,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,6,!1,1,(function(){t._webVRCamera.detachPostProcess(t._postProcessMove)})),this._scene.beginAnimation(this.currentVRCamera,0,6,!1,1)}},e.prototype._moveTeleportationSelectorTo=function(e,t,r){if(e.pickedPoint){t._teleportationRequestInitiated&&(this._displayTeleportationTarget(),this._haloCenter.copyFrom(e.pickedPoint),this._teleportationTarget.position.copyFrom(e.pickedPoint));var n=this._convertNormalToDirectionOfRay(e.getNormal(!0,!1),r);if(n){var i=h.Vector3.Cross(C.Axis.Y,n),o=h.Vector3.Cross(n,i);h.Vector3.RotationFromAxisToRef(o,n,i,this._teleportationTarget.rotation)}this._teleportationTarget.position.y+=.1}},e.prototype.teleportCamera=function(t){var r=this;if(this.currentVRCamera instanceof s.FreeCamera){var n,i;if(this.webVRCamera.leftCamera?(this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition),this._workingVector.subtractInPlace(this.webVRCamera.position),t.subtractToRef(this._workingVector,this._workingVector)):this._workingVector.copyFrom(t),this.isInVRMode?this._workingVector.y+=this.webVRCamera.deviceDistanceToRoomGround()*this._webVRCamera.deviceScaleFactor:this._workingVector.y+=this._defaultHeight,this.onBeforeCameraTeleport.notifyObservers(this._workingVector),this._teleportationMode==e.TELEPORTATIONMODE_CONSTANTSPEED){i=90;var o=h.Vector3.Distance(this.currentVRCamera.position,this._workingVector);n=this._teleportationSpeed/o}else i=Math.round(90*this._teleportationTime/1e3),n=1;this.currentVRCamera.animations=[];var a=new S.Animation("animationCameraTeleportation","position",90,S.Animation.ANIMATIONTYPE_VECTOR3,S.Animation.ANIMATIONLOOPMODE_CONSTANT),l=[{frame:0,value:this.currentVRCamera.position},{frame:i,value:this._workingVector}];a.setKeys(l),a.setEasingFunction(this._teleportationEasing),this.currentVRCamera.animations.push(a),this._postProcessMove.animations=[];var c=Math.round(i/2),u=new S.Animation("animationPP","vignetteWeight",90,S.Animation.ANIMATIONTYPE_FLOAT,S.Animation.ANIMATIONLOOPMODE_CONSTANT),d=[];d.push({frame:0,value:0}),d.push({frame:c,value:8}),d.push({frame:i,value:0}),u.setKeys(d),this._postProcessMove.animations.push(u);var f=new S.Animation("animationPP2","vignetteStretch",90,S.Animation.ANIMATIONTYPE_FLOAT,S.Animation.ANIMATIONLOOPMODE_CONSTANT),p=[];p.push({frame:0,value:0}),p.push({frame:c,value:10}),p.push({frame:i,value:0}),f.setKeys(p),this._postProcessMove.animations.push(f),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,i,!1,n,(function(){r._webVRCamera.detachPostProcess(r._postProcessMove)})),this._scene.beginAnimation(this.currentVRCamera,0,i,!1,n,(function(){r.onAfterCameraTeleport.notifyObservers(r._workingVector)})),this._hideTeleportationTarget()}},e.prototype._convertNormalToDirectionOfRay=function(e,t){return e&&Math.acos(h.Vector3.Dot(e,t.direction))<Math.PI/2&&e.scaleInPlace(-1),e},e.prototype._castRayAndSelectObject=function(e){if(this.currentVRCamera instanceof s.FreeCamera){var t=e._getForwardRay(this._rayLength),r=this._scene.pickWithRay(t,this._raySelectionPredicate);if(r&&(e._laserPointer&&(r.originMesh=e._laserPointer.parent),this._scene.simulatePointerMove(r,{pointerId:e._id})),e._currentHit=r,r&&r.pickedPoint){if(this._displayGaze){var n=1;e._gazeTracker.isVisible=!0,e._isActionableMesh&&(n=3),this.updateGazeTrackerScale&&(e._gazeTracker.scaling.x=r.distance*n,e._gazeTracker.scaling.y=r.distance*n,e._gazeTracker.scaling.z=r.distance*n);var o=this._convertNormalToDirectionOfRay(r.getNormal(),t);if(o){var a=h.Vector3.Cross(C.Axis.Y,o),l=h.Vector3.Cross(o,a);h.Vector3.RotationFromAxisToRef(l,o,a,e._gazeTracker.rotation)}e._gazeTracker.position.copyFrom(r.pickedPoint),e._gazeTracker.position.x<0?e._gazeTracker.position.x+=.002:e._gazeTracker.position.x-=.002,e._gazeTracker.position.y<0?e._gazeTracker.position.y+=.002:e._gazeTracker.position.y-=.002,e._gazeTracker.position.z<0?e._gazeTracker.position.z+=.002:e._gazeTracker.position.z-=.002}e._updatePointerDistance(r.distance)}else e._updatePointerDistance(),e._gazeTracker.isVisible=!1;if(r&&r.pickedMesh){if(this._teleportationInitialized&&this._isTeleportationFloor(r.pickedMesh)&&r.pickedPoint)return e._currentMeshSelected&&!this._isTeleportationFloor(e._currentMeshSelected)&&this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,void(e._teleportationRequestInitiated&&this._moveTeleportationSelectorTo(r,e,t));if(r.pickedMesh!==e._currentMeshSelected)if(this.meshSelectionPredicate(r.pickedMesh)){this.onNewMeshPicked.notifyObservers(r),e._currentMeshSelected=r.pickedMesh,r.pickedMesh.isPickable&&r.pickedMesh.actionManager?(this.changeGazeColor(this._pickedGazeColor),this.changeLaserColor(this._pickedLaserColor),e._isActionableMesh=!0):(this.changeGazeColor(this._gazeColor),this.changeLaserColor(this._laserColor),e._isActionableMesh=!1);try{this.onNewMeshSelected.notifyObservers(r.pickedMesh);var c=e;c.webVRController&&this.onMeshSelectedWithController.notifyObservers({mesh:r.pickedMesh,controller:c.webVRController})}catch(e){i.Logger.Warn("Error while raising onNewMeshSelected or onMeshSelectedWithController: "+e)}}else this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,this.changeGazeColor(this._gazeColor),this.changeLaserColor(this._laserColor)}else this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,this.changeGazeColor(this._gazeColor),this.changeLaserColor(this._laserColor)}},e.prototype._notifySelectedMeshUnselected=function(e){e&&this.onSelectedMeshUnselected.notifyObservers(e)},e.prototype.setLaserColor=function(e,t){void 0===t&&(t=this._pickedLaserColor),this._laserColor=e,this._pickedLaserColor=t},e.prototype.setLaserLightingState=function(e){void 0===e&&(e=!0),this._leftController&&this._leftController._setLaserPointerLightingDisabled(!e),this._rightController&&this._rightController._setLaserPointerLightingDisabled(!e)},e.prototype.setGazeColor=function(e,t){void 0===t&&(t=this._pickedGazeColor),this._gazeColor=e,this._pickedGazeColor=t},e.prototype.changeLaserColor=function(e){this.updateControllerLaserColor&&(this._leftController&&this._leftController._setLaserPointerColor(e),this._rightController&&this._rightController._setLaserPointerColor(e))},e.prototype.changeGazeColor=function(e){this.updateGazeTrackerColor&&this._cameraGazer._gazeTracker.material&&(this._cameraGazer._gazeTracker.material.emissiveColor=e,this._leftController&&(this._leftController._gazeTracker.material.emissiveColor=e),this._rightController&&(this._rightController._gazeTracker.material.emissiveColor=e))},e.prototype.dispose=function(){this.isInVRMode&&this.exitVR(),this._postProcessMove&&this._postProcessMove.dispose(),this._webVRCamera&&this._webVRCamera.dispose(),this._vrDeviceOrientationCamera&&this._vrDeviceOrientationCamera.dispose(),!this._useCustomVRButton&&this._btnVR&&this._btnVR.parentNode&&document.body.removeChild(this._btnVR),this._deviceOrientationCamera&&this._scene.activeCamera!=this._deviceOrientationCamera&&this._deviceOrientationCamera.dispose(),this._cameraGazer&&this._cameraGazer.dispose(),this._leftController&&this._leftController.dispose(),this._rightController&&this._rightController.dispose(),this._teleportationTarget&&this._teleportationTarget.dispose(),this.xr&&this.xr.dispose(),this._floorMeshesCollection=[],document.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),window.removeEventListener("resize",this._onResize),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.onmsfullscreenchange=null,this._scene.getEngine().onVRDisplayChangedObservable.removeCallback(this._onVRDisplayChanged),this._scene.getEngine().onVRRequestPresentStart.removeCallback(this._onVRRequestPresentStart),this._scene.getEngine().onVRRequestPresentComplete.removeCallback(this._onVRRequestPresentComplete),window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected),this._scene.unregisterBeforeRender(this.beforeRender)},e.prototype.getClassName=function(){return"VRExperienceHelper"},e.TELEPORTATIONMODE_CONSTANTTIME=0,e.TELEPORTATIONMODE_CONSTANTSPEED=1,e}()},"./Cameras/VR/webVRCamera.ts":
- /*!***********************************!*\
- !*** ./Cameras/VR/webVRCamera.ts ***!
- \***********************************/
- /*! exports provided: WebVRFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"WebVRFreeCamera",(function(){return p}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Cameras/freeCamera */"./Cameras/freeCamera.ts"),s=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),c=r(/*! ../../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),u=r(/*! ../../node */"./node.ts"),d=r(/*! ../../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),h=r(/*! ../../Misc/logger */"./Misc/logger.ts"),f=r(/*! ../../PostProcesses/vrMultiviewToSingleviewPostProcess */"./PostProcesses/vrMultiviewToSingleviewPostProcess.ts");r(/*! ../RigModes/webVRRigMode */"./Cameras/RigModes/webVRRigMode.ts"),r(/*! ../../Engines/Extensions/engine.webVR */"./Engines/Extensions/engine.webVR.ts"),u.Node.AddNodeConstructor("WebVRFreeCamera",(function(e,t){return function(){return new p(e,a.Vector3.Zero(),t)}})),u.Node.AddNodeConstructor("WebVRGamepadCamera",(function(e,t){return function(){return new p(e,a.Vector3.Zero(),t)}}));var p=function(e){function t(t,r,n,o){void 0===o&&(o={});var l=e.call(this,t,r,n)||this;l.webVROptions=o,l._vrDevice=null,l.rawPose=null,l._specsVersion="1.1",l._attached=!1,l._descendants=[],l._deviceRoomPosition=a.Vector3.Zero(),l._deviceRoomRotationQuaternion=a.Quaternion.Identity(),l._standingMatrix=null,l.devicePosition=a.Vector3.Zero(),l.deviceRotationQuaternion=a.Quaternion.Identity(),l.deviceScaleFactor=1,l._deviceToWorld=a.Matrix.Identity(),l._worldToDevice=a.Matrix.Identity(),l.controllers=[],l.onControllersAttachedObservable=new i.Observable,l.onControllerMeshLoadedObservable=new i.Observable,l.onPoseUpdatedFromDeviceObservable=new i.Observable,l._poseSet=!1,l.rigParenting=!0,l._defaultHeight=void 0,l._htmlElementAttached=null,l._detachIfAttached=function(){var e=l.getEngine().getVRDevice();e&&!e.isPresenting&&l._htmlElementAttached&&l.detachControl(l._htmlElementAttached)},l._workingVector=a.Vector3.Zero(),l._oneVector=a.Vector3.One(),l._workingMatrix=a.Matrix.Identity(),l._tmpMatrix=new a.Matrix,l._cache.position=a.Vector3.Zero(),o.defaultHeight&&(l._defaultHeight=o.defaultHeight,l.position.y=l._defaultHeight),l.minZ=.1,5===arguments.length&&(l.webVROptions=arguments[4]),null==l.webVROptions.trackPosition&&(l.webVROptions.trackPosition=!0),null==l.webVROptions.controllerMeshes&&(l.webVROptions.controllerMeshes=!0),null==l.webVROptions.defaultLightingOnControllers&&(l.webVROptions.defaultLightingOnControllers=!0),l.rotationQuaternion=new a.Quaternion,l.webVROptions&&l.webVROptions.positionScale&&(l.deviceScaleFactor=l.webVROptions.positionScale);var c=l.getEngine();return l._onVREnabled=function(e){e&&l.initControllers()},c.onVRRequestPresentComplete.add(l._onVREnabled),c.initWebVR().add((function(e){e.vrDisplay&&l._vrDevice!==e.vrDisplay&&(l._vrDevice=e.vrDisplay,l.setCameraRigMode(s.Camera.RIG_MODE_WEBVR,{parentCamera:l,vrDisplay:l._vrDevice,frameData:l._frameData,specs:l._specsVersion}),l._attached&&l.getEngine().enableVR(l.webVROptions))})),"undefined"!=typeof VRFrameData&&(l._frameData=new VRFrameData),o.useMultiview&&(l.getScene().getEngine().getCaps().multiview?(l._useMultiviewToSingleView=!0,l._rigPostProcess=new f.VRMultiviewToSingleviewPostProcess("VRMultiviewToSingleview",l,1)):(h.Logger.Warn("Multiview is not supported, falling back to standard rendering"),l._useMultiviewToSingleView=!1)),n.onBeforeCameraRenderObservable.add((function(e){e.parent===l&&l.rigParenting&&(l._descendants=l.getDescendants(!0,(function(e){var t=l.controllers.some((function(t){return t._mesh===e})),r=-1!==l._rigCameras.indexOf(e);return!t&&!r})),l._descendants.forEach((function(t){t.parent=e})))})),n.onAfterCameraRenderObservable.add((function(e){e.parent===l&&l.rigParenting&&l._descendants.forEach((function(e){e.parent=l}))})),l}return Object(n.__extends)(t,e),t.prototype.deviceDistanceToRoomGround=function(){return this._standingMatrix?(this._standingMatrix.getTranslationToRef(this._workingVector),this._deviceRoomPosition.y+this._workingVector.y):this._defaultHeight||0},t.prototype.useStandingMatrix=function(e){var t=this;void 0===e&&(e=function(e){}),this.getEngine().initWebVRAsync().then((function(r){r.vrDisplay&&r.vrDisplay.stageParameters&&r.vrDisplay.stageParameters.sittingToStandingTransform&&t.webVROptions.trackPosition?(t._standingMatrix=new a.Matrix,a.Matrix.FromFloat32ArrayToRefScaled(r.vrDisplay.stageParameters.sittingToStandingTransform,0,1,t._standingMatrix),t.getScene().useRightHandedSystem||t._standingMatrix&&t._standingMatrix.toggleModelMatrixHandInPlace(),e(!0)):e(!1)}))},t.prototype.useStandingMatrixAsync=function(){var e=this;return new Promise((function(t){e.useStandingMatrix((function(e){t(e)}))}))},t.prototype.dispose=function(){this._detachIfAttached(),this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled),this._updateCacheWhenTrackingDisabledObserver&&this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver),e.prototype.dispose.call(this)},t.prototype.getControllerByName=function(e){for(var t=0,r=this.controllers;t<r.length;t++){var n=r[t];if(n.hand===e)return n}return null},Object.defineProperty(t.prototype,"leftController",{get:function(){return this._leftController||(this._leftController=this.getControllerByName("left")),this._leftController},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightController",{get:function(){return this._rightController||(this._rightController=this.getControllerByName("right")),this._rightController},enumerable:!1,configurable:!0}),t.prototype.getForwardRay=function(t){return void 0===t&&(t=100),this.leftCamera?e.prototype.getForwardRay.call(this,t,this.leftCamera.getWorldMatrix(),this.leftCamera.globalPosition):e.prototype.getForwardRay.call(this,t)},t.prototype._checkInputs=function(){this._vrDevice&&this._vrDevice.isPresenting&&(this._vrDevice.getFrameData(this._frameData),this.updateFromDevice(this._frameData.pose)),e.prototype._checkInputs.call(this)},t.prototype.updateFromDevice=function(e){e&&e.orientation&&4===e.orientation.length&&(this.rawPose=e,this._deviceRoomRotationQuaternion.copyFromFloats(e.orientation[0],e.orientation[1],-e.orientation[2],-e.orientation[3]),this.getScene().useRightHandedSystem&&(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1),this.webVROptions.trackPosition&&this.rawPose.position&&(this._deviceRoomPosition.copyFromFloats(this.rawPose.position[0],this.rawPose.position[1],-this.rawPose.position[2]),this.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1)),this._poseSet=!0)},t.prototype.attachControl=function(t,r){e.prototype.attachControl.call(this,t,r),this._attached=!0,this._htmlElementAttached=t,r=!s.Camera.ForceAttachControlToAlwaysPreventDefault&&r,this._vrDevice&&this.getEngine().enableVR(this.webVROptions);var n=this._scene.getEngine().getHostWindow();n&&n.addEventListener("vrdisplaypresentchange",this._detachIfAttached)},t.prototype.detachControl=function(t){this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),e.prototype.detachControl.call(this,t),this._attached=!1,this.getEngine().disableVR(),window.removeEventListener("vrdisplaypresentchange",this._detachIfAttached)},t.prototype.getClassName=function(){return"WebVRFreeCamera"},t.prototype.resetToCurrentRotation=function(){this._vrDevice.resetPose()},t.prototype._updateRigCameras=function(){var e=this._rigCameras[0],t=this._rigCameras[1];e.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion),t.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion),e.position.copyFrom(this._deviceRoomPosition),t.position.copyFrom(this._deviceRoomPosition)},t.prototype._correctPositionIfNotTrackPosition=function(e,t){void 0===t&&(t=!1),this.rawPose&&this.rawPose.position&&!this.webVROptions.trackPosition&&(a.Matrix.TranslationToRef(this.rawPose.position[0],this.rawPose.position[1],-this.rawPose.position[2],this._tmpMatrix),t||this._tmpMatrix.invert(),this._tmpMatrix.multiplyToRef(e,e))},t.prototype._updateCache=function(t){var r=this;this.rotationQuaternion.equals(this._cache.rotationQuaternion)&&this.position.equals(this._cache.position)||(this.updateCacheCalled||(this.updateCacheCalled=!0,this.update()),this.rotationQuaternion.toRotationMatrix(this._workingMatrix),a.Vector3.TransformCoordinatesToRef(this._deviceRoomPosition,this._workingMatrix,this._workingVector),this.devicePosition.subtractToRef(this._workingVector,this._workingVector),a.Matrix.ComposeToRef(this._oneVector,this.rotationQuaternion,this._workingVector,this._deviceToWorld),this._deviceToWorld.getTranslationToRef(this._workingVector),this._workingVector.addInPlace(this.position),this._workingVector.subtractInPlace(this._cache.position),this._deviceToWorld.setTranslation(this._workingVector),this._deviceToWorld.invertToRef(this._worldToDevice),this.controllers.forEach((function(e){e._deviceToWorld.copyFrom(r._deviceToWorld),r._correctPositionIfNotTrackPosition(e._deviceToWorld),e.update()}))),t||e.prototype._updateCache.call(this),this.updateCacheCalled=!1},t.prototype._computeDevicePosition=function(){a.Vector3.TransformCoordinatesToRef(this._deviceRoomPosition,this._deviceToWorld,this.devicePosition)},t.prototype.update=function(){this._computeDevicePosition(),a.Matrix.FromQuaternionToRef(this._deviceRoomRotationQuaternion,this._workingMatrix),this._workingMatrix.multiplyToRef(this._deviceToWorld,this._workingMatrix),a.Quaternion.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this._poseSet&&this.onPoseUpdatedFromDeviceObservable.notifyObservers(null),e.prototype.update.call(this)},t.prototype._getViewMatrix=function(){return a.Matrix.Identity()},t.prototype._getWebVRViewMatrix=function(){var e=this._cameraRigParams.parentCamera;e._updateCache();var t=this._cameraRigParams.left?this._cameraRigParams.frameData.leftViewMatrix:this._cameraRigParams.frameData.rightViewMatrix;return a.Matrix.FromArrayToRef(t,0,this._webvrViewMatrix),this.getScene().useRightHandedSystem||this._webvrViewMatrix.toggleModelMatrixHandInPlace(),this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix),a.Vector3.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),1!==e.deviceScaleFactor&&(this._webvrViewMatrix.invert(),e.deviceScaleFactor&&(this._webvrViewMatrix.multiplyAtIndex(12,e.deviceScaleFactor),this._webvrViewMatrix.multiplyAtIndex(13,e.deviceScaleFactor),this._webvrViewMatrix.multiplyAtIndex(14,e.deviceScaleFactor)),this._webvrViewMatrix.invert()),e._correctPositionIfNotTrackPosition(this._webvrViewMatrix,!0),e._worldToDevice.multiplyToRef(this._webvrViewMatrix,this._webvrViewMatrix),this._workingMatrix=this._workingMatrix||a.Matrix.Identity(),this._webvrViewMatrix.invertToRef(this._workingMatrix),this._workingMatrix.multiplyToRef(e.getWorldMatrix(),this._workingMatrix),this._workingMatrix.getTranslationToRef(this._globalPosition),this._markSyncedWithParent(),this._webvrViewMatrix},t.prototype._getWebVRProjectionMatrix=function(){var e=this.parent;e._vrDevice.depthNear=e.minZ,e._vrDevice.depthFar=e.maxZ;var t=this._cameraRigParams.left?this._cameraRigParams.frameData.leftProjectionMatrix:this._cameraRigParams.frameData.rightProjectionMatrix;return a.Matrix.FromArrayToRef(t,0,this._projectionMatrix),this.getScene().useRightHandedSystem||this._projectionMatrix.toggleProjectionMatrixHandInPlace(),this._projectionMatrix},t.prototype.initControllers=function(){var e=this;this.controllers=[];var t=this.getScene().gamepadManager;this._onGamepadDisconnectedObserver=t.onGamepadDisconnectedObservable.add((function(t){if(t.type===l.Gamepad.POSE_ENABLED){var r=t;r.defaultModel&&r.defaultModel.setEnabled(!1),"right"===r.hand&&(e._rightController=null),"left"===r.hand&&(e._leftController=null);var n=e.controllers.indexOf(r);-1!==n&&e.controllers.splice(n,1)}})),this._onGamepadConnectedObserver=t.onGamepadConnectedObservable.add((function(t){if(t.type===l.Gamepad.POSE_ENABLED){var r=t;if(e.webVROptions.trackPosition||(r._disableTrackPosition(new a.Vector3("left"==r.hand?-.15:.15,-.5,.25)),e._updateCacheWhenTrackingDisabledObserver||(e._updateCacheWhenTrackingDisabledObserver=e._scene.onBeforeRenderObservable.add((function(){e._updateCache()})))),r.deviceScaleFactor=e.deviceScaleFactor,r._deviceToWorld.copyFrom(e._deviceToWorld),e._correctPositionIfNotTrackPosition(r._deviceToWorld),e.webVROptions.controllerMeshes&&(r.defaultModel?r.defaultModel.setEnabled(!0):r.initControllerMesh(e.getScene(),(function(t){if(t.scaling.scaleInPlace(e.deviceScaleFactor),e.onControllerMeshLoadedObservable.notifyObservers(r),e.webVROptions.defaultLightingOnControllers){e._lightOnControllers||(e._lightOnControllers=new d.HemisphericLight("vrControllersLight",new a.Vector3(0,1,0),e.getScene()));var n=function(e,t){var r=e.getChildren();r&&0!==r.length&&r.forEach((function(e){t.includedOnlyMeshes.push(e),n(e,t)}))};e._lightOnControllers.includedOnlyMeshes.push(t),n(t,e._lightOnControllers)}}))),r.attachToPoseControlledCamera(e),-1===e.controllers.indexOf(r)){e.controllers.push(r);for(var n=!1,i=0;i<e.controllers.length;i++)e.controllers[i].controllerType===c.PoseEnabledControllerType.VIVE&&(n?e.controllers[i].hand="right":(n=!0,e.controllers[i].hand="left"));e.controllers.length>=2&&e.onControllersAttachedObservable.notifyObservers(e.controllers)}}}))},t}(o.FreeCamera)},"./Cameras/arcRotateCamera.ts":
- /*!************************************!*\
- !*** ./Cameras/arcRotateCamera.ts ***!
- \************************************/
- /*! exports provided: ArcRotateCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCamera",(function(){return g}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../node */"./node.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Behaviors/Cameras/autoRotationBehavior */"./Behaviors/Cameras/autoRotationBehavior.ts"),u=r(/*! ../Behaviors/Cameras/bouncingBehavior */"./Behaviors/Cameras/bouncingBehavior.ts"),d=r(/*! ../Behaviors/Cameras/framingBehavior */"./Behaviors/Cameras/framingBehavior.ts"),h=r(/*! ./camera */"./Cameras/camera.ts"),f=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),p=r(/*! ../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts"),m=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts");a.Node.AddNodeConstructor("ArcRotateCamera",(function(e,t){return function(){return new g(e,0,0,1,s.Vector3.Zero(),t)}}));var g=function(e){function t(t,r,n,i,a,l,c){void 0===c&&(c=!0);var u=e.call(this,t,s.Vector3.Zero(),l,c)||this;return u._upVector=s.Vector3.Up(),u.inertialAlphaOffset=0,u.inertialBetaOffset=0,u.inertialRadiusOffset=0,u.lowerAlphaLimit=null,u.upperAlphaLimit=null,u.lowerBetaLimit=.01,u.upperBetaLimit=Math.PI-.01,u.lowerRadiusLimit=null,u.upperRadiusLimit=null,u.inertialPanningX=0,u.inertialPanningY=0,u.pinchToPanMaxDistance=20,u.panningDistanceLimit=null,u.panningOriginTarget=s.Vector3.Zero(),u.panningInertia=.9,u.zoomOnFactor=1,u.targetScreenOffset=s.Vector2.Zero(),u.allowUpsideDown=!0,u.useInputToRestoreState=!0,u._viewMatrix=new s.Matrix,u.panningAxis=new s.Vector3(1,1,0),u.onMeshTargetChangedObservable=new o.Observable,u.checkCollisions=!1,u.collisionRadius=new s.Vector3(.5,.5,.5),u._previousPosition=s.Vector3.Zero(),u._collisionVelocity=s.Vector3.Zero(),u._newPosition=s.Vector3.Zero(),u._computationVector=s.Vector3.Zero(),u._onCollisionPositionChange=function(e,t,r){void 0===r&&(r=null),r?(u.setPosition(t),u.onCollide&&u.onCollide(r)):u._previousPosition.copyFrom(u._position);var n=Math.cos(u.alpha),i=Math.sin(u.alpha),o=Math.cos(u.beta),s=Math.sin(u.beta);0===s&&(s=1e-4);var a=u._getTargetPosition();u._computationVector.copyFromFloats(u.radius*n*s,u.radius*o,u.radius*i*s),a.addToRef(u._computationVector,u._newPosition),u._position.copyFrom(u._newPosition);var l=u.upVector;u.allowUpsideDown&&u.beta<0&&(l=(l=l.clone()).negate()),u._computeViewMatrix(u._position,a,l),u._viewMatrix.addAtIndex(12,u.targetScreenOffset.x),u._viewMatrix.addAtIndex(13,u.targetScreenOffset.y),u._collisionTriggered=!1},u._target=s.Vector3.Zero(),a&&u.setTarget(a),u.alpha=r,u.beta=n,u.radius=i,u.getViewMatrix(),u.inputs=new p.ArcRotateCameraInputsManager(u),u.inputs.addKeyboard().addMouseWheel().addPointers(),u}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},set:function(e){this.setTarget(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this.setPosition(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"upVector",{get:function(){return this._upVector},set:function(e){this._upToYMatrix||(this._YToUpMatrix=new s.Matrix,this._upToYMatrix=new s.Matrix,this._upVector=s.Vector3.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()},enumerable:!1,configurable:!0}),t.prototype.setMatUp=function(){s.Matrix.RotationAlignToRef(s.Vector3.UpReadOnly,this._upVector,this._YToUpMatrix),s.Matrix.RotationAlignToRef(this._upVector,s.Vector3.UpReadOnly,this._upToYMatrix)},Object.defineProperty(t.prototype,"angularSensibilityX",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angularSensibilityY",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pinchPrecision",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchPrecision:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pinchDeltaPercentage",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useNaturalPinchZoom",{get:function(){var e=this.inputs.attached.pointers;return!!e&&e.useNaturalPinchZoom},set:function(e){var t=this.inputs.attached.pointers;t&&(t.useNaturalPinchZoom=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panningSensibility",{get:function(){var e=this.inputs.attached.pointers;return e?e.panningSensibility:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelPrecision",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wheelDeltaPercentage",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bouncingBehavior",{get:function(){return this._bouncingBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useBouncingBehavior",{get:function(){return null!=this._bouncingBehavior},set:function(e){e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new u.BouncingBehavior,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"framingBehavior",{get:function(){return this._framingBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useFramingBehavior",{get:function(){return null!=this._framingBehavior},set:function(e){e!==this.useFramingBehavior&&(e?(this._framingBehavior=new d.FramingBehavior,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoRotationBehavior",{get:function(){return this._autoRotationBehavior},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useAutoRotationBehavior",{get:function(){return null!=this._autoRotationBehavior},set:function(e){e!==this.useAutoRotationBehavior&&(e?(this._autoRotationBehavior=new c.AutoRotationBehavior,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))},enumerable:!1,configurable:!0}),t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache._target=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=s.Vector2.Zero()},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)},t.prototype._getTargetPosition=function(){if(this._targetHost&&this._targetHost.getAbsolutePosition){var e=this._targetHost.absolutePosition;this._targetBoundingCenter?e.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(e)}var t=this._getLockedTargetPosition();return t||this._target},t.prototype.storeState=function(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronizedViewMatrix.call(this)&&this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset)},t.prototype.attachControl=function(e,t,r,n){var i=this;void 0===r&&(r=!0),void 0===n&&(n=2),this._useCtrlForPanning=r,this._panningMouseButton=n,this.inputs.attachElement(e,t),this._reset=function(){i.inertialAlphaOffset=0,i.inertialBetaOffset=0,i.inertialRadiusOffset=0,i.inertialPanningX=0,i.inertialPanningY=0}},t.prototype.detachControl=function(e){this.inputs.detachElement(e),this._reset&&this._reset()},t.prototype._checkInputs=function(){if(!this._collisionTriggered){if(this.inputs.checkInputs(),0!==this.inertialAlphaOffset||0!==this.inertialBetaOffset||0!==this.inertialRadiusOffset){var t=this.inertialAlphaOffset;this.beta<=0&&(t*=-1),this.getScene().useRightHandedSystem&&(t*=-1),this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(t*=-1),this.alpha+=t,this.beta+=this.inertialBetaOffset,this.radius-=this.inertialRadiusOffset,this.inertialAlphaOffset*=this.inertia,this.inertialBetaOffset*=this.inertia,this.inertialRadiusOffset*=this.inertia,Math.abs(this.inertialAlphaOffset)<m.Epsilon&&(this.inertialAlphaOffset=0),Math.abs(this.inertialBetaOffset)<m.Epsilon&&(this.inertialBetaOffset=0),Math.abs(this.inertialRadiusOffset)<this.speed*m.Epsilon&&(this.inertialRadiusOffset=0)}0===this.inertialPanningX&&0===this.inertialPanningY||(this._localDirection||(this._localDirection=s.Vector3.Zero(),this._transformedDirection=s.Vector3.Zero()),this._localDirection.copyFromFloats(this.inertialPanningX,this.inertialPanningY,this.inertialPanningY),this._localDirection.multiplyInPlace(this.panningAxis),this._viewMatrix.invertToRef(this._cameraTransformMatrix),s.Vector3.TransformNormalToRef(this._localDirection,this._cameraTransformMatrix,this._transformedDirection),this.panningAxis.y||(this._transformedDirection.y=0),this._targetHost||(this.panningDistanceLimit?(this._transformedDirection.addInPlace(this._target),s.Vector3.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection)):this._target.addInPlace(this._transformedDirection)),this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia,Math.abs(this.inertialPanningX)<this.speed*m.Epsilon&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<this.speed*m.Epsilon&&(this.inertialPanningY=0)),this._checkLimits(),e.prototype._checkInputs.call(this)}},t.prototype._checkLimits=function(){null===this.lowerBetaLimit||void 0===this.lowerBetaLimit?this.allowUpsideDown&&this.beta>Math.PI&&(this.beta=this.beta-2*Math.PI):this.beta<this.lowerBetaLimit&&(this.beta=this.lowerBetaLimit),null===this.upperBetaLimit||void 0===this.upperBetaLimit?this.allowUpsideDown&&this.beta<-Math.PI&&(this.beta=this.beta+2*Math.PI):this.beta>this.upperBetaLimit&&(this.beta=this.upperBetaLimit),null!==this.lowerAlphaLimit&&this.alpha<this.lowerAlphaLimit&&(this.alpha=this.lowerAlphaLimit),null!==this.upperAlphaLimit&&this.alpha>this.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit,this.inertialRadiusOffset=0),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0)},t.prototype.rebuildAnglesAndRadius=function(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||s.Vector3.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4),0===this._computationVector.x&&0===this._computationVector.z?this.alpha=Math.PI/2:this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha),this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()},t.prototype.setPosition=function(e){this._position.equals(e)||(this._position.copyFrom(e),this.rebuildAnglesAndRadius())},t.prototype.setTarget=function(e,t,r){if(void 0===t&&(t=!1),void 0===r&&(r=!1),e.getBoundingInfo)this._targetBoundingCenter=t?e.getBoundingInfo().boundingBox.centerWorld.clone():null,e.computeWorldMatrix(),this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{var n=e,i=this._getTargetPosition();if(i&&!r&&i.equals(n))return;this._targetHost=null,this._target=n,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}this.rebuildAnglesAndRadius()},t.prototype._getViewMatrix=function(){var e=Math.cos(this.alpha),t=Math.sin(this.alpha),r=Math.cos(this.beta),n=Math.sin(this.beta);0===n&&(n=1e-4),0===this.radius&&(this.radius=1e-4);var i=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*n,this.radius*r,this.radius*t*n),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||s.Vector3.TransformCoordinatesToRef(this._computationVector,this._YToUpMatrix,this._computationVector),i.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){var o=this.getScene().collisionCoordinator;this._collider||(this._collider=o.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,o.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);var a=this.upVector;this.allowUpsideDown&&n<0&&(a=a.negate()),this._computeViewMatrix(this._position,i,a),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=i,this._viewMatrix},t.prototype.zoomOn=function(e,t){void 0===t&&(t=!1),e=e||this.getScene().meshes;var r=l.Mesh.MinMax(e),n=s.Vector3.Distance(r.min,r.max);this.radius=n*this.zoomOnFactor,this.focusOn({min:r.min,max:r.max,distance:n},t)},t.prototype.focusOn=function(e,t){var r,n;if(void 0===t&&(t=!1),void 0===e.min){var i=e||this.getScene().meshes;r=l.Mesh.MinMax(i),n=s.Vector3.Distance(r.min,r.max)}else r=e,n=e.distance;this._target=l.Mesh.Center(r),t||(this.maxZ=2*n)},t.prototype.createRigCamera=function(e,r){var n=0;switch(this.cameraRigMode){case h.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case h.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case h.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case h.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:case h.Camera.RIG_MODE_VR:n=this._cameraRigParams.stereoHalfAngle*(0===r?1:-1);break;case h.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:n=this._cameraRigParams.stereoHalfAngle*(0===r?-1:1)}var i=new t(e,this.alpha+n,this.beta,this.radius,this._target,this.getScene());return i._cameraRigParams={},i.isRigCamera=!0,i.rigParent=this,i.upVector=this.upVector,i},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],r=this._rigCameras[1];switch(t.beta=r.beta=this.beta,this.cameraRigMode){case h.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case h.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case h.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case h.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:case h.Camera.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,r.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case h.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,r.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle}e.prototype._updateRigCameras.call(this)},t.prototype.dispose=function(){this.inputs.clear(),e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"ArcRotateCamera"},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"alpha",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"beta",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"radius",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)("target")],t.prototype,"_target",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)("upVector")],t.prototype,"_upVector",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialAlphaOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialBetaOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialRadiusOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerAlphaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperAlphaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerBetaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperBetaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialPanningX",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialPanningY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchToPanMaxDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"panningDistanceLimit",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"panningOriginTarget",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"panningInertia",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"zoomOnFactor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"targetScreenOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"allowUpsideDown",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useInputToRestoreState",void 0),t}(f.TargetCamera)},"./Cameras/arcRotateCameraInputsManager.ts":
- /*!*************************************************!*\
- !*** ./Cameras/arcRotateCameraInputsManager.ts ***!
- \*************************************************/
- /*! exports provided: ArcRotateCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraInputsManager",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Cameras/Inputs/arcRotateCameraPointersInput */"./Cameras/Inputs/arcRotateCameraPointersInput.ts"),o=r(/*! ../Cameras/Inputs/arcRotateCameraKeyboardMoveInput */"./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts"),s=r(/*! ../Cameras/Inputs/arcRotateCameraMouseWheelInput */"./Cameras/Inputs/arcRotateCameraMouseWheelInput.ts"),a=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),t.prototype.addMouseWheel=function(){return this.add(new s.ArcRotateCameraMouseWheelInput),this},t.prototype.addPointers=function(){return this.add(new i.ArcRotateCameraPointersInput),this},t.prototype.addKeyboard=function(){return this.add(new o.ArcRotateCameraKeyboardMoveInput),this},t}(r(/*! ../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts").CameraInputsManager)},"./Cameras/camera.ts":
- /*!***************************!*\
- !*** ./Cameras/camera.ts ***!
- \***************************/
- /*! exports provided: Camera */function(e,t,r){"use strict";r.r(t),r.d(t,"Camera",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),s=r(/*! ../Misc/tools */"./Misc/tools.ts"),a=r(/*! ../Misc/observable */"./Misc/observable.ts"),l=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../node */"./node.ts"),u=r(/*! ../Misc/logger */"./Misc/logger.ts"),d=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),h=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),f=r(/*! ../Maths/math.viewport */"./Maths/math.viewport.ts"),p=r(/*! ../Maths/math.frustum */"./Maths/math.frustum.ts"),m=function(e){function t(r,n,i,s){void 0===s&&(s=!0);var c=e.call(this,r,i)||this;return c._position=l.Vector3.Zero(),c.upVector=l.Vector3.Up(),c.orthoLeft=null,c.orthoRight=null,c.orthoBottom=null,c.orthoTop=null,c.fov=.8,c.minZ=1,c.maxZ=1e4,c.inertia=.9,c.mode=t.PERSPECTIVE_CAMERA,c.isIntermediate=!1,c.viewport=new f.Viewport(0,0,1,1),c.layerMask=268435455,c.fovMode=t.FOVMODE_VERTICAL_FIXED,c.cameraRigMode=t.RIG_MODE_NONE,c.customRenderTargets=new Array,c.outputRenderTarget=null,c.onViewMatrixChangedObservable=new a.Observable,c.onProjectionMatrixChangedObservable=new a.Observable,c.onAfterCheckInputsObservable=new a.Observable,c.onRestoreStateObservable=new a.Observable,c.isRigCamera=!1,c._rigCameras=new Array,c._webvrViewMatrix=l.Matrix.Identity(),c._skipRendering=!1,c._projectionMatrix=new l.Matrix,c._postProcesses=new Array,c._activeMeshes=new o.SmartArray(256),c._globalPosition=l.Vector3.Zero(),c._computedViewMatrix=l.Matrix.Identity(),c._doNotComputeProjectionMatrix=!1,c._transformMatrix=l.Matrix.Zero(),c._refreshFrustumPlanes=!0,c._isCamera=!0,c._isLeftCamera=!1,c._isRightCamera=!1,c.getScene().addCamera(c),s&&!c.getScene().activeCamera&&(c.getScene().activeCamera=c),c.position=n,c}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!1,configurable:!0}),t.prototype.storeState=function(){return this._stateStored=!0,this._storedFov=this.fov,this},t.prototype._restoreStateValues=function(){return!!this._stateStored&&(this.fov=this._storedFov,!0)},t.prototype.restoreState=function(){return!!this._restoreStateValues()&&(this.onRestoreStateObservable.notifyObservers(this),!0)},t.prototype.getClassName=function(){return"Camera"},t.prototype.toString=function(e){var t="Name: "+this.name;if(t+=", type: "+this.getClassName(),this.animations)for(var r=0;r<this.animations.length;r++)t+=", animation[0]: "+this.animations[r].toString(e);return t},Object.defineProperty(t.prototype,"globalPosition",{get:function(){return this._globalPosition},enumerable:!1,configurable:!0}),t.prototype.getActiveMeshes=function(){return this._activeMeshes},t.prototype.isActiveMesh=function(e){return-1!==this._activeMeshes.indexOf(e)},t.prototype.isReady=function(t){if(void 0===t&&(t=!1),t)for(var r=0,n=this._postProcesses;r<n.length;r++){var i=n[r];if(i&&!i.isReady())return!1}return e.prototype.isReady.call(this,t)},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.position=new l.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new l.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)},t.prototype._isSynchronized=function(){return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronized.call(this)&&this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent()},t.prototype._isSynchronizedProjectionMatrix=function(){var e=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===this.maxZ;if(!e)return!1;var r=this.getEngine();return e=this.mode===t.PERSPECTIVE_CAMERA?this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===r.getAspectRatio(this):this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===r.getRenderWidth()&&this._cache.renderHeight===r.getRenderHeight()},t.prototype.attachControl=function(e,t){},t.prototype.detachControl=function(e){},t.prototype.update=function(){this._checkInputs(),this.cameraRigMode!==t.RIG_MODE_NONE&&this._updateRigCameras()},t.prototype._checkInputs=function(){this.onAfterCheckInputsObservable.notifyObservers(this)},Object.defineProperty(t.prototype,"rigCameras",{get:function(){return this._rigCameras},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rigPostProcess",{get:function(){return this._rigPostProcess},enumerable:!1,configurable:!0}),t.prototype._getFirstPostProcess=function(){for(var e=0;e<this._postProcesses.length;e++)if(null!==this._postProcesses[e])return this._postProcesses[e];return null},t.prototype._cascadePostProcessesToRigCams=function(){var e=this._getFirstPostProcess();e&&e.markTextureDirty();for(var t=0,r=this._rigCameras.length;t<r;t++){var n=this._rigCameras[t],i=n._rigPostProcess;i?("pass"===i.getEffectName()&&(n.isIntermediate=0===this._postProcesses.length),n._postProcesses=this._postProcesses.slice(0).concat(i),i.markTextureDirty()):n._postProcesses=this._postProcesses.slice(0)}},t.prototype.attachPostProcess=function(e,t){return void 0===t&&(t=null),!e.isReusable()&&this._postProcesses.indexOf(e)>-1?(u.Logger.Error("You're trying to reuse a post process not defined as reusable."),0):(null==t||t<0?this._postProcesses.push(e):null===this._postProcesses[t]?this._postProcesses[t]=e:this._postProcesses.splice(t,0,e),this._cascadePostProcessesToRigCams(),this._postProcesses.indexOf(e))},t.prototype.detachPostProcess=function(e){var t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses[t]=null),this._cascadePostProcessesToRigCams()},t.prototype.getWorldMatrix=function(){return this._isSynchronizedViewMatrix()||this.getViewMatrix(),this._worldMatrix},t.prototype._getViewMatrix=function(){return l.Matrix.Identity()},t.prototype.getViewMatrix=function(e){return!e&&this._isSynchronizedViewMatrix()||(this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix)),this._computedViewMatrix},t.prototype.freezeProjectionMatrix=function(e){this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)},t.prototype.unfreezeProjectionMatrix=function(){this._doNotComputeProjectionMatrix=!1},t.prototype.getProjectionMatrix=function(e){var r,n,i,o,s,a,c,u;if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;var d=this.getEngine(),h=this.getScene();if(this.mode===t.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=d.getAspectRatio(this),this.minZ<=0&&(this.minZ=.1);var f=d.useReverseDepthBuffer;(h.useRightHandedSystem?f?l.Matrix.PerspectiveFovReverseRHToRef:l.Matrix.PerspectiveFovRHToRef:f?l.Matrix.PerspectiveFovReverseLHToRef:l.Matrix.PerspectiveFovLHToRef)(this.fov,d.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED)}else{var p=d.getRenderWidth()/2,m=d.getRenderHeight()/2;h.useRightHandedSystem?l.Matrix.OrthoOffCenterRHToRef(null!==(r=this.orthoLeft)&&void 0!==r?r:-p,null!==(n=this.orthoRight)&&void 0!==n?n:p,null!==(i=this.orthoBottom)&&void 0!==i?i:-m,null!==(o=this.orthoTop)&&void 0!==o?o:m,this.minZ,this.maxZ,this._projectionMatrix):l.Matrix.OrthoOffCenterLHToRef(null!==(s=this.orthoLeft)&&void 0!==s?s:-p,null!==(a=this.orthoRight)&&void 0!==a?a:p,null!==(c=this.orthoBottom)&&void 0!==c?c:-m,null!==(u=this.orthoTop)&&void 0!==u?u:m,this.minZ,this.maxZ,this._projectionMatrix),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.renderWidth=d.getRenderWidth(),this._cache.renderHeight=d.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix},t.prototype.getTransformationMatrix=function(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix},t.prototype._updateFrustumPlanes=function(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?p.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=p.Frustum.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)},t.prototype.isInFrustum=function(e,t){if(void 0===t&&(t=!1),this._updateFrustumPlanes(),t&&this.rigCameras.length>0){var r=!1;return this.rigCameras.forEach((function(t){t._updateFrustumPlanes(),r=r||e.isInFrustum(t._frustumPlanes)})),r}return e.isInFrustum(this._frustumPlanes)},t.prototype.isCompletelyInFrustum=function(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)},t.prototype.getForwardRay=function(e,t,r){throw void 0===e&&(e=100),h._DevTools.WarnImport("Ray")},t.prototype.getForwardRayToRef=function(e,t,r,n){throw void 0===t&&(t=100),h._DevTools.WarnImport("Ray")},t.prototype.dispose=function(r,n){for(void 0===n&&(n=!1),this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){var i=this._rigCameras.pop();i&&i.dispose()}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses=[];else if(this.cameraRigMode!==t.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses=[];else for(var o=this._postProcesses.length;--o>=0;){var s=this._postProcesses[o];s&&s.dispose(this)}for(o=this.customRenderTargets.length;--o>=0;)this.customRenderTargets[o].dispose();this.customRenderTargets=[],this._activeMeshes.dispose(),e.prototype.dispose.call(this,r,n)},Object.defineProperty(t.prototype,"isLeftCamera",{get:function(){return this._isLeftCamera},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRightCamera",{get:function(){return this._isRightCamera},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftCamera",{get:function(){return this._rigCameras.length<1?null:this._rigCameras[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightCamera",{get:function(){return this._rigCameras.length<2?null:this._rigCameras[1]},enumerable:!1,configurable:!0}),t.prototype.getLeftTarget=function(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()},t.prototype.getRightTarget=function(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()},t.prototype.setCameraRigMode=function(e,r){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){var n=this._rigCameras.pop();n&&n.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=r.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=s.Tools.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==t.RIG_MODE_NONE){var i=this.createRigCamera(this.name+"_L",0);i&&(i._isLeftCamera=!0);var o=this.createRigCamera(this.name+"_R",1);o&&(o._isRightCamera=!0),i&&o&&(this._rigCameras.push(i),this._rigCameras.push(o))}switch(this.cameraRigMode){case t.RIG_MODE_STEREOSCOPIC_ANAGLYPH:t._setStereoscopicAnaglyphRigMode(this);break;case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case t.RIG_MODE_STEREOSCOPIC_OVERUNDER:case t.RIG_MODE_STEREOSCOPIC_INTERLACED:t._setStereoscopicRigMode(this);break;case t.RIG_MODE_VR:t._setVRRigMode(this,r);break;case t.RIG_MODE_WEBVR:t._setWebVRRigMode(this,r)}this._cascadePostProcessesToRigCams(),this.update()}},t._setStereoscopicRigMode=function(e){throw"Import Cameras/RigModes/stereoscopicRigMode before using stereoscopic rig mode"},t._setStereoscopicAnaglyphRigMode=function(e){throw"Import Cameras/RigModes/stereoscopicAnaglyphRigMode before using stereoscopic anaglyph rig mode"},t._setVRRigMode=function(e,t){throw"Import Cameras/RigModes/vrRigMode before using VR rig mode"},t._setWebVRRigMode=function(e,t){throw"Import Cameras/RigModes/WebVRRigMode before using Web VR rig mode"},t.prototype._getVRProjectionMatrix=function(){return l.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.maxZ,this._cameraRigParams.vrWorkMatrix),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix},t.prototype._updateCameraRotationMatrix=function(){},t.prototype._updateWebVRCameraRotationMatrix=function(){},t.prototype._getWebVRProjectionMatrix=function(){return l.Matrix.Identity()},t.prototype._getWebVRViewMatrix=function(){return l.Matrix.Identity()},t.prototype.setCameraRigParameter=function(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,"interaxialDistance"===e&&(this._cameraRigParams.stereoHalfAngle=s.Tools.ToRadians(t/.0637))},t.prototype.createRigCamera=function(e,t){return null},t.prototype._updateRigCameras=function(){for(var e=0;e<this._rigCameras.length;e++)this._rigCameras[e].minZ=this.minZ,this._rigCameras[e].maxZ=this.maxZ,this._rigCameras[e].fov=this.fov,this._rigCameras[e].upVector.copyFrom(this.upVector);this.cameraRigMode===t.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)},t.prototype._setupInputs=function(){},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.type=this.getClassName(),this.parent&&(e.parentId=this.parent.id),this.inputs&&this.inputs.serialize(e),i.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.prototype.clone=function(e){return i.SerializationHelper.Clone(t.GetConstructorFromName(this.getClassName(),e,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this)},t.prototype.getDirection=function(e){var t=l.Vector3.Zero();return this.getDirectionToRef(e,t),t},Object.defineProperty(t.prototype,"absoluteRotation",{get:function(){var e=l.Quaternion.Zero();return this.getWorldMatrix().decompose(void 0,e),e},enumerable:!1,configurable:!0}),t.prototype.getDirectionToRef=function(e,t){l.Vector3.TransformNormalToRef(e,this.getWorldMatrix(),t)},t.GetConstructorFromName=function(e,r,n,i,o){void 0===i&&(i=0),void 0===o&&(o=!0);var s=c.Node.Construct(e,r,n,{interaxial_distance:i,isStereoscopicSideBySide:o});return s||function(){return t._createDefaultParsedCamera(r,n)}},t.prototype.computeWorldMatrix=function(){return this.getWorldMatrix()},t.Parse=function(e,r){var n=e.type,o=t.GetConstructorFromName(n,e.name,r,e.interaxial_distance,e.isStereoscopicSideBySide),s=i.SerializationHelper.Parse(o,e,r);if(e.parentId&&(s._waitingParentId=e.parentId),s.inputs&&(s.inputs.parse(e),s._setupInputs()),s.setPosition&&(s.position.copyFromFloats(0,0,0),s.setPosition(l.Vector3.FromArray(e.position))),e.target&&s.setTarget&&s.setTarget(l.Vector3.FromArray(e.target)),e.cameraRigMode){var a=e.interaxial_distance?{interaxialDistance:e.interaxial_distance}:{};s.setCameraRigMode(e.cameraRigMode,a)}if(e.animations){for(var u=0;u<e.animations.length;u++){var h=e.animations[u],f=d._TypeStore.GetClass("BABYLON.Animation");f&&s.animations.push(f.Parse(h))}c.Node.ParseAnimationRanges(s,e,r)}return e.autoAnimate&&r.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),s},t._createDefaultParsedCamera=function(e,t){throw h._DevTools.WarnImport("UniversalCamera")},t.PERSPECTIVE_CAMERA=0,t.ORTHOGRAPHIC_CAMERA=1,t.FOVMODE_VERTICAL_FIXED=0,t.FOVMODE_HORIZONTAL_FIXED=1,t.RIG_MODE_NONE=0,t.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,t.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,t.RIG_MODE_STEREOSCOPIC_INTERLACED=14,t.RIG_MODE_VR=20,t.RIG_MODE_WEBVR=21,t.RIG_MODE_CUSTOM=22,t.ForceAttachControlToAlwaysPreventDefault=!1,Object(n.__decorate)([Object(i.serializeAsVector3)("position")],t.prototype,"_position",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"upVector",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"orthoLeft",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"orthoRight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"orthoBottom",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"orthoTop",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"fov",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"minZ",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"maxZ",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertia",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"mode",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"layerMask",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"fovMode",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"cameraRigMode",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"interaxialDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"isStereoscopicSideBySide",void 0),t}(c.Node)},"./Cameras/cameraInputsManager.ts":
- /*!****************************************!*\
- !*** ./Cameras/cameraInputsManager.ts ***!
- \****************************************/
- /*! exports provided: CameraInputTypes, CameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"CameraInputTypes",(function(){return s})),r.d(t,"CameraInputsManager",(function(){return a}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ./camera */"./Cameras/camera.ts"),s={},a=function(){function e(e){this.attached={},this.camera=e,this.checkInputs=function(){}}return e.prototype.add=function(e){var t=e.getSimpleName();this.attached[t]?n.Logger.Warn("camera input of type "+t+" already exists on camera"):(this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedElement&&e.attachControl(this.attachedElement))},e.prototype.remove=function(e){for(var t in this.attached){var r=this.attached[t];r===e&&(r.detachControl(this.attachedElement),r.camera=null,delete this.attached[t],this.rebuildInputCheck())}},e.prototype.removeByType=function(e){for(var t in this.attached){var r=this.attached[t];r.getClassName()===e&&(r.detachControl(this.attachedElement),r.camera=null,delete this.attached[t],this.rebuildInputCheck())}},e.prototype._addCheckInputs=function(e){var t=this.checkInputs;return function(){t(),e()}},e.prototype.attachInput=function(e){this.attachedElement&&e.attachControl(this.attachedElement,this.noPreventDefault)},e.prototype.attachElement=function(e,t){if(void 0===t&&(t=!1),!this.attachedElement)for(var r in t=!o.Camera.ForceAttachControlToAlwaysPreventDefault&&t,this.attachedElement=e,this.noPreventDefault=t,this.attached)this.attached[r].attachControl(e,t)},e.prototype.detachElement=function(e,t){if(void 0===t&&(t=!1),this.attachedElement===e){for(var r in this.attached)this.attached[r].detachControl(e),t&&(this.attached[r].camera=null);this.attachedElement=null}},e.prototype.rebuildInputCheck=function(){for(var e in this.checkInputs=function(){},this.attached){var t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}},e.prototype.clear=function(){this.attachedElement&&this.detachElement(this.attachedElement,!0),this.attached={},this.attachedElement=null,this.checkInputs=function(){}},e.prototype.serialize=function(e){var t={};for(var r in this.attached){var n=this.attached[r],o=i.SerializationHelper.Serialize(n);t[n.getClassName()]=o}e.inputsmgr=t},e.prototype.parse=function(e){var t=e.inputsmgr;if(t){for(var r in this.clear(),t)if(a=s[r]){var n=t[r],o=i.SerializationHelper.Parse((function(){return new a}),n,null);this.add(o)}}else for(var r in this.attached){var a;(a=s[this.attached[r].getClassName()])&&(o=i.SerializationHelper.Parse((function(){return new a}),e,null),this.remove(this.attached[r]),this.add(o))}},e}()},"./Cameras/deviceOrientationCamera.ts":
- /*!********************************************!*\
- !*** ./Cameras/deviceOrientationCamera.ts ***!
- \********************************************/
- /*! exports provided: DeviceOrientationCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"DeviceOrientationCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./freeCamera */"./Cameras/freeCamera.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../node */"./node.ts"),a=(r(/*! ./Inputs/freeCameraDeviceOrientationInput */"./Cameras/Inputs/freeCameraDeviceOrientationInput.ts"),r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"));s.Node.AddNodeConstructor("DeviceOrientationCamera",(function(e,t){return function(){return new l(e,o.Vector3.Zero(),t)}}));var l=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._tmpDragQuaternion=new o.Quaternion,i._disablePointerInputWhenUsingDeviceOrientation=!0,i._dragFactor=0,i._quaternionCache=new o.Quaternion,i.inputs.addDeviceOrientation(),i.inputs._deviceOrientationInput&&i.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce((function(){i._disablePointerInputWhenUsingDeviceOrientation&&i.inputs._mouseInput&&(i.inputs._mouseInput._allowCameraRotation=!1,i.inputs._mouseInput.onPointerMovedObservable.add((function(e){0!=i._dragFactor&&(i._initialQuaternion||(i._initialQuaternion=new o.Quaternion),o.Quaternion.FromEulerAnglesToRef(0,e.offsetX*i._dragFactor,0,i._tmpDragQuaternion),i._initialQuaternion.multiplyToRef(i._tmpDragQuaternion,i._initialQuaternion))})))})),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"disablePointerInputWhenUsingDeviceOrientation",{get:function(){return this._disablePointerInputWhenUsingDeviceOrientation},set:function(e){this._disablePointerInputWhenUsingDeviceOrientation=e},enumerable:!1,configurable:!0}),t.prototype.enableHorizontalDragging=function(e){void 0===e&&(e=1/300),this._dragFactor=e},t.prototype.getClassName=function(){return"DeviceOrientationCamera"},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._quaternionCache.copyFrom(this.rotationQuaternion),this._initialQuaternion&&this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)},t.prototype.resetToCurrentRotation=function(e){var t=this;void 0===e&&(e=a.Axis.Y),this.rotationQuaternion&&(this._initialQuaternion||(this._initialQuaternion=new o.Quaternion),this._initialQuaternion.copyFrom(this._quaternionCache||this.rotationQuaternion),["x","y","z"].forEach((function(r){e[r]?t._initialQuaternion[r]*=-1:t._initialQuaternion[r]=0})),this._initialQuaternion.normalize(),this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion))},t}(i.FreeCamera)},"./Cameras/flyCamera.ts":
- /*!******************************!*\
- !*** ./Cameras/flyCamera.ts ***!
- \******************************/
- /*! exports provided: FlyCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"FlyCamera",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),l=r(/*! ./flyCameraInputsManager */"./Cameras/flyCameraInputsManager.ts"),c=function(e){function t(t,r,n,i){void 0===i&&(i=!0);var a=e.call(this,t,r,n,i)||this;return a.ellipsoid=new o.Vector3(1,1,1),a.ellipsoidOffset=new o.Vector3(0,0,0),a.checkCollisions=!1,a.applyGravity=!1,a.cameraDirection=o.Vector3.Zero(),a._trackRoll=0,a.rollCorrect=100,a.bankedTurn=!1,a.bankedTurnLimit=Math.PI/2,a.bankedTurnMultiplier=1,a._needMoveForGravity=!1,a._oldPosition=o.Vector3.Zero(),a._diffPosition=o.Vector3.Zero(),a._newPosition=o.Vector3.Zero(),a._collisionMask=-1,a._onCollisionPositionChange=function(e,t,r){var n;void 0===r&&(r=null),n=t,a._newPosition.copyFrom(n),a._newPosition.subtractToRef(a._oldPosition,a._diffPosition),a._diffPosition.length()>s.Engine.CollisionsEpsilon&&(a.position.addInPlace(a._diffPosition),a.onCollide&&r&&a.onCollide(r))},a.inputs=new l.FlyCameraInputsManager(a),a.inputs.addKeyboard().addMouse(),a}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"angularSensibility",{get:function(){var e=this.inputs.attached.mouse;return e?e.angularSensibility:0},set:function(e){var t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysForward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysForward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysForward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysBackward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysBackward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysBackward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!1,configurable:!0}),t.prototype.attachControl=function(e,t){this.inputs.attachElement(e,t)},t.prototype.detachControl=function(e){this.inputs.detachElement(e),this.cameraDirection=new o.Vector3(0,0,0)},Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),t.prototype._collideWithWorld=function(e){(this.parent?o.Vector3.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position).subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);var t=this.getScene().collisionCoordinator;this._collider||(this._collider=t.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;var r=e;this.applyGravity&&(r=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,r,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=o.Vector3.Zero(),this._transformedDirection=o.Vector3.Zero()),this.inputs.checkInputs(),e.prototype._checkInputs.call(this)},t.prototype._decideIfNeedsToMove=function(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):e.prototype._updatePosition.call(this)},t.prototype.restoreRoll=function(e){var t=this._trackRoll,r=t-this.rotation.z;Math.abs(r)>=.001&&(this.rotation.z+=r/e,Math.abs(t-this.rotation.z)<=.001&&(this.rotation.z=t))},t.prototype.dispose=function(){this.inputs.clear(),e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"FlyCamera"},Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoid",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoidOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"checkCollisions",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"applyGravity",void 0),t}(a.TargetCamera)},"./Cameras/flyCameraInputsManager.ts":
- /*!*******************************************!*\
- !*** ./Cameras/flyCameraInputsManager.ts ***!
- \*******************************************/
- /*! exports provided: FlyCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"FlyCameraInputsManager",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./cameraInputsManager */"./Cameras/cameraInputsManager.ts"),o=r(/*! ../Cameras/Inputs/flyCameraMouseInput */"./Cameras/Inputs/flyCameraMouseInput.ts"),s=r(/*! ../Cameras/Inputs/flyCameraKeyboardInput */"./Cameras/Inputs/flyCameraKeyboardInput.ts"),a=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),t.prototype.addKeyboard=function(){return this.add(new s.FlyCameraKeyboardInput),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new o.FlyCameraMouseInput(e)),this},t}(i.CameraInputsManager)},"./Cameras/followCamera.ts":
- /*!*********************************!*\
- !*** ./Cameras/followCamera.ts ***!
- \*********************************/
- /*! exports provided: FollowCamera, ArcFollowCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCamera",(function(){return u})),r.d(t,"ArcFollowCamera",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../node */"./node.ts"),c=r(/*! ./followCameraInputsManager */"./Cameras/followCameraInputsManager.ts");l.Node.AddNodeConstructor("FollowCamera",(function(e,t){return function(){return new u(e,a.Vector3.Zero(),t)}})),l.Node.AddNodeConstructor("ArcFollowCamera",(function(e,t){return function(){return new d(e,0,0,1,null,t)}}));var u=function(e){function t(t,r,n,i){void 0===i&&(i=null);var o=e.call(this,t,r,n)||this;return o.radius=12,o.lowerRadiusLimit=null,o.upperRadiusLimit=null,o.rotationOffset=0,o.lowerRotationOffsetLimit=null,o.upperRotationOffsetLimit=null,o.heightOffset=4,o.lowerHeightOffsetLimit=null,o.upperHeightOffsetLimit=null,o.cameraAcceleration=.05,o.maxCameraSpeed=20,o.lockedTarget=i,o.inputs=new c.FollowCameraInputsManager(o),o.inputs.addKeyboard().addMouseWheel().addPointers(),o}return Object(n.__extends)(t,e),t.prototype._follow=function(e){if(e){var t;if(e.rotationQuaternion){var r=new a.Matrix;e.rotationQuaternion.toRotationMatrix(r),t=Math.atan2(r.m[8],r.m[10])}else t=e.rotation.y;var n=o.Tools.ToRadians(this.rotationOffset)+t,i=e.getAbsolutePosition(),s=i.x+Math.sin(n)*this.radius,l=i.z+Math.cos(n)*this.radius,c=s-this.position.x,u=i.y+this.heightOffset-this.position.y,d=l-this.position.z,h=c*this.cameraAcceleration*2,f=u*this.cameraAcceleration,p=d*this.cameraAcceleration*2;(h>this.maxCameraSpeed||h<-this.maxCameraSpeed)&&(h=h<1?-this.maxCameraSpeed:this.maxCameraSpeed),(f>this.maxCameraSpeed||f<-this.maxCameraSpeed)&&(f=f<1?-this.maxCameraSpeed:this.maxCameraSpeed),(p>this.maxCameraSpeed||p<-this.maxCameraSpeed)&&(p=p<1?-this.maxCameraSpeed:this.maxCameraSpeed),this.position=new a.Vector3(this.position.x+h,this.position.y+f,this.position.z+p),this.setTarget(i)}},t.prototype.attachControl=function(e,t){this.inputs.attachElement(e,t),this._reset=function(){}},t.prototype.detachControl=function(e){this.inputs.detachElement(e),this._reset&&this._reset()},t.prototype._checkInputs=function(){this.inputs.checkInputs(),this._checkLimits(),e.prototype._checkInputs.call(this),this.lockedTarget&&this._follow(this.lockedTarget)},t.prototype._checkLimits=function(){null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit),null!==this.lowerHeightOffsetLimit&&this.heightOffset<this.lowerHeightOffsetLimit&&(this.heightOffset=this.lowerHeightOffsetLimit),null!==this.upperHeightOffsetLimit&&this.heightOffset>this.upperHeightOffsetLimit&&(this.heightOffset=this.upperHeightOffsetLimit),null!==this.lowerRotationOffsetLimit&&this.rotationOffset<this.lowerRotationOffsetLimit&&(this.rotationOffset=this.lowerRotationOffsetLimit),null!==this.upperRotationOffsetLimit&&this.rotationOffset>this.upperRotationOffsetLimit&&(this.rotationOffset=this.upperRotationOffsetLimit)},t.prototype.getClassName=function(){return"FollowCamera"},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"radius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"rotationOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerRotationOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperRotationOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"heightOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerHeightOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperHeightOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"cameraAcceleration",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"maxCameraSpeed",void 0),Object(n.__decorate)([Object(i.serializeAsMeshReference)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(s.TargetCamera),d=function(e){function t(t,r,n,i,o,s){var l=e.call(this,t,a.Vector3.Zero(),s)||this;return l.alpha=r,l.beta=n,l.radius=i,l.target=o,l._cartesianCoordinates=a.Vector3.Zero(),l._follow(),l}return Object(n.__extends)(t,e),t.prototype._follow=function(){if(this.target){this._cartesianCoordinates.x=this.radius*Math.cos(this.alpha)*Math.cos(this.beta),this._cartesianCoordinates.y=this.radius*Math.sin(this.beta),this._cartesianCoordinates.z=this.radius*Math.sin(this.alpha)*Math.cos(this.beta);var e=this.target.getAbsolutePosition();this.position=e.add(this._cartesianCoordinates),this.setTarget(e)}},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._follow()},t.prototype.getClassName=function(){return"ArcFollowCamera"},t}(s.TargetCamera)},"./Cameras/followCameraInputsManager.ts":
- /*!**********************************************!*\
- !*** ./Cameras/followCameraInputsManager.ts ***!
- \**********************************************/
- /*! exports provided: FollowCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraInputsManager",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./cameraInputsManager */"./Cameras/cameraInputsManager.ts"),o=r(/*! ./Inputs/followCameraKeyboardMoveInput */"./Cameras/Inputs/followCameraKeyboardMoveInput.ts"),s=r(/*! ./Inputs/followCameraMouseWheelInput */"./Cameras/Inputs/followCameraMouseWheelInput.ts"),a=r(/*! ./Inputs/followCameraPointersInput */"./Cameras/Inputs/followCameraPointersInput.ts"),l=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),t.prototype.addKeyboard=function(){return this.add(new o.FollowCameraKeyboardMoveInput),this},t.prototype.addMouseWheel=function(){return this.add(new s.FollowCameraMouseWheelInput),this},t.prototype.addPointers=function(){return this.add(new a.FollowCameraPointersInput),this},t.prototype.addVRDeviceOrientation=function(){return console.warn("DeviceOrientation support not yet implemented for FollowCamera."),this},t}(i.CameraInputsManager)},"./Cameras/freeCamera.ts":
- /*!*******************************!*\
- !*** ./Cameras/freeCamera.ts ***!
- \*******************************/
- /*! exports provided: FreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCamera",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),l=r(/*! ./freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts"),c=function(e){function t(t,r,n,i){void 0===i&&(i=!0);var a=e.call(this,t,r,n,i)||this;return a.ellipsoid=new o.Vector3(.5,1,.5),a.ellipsoidOffset=new o.Vector3(0,0,0),a.checkCollisions=!1,a.applyGravity=!1,a._needMoveForGravity=!1,a._oldPosition=o.Vector3.Zero(),a._diffPosition=o.Vector3.Zero(),a._newPosition=o.Vector3.Zero(),a._collisionMask=-1,a._onCollisionPositionChange=function(e,t,r){var n;void 0===r&&(r=null),n=t,a._newPosition.copyFrom(n),a._newPosition.subtractToRef(a._oldPosition,a._diffPosition),a._diffPosition.length()>s.Engine.CollisionsEpsilon&&(a.position.addInPlace(a._diffPosition),a.onCollide&&r&&a.onCollide(r))},a.inputs=new l.FreeCameraInputsManager(a),a.inputs.addKeyboard().addMouse(),a}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"angularSensibility",{get:function(){var e=this.inputs.attached.mouse;return e?e.angularSensibility:0},set:function(e){var t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysUpward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUpward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUpward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysDownward",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDownward:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDownward=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!1,configurable:!0}),t.prototype.attachControl=function(e,t){this.inputs.attachElement(e,t)},t.prototype.detachControl=function(e){this.inputs.detachElement(e),this.cameraDirection=new o.Vector3(0,0,0),this.cameraRotation=new o.Vector2(0,0)},Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),t.prototype._collideWithWorld=function(e){(this.parent?o.Vector3.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position).subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);var t=this.getScene().collisionCoordinator;this._collider||(this._collider=t.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;var r=e;this.applyGravity&&(r=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,r,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=o.Vector3.Zero(),this._transformedDirection=o.Vector3.Zero()),this.inputs.checkInputs(),e.prototype._checkInputs.call(this)},t.prototype._decideIfNeedsToMove=function(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):e.prototype._updatePosition.call(this)},t.prototype.dispose=function(){this.inputs.clear(),e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"FreeCamera"},Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoid",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoidOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"checkCollisions",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"applyGravity",void 0),t}(a.TargetCamera)},"./Cameras/freeCameraInputsManager.ts":
- /*!********************************************!*\
- !*** ./Cameras/freeCameraInputsManager.ts ***!
- \********************************************/
- /*! exports provided: FreeCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraInputsManager",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./cameraInputsManager */"./Cameras/cameraInputsManager.ts"),o=r(/*! ../Cameras/Inputs/freeCameraKeyboardMoveInput */"./Cameras/Inputs/freeCameraKeyboardMoveInput.ts"),s=r(/*! ../Cameras/Inputs/freeCameraMouseInput */"./Cameras/Inputs/freeCameraMouseInput.ts"),a=r(/*! ../Cameras/Inputs/freeCameraTouchInput */"./Cameras/Inputs/freeCameraTouchInput.ts"),l=function(e){function t(t){var r=e.call(this,t)||this;return r._mouseInput=null,r}return Object(n.__extends)(t,e),t.prototype.addKeyboard=function(){return this.add(new o.FreeCameraKeyboardMoveInput),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this._mouseInput||(this._mouseInput=new s.FreeCameraMouseInput(e),this.add(this._mouseInput)),this},t.prototype.removeMouse=function(){return this._mouseInput&&this.remove(this._mouseInput),this},t.prototype.addTouch=function(){return this.add(new a.FreeCameraTouchInput),this},t.prototype.clear=function(){e.prototype.clear.call(this),this._mouseInput=null},t}(i.CameraInputsManager)},"./Cameras/gamepadCamera.ts":
- /*!**********************************!*\
- !*** ./Cameras/gamepadCamera.ts ***!
- \**********************************/
- /*! exports provided: GamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"GamepadCamera",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./universalCamera */"./Cameras/universalCamera.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts");r(/*! ../node */"./node.ts").Node.AddNodeConstructor("GamepadCamera",(function(e,t){return function(){return new s(e,o.Vector3.Zero(),t)}}));var s=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"GamepadCamera"},t}(i.UniversalCamera)},"./Cameras/index.ts":
- /*!**************************!*\
- !*** ./Cameras/index.ts ***!
- \**************************/
- /*! exports provided: ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FollowCameraKeyboardMoveInput, FollowCameraMouseWheelInput, FollowCameraPointersInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, FollowCameraInputsManager, GamepadCamera, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, UniversalCamera, VirtualJoysticksCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, OnAfterEnteringVRObservableEvent, VRExperienceHelper, WebVRFreeCamera */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Inputs/index */"./Cameras/Inputs/index.ts");r.d(t,"ArcRotateCameraGamepadInput",(function(){return n.ArcRotateCameraGamepadInput})),r.d(t,"ArcRotateCameraKeyboardMoveInput",(function(){return n.ArcRotateCameraKeyboardMoveInput})),r.d(t,"ArcRotateCameraMouseWheelInput",(function(){return n.ArcRotateCameraMouseWheelInput})),r.d(t,"ArcRotateCameraPointersInput",(function(){return n.ArcRotateCameraPointersInput})),r.d(t,"ArcRotateCameraVRDeviceOrientationInput",(function(){return n.ArcRotateCameraVRDeviceOrientationInput})),r.d(t,"FlyCameraKeyboardInput",(function(){return n.FlyCameraKeyboardInput})),r.d(t,"FlyCameraMouseInput",(function(){return n.FlyCameraMouseInput})),r.d(t,"FollowCameraKeyboardMoveInput",(function(){return n.FollowCameraKeyboardMoveInput})),r.d(t,"FollowCameraMouseWheelInput",(function(){return n.FollowCameraMouseWheelInput})),r.d(t,"FollowCameraPointersInput",(function(){return n.FollowCameraPointersInput})),r.d(t,"FreeCameraDeviceOrientationInput",(function(){return n.FreeCameraDeviceOrientationInput})),r.d(t,"FreeCameraGamepadInput",(function(){return n.FreeCameraGamepadInput})),r.d(t,"FreeCameraKeyboardMoveInput",(function(){return n.FreeCameraKeyboardMoveInput})),r.d(t,"FreeCameraMouseInput",(function(){return n.FreeCameraMouseInput})),r.d(t,"FreeCameraTouchInput",(function(){return n.FreeCameraTouchInput})),r.d(t,"FreeCameraVirtualJoystickInput",(function(){return n.FreeCameraVirtualJoystickInput}));var i=r(/*! ./cameraInputsManager */"./Cameras/cameraInputsManager.ts");r.d(t,"CameraInputTypes",(function(){return i.CameraInputTypes})),r.d(t,"CameraInputsManager",(function(){return i.CameraInputsManager}));var o=r(/*! ./camera */"./Cameras/camera.ts");r.d(t,"Camera",(function(){return o.Camera}));var s=r(/*! ./targetCamera */"./Cameras/targetCamera.ts");r.d(t,"TargetCamera",(function(){return s.TargetCamera}));var a=r(/*! ./freeCamera */"./Cameras/freeCamera.ts");r.d(t,"FreeCamera",(function(){return a.FreeCamera}));var l=r(/*! ./freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts");r.d(t,"FreeCameraInputsManager",(function(){return l.FreeCameraInputsManager}));var c=r(/*! ./touchCamera */"./Cameras/touchCamera.ts");r.d(t,"TouchCamera",(function(){return c.TouchCamera}));var u=r(/*! ./arcRotateCamera */"./Cameras/arcRotateCamera.ts");r.d(t,"ArcRotateCamera",(function(){return u.ArcRotateCamera}));var d=r(/*! ./arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts");r.d(t,"ArcRotateCameraInputsManager",(function(){return d.ArcRotateCameraInputsManager}));var h=r(/*! ./deviceOrientationCamera */"./Cameras/deviceOrientationCamera.ts");r.d(t,"DeviceOrientationCamera",(function(){return h.DeviceOrientationCamera}));var f=r(/*! ./flyCamera */"./Cameras/flyCamera.ts");r.d(t,"FlyCamera",(function(){return f.FlyCamera}));var p=r(/*! ./flyCameraInputsManager */"./Cameras/flyCameraInputsManager.ts");r.d(t,"FlyCameraInputsManager",(function(){return p.FlyCameraInputsManager}));var m=r(/*! ./followCamera */"./Cameras/followCamera.ts");r.d(t,"FollowCamera",(function(){return m.FollowCamera})),r.d(t,"ArcFollowCamera",(function(){return m.ArcFollowCamera}));var g=r(/*! ./followCameraInputsManager */"./Cameras/followCameraInputsManager.ts");r.d(t,"FollowCameraInputsManager",(function(){return g.FollowCameraInputsManager}));var _=r(/*! ./gamepadCamera */"./Cameras/gamepadCamera.ts");r.d(t,"GamepadCamera",(function(){return _.GamepadCamera}));var v=r(/*! ./Stereoscopic/index */"./Cameras/Stereoscopic/index.ts");r.d(t,"AnaglyphArcRotateCamera",(function(){return v.AnaglyphArcRotateCamera})),r.d(t,"AnaglyphFreeCamera",(function(){return v.AnaglyphFreeCamera})),r.d(t,"AnaglyphGamepadCamera",(function(){return v.AnaglyphGamepadCamera})),r.d(t,"AnaglyphUniversalCamera",(function(){return v.AnaglyphUniversalCamera})),r.d(t,"StereoscopicArcRotateCamera",(function(){return v.StereoscopicArcRotateCamera})),r.d(t,"StereoscopicFreeCamera",(function(){return v.StereoscopicFreeCamera})),r.d(t,"StereoscopicGamepadCamera",(function(){return v.StereoscopicGamepadCamera})),r.d(t,"StereoscopicUniversalCamera",(function(){return v.StereoscopicUniversalCamera}));var y=r(/*! ./universalCamera */"./Cameras/universalCamera.ts");r.d(t,"UniversalCamera",(function(){return y.UniversalCamera}));var b=r(/*! ./virtualJoysticksCamera */"./Cameras/virtualJoysticksCamera.ts");r.d(t,"VirtualJoysticksCamera",(function(){return b.VirtualJoysticksCamera}));var A=r(/*! ./VR/index */"./Cameras/VR/index.ts");r.d(t,"VRCameraMetrics",(function(){return A.VRCameraMetrics})),r.d(t,"VRDeviceOrientationArcRotateCamera",(function(){return A.VRDeviceOrientationArcRotateCamera})),r.d(t,"VRDeviceOrientationFreeCamera",(function(){return A.VRDeviceOrientationFreeCamera})),r.d(t,"VRDeviceOrientationGamepadCamera",(function(){return A.VRDeviceOrientationGamepadCamera})),r.d(t,"OnAfterEnteringVRObservableEvent",(function(){return A.OnAfterEnteringVRObservableEvent})),r.d(t,"VRExperienceHelper",(function(){return A.VRExperienceHelper})),r.d(t,"WebVRFreeCamera",(function(){return A.WebVRFreeCamera})),r(/*! ./RigModes/index */"./Cameras/RigModes/index.ts")},"./Cameras/targetCamera.ts":
- /*!*********************************!*\
- !*** ./Cameras/targetCamera.ts ***!
- \*********************************/
- /*! exports provided: TargetCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"TargetCamera",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ./camera */"./Cameras/camera.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),l=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),c=function(e){function t(t,r,n,i){void 0===i&&(i=!0);var o=e.call(this,t,r,n,i)||this;return o._tmpUpVector=s.Vector3.Zero(),o._tmpTargetVector=s.Vector3.Zero(),o.cameraDirection=new s.Vector3(0,0,0),o.cameraRotation=new s.Vector2(0,0),o.ignoreParentScaling=!1,o.updateUpVectorFromRotation=!1,o._tmpQuaternion=new s.Quaternion,o.rotation=new s.Vector3(0,0,0),o.speed=2,o.noRotationConstraint=!1,o.invertRotation=!1,o.inverseRotationSpeed=.2,o.lockedTarget=null,o._currentTarget=s.Vector3.Zero(),o._initialFocalDistance=1,o._viewMatrix=s.Matrix.Zero(),o._camMatrix=s.Matrix.Zero(),o._cameraTransformMatrix=s.Matrix.Zero(),o._cameraRotationMatrix=s.Matrix.Zero(),o._referencePoint=new s.Vector3(0,0,1),o._transformedReferencePoint=s.Vector3.Zero(),o._defaultUp=s.Vector3.Up(),o._cachedRotationZ=0,o._cachedQuaternionRotationZ=0,o}return Object(n.__extends)(t,e),t.prototype.getFrontPosition=function(e){this.getWorldMatrix();var t=this.getTarget().subtract(this.position);return t.normalize(),t.scaleInPlace(e),this.globalPosition.add(t)},t.prototype._getLockedTargetPosition=function(){return this.lockedTarget?(this.lockedTarget.absolutePosition&&this.lockedTarget.computeWorldMatrix(),this.lockedTarget.absolutePosition||this.lockedTarget):null},t.prototype.storeState=function(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.lockedTarget=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new s.Quaternion(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this);var r=this._getLockedTargetPosition();r?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(r):this._cache.lockedTarget=r.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)},t.prototype._isSynchronizedViewMatrix=function(){if(!e.prototype._isSynchronizedViewMatrix.call(this))return!1;var t=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(t):!t)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))},t.prototype._computeLocalCameraSpeed=function(){var e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(100*e.getFps()))},t.prototype.setTarget=function(e){this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=a.Epsilon),s.Matrix.LookAtLHToRef(this.position,e,this._defaultUp,this._camMatrix),this._camMatrix.invert(),this.rotation.x=Math.atan(this._camMatrix.m[6]/this._camMatrix.m[10]);var t=e.subtract(this.position);t.x>=0?this.rotation.y=-Math.atan(t.z/t.x)+Math.PI/2:this.rotation.y=-Math.atan(t.z/t.x)-Math.PI/2,this.rotation.z=0,isNaN(this.rotation.x)&&(this.rotation.x=0),isNaN(this.rotation.y)&&(this.rotation.y=0),isNaN(this.rotation.z)&&(this.rotation.z=0),this.rotationQuaternion&&s.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)},t.prototype.getTarget=function(){return this._currentTarget},t.prototype._decideIfNeedsToMove=function(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){if(this.parent)return this.parent.getWorldMatrix().invertToRef(s.TmpVectors.Matrix[0]),s.Vector3.TransformNormalToRef(this.cameraDirection,s.TmpVectors.Matrix[0],s.TmpVectors.Vector3[0]),void this.position.addInPlace(s.TmpVectors.Vector3[0]);this.position.addInPlace(this.cameraDirection)},t.prototype._checkInputs=function(){var t=this.invertRotation?-this.inverseRotationSpeed:1,r=this._decideIfNeedsToMove(),n=Math.abs(this.cameraRotation.x)>0||Math.abs(this.cameraRotation.y)>0;r&&this._updatePosition(),n&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this.rotation),this.rotation.x+=this.cameraRotation.x*t,this.rotation.y+=this.cameraRotation.y*t,this.noRotationConstraint||(this.rotation.x>1.570796&&(this.rotation.x=1.570796),this.rotation.x<-1.570796&&(this.rotation.x=-1.570796)),this.rotationQuaternion&&this.rotation.lengthSquared()&&s.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)),r&&(Math.abs(this.cameraDirection.x)<this.speed*a.Epsilon&&(this.cameraDirection.x=0),Math.abs(this.cameraDirection.y)<this.speed*a.Epsilon&&(this.cameraDirection.y=0),Math.abs(this.cameraDirection.z)<this.speed*a.Epsilon&&(this.cameraDirection.z=0),this.cameraDirection.scaleInPlace(this.inertia)),n&&(Math.abs(this.cameraRotation.x)<this.speed*a.Epsilon&&(this.cameraRotation.x=0),Math.abs(this.cameraRotation.y)<this.speed*a.Epsilon&&(this.cameraRotation.y=0),this.cameraRotation.scaleInPlace(this.inertia)),e.prototype._checkInputs.call(this)},t.prototype._updateCameraRotationMatrix=function(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):s.Matrix.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)},t.prototype._rotateUpVectorWithCameraRotationMatrix=function(){return s.Vector3.TransformNormalToRef(this._defaultUp,this._cameraRotationMatrix,this.upVector),this},t.prototype._getViewMatrix=function(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!=this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),s.Vector3.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?l.Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(s.Quaternion.FromEulerVectorToRef(this.rotation,this._tmpQuaternion),l.Axis.Y.rotateByQuaternionToRef(this._tmpQuaternion,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix},t.prototype._computeViewMatrix=function(e,t,r){if(this.ignoreParentScaling){if(this.parent){var n=this.parent.getWorldMatrix();s.Vector3.TransformCoordinatesToRef(e,n,this._globalPosition),s.Vector3.TransformCoordinatesToRef(t,n,this._tmpTargetVector),s.Vector3.TransformNormalToRef(r,n,this._tmpUpVector),this._markSyncedWithParent()}else this._globalPosition.copyFrom(e),this._tmpTargetVector.copyFrom(t),this._tmpUpVector.copyFrom(r);this.getScene().useRightHandedSystem?s.Matrix.LookAtRHToRef(this._globalPosition,this._tmpTargetVector,this._tmpUpVector,this._viewMatrix):s.Matrix.LookAtLHToRef(this._globalPosition,this._tmpTargetVector,this._tmpUpVector,this._viewMatrix)}else this.getScene().useRightHandedSystem?s.Matrix.LookAtRHToRef(e,t,r,this._viewMatrix):s.Matrix.LookAtLHToRef(e,t,r,this._viewMatrix),this.parent?(n=this.parent.getWorldMatrix(),this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(n,this._viewMatrix),this._viewMatrix.getTranslationToRef(this._globalPosition),this._viewMatrix.invert(),this._markSyncedWithParent()):this._globalPosition.copyFrom(e)},t.prototype.createRigCamera=function(e,r){if(this.cameraRigMode!==o.Camera.RIG_MODE_NONE){var n=new t(e,this.position.clone(),this.getScene());return n.isRigCamera=!0,n.rigParent=this,this.cameraRigMode!==o.Camera.RIG_MODE_VR&&this.cameraRigMode!==o.Camera.RIG_MODE_WEBVR||(this.rotationQuaternion||(this.rotationQuaternion=new s.Quaternion),n._cameraRigParams={},n.rotationQuaternion=new s.Quaternion),n}return null},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],r=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case o.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case o.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case o.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:var n=this.cameraRigMode===o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,i=this.cameraRigMode===o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*n,t),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*i,r);break;case o.Camera.RIG_MODE_VR:t.rotationQuaternion?(t.rotationQuaternion.copyFrom(this.rotationQuaternion),r.rotationQuaternion.copyFrom(this.rotationQuaternion)):(t.rotation.copyFrom(this.rotation),r.rotation.copyFrom(this.rotation)),t.position.copyFrom(this.position),r.position.copyFrom(this.position)}e.prototype._updateRigCameras.call(this)},t.prototype._getRigCamPositionAndTarget=function(e,r){this.getTarget().subtractToRef(this.position,t._TargetFocalPoint),t._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);var n=t._TargetFocalPoint.addInPlace(this.position);s.Matrix.TranslationToRef(-n.x,-n.y,-n.z,t._TargetTransformMatrix),t._TargetTransformMatrix.multiplyToRef(s.Matrix.RotationAxis(r.upVector,e),t._RigCamTransformMatrix),s.Matrix.TranslationToRef(n.x,n.y,n.z,t._TargetTransformMatrix),t._RigCamTransformMatrix.multiplyToRef(t._TargetTransformMatrix,t._RigCamTransformMatrix),s.Vector3.TransformCoordinatesToRef(this.position,t._RigCamTransformMatrix,r.position),r.setTarget(n)},t.prototype.getClassName=function(){return"TargetCamera"},t._RigCamTransformMatrix=new s.Matrix,t._TargetTransformMatrix=new s.Matrix,t._TargetFocalPoint=new s.Vector3,Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"rotation",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"speed",void 0),Object(n.__decorate)([Object(i.serializeAsMeshReference)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(o.Camera)},"./Cameras/touchCamera.ts":
- /*!********************************!*\
- !*** ./Cameras/touchCamera.ts ***!
- \********************************/
- /*! exports provided: TouchCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"TouchCamera",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./freeCamera */"./Cameras/freeCamera.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts");r(/*! ../node */"./node.ts").Node.AddNodeConstructor("TouchCamera",(function(e,t){return function(){return new s(e,o.Vector3.Zero(),t)}}));var s=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i.inputs.addTouch(),i._setupInputs(),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"touchAngularSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchAngularSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchAngularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"touchMoveSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchMoveSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchMoveSensibility=e)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"TouchCamera"},t.prototype._setupInputs=function(){var e=this.inputs.attached.mouse;e&&(e.touchEnabled=!1)},t}(i.FreeCamera)},"./Cameras/universalCamera.ts":
- /*!************************************!*\
- !*** ./Cameras/universalCamera.ts ***!
- \************************************/
- /*! exports provided: UniversalCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"UniversalCamera",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./touchCamera */"./Cameras/touchCamera.ts"),o=r(/*! ../node */"./node.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./camera */"./Cameras/camera.ts");r(/*! ../Gamepads/gamepadSceneComponent */"./Gamepads/gamepadSceneComponent.ts"),o.Node.AddNodeConstructor("FreeCamera",(function(e,t){return function(){return new l(e,s.Vector3.Zero(),t)}}));var l=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i.inputs.addGamepad(),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"gamepadAngularSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadAngularSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadAngularSensibility=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gamepadMoveSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadMoveSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadMoveSensibility=e)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"UniversalCamera"},t}(i.TouchCamera);a.Camera._createDefaultParsedCamera=function(e,t){return new l(e,s.Vector3.Zero(),t)}},"./Cameras/virtualJoysticksCamera.ts":
- /*!*******************************************!*\
- !*** ./Cameras/virtualJoysticksCamera.ts ***!
- \*******************************************/
- /*! exports provided: VirtualJoysticksCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"VirtualJoysticksCamera",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./freeCamera */"./Cameras/freeCamera.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../node */"./node.ts");r(/*! ./Inputs/freeCameraVirtualJoystickInput */"./Cameras/Inputs/freeCameraVirtualJoystickInput.ts"),s.Node.AddNodeConstructor("VirtualJoysticksCamera",(function(e,t){return function(){return new a(e,o.Vector3.Zero(),t)}}));var a=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i.inputs.addVirtualJoystick(),i}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VirtualJoysticksCamera"},t}(i.FreeCamera)},"./Collisions/collider.ts":
- /*!********************************!*\
- !*** ./Collisions/collider.ts ***!
- \********************************/
- /*! exports provided: Collider */function(e,t,r){"use strict";r.r(t),r.d(t,"Collider",(function(){return a}));var n,i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.plane */"./Maths/math.plane.ts"),s=(n={root:0,found:!1},function(e,t,r,i){n.root=0,n.found=!1;var o=t*t-4*e*r;if(o<0)return n;var s=Math.sqrt(o),a=(-t-s)/(2*e),l=(-t+s)/(2*e);if(a>l){var c=l;l=a,a=c}return a>0&&a<i?(n.root=a,n.found=!0,n):l>0&&l<i?(n.root=l,n.found=!0,n):n}),a=function(){function e(){this._collisionPoint=i.Vector3.Zero(),this._planeIntersectionPoint=i.Vector3.Zero(),this._tempVector=i.Vector3.Zero(),this._tempVector2=i.Vector3.Zero(),this._tempVector3=i.Vector3.Zero(),this._tempVector4=i.Vector3.Zero(),this._edge=i.Vector3.Zero(),this._baseToVertex=i.Vector3.Zero(),this._destinationPoint=i.Vector3.Zero(),this._slidePlaneNormal=i.Vector3.Zero(),this._displacementVector=i.Vector3.Zero(),this._radius=i.Vector3.One(),this._retry=0,this._basePointWorld=i.Vector3.Zero(),this._velocityWorld=i.Vector3.Zero(),this._normalizedVelocity=i.Vector3.Zero(),this._collisionMask=-1}return Object.defineProperty(e.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slidePlaneNormal",{get:function(){return this._slidePlaneNormal},enumerable:!1,configurable:!0}),e.prototype._initialize=function(e,t,r){this._velocity=t,i.Vector3.NormalizeToRef(t,this._normalizedVelocity),this._basePoint=e,e.multiplyToRef(this._radius,this._basePointWorld),t.multiplyToRef(this._radius,this._velocityWorld),this._velocityWorldLength=this._velocityWorld.length(),this._epsilon=r,this.collisionFound=!1},e.prototype._checkPointInTriangle=function(e,t,r,n,o){t.subtractToRef(e,this._tempVector),r.subtractToRef(e,this._tempVector2),i.Vector3.CrossToRef(this._tempVector,this._tempVector2,this._tempVector4);var s=i.Vector3.Dot(this._tempVector4,o);return!(s<0)&&(n.subtractToRef(e,this._tempVector3),i.Vector3.CrossToRef(this._tempVector2,this._tempVector3,this._tempVector4),!((s=i.Vector3.Dot(this._tempVector4,o))<0)&&(i.Vector3.CrossToRef(this._tempVector3,this._tempVector,this._tempVector4),(s=i.Vector3.Dot(this._tempVector4,o))>=0))},e.prototype._canDoCollision=function(e,t,r,n){var o=i.Vector3.Distance(this._basePointWorld,e),s=Math.max(this._radius.x,this._radius.y,this._radius.z);return!(o>this._velocityWorldLength+s+t||!function(e,t,r,n){return!(e.x>r.x+n||r.x-n>t.x||e.y>r.y+n||r.y-n>t.y||e.z>r.z+n||r.z-n>t.z)}(r,n,this._basePointWorld,this._velocityWorldLength+s))},e.prototype._testTriangle=function(e,t,r,n,a,l,c){var u,d=!1;t||(t=[]),t[e]||(t[e]=new o.Plane(0,0,0,0),t[e].copyFromPoints(r,n,a));var h=t[e];if(l||h.isFrontFacingTo(this._normalizedVelocity,0)){var f=h.signedDistanceTo(this._basePoint),p=i.Vector3.Dot(h.normal,this._velocity);if(0==p){if(Math.abs(f)>=1)return;d=!0,u=0}else{var m=(1-f)/p;if((u=(-1-f)/p)>m){var g=m;m=u,u=g}if(u>1||m<0)return;u<0&&(u=0),u>1&&(u=1)}this._collisionPoint.copyFromFloats(0,0,0);var _=!1,v=1;if(d||(this._basePoint.subtractToRef(h.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(u,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,r,n,a,h.normal)&&(_=!0,v=u,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!_){var y=this._velocity.lengthSquared(),b=y;this._basePoint.subtractToRef(r,this._tempVector);var A=2*i.Vector3.Dot(this._velocity,this._tempVector),T=this._tempVector.lengthSquared()-1,M=s(b,A,T,v);M.found&&(v=M.root,_=!0,this._collisionPoint.copyFrom(r)),this._basePoint.subtractToRef(n,this._tempVector),A=2*i.Vector3.Dot(this._velocity,this._tempVector),T=this._tempVector.lengthSquared()-1,(M=s(b,A,T,v)).found&&(v=M.root,_=!0,this._collisionPoint.copyFrom(n)),this._basePoint.subtractToRef(a,this._tempVector),A=2*i.Vector3.Dot(this._velocity,this._tempVector),T=this._tempVector.lengthSquared()-1,(M=s(b,A,T,v)).found&&(v=M.root,_=!0,this._collisionPoint.copyFrom(a)),n.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex);var P=this._edge.lengthSquared(),S=i.Vector3.Dot(this._edge,this._velocity),E=i.Vector3.Dot(this._edge,this._baseToVertex);if(b=P*-y+S*S,A=P*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*S*E,T=P*(1-this._baseToVertex.lengthSquared())+E*E,(M=s(b,A,T,v)).found){var C=(S*M.root-E)/P;C>=0&&C<=1&&(v=M.root,_=!0,this._edge.scaleInPlace(C),r.addToRef(this._edge,this._collisionPoint))}a.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),P=this._edge.lengthSquared(),S=i.Vector3.Dot(this._edge,this._velocity),E=i.Vector3.Dot(this._edge,this._baseToVertex),b=P*-y+S*S,A=P*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*S*E,T=P*(1-this._baseToVertex.lengthSquared())+E*E,(M=s(b,A,T,v)).found&&(C=(S*M.root-E)/P)>=0&&C<=1&&(v=M.root,_=!0,this._edge.scaleInPlace(C),n.addToRef(this._edge,this._collisionPoint)),r.subtractToRef(a,this._edge),a.subtractToRef(this._basePoint,this._baseToVertex),P=this._edge.lengthSquared(),S=i.Vector3.Dot(this._edge,this._velocity),E=i.Vector3.Dot(this._edge,this._baseToVertex),b=P*-y+S*S,A=P*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*S*E,T=P*(1-this._baseToVertex.lengthSquared())+E*E,(M=s(b,A,T,v)).found&&(C=(S*M.root-E)/P)>=0&&C<=1&&(v=M.root,_=!0,this._edge.scaleInPlace(C),a.addToRef(this._edge,this._collisionPoint))}if(_){var x=v*this._velocity.length();(!this.collisionFound||x<this._nearestDistance)&&(this.intersectionPoint?this.intersectionPoint.copyFrom(this._collisionPoint):this.intersectionPoint=this._collisionPoint.clone(),this._nearestDistance=x,this.collisionFound=!0,this.collidedMesh=c)}}},e.prototype._collide=function(e,t,r,n,i,o,s,a){for(var l=n;l<i;l+=3){var c=t[r[l]-o],u=t[r[l+1]-o],d=t[r[l+2]-o];this._testTriangle(l,e,d,u,c,s,a)}},e.prototype._getResponse=function(e,t){e.addToRef(t,this._destinationPoint),t.scaleInPlace(this._nearestDistance/t.length()),this._basePoint.addToRef(t,e),e.subtractToRef(this.intersectionPoint,this._slidePlaneNormal),this._slidePlaneNormal.normalize(),this._slidePlaneNormal.scaleToRef(this._epsilon,this._displacementVector),e.addInPlace(this._displacementVector),this.intersectionPoint.addInPlace(this._displacementVector),this._slidePlaneNormal.scaleInPlace(o.Plane.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint,this._slidePlaneNormal,this._destinationPoint)),this._destinationPoint.subtractInPlace(this._slidePlaneNormal),this._destinationPoint.subtractToRef(this.intersectionPoint,t)},e}()},"./Collisions/collisionCoordinator.ts":
- /*!********************************************!*\
- !*** ./Collisions/collisionCoordinator.ts ***!
- \********************************************/
- /*! exports provided: DefaultCollisionCoordinator */function(e,t,r){"use strict";r.r(t),r.d(t,"DefaultCollisionCoordinator",(function(){return a}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ./collider */"./Collisions/collider.ts"),a=function(){function e(){this._scaledPosition=i.Vector3.Zero(),this._scaledVelocity=i.Vector3.Zero(),this._finalPosition=i.Vector3.Zero()}return e.prototype.getNewPosition=function(e,t,r,n,i,o,s){e.divideToRef(r._radius,this._scaledPosition),t.divideToRef(r._radius,this._scaledVelocity),r.collidedMesh=null,r._retry=0,r._initialVelocity=this._scaledVelocity,r._initialPosition=this._scaledPosition,this._collideWithWorld(this._scaledPosition,this._scaledVelocity,r,n,this._finalPosition,i),this._finalPosition.multiplyInPlace(r._radius),o(s,this._finalPosition,r.collidedMesh)},e.prototype.createCollider=function(){return new s.Collider},e.prototype.init=function(e){this._scene=e},e.prototype._collideWithWorld=function(e,t,r,n,i,s){void 0===s&&(s=null);var a=10*o.Engine.CollisionsEpsilon;if(r._retry>=n)i.copyFrom(e);else{var l=s?s.collisionMask:r.collisionMask;r._initialize(e,t,a);for(var c=s&&s.surroundingMeshes||this._scene.meshes,u=0;u<c.length;u++){var d=c[u];d.isEnabled()&&d.checkCollisions&&d.subMeshes&&d!==s&&0!=(l&d.collisionGroup)&&d._checkCollision(r)}r.collisionFound?(0===t.x&&0===t.y&&0===t.z||r._getResponse(e,t),t.length()<=a?i.copyFrom(e):(r._retry++,this._collideWithWorld(e,t,r,n,i,s))):e.addToRef(t,i)}},e}();n.Scene.CollisionCoordinatorFactory=function(){return new a}},"./Collisions/index.ts":
- /*!*****************************!*\
- !*** ./Collisions/index.ts ***!
- \*****************************/
- /*! exports provided: Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, _MeshCollisionData */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./collider */"./Collisions/collider.ts");r.d(t,"Collider",(function(){return n.Collider}));var i=r(/*! ./collisionCoordinator */"./Collisions/collisionCoordinator.ts");r.d(t,"DefaultCollisionCoordinator",(function(){return i.DefaultCollisionCoordinator}));var o=r(/*! ./pickingInfo */"./Collisions/pickingInfo.ts");r.d(t,"PickingInfo",(function(){return o.PickingInfo}));var s=r(/*! ./intersectionInfo */"./Collisions/intersectionInfo.ts");r.d(t,"IntersectionInfo",(function(){return s.IntersectionInfo}));var a=r(/*! ./meshCollisionData */"./Collisions/meshCollisionData.ts");r.d(t,"_MeshCollisionData",(function(){return a._MeshCollisionData}))},"./Collisions/intersectionInfo.ts":
- /*!****************************************!*\
- !*** ./Collisions/intersectionInfo.ts ***!
- \****************************************/
- /*! exports provided: IntersectionInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"IntersectionInfo",(function(){return n}));var n=function(e,t,r){this.bu=e,this.bv=t,this.distance=r,this.faceId=0,this.subMeshId=0}},"./Collisions/meshCollisionData.ts":
- /*!*****************************************!*\
- !*** ./Collisions/meshCollisionData.ts ***!
- \*****************************************/
- /*! exports provided: _MeshCollisionData */function(e,t,r){"use strict";r.r(t),r.d(t,"_MeshCollisionData",(function(){return i}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=function(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new n.Vector3(0,0,0),this._diffPositionForCollisions=new n.Vector3(0,0,0)}},"./Collisions/pickingInfo.ts":
- /*!***********************************!*\
- !*** ./Collisions/pickingInfo.ts ***!
- \***********************************/
- /*! exports provided: PickingInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"PickingInfo",(function(){return o}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=function(){function e(){this._pickingUnavailable=!1,this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.originMesh=null,this.ray=null}return e.prototype.getNormal=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!0),!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(i.VertexBuffer.NormalKind))return null;var r,o=this.pickedMesh.getIndices();if(!o)return null;if(t){var s=this.pickedMesh.getVerticesData(i.VertexBuffer.NormalKind),a=n.Vector3.FromArray(s,3*o[3*this.faceId]),l=n.Vector3.FromArray(s,3*o[3*this.faceId+1]),c=n.Vector3.FromArray(s,3*o[3*this.faceId+2]);a=a.scale(this.bu),l=l.scale(this.bv),c=c.scale(1-this.bu-this.bv),r=new n.Vector3(a.x+l.x+c.x,a.y+l.y+c.y,a.z+l.z+c.z)}else{var u=this.pickedMesh.getVerticesData(i.VertexBuffer.PositionKind),d=n.Vector3.FromArray(u,3*o[3*this.faceId]),h=n.Vector3.FromArray(u,3*o[3*this.faceId+1]),f=n.Vector3.FromArray(u,3*o[3*this.faceId+2]),p=d.subtract(h),m=f.subtract(h);r=n.Vector3.Cross(p,m)}if(e){var g=this.pickedMesh.getWorldMatrix();this.pickedMesh.nonUniformScaling&&(n.TmpVectors.Matrix[0].copyFrom(g),(g=n.TmpVectors.Matrix[0]).setTranslationFromFloats(0,0,0),g.invert(),g.transposeToRef(n.TmpVectors.Matrix[1]),g=n.TmpVectors.Matrix[1]),r=n.Vector3.TransformNormal(r,g)}return r.normalize(),r},e.prototype.getTextureCoordinates=function(){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(i.VertexBuffer.UVKind))return null;var e=this.pickedMesh.getIndices();if(!e)return null;var t=this.pickedMesh.getVerticesData(i.VertexBuffer.UVKind);if(!t)return null;var r=n.Vector2.FromArray(t,2*e[3*this.faceId]),o=n.Vector2.FromArray(t,2*e[3*this.faceId+1]),s=n.Vector2.FromArray(t,2*e[3*this.faceId+2]);return r=r.scale(this.bu),o=o.scale(this.bv),s=s.scale(1-this.bu-this.bv),new n.Vector2(r.x+o.x+s.x,r.y+o.y+s.y)},e}()},"./Culling/Octrees/index.ts":
- /*!**********************************!*\
- !*** ./Culling/Octrees/index.ts ***!
- \**********************************/
- /*! exports provided: Octree, OctreeBlock, OctreeSceneComponent */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./octree */"./Culling/Octrees/octree.ts");r.d(t,"Octree",(function(){return n.Octree}));var i=r(/*! ./octreeBlock */"./Culling/Octrees/octreeBlock.ts");r.d(t,"OctreeBlock",(function(){return i.OctreeBlock}));var o=r(/*! ./octreeSceneComponent */"./Culling/Octrees/octreeSceneComponent.ts");r.d(t,"OctreeSceneComponent",(function(){return o.OctreeSceneComponent}))},"./Culling/Octrees/octree.ts":
- /*!***********************************!*\
- !*** ./Culling/Octrees/octree.ts ***!
- \***********************************/
- /*! exports provided: Octree */function(e,t,r){"use strict";r.r(t),r.d(t,"Octree",(function(){return o}));var n=r(/*! ../../Misc/smartArray */"./Misc/smartArray.ts"),i=r(/*! ./octreeBlock */"./Culling/Octrees/octreeBlock.ts"),o=function(){function e(e,t,r){void 0===r&&(r=2),this.maxDepth=r,this.dynamicContent=new Array,this._maxBlockCapacity=t||64,this._selectionContent=new n.SmartArrayNoDuplicate(1024),this._creationFunc=e}return e.prototype.update=function(e,t,r){i.OctreeBlock._CreateBlocks(e,t,r,this._maxBlockCapacity,0,this.maxDepth,this,this._creationFunc)},e.prototype.addMesh=function(e){for(var t=0;t<this.blocks.length;t++)this.blocks[t].addEntry(e)},e.prototype.removeMesh=function(e){for(var t=0;t<this.blocks.length;t++)this.blocks[t].removeEntry(e)},e.prototype.select=function(e,t){this._selectionContent.reset();for(var r=0;r<this.blocks.length;r++)this.blocks[r].select(e,this._selectionContent,t);return t?this._selectionContent.concat(this.dynamicContent):this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent},e.prototype.intersects=function(e,t,r){this._selectionContent.reset();for(var n=0;n<this.blocks.length;n++)this.blocks[n].intersects(e,t,this._selectionContent,r);return r?this._selectionContent.concat(this.dynamicContent):this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent},e.prototype.intersectsRay=function(e){this._selectionContent.reset();for(var t=0;t<this.blocks.length;t++)this.blocks[t].intersectsRay(e,this._selectionContent);return this._selectionContent.concatWithNoDuplicate(this.dynamicContent),this._selectionContent},e.CreationFuncForMeshes=function(e,t){var r=e.getBoundingInfo();!e.isBlocked&&r.boundingBox.intersectsMinMax(t.minPoint,t.maxPoint)&&t.entries.push(e)},e.CreationFuncForSubMeshes=function(e,t){e.getBoundingInfo().boundingBox.intersectsMinMax(t.minPoint,t.maxPoint)&&t.entries.push(e)},e}()},"./Culling/Octrees/octreeBlock.ts":
- /*!****************************************!*\
- !*** ./Culling/Octrees/octreeBlock.ts ***!
- \****************************************/
- /*! exports provided: OctreeBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"OctreeBlock",(function(){return o}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Culling/boundingBox */"./Culling/boundingBox.ts"),o=function(){function e(e,t,r,n,i,o){this.entries=new Array,this._boundingVectors=new Array,this._capacity=r,this._depth=n,this._maxDepth=i,this._creationFunc=o,this._minPoint=e,this._maxPoint=t,this._boundingVectors.push(e.clone()),this._boundingVectors.push(t.clone()),this._boundingVectors.push(e.clone()),this._boundingVectors[2].x=t.x,this._boundingVectors.push(e.clone()),this._boundingVectors[3].y=t.y,this._boundingVectors.push(e.clone()),this._boundingVectors[4].z=t.z,this._boundingVectors.push(t.clone()),this._boundingVectors[5].z=e.z,this._boundingVectors.push(t.clone()),this._boundingVectors[6].x=e.x,this._boundingVectors.push(t.clone()),this._boundingVectors[7].y=e.y}return Object.defineProperty(e.prototype,"capacity",{get:function(){return this._capacity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minPoint",{get:function(){return this._minPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxPoint",{get:function(){return this._maxPoint},enumerable:!1,configurable:!0}),e.prototype.addEntry=function(e){if(this.blocks)for(var t=0;t<this.blocks.length;t++)this.blocks[t].addEntry(e);else this._creationFunc(e,this),this.entries.length>this.capacity&&this._depth<this._maxDepth&&this.createInnerBlocks()},e.prototype.removeEntry=function(e){if(this.blocks)for(var t=0;t<this.blocks.length;t++)this.blocks[t].removeEntry(e);else{var r=this.entries.indexOf(e);r>-1&&this.entries.splice(r,1)}},e.prototype.addEntries=function(e){for(var t=0;t<e.length;t++){var r=e[t];this.addEntry(r)}},e.prototype.select=function(e,t,r){if(i.BoundingBox.IsInFrustum(this._boundingVectors,e)){if(this.blocks){for(var n=0;n<this.blocks.length;n++)this.blocks[n].select(e,t,r);return}r?t.concat(this.entries):t.concatWithNoDuplicate(this.entries)}},e.prototype.intersects=function(e,t,r,n){if(i.BoundingBox.IntersectsSphere(this._minPoint,this._maxPoint,e,t)){if(this.blocks){for(var o=0;o<this.blocks.length;o++)this.blocks[o].intersects(e,t,r,n);return}n?r.concat(this.entries):r.concatWithNoDuplicate(this.entries)}},e.prototype.intersectsRay=function(e,t){if(e.intersectsBoxMinMax(this._minPoint,this._maxPoint)){if(this.blocks){for(var r=0;r<this.blocks.length;r++)this.blocks[r].intersectsRay(e,t);return}t.concatWithNoDuplicate(this.entries)}},e.prototype.createInnerBlocks=function(){e._CreateBlocks(this._minPoint,this._maxPoint,this.entries,this._capacity,this._depth,this._maxDepth,this,this._creationFunc)},e._CreateBlocks=function(t,r,i,o,s,a,l,c){l.blocks=new Array;for(var u=new n.Vector3((r.x-t.x)/2,(r.y-t.y)/2,(r.z-t.z)/2),d=0;d<2;d++)for(var h=0;h<2;h++)for(var f=0;f<2;f++){var p=new e(t.add(u.multiplyByFloats(d,h,f)),t.add(u.multiplyByFloats(d+1,h+1,f+1)),o,s+1,a,c);p.addEntries(i),l.blocks.push(p)}},e}()},"./Culling/Octrees/octreeSceneComponent.ts":
- /*!*************************************************!*\
- !*** ./Culling/Octrees/octreeSceneComponent.ts ***!
- \*************************************************/
- /*! exports provided: OctreeSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"OctreeSceneComponent",(function(){return c}));var n=r(/*! ../../scene */"./scene.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../../Culling/ray */"./Culling/ray.ts"),a=r(/*! ../../sceneComponent */"./sceneComponent.ts"),l=r(/*! ./octree */"./Culling/Octrees/octree.ts");n.Scene.prototype.createOrUpdateSelectionOctree=function(e,t){void 0===e&&(e=64),void 0===t&&(t=2);var r=this._getComponent(a.SceneComponentConstants.NAME_OCTREE);r||(r=new c(this),this._addComponent(r)),this._selectionOctree||(this._selectionOctree=new l.Octree(l.Octree.CreationFuncForMeshes,e,t));var n=this.getWorldExtends();return this._selectionOctree.update(n.min,n.max,this.meshes),this._selectionOctree},Object.defineProperty(n.Scene.prototype,"selectionOctree",{get:function(){return this._selectionOctree},enumerable:!0,configurable:!0}),o.AbstractMesh.prototype.createOrUpdateSubmeshesOctree=function(e,t){void 0===e&&(e=64),void 0===t&&(t=2);var r=this.getScene(),n=r._getComponent(a.SceneComponentConstants.NAME_OCTREE);n||(n=new c(r),r._addComponent(n)),this._submeshesOctree||(this._submeshesOctree=new l.Octree(l.Octree.CreationFuncForSubMeshes,e,t)),this.computeWorldMatrix(!0);var i=this.getBoundingInfo().boundingBox;return this._submeshesOctree.update(i.minimumWorld,i.maximumWorld,this.subMeshes),this._submeshesOctree};var c=function(){function e(e){this.name=a.SceneComponentConstants.NAME_OCTREE,this.checksIsEnabled=!0,this._tempRay=new s.Ray(i.Vector3.Zero(),new i.Vector3(1,1,1)),this.scene=e,this.scene.getActiveMeshCandidates=this.getActiveMeshCandidates.bind(this),this.scene.getActiveSubMeshCandidates=this.getActiveSubMeshCandidates.bind(this),this.scene.getCollidingSubMeshCandidates=this.getCollidingSubMeshCandidates.bind(this),this.scene.getIntersectingSubMeshCandidates=this.getIntersectingSubMeshCandidates.bind(this)}return e.prototype.register=function(){var e=this;this.scene.onMeshRemovedObservable.add((function(t){var r=e.scene.selectionOctree;if(null!=r){var n=r.dynamicContent.indexOf(t);-1!==n&&r.dynamicContent.splice(n,1)}})),this.scene.onMeshImportedObservable.add((function(t){var r=e.scene.selectionOctree;null!=r&&r.addMesh(t)}))},e.prototype.getActiveMeshCandidates=function(){return this.scene._selectionOctree?this.scene._selectionOctree.select(this.scene.frustumPlanes):this.scene._getDefaultMeshCandidates()},e.prototype.getActiveSubMeshCandidates=function(e){return e._submeshesOctree&&e.useOctreeForRenderingSelection?e._submeshesOctree.select(this.scene.frustumPlanes):this.scene._getDefaultSubMeshCandidates(e)},e.prototype.getIntersectingSubMeshCandidates=function(e,t){return e._submeshesOctree&&e.useOctreeForPicking?(s.Ray.TransformToRef(t,e.getWorldMatrix(),this._tempRay),e._submeshesOctree.intersectsRay(this._tempRay)):this.scene._getDefaultSubMeshCandidates(e)},e.prototype.getCollidingSubMeshCandidates=function(e,t){if(e._submeshesOctree&&e.useOctreeForCollisions){var r=t._velocityWorldLength+Math.max(t._radius.x,t._radius.y,t._radius.z);return e._submeshesOctree.intersects(t._basePointWorld,r)}return this.scene._getDefaultSubMeshCandidates(e)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e}()},"./Culling/boundingBox.ts":
- /*!********************************!*\
- !*** ./Culling/boundingBox.ts ***!
- \********************************/
- /*! exports provided: BoundingBox */function(e,t,r){"use strict";r.r(t),r.d(t,"BoundingBox",(function(){return s}));var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),s=function(){function e(e,t,r){this.vectors=n.ArrayTools.BuildArray(8,i.Vector3.Zero),this.center=i.Vector3.Zero(),this.centerWorld=i.Vector3.Zero(),this.extendSize=i.Vector3.Zero(),this.extendSizeWorld=i.Vector3.Zero(),this.directions=n.ArrayTools.BuildArray(3,i.Vector3.Zero),this.vectorsWorld=n.ArrayTools.BuildArray(8,i.Vector3.Zero),this.minimumWorld=i.Vector3.Zero(),this.maximumWorld=i.Vector3.Zero(),this.minimum=i.Vector3.Zero(),this.maximum=i.Vector3.Zero(),this.reConstruct(e,t,r)}return e.prototype.reConstruct=function(e,t,r){var n=e.x,o=e.y,s=e.z,a=t.x,l=t.y,c=t.z,u=this.vectors;this.minimum.copyFromFloats(n,o,s),this.maximum.copyFromFloats(a,l,c),u[0].copyFromFloats(n,o,s),u[1].copyFromFloats(a,l,c),u[2].copyFromFloats(a,o,s),u[3].copyFromFloats(n,l,s),u[4].copyFromFloats(n,o,c),u[5].copyFromFloats(a,l,s),u[6].copyFromFloats(n,l,c),u[7].copyFromFloats(a,o,c),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=r||i.Matrix.IdentityReadOnly,this._update(this._worldMatrix)},e.prototype.scale=function(t){var r=e.TmpVector3,n=this.maximum.subtractToRef(this.minimum,r[0]),i=n.length();n.normalizeFromLength(i);var o=i*t,s=n.scaleInPlace(.5*o),a=this.center.subtractToRef(s,r[1]),l=this.center.addToRef(s,r[2]);return this.reConstruct(a,l,this._worldMatrix),this},e.prototype.getWorldMatrix=function(){return this._worldMatrix},e.prototype._update=function(e){var t=this.minimumWorld,r=this.maximumWorld,n=this.directions,o=this.vectorsWorld,s=this.vectors;if(e.isIdentity()){for(t.copyFrom(this.minimum),r.copyFrom(this.maximum),a=0;a<8;++a)o[a].copyFrom(s[a]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),r.setAll(-Number.MAX_VALUE);for(var a=0;a<8;++a){var l=o[a];i.Vector3.TransformCoordinatesToRef(s[a],e,l),t.minimizeInPlace(l),r.maximizeInPlace(l)}r.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),r.addToRef(t,this.centerWorld).scaleInPlace(.5)}i.Vector3.FromArrayToRef(e.m,0,n[0]),i.Vector3.FromArrayToRef(e.m,4,n[1]),i.Vector3.FromArrayToRef(e.m,8,n[2]),this._worldMatrix=e},e.prototype.isInFrustum=function(t){return e.IsInFrustum(this.vectorsWorld,t)},e.prototype.isCompletelyInFrustum=function(t){return e.IsCompletelyInFrustum(this.vectorsWorld,t)},e.prototype.intersectsPoint=function(e){var t=this.minimumWorld,r=this.maximumWorld,n=t.x,i=t.y,s=t.z,a=r.x,l=r.y,c=r.z,u=e.x,d=e.y,h=e.z,f=-o.Epsilon;return!(a-u<f||f>u-n||l-d<f||f>d-i||c-h<f||f>h-s)},e.prototype.intersectsSphere=function(t){return e.IntersectsSphere(this.minimumWorld,this.maximumWorld,t.centerWorld,t.radiusWorld)},e.prototype.intersectsMinMax=function(e,t){var r=this.minimumWorld,n=this.maximumWorld,i=r.x,o=r.y,s=r.z,a=n.x,l=n.y,c=n.z,u=e.x,d=e.y,h=e.z,f=t.x,p=t.y,m=t.z;return!(a<u||i>f||l<d||o>p||c<h||s>m)},e.Intersects=function(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)},e.IntersectsSphere=function(t,r,n,o){var s=e.TmpVector3[0];return i.Vector3.ClampToRef(n,t,r,s),i.Vector3.DistanceSquared(n,s)<=o*o},e.IsCompletelyInFrustum=function(e,t){for(var r=0;r<6;++r)for(var n=t[r],i=0;i<8;++i)if(n.dotCoordinate(e[i])<0)return!1;return!0},e.IsInFrustum=function(e,t){for(var r=0;r<6;++r){for(var n=!0,i=t[r],o=0;o<8;++o)if(i.dotCoordinate(e[o])>=0){n=!1;break}if(n)return!1}return!0},e.TmpVector3=n.ArrayTools.BuildArray(3,i.Vector3.Zero),e}()},"./Culling/boundingInfo.ts":
- /*!*********************************!*\
- !*** ./Culling/boundingInfo.ts ***!
- \*********************************/
- /*! exports provided: BoundingInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"BoundingInfo",(function(){return h}));var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=r(/*! ./boundingBox */"./Culling/boundingBox.ts"),a=r(/*! ./boundingSphere */"./Culling/boundingSphere.ts"),l={min:0,max:0},c={min:0,max:0},u=function(e,t,r){var n=i.Vector3.Dot(t.centerWorld,e),o=Math.abs(i.Vector3.Dot(t.directions[0],e))*t.extendSize.x+Math.abs(i.Vector3.Dot(t.directions[1],e))*t.extendSize.y+Math.abs(i.Vector3.Dot(t.directions[2],e))*t.extendSize.z;r.min=n-o,r.max=n+o},d=function(e,t,r){return u(e,t,l),u(e,r,c),!(l.min>c.max||c.min>l.max)},h=function(){function e(e,t,r){this._isLocked=!1,this.boundingBox=new s.BoundingBox(e,t,r),this.boundingSphere=new a.BoundingSphere(e,t,r)}return e.prototype.reConstruct=function(e,t,r){this.boundingBox.reConstruct(e,t,r),this.boundingSphere.reConstruct(e,t,r)},Object.defineProperty(e.prototype,"minimum",{get:function(){return this.boundingBox.minimum},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this.boundingBox.maximum},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLocked",{get:function(){return this._isLocked},set:function(e){this._isLocked=e},enumerable:!1,configurable:!0}),e.prototype.update=function(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))},e.prototype.centerOn=function(t,r){var n=e.TmpVector3[0].copyFrom(t).subtractInPlace(r),i=e.TmpVector3[1].copyFrom(t).addInPlace(r);return this.boundingBox.reConstruct(n,i,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(n,i,this.boundingBox.getWorldMatrix()),this},e.prototype.scale=function(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this},e.prototype.isInFrustum=function(e,t){return void 0===t&&(t=o.Constants.MESHES_CULLINGSTRATEGY_STANDARD),!(t!==o.Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION&&t!==o.Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY||!this.boundingSphere.isCenterInFrustum(e))||!!this.boundingSphere.isInFrustum(e)&&(!(t!==o.Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY&&t!==o.Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY)||this.boundingBox.isInFrustum(e))},Object.defineProperty(e.prototype,"diagonalLength",{get:function(){var t=this.boundingBox;return t.maximumWorld.subtractToRef(t.minimumWorld,e.TmpVector3[0]).length()},enumerable:!1,configurable:!0}),e.prototype.isCompletelyInFrustum=function(e){return this.boundingBox.isCompletelyInFrustum(e)},e.prototype._checkCollision=function(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)},e.prototype.intersectsPoint=function(e){return!!this.boundingSphere.centerWorld&&!!this.boundingSphere.intersectsPoint(e)&&!!this.boundingBox.intersectsPoint(e)},e.prototype.intersects=function(e,t){if(!a.BoundingSphere.Intersects(this.boundingSphere,e.boundingSphere))return!1;if(!s.BoundingBox.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;var r=this.boundingBox,n=e.boundingBox;return!!(d(r.directions[0],r,n)&&d(r.directions[1],r,n)&&d(r.directions[2],r,n)&&d(n.directions[0],r,n)&&d(n.directions[1],r,n)&&d(n.directions[2],r,n)&&d(i.Vector3.Cross(r.directions[0],n.directions[0]),r,n)&&d(i.Vector3.Cross(r.directions[0],n.directions[1]),r,n)&&d(i.Vector3.Cross(r.directions[0],n.directions[2]),r,n)&&d(i.Vector3.Cross(r.directions[1],n.directions[0]),r,n)&&d(i.Vector3.Cross(r.directions[1],n.directions[1]),r,n)&&d(i.Vector3.Cross(r.directions[1],n.directions[2]),r,n)&&d(i.Vector3.Cross(r.directions[2],n.directions[0]),r,n)&&d(i.Vector3.Cross(r.directions[2],n.directions[1]),r,n)&&d(i.Vector3.Cross(r.directions[2],n.directions[2]),r,n))},e.TmpVector3=n.ArrayTools.BuildArray(2,i.Vector3.Zero),e}()},"./Culling/boundingSphere.ts":
- /*!***********************************!*\
- !*** ./Culling/boundingSphere.ts ***!
- \***********************************/
- /*! exports provided: BoundingSphere */function(e,t,r){"use strict";r.r(t),r.d(t,"BoundingSphere",(function(){return o}));var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=function(){function e(e,t,r){this.center=i.Vector3.Zero(),this.centerWorld=i.Vector3.Zero(),this.minimum=i.Vector3.Zero(),this.maximum=i.Vector3.Zero(),this.reConstruct(e,t,r)}return e.prototype.reConstruct=function(e,t,r){this.minimum.copyFrom(e),this.maximum.copyFrom(t);var n=i.Vector3.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*n,this._update(r||i.Matrix.IdentityReadOnly)},e.prototype.scale=function(t){var r=this.radius*t,n=e.TmpVector3,i=n[0].setAll(r),o=this.center.subtractToRef(i,n[1]),s=this.center.addToRef(i,n[2]);return this.reConstruct(o,s,this._worldMatrix),this},e.prototype.getWorldMatrix=function(){return this._worldMatrix},e.prototype._update=function(t){if(t.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{i.Vector3.TransformCoordinatesToRef(this.center,t,this.centerWorld);var r=e.TmpVector3[0];i.Vector3.TransformNormalFromFloatsToRef(1,1,1,t,r),this.radiusWorld=Math.max(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z))*this.radius}},e.prototype.isInFrustum=function(e){for(var t=this.centerWorld,r=this.radiusWorld,n=0;n<6;n++)if(e[n].dotCoordinate(t)<=-r)return!1;return!0},e.prototype.isCenterInFrustum=function(e){for(var t=this.centerWorld,r=0;r<6;r++)if(e[r].dotCoordinate(t)<0)return!1;return!0},e.prototype.intersectsPoint=function(e){var t=i.Vector3.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)},e.Intersects=function(e,t){var r=i.Vector3.DistanceSquared(e.centerWorld,t.centerWorld),n=e.radiusWorld+t.radiusWorld;return!(n*n<r)},e.TmpVector3=n.ArrayTools.BuildArray(3,i.Vector3.Zero),e}()},"./Culling/index.ts":
- /*!**************************!*\
- !*** ./Culling/index.ts ***!
- \**************************/
- /*! exports provided: BoundingBox, BoundingInfo, BoundingSphere, Octree, OctreeBlock, OctreeSceneComponent, Ray */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./boundingBox */"./Culling/boundingBox.ts");r.d(t,"BoundingBox",(function(){return n.BoundingBox}));var i=r(/*! ./boundingInfo */"./Culling/boundingInfo.ts");r.d(t,"BoundingInfo",(function(){return i.BoundingInfo}));var o=r(/*! ./boundingSphere */"./Culling/boundingSphere.ts");r.d(t,"BoundingSphere",(function(){return o.BoundingSphere}));var s=r(/*! ./Octrees/index */"./Culling/Octrees/index.ts");r.d(t,"Octree",(function(){return s.Octree})),r.d(t,"OctreeBlock",(function(){return s.OctreeBlock})),r.d(t,"OctreeSceneComponent",(function(){return s.OctreeSceneComponent}));var a=r(/*! ./ray */"./Culling/ray.ts");r.d(t,"Ray",(function(){return a.Ray}))},"./Culling/ray.ts":
- /*!************************!*\
- !*** ./Culling/ray.ts ***!
- \************************/
- /*! exports provided: Ray */function(e,t,r){"use strict";r.r(t),r.d(t,"Ray",(function(){return c}));var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),s=r(/*! ../Collisions/intersectionInfo */"./Collisions/intersectionInfo.ts"),a=r(/*! ../scene */"./scene.ts"),l=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),c=function(){function e(e,t,r){void 0===r&&(r=Number.MAX_VALUE),this.origin=e,this.direction=t,this.length=r}return e.prototype.intersectsBoxMinMax=function(t,r,n){void 0===n&&(n=0);var i,o,s,a,l=e.TmpVector3[0].copyFromFloats(t.x-n,t.y-n,t.z-n),c=e.TmpVector3[1].copyFromFloats(r.x+n,r.y+n,r.z+n),u=0,d=Number.MAX_VALUE;if(Math.abs(this.direction.x)<1e-7){if(this.origin.x<l.x||this.origin.x>c.x)return!1}else if(i=1/this.direction.x,o=(l.x-this.origin.x)*i,(s=(c.x-this.origin.x)*i)==-1/0&&(s=1/0),o>s&&(a=o,o=s,s=a),(u=Math.max(o,u))>(d=Math.min(s,d)))return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.y<l.y||this.origin.y>c.y)return!1}else if(i=1/this.direction.y,o=(l.y-this.origin.y)*i,(s=(c.y-this.origin.y)*i)==-1/0&&(s=1/0),o>s&&(a=o,o=s,s=a),(u=Math.max(o,u))>(d=Math.min(s,d)))return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.z<l.z||this.origin.z>c.z)return!1}else if(i=1/this.direction.z,o=(l.z-this.origin.z)*i,(s=(c.z-this.origin.z)*i)==-1/0&&(s=1/0),o>s&&(a=o,o=s,s=a),(u=Math.max(o,u))>(d=Math.min(s,d)))return!1;return!0},e.prototype.intersectsBox=function(e,t){return void 0===t&&(t=0),this.intersectsBoxMinMax(e.minimum,e.maximum,t)},e.prototype.intersectsSphere=function(e,t){void 0===t&&(t=0);var r=e.center.x-this.origin.x,n=e.center.y-this.origin.y,i=e.center.z-this.origin.z,o=r*r+n*n+i*i,s=e.radius+t,a=s*s;if(o<=a)return!0;var l=r*this.direction.x+n*this.direction.y+i*this.direction.z;return!(l<0)&&o-l*l<=a},e.prototype.intersectsTriangle=function(t,r,n){var o=e.TmpVector3[0],a=e.TmpVector3[1],l=e.TmpVector3[2],c=e.TmpVector3[3],u=e.TmpVector3[4];r.subtractToRef(t,o),n.subtractToRef(t,a),i.Vector3.CrossToRef(this.direction,a,l);var d=i.Vector3.Dot(o,l);if(0===d)return null;var h=1/d;this.origin.subtractToRef(t,c);var f=i.Vector3.Dot(c,l)*h;if(f<0||f>1)return null;i.Vector3.CrossToRef(c,o,u);var p=i.Vector3.Dot(this.direction,u)*h;if(p<0||f+p>1)return null;var m=i.Vector3.Dot(a,u)*h;return m>this.length?null:new s.IntersectionInfo(1-f-p,f,m)},e.prototype.intersectsPlane=function(e){var t,r=i.Vector3.Dot(e.normal,this.direction);if(Math.abs(r)<9.99999997475243e-7)return null;var n=i.Vector3.Dot(e.normal,this.origin);return(t=(-e.d-n)/r)<0?t<-9.99999997475243e-7?null:0:t},e.prototype.intersectsAxis=function(e,t){switch(void 0===t&&(t=0),e){case"y":return(r=(this.origin.y-t)/this.direction.y)>0?null:new i.Vector3(this.origin.x+this.direction.x*-r,t,this.origin.z+this.direction.z*-r);case"x":return(r=(this.origin.x-t)/this.direction.x)>0?null:new i.Vector3(t,this.origin.y+this.direction.y*-r,this.origin.z+this.direction.z*-r);case"z":var r;return(r=(this.origin.z-t)/this.direction.z)>0?null:new i.Vector3(this.origin.x+this.direction.x*-r,this.origin.y+this.direction.y*-r,t);default:return null}},e.prototype.intersectsMesh=function(t,r){var n=i.TmpVectors.Matrix[0];return t.getWorldMatrix().invertToRef(n),this._tmpRay?e.TransformToRef(this,n,this._tmpRay):this._tmpRay=e.Transform(this,n),t.intersects(this._tmpRay,r)},e.prototype.intersectsMeshes=function(e,t,r){r?r.length=0:r=[];for(var n=0;n<e.length;n++){var i=this.intersectsMesh(e[n],t);i.hit&&r.push(i)}return r.sort(this._comparePickingInfo),r},e.prototype._comparePickingInfo=function(e,t){return e.distance<t.distance?-1:e.distance>t.distance?1:0},e.prototype.intersectionSegment=function(t,r,n){var o=this.origin,s=i.TmpVectors.Vector3[0],a=i.TmpVectors.Vector3[1],l=i.TmpVectors.Vector3[2],c=i.TmpVectors.Vector3[3];r.subtractToRef(t,s),this.direction.scaleToRef(e.rayl,l),o.addToRef(l,a),t.subtractToRef(o,c);var u,d,h,f,p=i.Vector3.Dot(s,s),m=i.Vector3.Dot(s,l),g=i.Vector3.Dot(l,l),_=i.Vector3.Dot(s,c),v=i.Vector3.Dot(l,c),y=p*g-m*m,b=y,A=y;y<e.smallnum?(d=0,b=1,f=v,A=g):(f=p*v-m*_,(d=m*v-g*_)<0?(d=0,f=v,A=g):d>b&&(d=b,f=v+m,A=g)),f<0?(f=0,-_<0?d=0:-_>p?d=b:(d=-_,b=p)):f>A&&(f=A,-_+m<0?d=0:-_+m>p?d=b:(d=-_+m,b=p)),u=Math.abs(d)<e.smallnum?0:d/b,h=Math.abs(f)<e.smallnum?0:f/A;var T=i.TmpVectors.Vector3[4];l.scaleToRef(h,T);var M=i.TmpVectors.Vector3[5];s.scaleToRef(u,M),M.addInPlace(c);var P=i.TmpVectors.Vector3[6];return M.subtractToRef(T,P),h>0&&h<=this.length&&P.lengthSquared()<n*n?M.length():-1},e.prototype.update=function(e,t,r,n,i,o,s){return this.unprojectRayToRef(e,t,r,n,i,o,s),this},e.Zero=function(){return new e(i.Vector3.Zero(),i.Vector3.Zero())},e.CreateNew=function(t,r,n,i,o,s,a){return e.Zero().update(t,r,n,i,o,s,a)},e.CreateNewFromTo=function(t,r,n){void 0===n&&(n=i.Matrix.IdentityReadOnly);var o=r.subtract(t),s=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);return o.normalize(),e.Transform(new e(t,o,s),n)},e.Transform=function(t,r){var n=new e(new i.Vector3(0,0,0),new i.Vector3(0,0,0));return e.TransformToRef(t,r,n),n},e.TransformToRef=function(e,t,r){i.Vector3.TransformCoordinatesToRef(e.origin,t,r.origin),i.Vector3.TransformNormalToRef(e.direction,t,r.direction),r.length=e.length;var n=r.direction,o=n.length();if(0!==o&&1!==o){var s=1/o;n.x*=s,n.y*=s,n.z*=s,r.length*=o}},e.prototype.unprojectRayToRef=function(e,t,r,n,o,s,a){var l=i.TmpVectors.Matrix[0];o.multiplyToRef(s,l),l.multiplyToRef(a,l),l.invert();var c=i.TmpVectors.Vector3[0];c.x=e/r*2-1,c.y=-(t/n*2-1),c.z=-1;var u=i.TmpVectors.Vector3[1].copyFromFloats(c.x,c.y,1),d=i.TmpVectors.Vector3[2],h=i.TmpVectors.Vector3[3];i.Vector3._UnprojectFromInvertedMatrixToRef(c,l,d),i.Vector3._UnprojectFromInvertedMatrixToRef(u,l,h),this.origin.copyFrom(d),h.subtractToRef(d,this.direction),this.direction.normalize()},e.TmpVector3=n.ArrayTools.BuildArray(6,i.Vector3.Zero),e.smallnum=1e-8,e.rayl=1e9,e}();a.Scene.prototype.createPickingRay=function(e,t,r,n,i){void 0===i&&(i=!1);var o=c.Zero();return this.createPickingRayToRef(e,t,r,o,n,i),o},a.Scene.prototype.createPickingRayToRef=function(e,t,r,n,o,s){void 0===s&&(s=!1);var a=this.getEngine();if(!o){if(!this.activeCamera)return this;o=this.activeCamera}var l=o.viewport.toGlobal(a.getRenderWidth(),a.getRenderHeight());return e=e/a.getHardwareScalingLevel()-l.x,t=t/a.getHardwareScalingLevel()-(a.getRenderHeight()-l.y-l.height),n.update(e,t,l.width,l.height,r||i.Matrix.IdentityReadOnly,s?i.Matrix.IdentityReadOnly:o.getViewMatrix(),o.getProjectionMatrix()),this},a.Scene.prototype.createPickingRayInCameraSpace=function(e,t,r){var n=c.Zero();return this.createPickingRayInCameraSpaceToRef(e,t,n,r),n},a.Scene.prototype.createPickingRayInCameraSpaceToRef=function(e,t,r,n){if(!o.PickingInfo)return this;var s=this.getEngine();if(!n){if(!this.activeCamera)throw new Error("Active camera not set");n=this.activeCamera}var a=n.viewport.toGlobal(s.getRenderWidth(),s.getRenderHeight()),l=i.Matrix.Identity();return e=e/s.getHardwareScalingLevel()-a.x,t=t/s.getHardwareScalingLevel()-(s.getRenderHeight()-a.y-a.height),r.update(e,t,a.width,a.height,l,l,n.getProjectionMatrix()),this},a.Scene.prototype._internalPick=function(e,t,r,n,i){if(!o.PickingInfo)return null;for(var s=null,a=0;a<this.meshes.length;a++){var l=this.meshes[a];if(t){if(!t(l))continue}else if(!l.isEnabled()||!l.isVisible||!l.isPickable)continue;var c=e(l.skeleton&&l.skeleton.overrideMesh?l.skeleton.overrideMesh.getWorldMatrix():l.getWorldMatrix()),u=l.intersects(c,r,i,n);if(u&&u.hit&&(r||null==s||!(u.distance>=s.distance))&&(s=u,r))break}return s||new o.PickingInfo},a.Scene.prototype._internalMultiPick=function(e,t,r){if(!o.PickingInfo)return null;for(var n=new Array,i=0;i<this.meshes.length;i++){var s=this.meshes[i];if(t){if(!t(s))continue}else if(!s.isEnabled()||!s.isVisible||!s.isPickable)continue;var a=e(s.getWorldMatrix()),l=s.intersects(a,!1,r);l&&l.hit&&n.push(l)}return n},a.Scene.prototype.pickWithBoundingInfo=function(e,t,r,n,s){var a=this;if(!o.PickingInfo)return null;var l=this._internalPick((function(r){return a._tempPickingRay||(a._tempPickingRay=c.Zero()),a.createPickingRayToRef(e,t,r,a._tempPickingRay,s||null),a._tempPickingRay}),r,n,!0);return l&&(l.ray=this.createPickingRay(e,t,i.Matrix.Identity(),s||null)),l},a.Scene.prototype.pick=function(e,t,r,n,s,a){var l=this;if(!o.PickingInfo)return null;var u=this._internalPick((function(r){return l._tempPickingRay||(l._tempPickingRay=c.Zero()),l.createPickingRayToRef(e,t,r,l._tempPickingRay,s||null),l._tempPickingRay}),r,n,!1,a);return u&&(u.ray=this.createPickingRay(e,t,i.Matrix.Identity(),s||null)),u},a.Scene.prototype.pickWithRay=function(e,t,r,n){var o=this,s=this._internalPick((function(t){return o._pickWithRayInverseMatrix||(o._pickWithRayInverseMatrix=i.Matrix.Identity()),t.invertToRef(o._pickWithRayInverseMatrix),o._cachedRayForTransform||(o._cachedRayForTransform=c.Zero()),c.TransformToRef(e,o._pickWithRayInverseMatrix,o._cachedRayForTransform),o._cachedRayForTransform}),t,r,!1,n);return s&&(s.ray=e),s},a.Scene.prototype.multiPick=function(e,t,r,n,i){var o=this;return this._internalMultiPick((function(r){return o.createPickingRay(e,t,r,n||null)}),r,i)},a.Scene.prototype.multiPickWithRay=function(e,t,r){var n=this;return this._internalMultiPick((function(t){return n._pickWithRayInverseMatrix||(n._pickWithRayInverseMatrix=i.Matrix.Identity()),t.invertToRef(n._pickWithRayInverseMatrix),n._cachedRayForTransform||(n._cachedRayForTransform=c.Zero()),c.TransformToRef(e,n._pickWithRayInverseMatrix,n._cachedRayForTransform),n._cachedRayForTransform}),t,r)},l.Camera.prototype.getForwardRay=function(e,t,r){return void 0===e&&(e=100),this.getForwardRayToRef(new c(i.Vector3.Zero(),i.Vector3.Zero(),e),e,t,r)},l.Camera.prototype.getForwardRayToRef=function(e,t,r,n){return void 0===t&&(t=100),r||(r=this.getWorldMatrix()),e.length=t,n?e.origin.copyFrom(n):e.origin.copyFrom(this.position),i.TmpVectors.Vector3[2].set(0,0,this._scene.useRightHandedSystem?-1:1),i.Vector3.TransformNormalToRef(i.TmpVectors.Vector3[2],r,i.TmpVectors.Vector3[3]),i.Vector3.NormalizeToRef(i.TmpVectors.Vector3[3],e.direction),e}},"./Debug/axesViewer.ts":
- /*!*****************************!*\
- !*** ./Debug/axesViewer.ts ***!
- \*****************************/
- /*! exports provided: AxesViewer */function(e,t,r){"use strict";r.r(t),r.d(t,"AxesViewer",(function(){return a}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),o=r(/*! ../Gizmos/axisDragGizmo */"./Gizmos/axisDragGizmo.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=function(){function e(t,r,a,l,c,u){if(void 0===r&&(r=1),void 0===a&&(a=2),this._scaleLinesFactor=4,this._instanced=!1,this.scaleLines=1,this.scaleLines=r,!l){var d=new i.StandardMaterial("",t);d.disableLighting=!0,d.emissiveColor=s.Color3.Red().scale(.5),l=o.AxisDragGizmo._CreateArrow(t,d)}if(!c){var h=new i.StandardMaterial("",t);h.disableLighting=!0,h.emissiveColor=s.Color3.Green().scale(.5),c=o.AxisDragGizmo._CreateArrow(t,h)}if(!u){var f=new i.StandardMaterial("",t);f.disableLighting=!0,f.emissiveColor=s.Color3.Blue().scale(.5),u=o.AxisDragGizmo._CreateArrow(t,f)}this._xAxis=l,this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis=c,this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis=u,this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),null!=a&&(e._SetRenderingGroupId(this._xAxis,a),e._SetRenderingGroupId(this._yAxis,a),e._SetRenderingGroupId(this._zAxis,a)),this.scene=t,this.update(new n.Vector3,n.Vector3.Right(),n.Vector3.Up(),n.Vector3.Forward())}return Object.defineProperty(e.prototype,"xAxis",{get:function(){return this._xAxis},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yAxis",{get:function(){return this._yAxis},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zAxis",{get:function(){return this._zAxis},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t,r,n){this._xAxis.position.copyFrom(e),this._xAxis.setDirection(t),this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis.position.copyFrom(e),this._yAxis.setDirection(r),this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis.position.copyFrom(e),this._zAxis.setDirection(n),this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor)},e.prototype.createInstance=function(){var t=o.AxisDragGizmo._CreateArrowInstance(this.scene,this._xAxis),r=o.AxisDragGizmo._CreateArrowInstance(this.scene,this._yAxis),n=o.AxisDragGizmo._CreateArrowInstance(this.scene,this._zAxis),i=new e(this.scene,this.scaleLines,null,t,r,n);return i._instanced=!0,i},e.prototype.dispose=function(){this._xAxis&&(this._xAxis.dispose(!1,!this._instanced),delete this._xAxis),this._yAxis&&(this._yAxis.dispose(!1,!this._instanced),delete this._yAxis),this._zAxis&&(this._zAxis.dispose(!1,!this._instanced),delete this._zAxis),delete this.scene},e._SetRenderingGroupId=function(e,t){e.getChildMeshes().forEach((function(e){e.renderingGroupId=t}))},e}()},"./Debug/boneAxesViewer.ts":
- /*!*********************************!*\
- !*** ./Debug/boneAxesViewer.ts ***!
- \*********************************/
- /*! exports provided: BoneAxesViewer */function(e,t,r){"use strict";r.r(t),r.d(t,"BoneAxesViewer",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Debug/axesViewer */"./Debug/axesViewer.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),a=function(e){function t(t,r,n,i){void 0===i&&(i=1);var s=e.call(this,t,i)||this;return s.pos=o.Vector3.Zero(),s.xaxis=o.Vector3.Zero(),s.yaxis=o.Vector3.Zero(),s.zaxis=o.Vector3.Zero(),s.mesh=n,s.bone=r,s}return Object(n.__extends)(t,e),t.prototype.update=function(){if(this.mesh&&this.bone){var t=this.bone;t._markAsDirtyAndCompose(),t.getAbsolutePositionToRef(this.mesh,this.pos),t.getDirectionToRef(s.Axis.X,this.mesh,this.xaxis),t.getDirectionToRef(s.Axis.Y,this.mesh,this.yaxis),t.getDirectionToRef(s.Axis.Z,this.mesh,this.zaxis),e.prototype.update.call(this,this.pos,this.xaxis,this.yaxis,this.zaxis)}},t.prototype.dispose=function(){this.mesh&&(this.mesh=null,this.bone=null,e.prototype.dispose.call(this))},t}(i.AxesViewer)},"./Debug/debugLayer.ts":
- /*!*****************************!*\
- !*** ./Debug/debugLayer.ts ***!
- \*****************************/
- /*! exports provided: DebugLayerTab, DebugLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"DebugLayerTab",(function(){return n})),r.d(t,"DebugLayer",(function(){return c}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../scene */"./scene.ts"),l=r(/*! ../Engines/engine */"./Engines/engine.ts");Object.defineProperty(a.Scene.prototype,"debugLayer",{get:function(){return this._debugLayer||(this._debugLayer=new c(this)),this._debugLayer},enumerable:!0,configurable:!0}),function(e){e[e.Properties=0]="Properties",e[e.Debug=1]="Debug",e[e.Statistics=2]="Statistics",e[e.Tools=3]="Tools",e[e.Settings=4]="Settings"}(n||(n={}));var c=function(){function e(e){var t=this;this.BJSINSPECTOR=this._getGlobalInspector(),this._scene=e,this._scene.onDisposeObservable.add((function(){t._scene._debugLayer&&t._scene._debugLayer.hide()}))}return Object.defineProperty(e.prototype,"onPropertyChangedObservable",{get:function(){return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector?this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable:(this._onPropertyChangedObservable||(this._onPropertyChangedObservable=new s.Observable),this._onPropertyChangedObservable)},enumerable:!1,configurable:!0}),e.prototype._createInspector=function(e){if(!this.isVisible()){if(this._onPropertyChangedObservable){for(var t=0,r=this._onPropertyChangedObservable.observers;t<r.length;t++){var n=r[t];this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(n)}this._onPropertyChangedObservable.clear(),this._onPropertyChangedObservable=void 0}var o=Object(i.__assign)({overlay:!1,showExplorer:!0,showInspector:!0,embedMode:!1,handleResize:!0,enablePopup:!0},e);this.BJSINSPECTOR=this.BJSINSPECTOR||this._getGlobalInspector(),this.BJSINSPECTOR.Inspector.Show(this._scene,o)}},e.prototype.select=function(e,t){this.BJSINSPECTOR&&(t&&("[object String]"==Object.prototype.toString.call(t)?this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(t):this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(t)),this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(e))},e.prototype._getGlobalInspector=function(){return"undefined"!=typeof INSPECTOR?INSPECTOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.Inspector?BABYLON:void 0},e.prototype.isVisible=function(){return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.IsVisible},e.prototype.hide=function(){this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.Hide()},e.prototype.setAsActiveScene=function(){this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector._SetNewScene(this._scene)},e.prototype.show=function(t){var r=this;return new Promise((function(n,i){if(void 0===r.BJSINSPECTOR){var s=t&&t.inspectorURL?t.inspectorURL:e.InspectorURL;o.Tools.LoadScript(s,(function(){r._createInspector(t),n(r)}))}else r._createInspector(t),n(r)}))},e.InspectorURL="https://unpkg.com/babylonjs-inspector@"+l.Engine.Version+"/babylon.inspector.bundle.js",e}()},"./Debug/index.ts":
- /*!************************!*\
- !*** ./Debug/index.ts ***!
- \************************/
- /*! exports provided: AxesViewer, BoneAxesViewer, DebugLayerTab, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./axesViewer */"./Debug/axesViewer.ts");r.d(t,"AxesViewer",(function(){return n.AxesViewer}));var i=r(/*! ./boneAxesViewer */"./Debug/boneAxesViewer.ts");r.d(t,"BoneAxesViewer",(function(){return i.BoneAxesViewer}));var o=r(/*! ./debugLayer */"./Debug/debugLayer.ts");r.d(t,"DebugLayerTab",(function(){return o.DebugLayerTab})),r.d(t,"DebugLayer",(function(){return o.DebugLayer}));var s=r(/*! ./physicsViewer */"./Debug/physicsViewer.ts");r.d(t,"PhysicsViewer",(function(){return s.PhysicsViewer}));var a=r(/*! ./rayHelper */"./Debug/rayHelper.ts");r.d(t,"RayHelper",(function(){return a.RayHelper}));var l=r(/*! ./skeletonViewer */"./Debug/skeletonViewer.ts");r.d(t,"SkeletonViewer",(function(){return l.SkeletonViewer}))},"./Debug/physicsViewer.ts":
- /*!********************************!*\
- !*** ./Debug/physicsViewer.ts ***!
- \********************************/
- /*! exports provided: PhysicsViewer */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsViewer",(function(){return f}));var n=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),i=r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),o=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),u=r(/*! ../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),d=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=r(/*! ../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),f=function(){function e(e){this._impostors=[],this._meshes=[],this._numMeshes=0,this._debugMeshMeshes=new Array,this._scene=e||l.EngineStore.LastCreatedScene;var t=this._scene.getPhysicsEngine();t&&(this._physicsEnginePlugin=t.getPhysicsPlugin()),this._utilityLayer=new d.UtilityLayerRenderer(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0}return e.prototype._updateDebugMeshes=function(){for(var e=this._physicsEnginePlugin,t=0;t<this._numMeshes;t++){var r=this._impostors[t];if(r)if(r.isDisposed)this.hideImpostor(this._impostors[t--]);else{if(r.type===u.PhysicsImpostor.MeshImpostor)continue;var n=this._meshes[t];n&&e&&e.syncMeshWithImpostor(n,r)}}},e.prototype.showImpostor=function(e,t){if(!this._scene)return null;for(var r=0;r<this._numMeshes;r++)if(this._impostors[r]==e)return null;var n=this._getDebugMesh(e,t);return n&&(this._impostors[this._numMeshes]=e,this._meshes[this._numMeshes]=n,0===this._numMeshes&&(this._renderFunction=this._updateDebugMeshes.bind(this),this._scene.registerBeforeRender(this._renderFunction)),this._numMeshes++),n},e.prototype.hideImpostor=function(e){if(e&&this._scene&&this._utilityLayer){for(var t=!1,r=this._utilityLayer.utilityLayerScene,n=0;n<this._numMeshes;n++)if(this._impostors[n]==e){var i=this._meshes[n];if(!i)continue;r.removeMesh(i),i.dispose();var o=this._debugMeshMeshes.indexOf(i);o>-1&&this._debugMeshMeshes.splice(o,1),this._numMeshes--,this._numMeshes>0?(this._meshes[n]=this._meshes[this._numMeshes],this._impostors[n]=this._impostors[this._numMeshes],this._meshes[this._numMeshes]=null,this._impostors[this._numMeshes]=null):(this._meshes[0]=null,this._impostors[0]=null),t=!0;break}t&&0===this._numMeshes&&this._scene.unregisterBeforeRender(this._renderFunction)}},e.prototype._getDebugMaterial=function(e){return this._debugMaterial||(this._debugMaterial=new c.StandardMaterial("",e),this._debugMaterial.wireframe=!0,this._debugMaterial.emissiveColor=a.Color3.White(),this._debugMaterial.disableLighting=!0),this._debugMaterial},e.prototype._getDebugBoxMesh=function(e){return this._debugBoxMesh||(this._debugBoxMesh=i.BoxBuilder.CreateBox("physicsBodyBoxViewMesh",{size:1},e),this._debugBoxMesh.rotationQuaternion=s.Quaternion.Identity(),this._debugBoxMesh.material=this._getDebugMaterial(e),this._debugBoxMesh.setEnabled(!1)),this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugSphereMesh=function(e){return this._debugSphereMesh||(this._debugSphereMesh=o.SphereBuilder.CreateSphere("physicsBodySphereViewMesh",{diameter:1},e),this._debugSphereMesh.rotationQuaternion=s.Quaternion.Identity(),this._debugSphereMesh.material=this._getDebugMaterial(e),this._debugSphereMesh.setEnabled(!1)),this._debugSphereMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugCylinderMesh=function(e){return this._debugCylinderMesh||(this._debugCylinderMesh=h.CylinderBuilder.CreateCylinder("physicsBodyCylinderViewMesh",{diameterTop:1,diameterBottom:1,height:1},e),this._debugCylinderMesh.rotationQuaternion=s.Quaternion.Identity(),this._debugCylinderMesh.material=this._getDebugMaterial(e),this._debugCylinderMesh.setEnabled(!1)),this._debugCylinderMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugMeshMesh=function(e,t){var r=new n.Mesh(e.name,t,null,e);return r.position=s.Vector3.Zero(),r.setParent(e),r.material=this._getDebugMaterial(t),this._debugMeshMeshes.push(r),r},e.prototype._getDebugMesh=function(e,t){var r=this;if(!this._utilityLayer)return null;if(t&&t.parent&&t.parent.physicsImpostor)return null;var n=null,i=this._utilityLayer.utilityLayerScene;switch(e.type){case u.PhysicsImpostor.BoxImpostor:n=this._getDebugBoxMesh(i),e.getBoxSizeToRef(n.scaling);break;case u.PhysicsImpostor.SphereImpostor:n=this._getDebugSphereMesh(i);var o=e.getRadius();n.scaling.x=2*o,n.scaling.y=2*o,n.scaling.z=2*o;break;case u.PhysicsImpostor.MeshImpostor:t&&(n=this._getDebugMeshMesh(t,i));break;case u.PhysicsImpostor.NoImpostor:t&&t.getChildMeshes().filter((function(e){return e.physicsImpostor?1:0})).forEach((function(e){r._getDebugBoxMesh(i).parent=e}));break;case u.PhysicsImpostor.CylinderImpostor:n=this._getDebugCylinderMesh(i);var s=e.object.getBoundingInfo();n.scaling.x=s.boundingBox.maximum.x-s.boundingBox.minimum.x,n.scaling.y=s.boundingBox.maximum.y-s.boundingBox.minimum.y,n.scaling.z=s.boundingBox.maximum.z-s.boundingBox.minimum.z}return n},e.prototype.dispose=function(){for(var e=this._numMeshes,t=0;t<e;t++)this.hideImpostor(this._impostors[0]);this._debugBoxMesh&&this._debugBoxMesh.dispose(),this._debugSphereMesh&&this._debugSphereMesh.dispose(),this._debugCylinderMesh&&this._debugCylinderMesh.dispose(),this._debugMaterial&&this._debugMaterial.dispose(),this._impostors.length=0,this._scene=null,this._physicsEnginePlugin=null,this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)},e}()},"./Debug/rayHelper.ts":
- /*!****************************!*\
- !*** ./Debug/rayHelper.ts ***!
- \****************************/
- /*! exports provided: RayHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"RayHelper",(function(){return o}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),o=(r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),function(){function e(e){this.ray=e}return e.CreateAndShow=function(t,r,n){var i=new e(t);return i.show(r,n),i},e.prototype.show=function(e,t){if(!this._renderFunction&&this.ray){var r=this.ray;this._renderFunction=this._render.bind(this),this._scene=e,this._renderPoints=[r.origin,r.origin.add(r.direction.scale(r.length))],this._renderLine=i.Mesh.CreateLines("ray",this._renderPoints,e,!0),this._renderFunction&&this._scene.registerBeforeRender(this._renderFunction)}t&&this._renderLine&&this._renderLine.color.copyFrom(t)},e.prototype.hide=function(){this._renderFunction&&this._scene&&(this._scene.unregisterBeforeRender(this._renderFunction),this._scene=null,this._renderFunction=null,this._renderLine&&(this._renderLine.dispose(),this._renderLine=null),this._renderPoints=[])},e.prototype._render=function(){var e=this.ray;if(e){var t=this._renderPoints[1],r=Math.min(e.length,1e6);t.copyFrom(e.direction),t.scaleInPlace(r),t.addInPlace(e.origin),i.Mesh.CreateLines("ray",this._renderPoints,this._scene,!0,this._renderLine)}},e.prototype.attachToMesh=function(e,t,r,i){this._attachedToMesh=e;var o=this.ray;o&&(o.direction||(o.direction=n.Vector3.Zero()),o.origin||(o.origin=n.Vector3.Zero()),i&&(o.length=i),r||(r=n.Vector3.Zero()),t||(t=new n.Vector3(0,0,-1)),this._meshSpaceDirection?(this._meshSpaceDirection.copyFrom(t),this._meshSpaceOrigin.copyFrom(r)):(this._meshSpaceDirection=t.clone(),this._meshSpaceOrigin=r.clone()),this._updateToMeshFunction||(this._updateToMeshFunction=this._updateToMesh.bind(this),this._attachedToMesh.getScene().registerBeforeRender(this._updateToMeshFunction)),this._attachedToMesh.computeWorldMatrix(!0),this._updateToMesh())},e.prototype.detachFromMesh=function(){this._attachedToMesh&&(this._updateToMeshFunction&&this._attachedToMesh.getScene().unregisterBeforeRender(this._updateToMeshFunction),this._attachedToMesh=null,this._updateToMeshFunction=null)},e.prototype._updateToMesh=function(){var e=this.ray;this._attachedToMesh&&e&&(this._attachedToMesh._isDisposed?this.detachFromMesh():(this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection,e.direction),n.Vector3.TransformCoordinatesToRef(this._meshSpaceOrigin,this._attachedToMesh.getWorldMatrix(),e.origin)))},e.prototype.dispose=function(){this.hide(),this.detachFromMesh(),this.ray=null},e}())},"./Debug/skeletonViewer.ts":
- /*!*********************************!*\
- !*** ./Debug/skeletonViewer.ts ***!
- \*********************************/
- /*! exports provided: SkeletonViewer */function(e,t,r){"use strict";r.r(t),r.d(t,"SkeletonViewer",(function(){return a}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),s=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),a=function(){function e(e,t,r,n,o){void 0===n&&(n=!0),void 0===o&&(o=1),this.skeleton=e,this.mesh=t,this.autoUpdateBonesMatrices=n,this.renderingGroupId=o,this.color=i.Color3.White(),this._debugLines=new Array,this._isEnabled=!1,this._scene=r,this._utilityLayer=new s.UtilityLayerRenderer(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0,this.update(),this._renderFunction=this.update.bind(this)}return Object.defineProperty(e.prototype,"debugMesh",{get:function(){return this._debugMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,this._debugMesh&&this._debugMesh.setEnabled(e),e?this._scene.registerBeforeRender(this._renderFunction):this._scene.unregisterBeforeRender(this._renderFunction))},enumerable:!1,configurable:!0}),e.prototype._getBonePosition=function(e,t,r,i,o,s){void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0);var a=n.TmpVectors.Matrix[0],l=t.getParent();if(a.copyFrom(t.getLocalMatrix()),0!==i||0!==o||0!==s){var c=n.TmpVectors.Matrix[1];n.Matrix.IdentityToRef(c),c.setTranslationFromFloats(i,o,s),c.multiplyToRef(a,a)}l&&a.multiplyToRef(l.getAbsoluteTransform(),a),a.multiplyToRef(r,a),e.x=a.m[12],e.y=a.m[13],e.z=a.m[14]},e.prototype._getLinesForBonesWithLength=function(e,t){for(var r=e.length,i=this.mesh._effectiveMesh.position,o=0;o<r;o++){var s=e[o],a=this._debugLines[o];a||(a=[n.Vector3.Zero(),n.Vector3.Zero()],this._debugLines[o]=a),this._getBonePosition(a[0],s,t),this._getBonePosition(a[1],s,t,0,s.length,0),a[0].subtractInPlace(i),a[1].subtractInPlace(i)}},e.prototype._getLinesForBonesNoLength=function(e,t){for(var r=e.length,i=0,o=this.mesh._effectiveMesh,s=o.position,a=r-1;a>=0;a--){var l=e[a],c=l.getParent();if(c){var u=this._debugLines[i];u||(u=[n.Vector3.Zero(),n.Vector3.Zero()],this._debugLines[i]=u),l.getAbsolutePositionToRef(o,u[0]),c.getAbsolutePositionToRef(o,u[1]),u[0].subtractInPlace(s),u[1].subtractInPlace(s),i++}}},e.prototype.update=function(){if(this._utilityLayer){this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms();var e=this.mesh._effectiveMesh;void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones,e.getWorldMatrix()):this._getLinesForBonesWithLength(this.skeleton.bones,e.getWorldMatrix());var t=this._utilityLayer.utilityLayerScene;this._debugMesh?o.LinesBuilder.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},t):(this._debugMesh=o.LinesBuilder.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:null},t),this._debugMesh.renderingGroupId=this.renderingGroupId),this._debugMesh.position.copyFrom(this.mesh.position),this._debugMesh.color=this.color}},e.prototype.dispose=function(){this.isEnabled=!1,this._debugMesh&&(this.isEnabled=!1,this._debugMesh.dispose(),this._debugMesh=null),this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)},e}()},"./DeviceInput/InputDevices/deviceEnums.ts":
- /*!*************************************************!*\
- !*** ./DeviceInput/InputDevices/deviceEnums.ts ***!
- \*************************************************/
- /*! exports provided: DeviceType, PointerInput, DualShockInput, XboxInput, SwitchInput */function(e,t,r){"use strict";var n,i,o,s,a;r.r(t),r.d(t,"DeviceType",(function(){return n})),r.d(t,"PointerInput",(function(){return i})),r.d(t,"DualShockInput",(function(){return o})),r.d(t,"XboxInput",(function(){return s})),r.d(t,"SwitchInput",(function(){return a})),function(e){e[e.Generic=0]="Generic",e[e.Keyboard=1]="Keyboard",e[e.Mouse=2]="Mouse",e[e.Touch=3]="Touch",e[e.DualShock=4]="DualShock",e[e.Xbox=5]="Xbox",e[e.Switch=6]="Switch"}(n||(n={})),function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.LeftClick=2]="LeftClick",e[e.MiddleClick=3]="MiddleClick",e[e.RightClick=4]="RightClick",e[e.BrowserBack=5]="BrowserBack",e[e.BrowserForward=6]="BrowserForward"}(i||(i={})),function(e){e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.L2=6]="L2",e[e.R2=7]="R2",e[e.Share=8]="Share",e[e.Options=9]="Options",e[e.L3=10]="L3",e[e.R3=11]="R3",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.TouchPad=17]="TouchPad",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(o||(o={})),function(e){e[e.A=0]="A",e[e.B=1]="B",e[e.X=2]="X",e[e.Y=3]="Y",e[e.LB=4]="LB",e[e.RB=5]="RB",e[e.LT=6]="LT",e[e.RT=7]="RT",e[e.Back=8]="Back",e[e.Start=9]="Start",e[e.LS=10]="LS",e[e.RS=11]="RS",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.LStickXAxis=17]="LStickXAxis",e[e.LStickYAxis=18]="LStickYAxis",e[e.RStickXAxis=19]="RStickXAxis",e[e.RStickYAxis=20]="RStickYAxis"}(s||(s={})),function(e){e[e.B=0]="B",e[e.A=1]="A",e[e.Y=2]="Y",e[e.X=3]="X",e[e.L=4]="L",e[e.R=5]="R",e[e.ZL=6]="ZL",e[e.ZR=7]="ZR",e[e.Minus=8]="Minus",e[e.Plus=9]="Plus",e[e.LS=10]="LS",e[e.RS=11]="RS",e[e.DPadUp=12]="DPadUp",e[e.DPadDown=13]="DPadDown",e[e.DPadLeft=14]="DPadLeft",e[e.DPadRight=15]="DPadRight",e[e.Home=16]="Home",e[e.Capture=17]="Capture",e[e.LStickXAxis=18]="LStickXAxis",e[e.LStickYAxis=19]="LStickYAxis",e[e.RStickXAxis=20]="RStickXAxis",e[e.RStickYAxis=21]="RStickYAxis"}(a||(a={}))},"./DeviceInput/InputDevices/deviceSourceManager.ts":
- /*!*********************************************************!*\
- !*** ./DeviceInput/InputDevices/deviceSourceManager.ts ***!
- \*********************************************************/
- /*! exports provided: DeviceSource, DeviceSourceManager */function(e,t,r){"use strict";r.r(t),r.d(t,"DeviceSource",(function(){return s})),r.d(t,"DeviceSourceManager",(function(){return a}));var n=r(/*! ../deviceInputSystem */"./DeviceInput/deviceInputSystem.ts"),i=r(/*! ./deviceEnums */"./DeviceInput/InputDevices/deviceEnums.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=function(){function e(e,t,r){void 0===r&&(r=0),this.deviceType=t,this.deviceSlot=r,this.onInputChangedObservable=new o.Observable,this._deviceInputSystem=e}return e.prototype.getInput=function(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)},e}(),a=function(){function e(e){var t=this;this.onBeforeDeviceConnectedObservable=new o.Observable,this.onBeforeDeviceDisconnectedObservable=new o.Observable,this.onAfterDeviceConnectedObservable=new o.Observable,this.onAfterDeviceDisconnectedObservable=new o.Observable;var r=Object.keys(i.DeviceType).length/2;this._devices=new Array(r),this._firstDevice=new Array(r),this._deviceInputSystem=n.DeviceInputSystem.Create(e),this._deviceInputSystem.onDeviceConnected=function(e,r){t.onBeforeDeviceConnectedObservable.notifyObservers({deviceType:e,deviceSlot:r}),t._addDevice(e,r),t.onAfterDeviceConnectedObservable.notifyObservers({deviceType:e,deviceSlot:r})},this._deviceInputSystem.onDeviceDisconnected=function(e,r){t.onBeforeDeviceDisconnectedObservable.notifyObservers({deviceType:e,deviceSlot:r}),t._removeDevice(e,r),t.onAfterDeviceDisconnectedObservable.notifyObservers({deviceType:e,deviceSlot:r})},this._deviceInputSystem.onInputChanged||(this._deviceInputSystem.onInputChanged=function(e,r,n,i,o){var s;null===(s=t.getDeviceSource(e,r))||void 0===s||s.onInputChangedObservable.notifyObservers({inputIndex:n,previousState:i,currentState:o})})}return e.prototype.getDeviceSource=function(e,t){if(void 0===t){if(void 0===this._firstDevice[e])return null;t=this._firstDevice[e]}return this._devices[e]&&void 0!==this._devices[e][t]?this._devices[e][t]:null},e.prototype.getDeviceSources=function(e){return this._devices[e]},e.prototype.dispose=function(){this._deviceInputSystem.dispose()},e.prototype._addDevice=function(e,t){this._devices[e]||(this._devices[e]=new Array),this._devices[e][t]=new s(this._deviceInputSystem,e,t),this._updateFirstDevices(e)},e.prototype._removeDevice=function(e,t){delete this._devices[e][t],this._updateFirstDevices(e)},e.prototype._updateFirstDevices=function(e){switch(e){case i.DeviceType.Keyboard:case i.DeviceType.Mouse:this._firstDevice[e]=0;break;case i.DeviceType.Touch:case i.DeviceType.DualShock:case i.DeviceType.Xbox:case i.DeviceType.Switch:case i.DeviceType.Generic:var t=this._devices[e];delete this._firstDevice[e];for(var r=0;r<t.length;r++)if(t[r]){this._firstDevice[e]=r;break}}},e}()},"./DeviceInput/InputDevices/deviceTypes.ts":
- /*!*************************************************!*\
- !*** ./DeviceInput/InputDevices/deviceTypes.ts ***!
- \*************************************************/
- /*! no static exports found */function(e,t){},"./DeviceInput/deviceInputSystem.ts":
- /*!******************************************!*\
- !*** ./DeviceInput/deviceInputSystem.ts ***!
- \******************************************/
- /*! exports provided: DeviceInputSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"DeviceInputSystem",(function(){return i}));var n=r(/*! ./InputDevices/deviceEnums */"./DeviceInput/InputDevices/deviceEnums.ts"),i=function(){function e(e){this.onDeviceConnected=function(){},this.onDeviceDisconnected=function(){},this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._keyboardDownEvent=function(e){},this._keyboardUpEvent=function(e){},this._pointerMoveEvent=function(e){},this._pointerDownEvent=function(e){},this._pointerUpEvent=function(e){},this._gamepadConnectedEvent=function(e){},this._gamepadDisconnectedEvent=function(e){};var t=e.getInputElement();t&&(this._elementToAttachTo=t,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions())}return e.Create=function(t){return"undefined"!=typeof _native&&_native.DeviceInputSystem?new _native.DeviceInputSystem(t):new e(t)},e.prototype.pollInput=function(e,t,r){var i=this._inputs[e][t];if(!i)throw"Unable to find device "+n.DeviceType[e];if(this._updateDevice(e,t,r),void 0===i[r])throw"Unable to find input "+r+" for device "+n.DeviceType[e]+" in slot "+t;return i[r]},e.prototype.dispose=function(){this._keyboardActive&&(window.removeEventListener("keydown",this._keyboardDownEvent),window.removeEventListener("keyup",this._keyboardUpEvent)),this._pointerActive&&(this._elementToAttachTo.removeEventListener("pointermove",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener("pointerdown",this._pointerDownEvent),this._elementToAttachTo.removeEventListener("pointerup",this._pointerUpEvent)),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)},e.prototype._registerDevice=function(e,t,r){if(this._inputs[e]||(this._inputs[e]=[]),!this._inputs[e][t]){for(var n=new Array(r),i=0;i<r;i++)n[i]=null;this._inputs[e][t]=n,this.onDeviceConnected(e,t)}},e.prototype._unregisterDevice=function(e,t){this._inputs[e][t]&&(delete this._inputs[e][t],this.onDeviceDisconnected(e,t))},e.prototype._handleKeyActions=function(){var t=this;this._keyboardDownEvent=function(r){t._keyboardActive||(t._keyboardActive=!0,t._registerDevice(n.DeviceType.Keyboard,0,e._MAX_KEYCODES));var i=t._inputs[n.DeviceType.Keyboard][0];i&&(t.onInputChanged&&t.onInputChanged(n.DeviceType.Keyboard,0,r.keyCode,i[r.keyCode],1),i[r.keyCode]=1)},this._keyboardUpEvent=function(e){var r=t._inputs[n.DeviceType.Keyboard][0];r&&(t.onInputChanged&&t.onInputChanged(n.DeviceType.Keyboard,0,e.keyCode,r[e.keyCode],0),r[e.keyCode]=0)},window.addEventListener("keydown",this._keyboardDownEvent),window.addEventListener("keyup",this._keyboardUpEvent)},e.prototype._handlePointerActions=function(){var t=this;this._pointerMoveEvent=function(r){var i="mouse"==r.pointerType?n.DeviceType.Mouse:n.DeviceType.Touch,o="mouse"==r.pointerType?0:r.pointerId;t._inputs[i]||(t._inputs[i]=[]),t._inputs[i][o]||(t._pointerActive=!0,t._registerDevice(i,o,e._MAX_POINTER_INPUTS));var s=t._inputs[i][o];s&&(t.onInputChanged&&(t.onInputChanged(i,o,0,s[0],r.clientX),t.onInputChanged(i,o,1,s[1],r.clientY)),s[0]=r.clientX,s[1]=r.clientY)},this._pointerDownEvent=function(r){var i="mouse"==r.pointerType?n.DeviceType.Mouse:n.DeviceType.Touch,o="mouse"==r.pointerType?0:r.pointerId;t._inputs[i]||(t._inputs[i]=[]),t._inputs[i][o]||(t._pointerActive=!0,t._registerDevice(i,o,e._MAX_POINTER_INPUTS));var s=t._inputs[i][o];s&&(t.onInputChanged&&(t.onInputChanged(i,o,0,s[0],r.clientX),t.onInputChanged(i,o,1,s[1],r.clientY),t.onInputChanged(i,o,r.button+2,s[r.button+2],1)),s[0]=r.clientX,s[1]=r.clientY,s[r.button+2]=1)},this._pointerUpEvent=function(e){var r="mouse"==e.pointerType?n.DeviceType.Mouse:n.DeviceType.Touch,i="mouse"==e.pointerType?0:e.pointerId,o=t._inputs[r][i];o&&(t.onInputChanged&&t.onInputChanged(r,i,e.button+2,o[e.button+2],0),o[e.button+2]=0),"mouse"!=e.pointerType&&t._unregisterDevice(r,i)},this._elementToAttachTo.addEventListener("pointermove",this._pointerMoveEvent),this._elementToAttachTo.addEventListener("pointerdown",this._pointerDownEvent),this._elementToAttachTo.addEventListener("pointerup",this._pointerUpEvent)},e.prototype._handleGamepadActions=function(){var e=this;this._gamepadConnectedEvent=function(t){var r=e._getGamepadDeviceType(t.gamepad.id),n=t.gamepad.index;e._registerDevice(r,n,t.gamepad.buttons.length+t.gamepad.axes.length),e._gamepads=e._gamepads||new Array(t.gamepad.index+1),e._gamepads[n]=r},this._gamepadDisconnectedEvent=function(t){if(e._gamepads){var r=e._getGamepadDeviceType(t.gamepad.id),n=t.gamepad.index;e._unregisterDevice(r,n),delete e._gamepads[n]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)},e.prototype._updateDevice=function(e,t,r){var n=navigator.getGamepads()[t];if(n&&e==this._gamepads[t]){var i=this._inputs[e][t];r>=n.buttons.length?i[r]=n.axes[r-n.buttons.length].valueOf():i[r]=n.buttons[r].value}},e.prototype._getGamepadDeviceType=function(e){return-1!==e.indexOf("054c")?n.DeviceType.DualShock:-1!==e.indexOf("Xbox One")||-1!==e.search("Xbox 360")||-1!==e.search("xinput")?n.DeviceType.Xbox:-1!==e.indexOf("057e")?n.DeviceType.Switch:n.DeviceType.Generic},e._MAX_KEYCODES=255,e._MAX_POINTER_INPUTS=7,e}()},"./DeviceInput/index.ts":
- /*!******************************!*\
- !*** ./DeviceInput/index.ts ***!
- \******************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./deviceInputSystem */"./DeviceInput/deviceInputSystem.ts");r.d(t,"DeviceInputSystem",(function(){return n.DeviceInputSystem}));var i=r(/*! ./InputDevices/deviceEnums */"./DeviceInput/InputDevices/deviceEnums.ts");r.d(t,"DeviceType",(function(){return i.DeviceType})),r.d(t,"PointerInput",(function(){return i.PointerInput})),r.d(t,"DualShockInput",(function(){return i.DualShockInput})),r.d(t,"XboxInput",(function(){return i.XboxInput})),r.d(t,"SwitchInput",(function(){return i.SwitchInput}));var o=r(/*! ./InputDevices/deviceTypes */"./DeviceInput/InputDevices/deviceTypes.ts");for(var s in o)["DeviceInputSystem","DeviceType","PointerInput","DualShockInput","XboxInput","SwitchInput","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(s);var a=r(/*! ./InputDevices/deviceSourceManager */"./DeviceInput/InputDevices/deviceSourceManager.ts");r.d(t,"DeviceSource",(function(){return a.DeviceSource})),r.d(t,"DeviceSourceManager",(function(){return a.DeviceSourceManager}))},"./Engines/Extensions/engine.alpha.ts":
- /*!********************************************!*\
- !*** ./Engines/Extensions/engine.alpha.ts ***!
- \********************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../constants */"./Engines/constants.ts");n.ThinEngine.prototype.setAlphaConstants=function(e,t,r,n){this._alphaState.setAlphaBlendConstants(e,t,r,n)},n.ThinEngine.prototype.setAlphaMode=function(e,t){if(void 0===t&&(t=!1),this._alphaMode!==e){switch(e){case i.Constants.ALPHA_DISABLE:this._alphaState.alphaBlend=!1;break;case i.Constants.ALPHA_PREMULTIPLIED:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_COMBINE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ADD:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_SUBTRACT:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_MULTIPLY:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR,this._gl.ZERO,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_MAXIMIZED:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_INTERPOLATE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR,this._gl.ONE_MINUS_CONSTANT_COLOR,this._gl.CONSTANT_ALPHA,this._gl.ONE_MINUS_CONSTANT_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_SCREENMODE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ONEONE_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ALPHATOCOLOR:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_REVERSEONEMINUS:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE_MINUS_DST_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ONEONE_ONEZERO:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_EXCLUSION:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0}t||(this.depthCullingState.depthMask=e===i.Constants.ALPHA_DISABLE),this._alphaMode=e}},n.ThinEngine.prototype.getAlphaMode=function(){return this._alphaMode},n.ThinEngine.prototype.setAlphaEquation=function(e){if(this._alphaEquation!==e){switch(e){case i.Constants.ALPHA_EQUATION_ADD:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_ADD,this._gl.FUNC_ADD);break;case i.Constants.ALPHA_EQUATION_SUBSTRACT:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_SUBTRACT,this._gl.FUNC_SUBTRACT);break;case i.Constants.ALPHA_EQUATION_REVERSE_SUBTRACT:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_REVERSE_SUBTRACT,this._gl.FUNC_REVERSE_SUBTRACT);break;case i.Constants.ALPHA_EQUATION_MAX:this._alphaState.setAlphaEquationParameters(this._gl.MAX,this._gl.MAX);break;case i.Constants.ALPHA_EQUATION_MIN:this._alphaState.setAlphaEquationParameters(this._gl.MIN,this._gl.MIN);break;case i.Constants.ALPHA_EQUATION_DARKEN:this._alphaState.setAlphaEquationParameters(this._gl.MIN,this._gl.FUNC_ADD)}this._alphaEquation=e}},n.ThinEngine.prototype.getAlphaEquation=function(){return this._alphaEquation}},"./Engines/Extensions/engine.cubeTexture.ts":
- /*!**************************************************!*\
- !*** ./Engines/Extensions/engine.cubeTexture.ts ***!
- \**************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),o=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../../Misc/fileTools */"./Misc/fileTools.ts");i.ThinEngine.prototype._createDepthStencilCubeTexture=function(e,t){var r=new o.InternalTexture(this,o.InternalTextureSource.Unknown);if(r.isCube=!0,1===this.webGLVersion)return s.Logger.Error("Depth cube texture is not supported by WebGL 1."),r;var i=Object(n.__assign)({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),a=this._gl;this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,r,!0),this._setupDepthStencilTexture(r,e,i.generateStencil,i.bilinearFiltering,i.comparisonFunction);for(var l=0;l<6;l++)i.generateStencil?a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,a.DEPTH24_STENCIL8,e,e,0,a.DEPTH_STENCIL,a.UNSIGNED_INT_24_8,null):a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,a.DEPTH_COMPONENT24,e,e,0,a.DEPTH_COMPONENT,a.UNSIGNED_INT,null);return this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null),r},i.ThinEngine.prototype._partialLoadFile=function(e,t,r,n,i){void 0===i&&(i=null),this._loadFile(e,(function(e){r[t]=e,r._internalCount++,6===r._internalCount&&n(r)}),void 0,void 0,!0,(function(e,t){i&&e&&i(e.status+" "+e.statusText,t)}))},i.ThinEngine.prototype._cascadeLoadFiles=function(e,t,r,n){void 0===n&&(n=null);var i=[];i._internalCount=0;for(var o=0;o<6;o++)this._partialLoadFile(r[o],o,i,t,n)},i.ThinEngine.prototype._cascadeLoadImgs=function(e,t,r,n,i){void 0===n&&(n=null);var o=[];o._internalCount=0;for(var s=0;s<6;s++)this._partialLoadImg(r[s],s,o,e,t,n,i)},i.ThinEngine.prototype._partialLoadImg=function(e,t,r,n,i,o,s){var l;void 0===o&&(o=null),l=a.FileTools.LoadImage(e,(function(){l&&(r[t]=l,r._internalCount++,n&&n._removePendingData(l)),6===r._internalCount&&i(r)}),(function(e,t){n&&n._removePendingData(l),o&&o(e,t)}),n?n.offlineProvider:null,s),n&&l&&n._addPendingData(l)},i.ThinEngine.prototype._setCubeMapTextureParams=function(e){var t=this._gl;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,null)},i.ThinEngine.prototype.createCubeTexture=function(e,t,r,n,a,l,c,u,d,h,f,p){var m=this;void 0===a&&(a=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===d&&(d=!1),void 0===h&&(h=0),void 0===f&&(f=0),void 0===p&&(p=null);var g=this._gl,_=p||new o.InternalTexture(this,o.InternalTextureSource.Cube);_.isCube=!0,_.url=e,_.generateMipMaps=!n,_._lodGenerationScale=h,_._lodGenerationOffset=f,this._doNotHandleContextLost||(_._extension=u,_._files=r);var v=e;this._transformTextureUrl&&!p&&(e=this._transformTextureUrl(e));for(var y=e.lastIndexOf("."),b=u||(y>-1?e.substring(y).toLowerCase():""),A=null,T=0,M=i.ThinEngine._TextureLoaders;T<M.length;T++){var P=M[T];if(P.canLoad(b)){A=P;break}}if(A){var S=function(e){m._bindTextureDirectly(g.TEXTURE_CUBE_MAP,_,!0),A.loadCubeData(e,_,d,a,l)};r&&6===r.length?A.supportCascades?this._cascadeLoadFiles(t,(function(e){return S(e.map((function(e){return new Uint8Array(e)})))}),r,l):l?l("Textures type does not support cascades."):s.Logger.Warn("Texture loader does not support cascades."):this._loadFile(e,(function(e){return S(new Uint8Array(e))}),void 0,void 0,!0,(function(i,o){e===v?l&&i&&l(i.status+" "+i.statusText,o):(s.Logger.Warn("Failed to load "+e+", falling back to the "+v),m.createCubeTexture(v,t,r,n,a,l,c,u,d,h,f,_))}))}else{if(!r)throw new Error("Cannot load cubemap because files were not defined");this._cascadeLoadImgs(t,(function(e){var t=m.needPOTTextures?i.ThinEngine.GetExponentOfTwo(e[0].width,m._caps.maxCubemapTextureSize):e[0].width,r=t,o=[g.TEXTURE_CUBE_MAP_POSITIVE_X,g.TEXTURE_CUBE_MAP_POSITIVE_Y,g.TEXTURE_CUBE_MAP_POSITIVE_Z,g.TEXTURE_CUBE_MAP_NEGATIVE_X,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,g.TEXTURE_CUBE_MAP_NEGATIVE_Z];m._bindTextureDirectly(g.TEXTURE_CUBE_MAP,_,!0),m._unpackFlipY(!1);for(var l=c?m._getInternalFormat(c):m._gl.RGBA,u=0;u<o.length;u++)if(e[u].width!==t||e[u].height!==r){if(m._prepareWorkingCanvas(),!m._workingCanvas||!m._workingContext)return void s.Logger.Warn("Cannot create canvas to resize texture.");m._workingCanvas.width=t,m._workingCanvas.height=r,m._workingContext.drawImage(e[u],0,0,e[u].width,e[u].height,0,0,t,r),g.texImage2D(o[u],0,l,l,g.UNSIGNED_BYTE,m._workingCanvas)}else g.texImage2D(o[u],0,l,l,g.UNSIGNED_BYTE,e[u]);n||g.generateMipmap(g.TEXTURE_CUBE_MAP),m._setCubeMapTextureParams(!n),_.width=t,_.height=r,_.isReady=!0,c&&(_.format=c),_.onLoadedObservable.notifyObservers(_),_.onLoadedObservable.clear(),a&&a()}),r,l)}return this._internalTexturesCache.push(_),_}},"./Engines/Extensions/engine.dynamicTexture.ts":
- /*!*****************************************************!*\
- !*** ./Engines/Extensions/engine.dynamicTexture.ts ***!
- \*****************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts");n.ThinEngine.prototype.createDynamicTexture=function(e,t,r,o){var s=new i.InternalTexture(this,i.InternalTextureSource.Dynamic);return s.baseWidth=e,s.baseHeight=t,r&&(e=this.needPOTTextures?n.ThinEngine.GetExponentOfTwo(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?n.ThinEngine.GetExponentOfTwo(t,this._caps.maxTextureSize):t),s.width=e,s.height=t,s.isReady=!1,s.generateMipMaps=r,s.samplingMode=o,this.updateTextureSamplingMode(o,s),this._internalTexturesCache.push(s),s},n.ThinEngine.prototype.updateDynamicTexture=function(e,t,r,n,i,o){if(void 0===n&&(n=!1),void 0===o&&(o=!1),e){this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0,o),this._unpackFlipY(r),n&&this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);var s=i?this._getInternalFormat(i):this._gl.RGBA;this._gl.texImage2D(this._gl.TEXTURE_2D,0,s,s,this._gl.UNSIGNED_BYTE,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),n&&this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),e.isReady=!0}}},"./Engines/Extensions/engine.multiRender.ts":
- /*!**************************************************!*\
- !*** ./Engines/Extensions/engine.multiRender.ts ***!
- \**************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../constants */"./Engines/constants.ts"),s=r(/*! ../thinEngine */"./Engines/thinEngine.ts");s.ThinEngine.prototype.bindAttachments=function(e){this._gl.drawBuffers(e)},s.ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer=function(e,t,r){void 0===t&&(t=!1),this._currentRenderTarget=null;var n=this._gl,i=e[0]._attachments,o=i.length;if(e[0]._MSAAFramebuffer){n.bindFramebuffer(n.READ_FRAMEBUFFER,e[0]._MSAAFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,e[0]._framebuffer);for(var s=0;s<o;s++){for(var a=e[s],l=0;l<o;l++)i[l]=n.NONE;i[s]=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+s:"COLOR_ATTACHMENT"+s+"_WEBGL"],n.readBuffer(i[s]),n.drawBuffers(i),n.blitFramebuffer(0,0,a.width,a.height,0,0,a.width,a.height,n.COLOR_BUFFER_BIT,n.NEAREST)}for(s=0;s<o;s++)i[s]=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+s:"COLOR_ATTACHMENT"+s+"_WEBGL"];n.drawBuffers(i)}for(s=0;s<o;s++)!(a=e[s]).generateMipMaps||t||a.isCube||(this._bindTextureDirectly(n.TEXTURE_2D,a,!0),n.generateMipmap(n.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null));r&&(e[0]._MSAAFramebuffer&&this._bindUnboundFramebuffer(e[0]._framebuffer),r()),this._bindUnboundFramebuffer(null)},s.ThinEngine.prototype.createMultipleRenderTarget=function(e,t){var r=!1,s=!0,a=!1,l=!1,c=1,u=o.Constants.TEXTURETYPE_UNSIGNED_INT,d=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,h=new Array,f=new Array;void 0!==t&&(r=void 0!==t.generateMipMaps&&t.generateMipMaps,s=void 0===t.generateDepthBuffer||t.generateDepthBuffer,a=void 0!==t.generateStencilBuffer&&t.generateStencilBuffer,l=void 0!==t.generateDepthTexture&&t.generateDepthTexture,c=t.textureCount||1,t.types&&(h=t.types),t.samplingModes&&(f=t.samplingModes));var p=this._gl,m=p.createFramebuffer();this._bindUnboundFramebuffer(m);for(var g=e.width||e,_=e.height||e,v=[],y=[],b=this._setupFramebufferDepthAttachments(a,s,g,_),A=0;A<c;A++){var T=f[A]||d,M=h[A]||u;(M!==o.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(M!==o.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(T=o.Constants.TEXTURE_NEAREST_SAMPLINGMODE);var P=this._getSamplingParameters(T,r);M!==o.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(M=o.Constants.TEXTURETYPE_UNSIGNED_INT,i.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var S=new n.InternalTexture(this,n.InternalTextureSource.MultiRenderTarget),E=p[this.webGLVersion>1?"COLOR_ATTACHMENT"+A:"COLOR_ATTACHMENT"+A+"_WEBGL"];v.push(S),y.push(E),p.activeTexture(p["TEXTURE"+A]),p.bindTexture(p.TEXTURE_2D,S._webGLTexture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,P.mag),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,P.min),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(M),g,_,0,p.RGBA,this._getWebGLTextureType(M),null),p.framebufferTexture2D(p.DRAW_FRAMEBUFFER,E,p.TEXTURE_2D,S._webGLTexture,0),r&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(p.TEXTURE_2D,null),S._framebuffer=m,S._depthStencilBuffer=b,S.baseWidth=g,S.baseHeight=_,S.width=g,S.height=_,S.isReady=!0,S.samples=1,S.generateMipMaps=r,S.samplingMode=T,S.type=M,S._generateDepthBuffer=s,S._generateStencilBuffer=a,S._attachments=y,S._textureArray=v,this._internalTexturesCache.push(S)}if(l&&this._caps.depthTextureExtension){var C=new n.InternalTexture(this,n.InternalTextureSource.MultiRenderTarget);p.activeTexture(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,C._webGLTexture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,this.webGLVersion<2?p.DEPTH_COMPONENT:p.DEPTH_COMPONENT16,g,_,0,p.DEPTH_COMPONENT,p.UNSIGNED_SHORT,null),p.framebufferTexture2D(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.TEXTURE_2D,C._webGLTexture,0),C._framebuffer=m,C.baseWidth=g,C.baseHeight=_,C.width=g,C.height=_,C.isReady=!0,C.samples=1,C.generateMipMaps=r,C.samplingMode=p.NEAREST,C._generateDepthBuffer=s,C._generateStencilBuffer=a,v.push(C),this._internalTexturesCache.push(C)}return p.drawBuffers(y),this._bindUnboundFramebuffer(null),this.resetTextureCache(),v},s.ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e[0].samples===t)return t;var r=e[0]._attachments.length;if(0===r)return 1;var n=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e[0]._depthStencilBuffer&&(n.deleteRenderbuffer(e[0]._depthStencilBuffer),e[0]._depthStencilBuffer=null),e[0]._MSAAFramebuffer&&(n.deleteFramebuffer(e[0]._MSAAFramebuffer),e[0]._MSAAFramebuffer=null);for(var i=0;i<r;i++)e[i]._MSAARenderBuffer&&(n.deleteRenderbuffer(e[i]._MSAARenderBuffer),e[i]._MSAARenderBuffer=null);if(t>1&&n.renderbufferStorageMultisample){var o=n.createFramebuffer();if(!o)throw new Error("Unable to create multi sampled framebuffer");this._bindUnboundFramebuffer(o);var s=this._setupFramebufferDepthAttachments(e[0]._generateStencilBuffer,e[0]._generateDepthBuffer,e[0].width,e[0].height,t),a=[];for(i=0;i<r;i++){var l=e[i],c=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+i:"COLOR_ATTACHMENT"+i+"_WEBGL"],u=n.createRenderbuffer();if(!u)throw new Error("Unable to create multi sampled framebuffer");n.bindRenderbuffer(n.RENDERBUFFER,u),n.renderbufferStorageMultisample(n.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(l.type),l.width,l.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,c,n.RENDERBUFFER,u),l._MSAAFramebuffer=o,l._MSAARenderBuffer=u,l.samples=t,l._depthStencilBuffer=s,n.bindRenderbuffer(n.RENDERBUFFER,null),a.push(c)}n.drawBuffers(a)}else this._bindUnboundFramebuffer(e[0]._framebuffer);return this._bindUnboundFramebuffer(null),t}},"./Engines/Extensions/engine.multiview.ts":
- /*!************************************************!*\
- !*** ./Engines/Extensions/engine.multiview.ts ***!
- \************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),i=r(/*! ../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../scene */"./scene.ts"),s=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),c=r(/*! ../../Materials/Textures/MultiviewRenderTarget */"./Materials/Textures/MultiviewRenderTarget.ts"),u=r(/*! ../../Maths/math.frustum */"./Maths/math.frustum.ts");i.Engine.prototype.createMultiviewRenderTargetTexture=function(e,t){var r=this._gl;if(!this.getCaps().multiview)throw"Multiview is not supported";var n=new s.InternalTexture(this,s.InternalTextureSource.Unknown,!0);return n.width=e,n.height=t,n._framebuffer=r.createFramebuffer(),n._colorTextureArray=r.createTexture(),r.bindTexture(r.TEXTURE_2D_ARRAY,n._colorTextureArray),r.texStorage3D(r.TEXTURE_2D_ARRAY,1,r.RGBA8,e,t,2),n._depthStencilTextureArray=r.createTexture(),r.bindTexture(r.TEXTURE_2D_ARRAY,n._depthStencilTextureArray),r.texStorage3D(r.TEXTURE_2D_ARRAY,1,r.DEPTH32F_STENCIL8,e,t,2),n.isReady=!0,n},i.Engine.prototype.bindMultiviewFramebuffer=function(e){var t=this._gl,r=this.getCaps().oculusMultiview||this.getCaps().multiview;if(this.bindFramebuffer(e,void 0,void 0,void 0,!0),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),!e._colorTextureArray||!e._depthStencilTextureArray)throw"Invalid multiview frame buffer";this.getCaps().oculusMultiview?(r.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,e.samples,0,2),r.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,e.samples,0,2)):(r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,0,2),r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,0,2))},n.Camera.prototype._useMultiviewToSingleView=!1,n.Camera.prototype._multiviewTexture=null,n.Camera.prototype._resizeOrCreateMultiviewTexture=function(e,t){this._multiviewTexture?this._multiviewTexture.getRenderWidth()==e&&this._multiviewTexture.getRenderHeight()==t||(this._multiviewTexture.dispose(),this._multiviewTexture=new c.MultiviewRenderTarget(this.getScene(),{width:e,height:t})):this._multiviewTexture=new c.MultiviewRenderTarget(this.getScene(),{width:e,height:t})},o.Scene.prototype._transformMatrixR=a.Matrix.Zero(),o.Scene.prototype._multiviewSceneUbo=null,o.Scene.prototype._createMultiviewUbo=function(){this._multiviewSceneUbo=new l.UniformBuffer(this.getEngine(),void 0,!0),this._multiviewSceneUbo.addUniform("viewProjection",16),this._multiviewSceneUbo.addUniform("viewProjectionR",16),this._multiviewSceneUbo.addUniform("view",16)},o.Scene.prototype._updateMultiviewUbo=function(e,t){e&&t&&e.multiplyToRef(t,this._transformMatrixR),e&&t&&(e.multiplyToRef(t,a.TmpVectors.Matrix[0]),u.Frustum.GetRightPlaneToRef(a.TmpVectors.Matrix[0],this._frustumPlanes[3])),this._multiviewSceneUbo&&(this._multiviewSceneUbo.updateMatrix("viewProjection",this.getTransformMatrix()),this._multiviewSceneUbo.updateMatrix("viewProjectionR",this._transformMatrixR),this._multiviewSceneUbo.updateMatrix("view",this._viewMatrix),this._multiviewSceneUbo.update())},o.Scene.prototype._renderMultiviewToSingleView=function(e){e._resizeOrCreateMultiviewTexture(e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.width>0?e._rigPostProcess.width:this.getEngine().getRenderWidth(!0),e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.height>0?e._rigPostProcess.height:this.getEngine().getRenderHeight(!0)),this._multiviewSceneUbo||this._createMultiviewUbo(),e.outputRenderTarget=e._multiviewTexture,this._renderForCamera(e),e.outputRenderTarget=null;for(var t=0;t<e._rigCameras.length;t++){var r=this.getEngine();this._activeCamera=e._rigCameras[t],r.setViewport(this._activeCamera.viewport),this.postProcessManager&&(this.postProcessManager._prepareFrame(),this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate))}}},"./Engines/Extensions/engine.occlusionQuery.ts":
- /*!*****************************************************!*\
- !*** ./Engines/Extensions/engine.occlusionQuery.ts ***!
- \*****************************************************/
- /*! exports provided: _OcclusionDataStorage */function(e,t,r){"use strict";r.r(t),r.d(t,"_OcclusionDataStorage",(function(){return s}));var n=r(/*! ../../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),o=r(/*! ../../Instrumentation/timeToken */"./Instrumentation/timeToken.ts"),s=function(){this.occlusionInternalRetryCounter=0,this.isOcclusionQueryInProgress=!1,this.isOccluded=!1,this.occlusionRetryCount=-1,this.occlusionType=i.AbstractMesh.OCCLUSION_TYPE_NONE,this.occlusionQueryAlgorithmType=i.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE};n.Engine.prototype.createQuery=function(){return this._gl.createQuery()},n.Engine.prototype.deleteQuery=function(e){return this._gl.deleteQuery(e),this},n.Engine.prototype.isQueryResultAvailable=function(e){return this._gl.getQueryParameter(e,this._gl.QUERY_RESULT_AVAILABLE)},n.Engine.prototype.getQueryResult=function(e){return this._gl.getQueryParameter(e,this._gl.QUERY_RESULT)},n.Engine.prototype.beginOcclusionQuery=function(e,t){var r=this._getGlAlgorithmType(e);return this._gl.beginQuery(r,t),this},n.Engine.prototype.endOcclusionQuery=function(e){var t=this._getGlAlgorithmType(e);return this._gl.endQuery(t),this},n.Engine.prototype._createTimeQuery=function(){var e=this.getCaps().timerQuery;return e.createQueryEXT?e.createQueryEXT():this.createQuery()},n.Engine.prototype._deleteTimeQuery=function(e){var t=this.getCaps().timerQuery;t.deleteQueryEXT?t.deleteQueryEXT(e):this.deleteQuery(e)},n.Engine.prototype._getTimeQueryResult=function(e){var t=this.getCaps().timerQuery;return t.getQueryObjectEXT?t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT):this.getQueryResult(e)},n.Engine.prototype._getTimeQueryAvailability=function(e){var t=this.getCaps().timerQuery;return t.getQueryObjectEXT?t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT):this.isQueryResultAvailable(e)},n.Engine.prototype.startTimeQuery=function(){var e=this.getCaps(),t=e.timerQuery;if(!t)return null;var r=new o._TimeToken;if(this._gl.getParameter(t.GPU_DISJOINT_EXT),e.canUseTimestampForTimerQuery)r._startTimeQuery=this._createTimeQuery(),t.queryCounterEXT(r._startTimeQuery,t.TIMESTAMP_EXT);else{if(this._currentNonTimestampToken)return this._currentNonTimestampToken;r._timeElapsedQuery=this._createTimeQuery(),t.beginQueryEXT?t.beginQueryEXT(t.TIME_ELAPSED_EXT,r._timeElapsedQuery):this._gl.beginQuery(t.TIME_ELAPSED_EXT,r._timeElapsedQuery),this._currentNonTimestampToken=r}return r},n.Engine.prototype.endTimeQuery=function(e){var t=this.getCaps(),r=t.timerQuery;if(!r||!e)return-1;if(t.canUseTimestampForTimerQuery){if(!e._startTimeQuery)return-1;e._endTimeQuery||(e._endTimeQuery=this._createTimeQuery(),r.queryCounterEXT(e._endTimeQuery,r.TIMESTAMP_EXT))}else if(!e._timeElapsedQueryEnded){if(!e._timeElapsedQuery)return-1;r.endQueryEXT?r.endQueryEXT(r.TIME_ELAPSED_EXT):this._gl.endQuery(r.TIME_ELAPSED_EXT),e._timeElapsedQueryEnded=!0}var n=this._gl.getParameter(r.GPU_DISJOINT_EXT),i=!1;if(e._endTimeQuery?i=this._getTimeQueryAvailability(e._endTimeQuery):e._timeElapsedQuery&&(i=this._getTimeQueryAvailability(e._timeElapsedQuery)),i&&!n){var o=0;if(t.canUseTimestampForTimerQuery){if(!e._startTimeQuery||!e._endTimeQuery)return-1;var s=this._getTimeQueryResult(e._startTimeQuery);o=this._getTimeQueryResult(e._endTimeQuery)-s,this._deleteTimeQuery(e._startTimeQuery),this._deleteTimeQuery(e._endTimeQuery),e._startTimeQuery=null,e._endTimeQuery=null}else{if(!e._timeElapsedQuery)return-1;o=this._getTimeQueryResult(e._timeElapsedQuery),this._deleteTimeQuery(e._timeElapsedQuery),e._timeElapsedQuery=null,e._timeElapsedQueryEnded=!1,this._currentNonTimestampToken=null}return o}return-1},n.Engine.prototype._getGlAlgorithmType=function(e){return e===i.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE?this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE:this._gl.ANY_SAMPLES_PASSED},Object.defineProperty(i.AbstractMesh.prototype,"isOcclusionQueryInProgress",{get:function(){return this._occlusionDataStorage.isOcclusionQueryInProgress},set:function(e){this._occlusionDataStorage.isOcclusionQueryInProgress=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.AbstractMesh.prototype,"_occlusionDataStorage",{get:function(){return this.__occlusionDataStorage||(this.__occlusionDataStorage=new s),this.__occlusionDataStorage},enumerable:!1,configurable:!0}),Object.defineProperty(i.AbstractMesh.prototype,"isOccluded",{get:function(){return this._occlusionDataStorage.isOccluded},set:function(e){this._occlusionDataStorage.isOccluded=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.AbstractMesh.prototype,"occlusionQueryAlgorithmType",{get:function(){return this._occlusionDataStorage.occlusionQueryAlgorithmType},set:function(e){this._occlusionDataStorage.occlusionQueryAlgorithmType=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.AbstractMesh.prototype,"occlusionType",{get:function(){return this._occlusionDataStorage.occlusionType},set:function(e){this._occlusionDataStorage.occlusionType=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.AbstractMesh.prototype,"occlusionRetryCount",{get:function(){return this._occlusionDataStorage.occlusionRetryCount},set:function(e){this._occlusionDataStorage.occlusionRetryCount=e},enumerable:!0,configurable:!0}),i.AbstractMesh.prototype._checkOcclusionQuery=function(){var e=this._occlusionDataStorage;if(e.occlusionType===i.AbstractMesh.OCCLUSION_TYPE_NONE)return e.isOccluded=!1,!1;var t=this.getEngine();if(t.webGLVersion<2)return e.isOccluded=!1,!1;if(!t.isQueryResultAvailable)return e.isOccluded=!1,!1;if(this.isOcclusionQueryInProgress&&this._occlusionQuery)if(t.isQueryResultAvailable(this._occlusionQuery)){var r=t.getQueryResult(this._occlusionQuery);e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=1!==r}else{if(e.occlusionInternalRetryCounter++,!(-1!==e.occlusionRetryCount&&e.occlusionInternalRetryCounter>e.occlusionRetryCount))return!1;e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=e.occlusionType!==i.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded}var n=this.getScene();if(n.getBoundingBoxRenderer){var o=n.getBoundingBoxRenderer();this._occlusionQuery||(this._occlusionQuery=t.createQuery()),t.beginOcclusionQuery(e.occlusionQueryAlgorithmType,this._occlusionQuery),o.renderOcclusionBoundingBox(this),t.endOcclusionQuery(e.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0}return e.isOccluded}},"./Engines/Extensions/engine.rawTexture.ts":
- /*!*************************************************!*\
- !*** ./Engines/Extensions/engine.rawTexture.ts ***!
- \*************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../constants */"./Engines/constants.ts"),a=r(/*! ../thinEngine */"./Engines/thinEngine.ts");function l(e,t,r,n){var i;i=n===s.Constants.TEXTURETYPE_FLOAT?new Float32Array(t*r*4):new Uint32Array(t*r*4);for(var o=0;o<t;o++)for(var a=0;a<r;a++){var l=3*(a*t+o),c=4*(a*t+o);i[c+0]=e[l+0],i[c+1]=e[l+1],i[c+2]=e[l+2],i[c+3]=1}return i}function c(e){return function(t,r,i,o,a,l,c,u,d,h){void 0===d&&(d=null),void 0===h&&(h=s.Constants.TEXTURETYPE_UNSIGNED_INT);var f=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,p=e?n.InternalTextureSource.Raw3D:n.InternalTextureSource.Raw2DArray,m=new n.InternalTexture(this,p);m.baseWidth=r,m.baseHeight=i,m.baseDepth=o,m.width=r,m.height=i,m.depth=o,m.format=a,m.type=h,m.generateMipMaps=l,m.samplingMode=u,e?m.is3D=!0:m.is2DArray=!0,this._doNotHandleContextLost||(m._bufferView=t),e?this.updateRawTexture3D(m,t,a,c,d,h):this.updateRawTexture2DArray(m,t,a,c,d,h),this._bindTextureDirectly(f,m,!0);var g=this._getSamplingParameters(u,l);return this._gl.texParameteri(f,this._gl.TEXTURE_MAG_FILTER,g.mag),this._gl.texParameteri(f,this._gl.TEXTURE_MIN_FILTER,g.min),l&&this._gl.generateMipmap(f),this._bindTextureDirectly(f,null),this._internalTexturesCache.push(m),m}}function u(e){return function(t,r,n,i,o,a){void 0===o&&(o=null),void 0===a&&(a=s.Constants.TEXTURETYPE_UNSIGNED_INT);var l=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,c=this._getWebGLTextureType(a),u=this._getInternalFormat(n),d=this._getRGBABufferInternalSizedFormat(a,n);this._bindTextureDirectly(l,t,!0),this._unpackFlipY(void 0===i||!!i),this._doNotHandleContextLost||(t._bufferView=r,t.format=n,t.invertY=i,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&r?this._gl.compressedTexImage3D(l,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,r):this._gl.texImage3D(l,0,d,t.width,t.height,t.depth,0,u,c,r),t.generateMipMaps&&this._gl.generateMipmap(l),this._bindTextureDirectly(l,null),t.isReady=!0}}a.ThinEngine.prototype.updateRawTexture=function(e,t,r,n,i,o){if(void 0===i&&(i=null),void 0===o&&(o=s.Constants.TEXTURETYPE_UNSIGNED_INT),e){var a=this._getRGBABufferInternalSizedFormat(o,r),l=this._getInternalFormat(r),c=this._getWebGLTextureType(o);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(e._bufferView=t,e.format=r,e.type=o,e.invertY=n,e._compression=i),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),i&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[i],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,e.width,e.height,0,l,c,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}},a.ThinEngine.prototype.createRawTexture=function(e,t,r,i,o,a,l,c,u){void 0===c&&(c=null),void 0===u&&(u=s.Constants.TEXTURETYPE_UNSIGNED_INT);var d=new n.InternalTexture(this,n.InternalTextureSource.Raw);d.baseWidth=t,d.baseHeight=r,d.width=t,d.height=r,d.format=i,d.generateMipMaps=o,d.samplingMode=l,d.invertY=a,d._compression=c,d.type=u,this._doNotHandleContextLost||(d._bufferView=e),this.updateRawTexture(d,e,i,a,c,u),this._bindTextureDirectly(this._gl.TEXTURE_2D,d,!0);var h=this._getSamplingParameters(l,o);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,h.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,h.min),o&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(d),d},a.ThinEngine.prototype.createRawCubeTexture=function(e,t,r,a,l,c,u,d){void 0===d&&(d=null);var h=this._gl,f=new n.InternalTexture(this,n.InternalTextureSource.CubeRaw);f.isCube=!0,f.format=r,f.type=a,this._doNotHandleContextLost||(f._bufferViewArray=e);var p=this._getWebGLTextureType(a),m=this._getInternalFormat(r);m===h.RGB&&(m=h.RGBA),p!==h.FLOAT||this._caps.textureFloatLinearFiltering?p!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?p!==h.FLOAT||this._caps.textureFloatRender?p!==h.HALF_FLOAT||this._caps.colorBufferFloat||(l=!1,i.Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(l=!1,i.Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(l=!1,u=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE,i.Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(l=!1,u=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE,i.Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));var g=t,_=g;f.width=g,f.height=_,!this.needPOTTextures||o.Tools.IsExponentOfTwo(f.width)&&o.Tools.IsExponentOfTwo(f.height)||(l=!1),e&&this.updateRawCubeTexture(f,e,r,a,c,d),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,f,!0),e&&l&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);var v=this._getSamplingParameters(u,l);return h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_MAG_FILTER,v.mag),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_MIN_FILTER,v.min),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),this._bindTextureDirectly(h.TEXTURE_CUBE_MAP,null),f.generateMipMaps=l,f},a.ThinEngine.prototype.updateRawCubeTexture=function(e,t,r,n,i,s,a){void 0===s&&(s=null),void 0===a&&(a=0),e._bufferViewArray=t,e.format=r,e.type=n,e.invertY=i,e._compression=s;var c=this._gl,u=this._getWebGLTextureType(n),d=this._getInternalFormat(r),h=this._getRGBABufferInternalSizedFormat(n),f=!1;d===c.RGB&&(d=c.RGBA,f=!0),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===i||!!i),e.width%4!=0&&c.pixelStorei(c.UNPACK_ALIGNMENT,1);for(var p=0;p<6;p++){var m=t[p];s?c.compressedTexImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+p,a,this.getCaps().s3tc[s],e.width,e.height,0,m):(f&&(m=l(m,e.width,e.height,n)),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+p,a,h,e.width,e.height,0,d,u,m))}(!this.needPOTTextures||o.Tools.IsExponentOfTwo(e.width)&&o.Tools.IsExponentOfTwo(e.height))&&e.generateMipMaps&&0===a&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},a.ThinEngine.prototype.createRawCubeTextureFromUrl=function(e,t,r,n,i,o,a,c,u,d,h,f){var p=this;void 0===u&&(u=null),void 0===d&&(d=null),void 0===h&&(h=s.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===f&&(f=!1);var m=this._gl,g=this.createRawCubeTexture(null,r,n,i,!o,f,h,null);return null==t||t._addPendingData(g),g.url=e,this._internalTexturesCache.push(g),this._loadFile(e,(function(e){!function(e){var r=g.width,o=a(e);if(o){if(c){var s=p._getWebGLTextureType(i),d=p._getInternalFormat(n),h=p._getRGBABufferInternalSizedFormat(i),_=!1;d===m.RGB&&(d=m.RGBA,_=!0),p._bindTextureDirectly(m.TEXTURE_CUBE_MAP,g,!0),p._unpackFlipY(!1);for(var v=c(o),y=0;y<v.length;y++)for(var b=r>>y,A=0;A<6;A++){var T=v[y][A];_&&(T=l(T,b,b,i)),m.texImage2D(A,y,h,b,b,0,d,s,T)}p._bindTextureDirectly(m.TEXTURE_CUBE_MAP,null)}else p.updateRawCubeTexture(g,o,n,i,f);g.isReady=!0,null==t||t._removePendingData(g),u&&u()}}(e)}),void 0,null==t?void 0:t.offlineProvider,!0,(function(e,r){null==t||t._removePendingData(g),d&&e&&d(e.status+" "+e.statusText,r)})),g},a.ThinEngine.prototype.createRawTexture2DArray=c(!1),a.ThinEngine.prototype.createRawTexture3D=c(!0),a.ThinEngine.prototype.updateRawTexture2DArray=u(!1),a.ThinEngine.prototype.updateRawTexture3D=u(!0)},"./Engines/Extensions/engine.readTexture.ts":
- /*!**************************************************!*\
- !*** ./Engines/Extensions/engine.readTexture.ts ***!
- \**************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t),r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts").ThinEngine.prototype._readTexturePixels=function(e,t,r,n,i,o){void 0===n&&(n=-1),void 0===i&&(i=0),void 0===o&&(o=null);var s=this._gl;if(!s)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){var a=s.createFramebuffer();if(!a)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=a}s.bindFramebuffer(s.FRAMEBUFFER,this._dummyFramebuffer),n>-1?s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+n,e._webGLTexture,i):s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e._webGLTexture,i);var l=void 0!==e.type?this._getWebGLTextureType(e.type):s.UNSIGNED_BYTE;switch(l){case s.UNSIGNED_BYTE:o||(o=new Uint8Array(4*t*r)),l=s.UNSIGNED_BYTE;break;default:o||(o=new Float32Array(4*t*r)),l=s.FLOAT}return s.readPixels(0,0,t,r,s.RGBA,l,o),s.bindFramebuffer(s.FRAMEBUFFER,this._currentFramebuffer),o}},"./Engines/Extensions/engine.renderTarget.ts":
- /*!***************************************************!*\
- !*** ./Engines/Extensions/engine.renderTarget.ts ***!
- \***************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),o=r(/*! ../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),a=r(/*! ../constants */"./Engines/constants.ts"),l=r(/*! ../thinEngine */"./Engines/thinEngine.ts");l.ThinEngine.prototype.createRenderTargetTexture=function(e,t){var r=new s.RenderTargetCreationOptions;void 0!==t&&"object"==typeof t?(r.generateMipMaps=t.generateMipMaps,r.generateDepthBuffer=!!t.generateDepthBuffer,r.generateStencilBuffer=!!t.generateStencilBuffer,r.type=void 0===t.type?a.Constants.TEXTURETYPE_UNSIGNED_INT:t.type,r.samplingMode=void 0===t.samplingMode?a.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode,r.format=void 0===t.format?a.Constants.TEXTUREFORMAT_RGBA:t.format):(r.generateMipMaps=t,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.type=a.Constants.TEXTURETYPE_UNSIGNED_INT,r.samplingMode=a.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,r.format=a.Constants.TEXTUREFORMAT_RGBA),(r.type!==a.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(r.type!==a.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=a.Constants.TEXTURE_NEAREST_SAMPLINGMODE),r.type!==a.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(r.type=a.Constants.TEXTURETYPE_UNSIGNED_INT,o.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var n=this._gl,l=new i.InternalTexture(this,i.InternalTextureSource.RenderTarget),c=e.width||e,u=e.height||e,d=e.layers||0,h=this._getSamplingParameters(r.samplingMode,!!r.generateMipMaps),f=0!==d?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D,p=this._getRGBABufferInternalSizedFormat(r.type,r.format),m=this._getInternalFormat(r.format),g=this._getWebGLTextureType(r.type);this._bindTextureDirectly(f,l),0!==d?(l.is2DArray=!0,n.texImage3D(f,0,p,c,u,d,0,m,g,null)):n.texImage2D(f,0,p,c,u,0,m,g,null),n.texParameteri(f,n.TEXTURE_MAG_FILTER,h.mag),n.texParameteri(f,n.TEXTURE_MIN_FILTER,h.min),n.texParameteri(f,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(f,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),r.generateMipMaps&&this._gl.generateMipmap(f),this._bindTextureDirectly(f,null);var _=n.createFramebuffer();return this._bindUnboundFramebuffer(_),l._depthStencilBuffer=this._setupFramebufferDepthAttachments(!!r.generateStencilBuffer,r.generateDepthBuffer,c,u),l.is2DArray||n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,l._webGLTexture,0),this._bindUnboundFramebuffer(null),l._framebuffer=_,l.baseWidth=c,l.baseHeight=u,l.width=c,l.height=u,l.depth=d,l.isReady=!0,l.samples=1,l.generateMipMaps=!!r.generateMipMaps,l.samplingMode=r.samplingMode,l.type=r.type,l.format=r.format,l._generateDepthBuffer=r.generateDepthBuffer,l._generateStencilBuffer=!!r.generateStencilBuffer,this._internalTexturesCache.push(l),l},l.ThinEngine.prototype.createDepthStencilTexture=function(e,t){if(t.isCube){var r=e.width||e;return this._createDepthStencilCubeTexture(r,t)}return this._createDepthStencilTexture(e,t)},l.ThinEngine.prototype._createDepthStencilTexture=function(e,t){var r=this._gl,s=e.layers||0,a=0!==s?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D,l=new i.InternalTexture(this,i.InternalTextureSource.Depth);if(!this._caps.depthTextureExtension)return o.Logger.Error("Depth texture is not supported by your browser or hardware."),l;var c=Object(n.__assign)({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t);this._bindTextureDirectly(a,l,!0),this._setupDepthStencilTexture(l,e,c.generateStencil,c.bilinearFiltering,c.comparisonFunction);var u=c.generateStencil?r.UNSIGNED_INT_24_8:r.UNSIGNED_INT,d=c.generateStencil?r.DEPTH_STENCIL:r.DEPTH_COMPONENT,h=d;return this.webGLVersion>1&&(h=c.generateStencil?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24),l.is2DArray?r.texImage3D(a,0,h,l.width,l.height,s,0,d,u,null):r.texImage2D(a,0,h,l.width,l.height,0,d,u,null),this._bindTextureDirectly(a,null),l}},"./Engines/Extensions/engine.renderTargetCube.ts":
- /*!*******************************************************!*\
- !*** ./Engines/Extensions/engine.renderTargetCube.ts ***!
- \*******************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),o=r(/*! ../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../constants */"./Engines/constants.ts");r(/*! ../thinEngine */"./Engines/thinEngine.ts").ThinEngine.prototype.createRenderTargetCubeTexture=function(e,t){var r=Object(n.__assign)({generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:s.Constants.TEXTURETYPE_UNSIGNED_INT,samplingMode:s.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,format:s.Constants.TEXTUREFORMAT_RGBA},t);r.generateStencilBuffer=r.generateDepthBuffer&&r.generateStencilBuffer,(r.type!==s.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(r.type!==s.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE);var a=this._gl,l=new i.InternalTexture(this,i.InternalTextureSource.RenderTarget);this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,l,!0);var c=this._getSamplingParameters(r.samplingMode,r.generateMipMaps);r.type!==s.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(r.type=s.Constants.TEXTURETYPE_UNSIGNED_INT,o.Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,c.mag),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,c.min),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);for(var u=0;u<6;u++)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,this._getRGBABufferInternalSizedFormat(r.type,r.format),e,e,0,this._getInternalFormat(r.format),this._getWebGLTextureType(r.type),null);var d=a.createFramebuffer();return this._bindUnboundFramebuffer(d),l._depthStencilBuffer=this._setupFramebufferDepthAttachments(r.generateStencilBuffer,r.generateDepthBuffer,e,e),r.generateMipMaps&&a.generateMipmap(a.TEXTURE_CUBE_MAP),this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),l._framebuffer=d,l.width=e,l.height=e,l.isReady=!0,l.isCube=!0,l.samples=1,l.generateMipMaps=r.generateMipMaps,l.samplingMode=r.samplingMode,l.type=r.type,l.format=r.format,l._generateDepthBuffer=r.generateDepthBuffer,l._generateStencilBuffer=r.generateStencilBuffer,this._internalTexturesCache.push(l),l}},"./Engines/Extensions/engine.textureSelector.ts":
- /*!******************************************************!*\
- !*** ./Engines/Extensions/engine.textureSelector.ts ***!
- \******************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../engine */"./Engines/engine.ts");function i(e){if(this._excludedCompressedTextures&&this._excludedCompressedTextures.some((function(t){var r="\\b"+t+"\\b";return e&&(e===t||e.match(new RegExp(r,"g")))})))return e;var t=e.lastIndexOf(".");return(t>-1?e.substring(0,t):e)+this._textureFormatInUse}Object.defineProperty(n.Engine.prototype,"texturesSupported",{get:function(){var e=new Array;return this._caps.astc&&e.push("-astc.ktx"),this._caps.s3tc&&e.push("-dxt.ktx"),this._caps.pvrtc&&e.push("-pvrtc.ktx"),this._caps.etc2&&e.push("-etc2.ktx"),this._caps.etc1&&e.push("-etc1.ktx"),e},enumerable:!0,configurable:!0}),Object.defineProperty(n.Engine.prototype,"textureFormatInUse",{get:function(){return this._textureFormatInUse||null},enumerable:!0,configurable:!0}),n.Engine.prototype.setCompressedTextureExclusions=function(e){this._excludedCompressedTextures=e},n.Engine.prototype.setTextureFormatToUse=function(e){for(var t=this.texturesSupported,r=0,n=t.length;r<n;r++)for(var o=0,s=e.length;o<s;o++)if(t[r]===e[o].toLowerCase())return this._transformTextureUrl=i.bind(this),this._textureFormatInUse=t[r];return delete this._textureFormatInUse,delete this._transformTextureUrl,null}},"./Engines/Extensions/engine.transformFeedback.ts":
- /*!********************************************************!*\
- !*** ./Engines/Extensions/engine.transformFeedback.ts ***!
- \********************************************************/
- /*! exports provided: _forceTransformFeedbackToBundle */function(e,t,r){"use strict";r.r(t),r.d(t,"_forceTransformFeedbackToBundle",(function(){return i}));var n=r(/*! ../../Engines/engine */"./Engines/engine.ts"),i=!0;n.Engine.prototype.createTransformFeedback=function(){return this._gl.createTransformFeedback()},n.Engine.prototype.deleteTransformFeedback=function(e){this._gl.deleteTransformFeedback(e)},n.Engine.prototype.bindTransformFeedback=function(e){this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK,e)},n.Engine.prototype.beginTransformFeedback=function(e){void 0===e&&(e=!0),this._gl.beginTransformFeedback(e?this._gl.POINTS:this._gl.TRIANGLES)},n.Engine.prototype.endTransformFeedback=function(){this._gl.endTransformFeedback()},n.Engine.prototype.setTranformFeedbackVaryings=function(e,t){this._gl.transformFeedbackVaryings(e,t,this._gl.INTERLEAVED_ATTRIBS)},n.Engine.prototype.bindTransformFeedbackBuffer=function(e){this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e?e.underlyingResource:null)}},"./Engines/Extensions/engine.uniformBuffer.ts":
- /*!****************************************************!*\
- !*** ./Engines/Extensions/engine.uniformBuffer.ts ***!
- \****************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../../Meshes/WebGL/webGLDataBuffer */"./Meshes/WebGL/webGLDataBuffer.ts");n.ThinEngine.prototype.createUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");var r=new i.WebGLDataBuffer(t);return this.bindUniformBuffer(r),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),r.references=1,r},n.ThinEngine.prototype.createDynamicUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");var r=new i.WebGLDataBuffer(t);return this.bindUniformBuffer(r),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),r.references=1,r},n.ThinEngine.prototype.updateUniformBuffer=function(e,t,r,n){this.bindUniformBuffer(e),void 0===r&&(r=0),void 0===n?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(r,r+n)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(r,r+n)),this.bindUniformBuffer(null)},n.ThinEngine.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},n.ThinEngine.prototype.bindUniformBufferBase=function(e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},n.ThinEngine.prototype.bindUniformBlock=function(e,t,r){var n=e.program,i=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,i,r)}},"./Engines/Extensions/engine.videoTexture.ts":
- /*!***************************************************!*\
- !*** ./Engines/Extensions/engine.videoTexture.ts ***!
- \***************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../../Misc/canvasGenerator */"./Misc/canvasGenerator.ts");n.ThinEngine.prototype.updateVideoTexture=function(e,t,r){if(e&&!e._isDisabled){var n=this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0);this._unpackFlipY(!r);try{if(void 0===this._videoTextureSupported&&(this._gl.getError(),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t),0!==this._gl.getError()?this._videoTextureSupported=!1:this._videoTextureSupported=!0),this._videoTextureSupported)this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t);else{if(!e._workingCanvas){e._workingCanvas=i.CanvasGenerator.CreateCanvas(e.width,e.height);var o=e._workingCanvas.getContext("2d");if(!o)throw new Error("Unable to get 2d context");e._workingContext=o,e._workingCanvas.width=e.width,e._workingCanvas.height=e.height}e._workingContext.clearRect(0,0,e.width,e.height),e._workingContext.drawImage(t,0,0,t.videoWidth,t.videoHeight,0,0,e.width,e.height),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,e._workingCanvas)}e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),n||this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}catch(t){e._isDisabled=!0}}}},"./Engines/Extensions/engine.views.ts":
- /*!********************************************!*\
- !*** ./Engines/Extensions/engine.views.ts ***!
- \********************************************/
- /*! exports provided: EngineView */function(e,t,r){"use strict";r.r(t),r.d(t,"EngineView",(function(){return i}));var n=r(/*! ../engine */"./Engines/engine.ts"),i=function(){};n.Engine.prototype.getInputElement=function(){return this.inputElement||this.getRenderingCanvas()},n.Engine.prototype.registerView=function(e,t){var r=this;this.views||(this.views=[]);for(var n=0,i=this.views;n<i.length;n++){var o=i[n];if(o.target===e)return o}var s=this.getRenderingCanvas();s&&(e.width=s.width,e.height=s.height);var a={target:e,camera:t};return this.views.push(a),t&&t.onDisposeObservable.add((function(){r.unRegisterView(e)})),a},n.Engine.prototype.unRegisterView=function(e){if(!this.views)return this;for(var t=0,r=this.views;t<r.length;t++){var n=r[t];if(n.target===e){var i=this.views.indexOf(n);-1!==i&&this.views.splice(i,1);break}}return this},n.Engine.prototype._renderViews=function(){if(!this.views)return!1;var e=this.getRenderingCanvas();if(!e)return!1;for(var t=0,r=this.views;t<r.length;t++){var n=r[t],i=n.target,o=i.getContext("2d");if(o){var s=n.camera,a=null,l=null;if(s){if((l=s.getScene()).activeCameras.length)continue;this.activeView=n,a=l.activeCamera,l.activeCamera=s}var c=i.width!==i.clientWidth||i.height!==i.clientHeight;if(i.clientWidth&&i.clientHeight&&c&&(i.width=i.clientWidth,i.height=i.clientHeight,e.width=i.clientWidth,e.height=i.clientHeight,this.resize()),!e.width||!e.height)return!1;this._renderFrame(),o.drawImage(e,0,0),a&&l&&(l.activeCamera=a)}}return this.activeView=null,!0}},"./Engines/Extensions/engine.webVR.ts":
- /*!********************************************!*\
- !*** ./Engines/Extensions/engine.webVR.ts ***!
- \********************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../Maths/math.size */"./Maths/math.size.ts"),s=r(/*! ../../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../../Misc/tools */"./Misc/tools.ts"),l=r(/*! ../../Misc/domManagement */"./Misc/domManagement.ts");Object.defineProperty(i.Engine.prototype,"isInVRExclusivePointerMode",{get:function(){return this._vrExclusivePointerMode},enumerable:!0,configurable:!0}),i.Engine.prototype._prepareVRComponent=function(){this._vrSupported=!1,this._vrExclusivePointerMode=!1,this.onVRDisplayChangedObservable=new s.Observable,this.onVRRequestPresentComplete=new s.Observable,this.onVRRequestPresentStart=new s.Observable},i.Engine.prototype.isVRDevicePresent=function(){return!!this._vrDisplay},i.Engine.prototype.getVRDevice=function(){return this._vrDisplay},i.Engine.prototype.initWebVR=function(){return this.initWebVRAsync(),this.onVRDisplayChangedObservable},i.Engine.prototype.initWebVRAsync=function(){var e=this,t=function(){var t={vrDisplay:e._vrDisplay,vrSupported:e._vrSupported};e.onVRDisplayChangedObservable.notifyObservers(t),e._webVRInitPromise=new Promise((function(e){e(t)}))};if(!this._onVrDisplayConnect){this._onVrDisplayConnect=function(r){e._vrDisplay=r.display,t()},this._onVrDisplayDisconnect=function(){e._vrDisplay.cancelAnimationFrame(e._frameHandler),e._vrDisplay=void 0,e._frameHandler=i.Engine.QueueNewFrame(e._boundRenderFunction),t()},this._onVrDisplayPresentChange=function(){e._vrExclusivePointerMode=e._vrDisplay&&e._vrDisplay.isPresenting};var r=this.getHostWindow();r&&(r.addEventListener("vrdisplayconnect",this._onVrDisplayConnect),r.addEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),r.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange))}return this._webVRInitPromise=this._webVRInitPromise||this._getVRDisplaysAsync(),this._webVRInitPromise.then(t),this._webVRInitPromise},i.Engine.prototype._getVRDisplaysAsync=function(){var e=this;return new Promise((function(t){navigator.getVRDisplays?navigator.getVRDisplays().then((function(r){e._vrSupported=!0,e._vrDisplay=r[0],t({vrDisplay:e._vrDisplay,vrSupported:e._vrSupported})})):(e._vrDisplay=void 0,e._vrSupported=!1,t({vrDisplay:e._vrDisplay,vrSupported:e._vrSupported}))}))},i.Engine.prototype.enableVR=function(e){var t=this;if(this._vrDisplay&&!this._vrDisplay.isPresenting){this.onVRRequestPresentStart.notifyObservers(this);var r={highRefreshRate:!!this.vrPresentationAttributes&&this.vrPresentationAttributes.highRefreshRate,foveationLevel:this.vrPresentationAttributes?this.vrPresentationAttributes.foveationLevel:1,multiview:(this.getCaps().multiview||this.getCaps().oculusMultiview)&&e.useMultiview};this._vrDisplay.requestPresent([Object(n.__assign)({source:this.getRenderingCanvas(),attributes:r},r)]).then((function(){t.onVRRequestPresentComplete.notifyObservers(!0),t._onVRFullScreenTriggered()})).catch((function(){t.onVRRequestPresentComplete.notifyObservers(!1)}))}},i.Engine.prototype._onVRFullScreenTriggered=function(){if(this._vrDisplay&&this._vrDisplay.isPresenting){this._oldSize=new o.Size(this.getRenderWidth(),this.getRenderHeight()),this._oldHardwareScaleFactor=this.getHardwareScalingLevel();var e=this._vrDisplay.getEyeParameters("left");this.setHardwareScalingLevel(1),this.setSize(2*e.renderWidth,e.renderHeight)}else this.setHardwareScalingLevel(this._oldHardwareScaleFactor),this.setSize(this._oldSize.width,this._oldSize.height)},i.Engine.prototype.disableVR=function(){var e=this;this._vrDisplay&&this._vrDisplay.isPresenting&&this._vrDisplay.exitPresent().then((function(){return e._onVRFullScreenTriggered()})).catch((function(){return e._onVRFullScreenTriggered()})),l.DomManagement.IsWindowObjectExist()&&(window.removeEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted),window.removeEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted),this._onVrDisplayConnect&&(window.removeEventListener("vrdisplayconnect",this._onVrDisplayConnect),this._onVrDisplayDisconnect&&window.removeEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),this._onVrDisplayPresentChange&&window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),this._onVrDisplayConnect=null,this._onVrDisplayDisconnect=null))},i.Engine.prototype._connectVREvents=function(e,t){var r=this;if(this._onVRDisplayPointerRestricted=function(){e&&e.requestPointerLock()},this._onVRDisplayPointerUnrestricted=function(){if(t)t.exitPointerLock&&t.exitPointerLock();else{var e=r.getHostWindow();e.document&&e.document.exitPointerLock&&e.document.exitPointerLock()}},l.DomManagement.IsWindowObjectExist()){var n=this.getHostWindow();n.addEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted,!1),n.addEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted,!1)}},i.Engine.prototype._submitVRFrame=function(){if(this._vrDisplay&&this._vrDisplay.isPresenting)try{this._vrDisplay.submitFrame()}catch(e){a.Tools.Warn("webVR submitFrame has had an unexpected failure: "+e)}},i.Engine.prototype.isVRPresenting=function(){return this._vrDisplay&&this._vrDisplay.isPresenting},i.Engine.prototype._requestVRFrame=function(){this._frameHandler=i.Engine.QueueNewFrame(this._boundRenderFunction,this._vrDisplay)}},"./Engines/Extensions/index.ts":
- /*!*************************************!*\
- !*** ./Engines/Extensions/index.ts ***!
- \*************************************/
- /*! exports provided: _OcclusionDataStorage, _forceTransformFeedbackToBundle, EngineView */function(e,t,r){"use strict";r.r(t),r(/*! ./engine.alpha */"./Engines/Extensions/engine.alpha.ts");var n=r(/*! ./engine.occlusionQuery */"./Engines/Extensions/engine.occlusionQuery.ts");r.d(t,"_OcclusionDataStorage",(function(){return n._OcclusionDataStorage}));var i=r(/*! ./engine.transformFeedback */"./Engines/Extensions/engine.transformFeedback.ts");r.d(t,"_forceTransformFeedbackToBundle",(function(){return i._forceTransformFeedbackToBundle})),r(/*! ./engine.multiview */"./Engines/Extensions/engine.multiview.ts"),r(/*! ./engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),r(/*! ./engine.dynamicTexture */"./Engines/Extensions/engine.dynamicTexture.ts"),r(/*! ./engine.videoTexture */"./Engines/Extensions/engine.videoTexture.ts"),r(/*! ./engine.multiRender */"./Engines/Extensions/engine.multiRender.ts"),r(/*! ./engine.cubeTexture */"./Engines/Extensions/engine.cubeTexture.ts"),r(/*! ./engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),r(/*! ./engine.renderTargetCube */"./Engines/Extensions/engine.renderTargetCube.ts"),r(/*! ./engine.webVR */"./Engines/Extensions/engine.webVR.ts"),r(/*! ./engine.uniformBuffer */"./Engines/Extensions/engine.uniformBuffer.ts");var o=r(/*! ./engine.views */"./Engines/Extensions/engine.views.ts");r.d(t,"EngineView",(function(){return o.EngineView})),r(/*! ./engine.readTexture */"./Engines/Extensions/engine.readTexture.ts"),r(/*! ./engine.textureSelector */"./Engines/Extensions/engine.textureSelector.ts")},"./Engines/IPipelineContext.ts":
- /*!*************************************!*\
- !*** ./Engines/IPipelineContext.ts ***!
- \*************************************/
- /*! no static exports found */function(e,t){},"./Engines/Processors/Expressions/Operators/shaderDefineAndOperator.ts":
- /*!*****************************************************************************!*\
- !*** ./Engines/Processors/Expressions/Operators/shaderDefineAndOperator.ts ***!
- \*****************************************************************************/
- /*! exports provided: ShaderDefineAndOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineAndOperator",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.ts":
- /*!************************************************************************************!*\
- !*** ./Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.ts ***!
- \************************************************************************************/
- /*! exports provided: ShaderDefineArithmeticOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineArithmeticOperator",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(t,r,n){var i=e.call(this)||this;return i.define=t,i.operand=r,i.testValue=n,i}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){var t=e[this.define];void 0===t&&(t=this.define);var r=!1,n=parseInt(t),i=parseInt(this.testValue);switch(this.operand){case">":r=n>i;break;case"<":r=n<i;break;case"<=":r=n<=i;break;case">=":r=n>=i;break;case"==":r=n===i}return r},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.ts":
- /*!***********************************************************************************!*\
- !*** ./Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.ts ***!
- \***********************************************************************************/
- /*! exports provided: ShaderDefineIsDefinedOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineIsDefinedOperator",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(t,r){void 0===r&&(r=!1);var n=e.call(this)||this;return n.define=t,n.not=r,n}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){var t=void 0!==e[this.define];return this.not&&(t=!t),t},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/Operators/shaderDefineOrOperator.ts":
- /*!****************************************************************************!*\
- !*** ./Engines/Processors/Expressions/Operators/shaderDefineOrOperator.ts ***!
- \****************************************************************************/
- /*! exports provided: ShaderDefineOrOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineOrOperator",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/shaderDefineExpression.ts":
- /*!******************************************************************!*\
- !*** ./Engines/Processors/Expressions/shaderDefineExpression.ts ***!
- \******************************************************************/
- /*! exports provided: ShaderDefineExpression */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineExpression",(function(){return n}));var n=function(){function e(){}return e.prototype.isTrue=function(e){return!0},e.postfixToInfix=function(t){for(var r=[],n=0,i=t;n<i.length;n++){var o=i[n];if(void 0===e._OperatorPriority[o])r.push(o);else{var s=r[r.length-1],a=r[r.length-2];r.length-=2,r.push("("+a+o+s+")")}}return r[r.length-1]},e.infixToPostfix=function(t){for(var r=[],n=-1,i=function(){""!==(c=c.trim())&&(r.push(c),c="")},o=function(t){n<e._Stack.length-1&&(e._Stack[++n]=t)},s=function(){return e._Stack[n]},a=function(){return-1===n?"!!INVALID EXPRESSION!!":e._Stack[n--]},l=0,c="";l<t.length;){var u=t.charAt(l),d=l<t.length-1?t.substr(l,2):"";if("("===u)c="",o(u);else if(")"===u){for(i();-1!==n&&"("!==s();)r.push(a());a()}else if(e._OperatorPriority[d]>1){for(i();-1!==n&&e._OperatorPriority[s()]>=e._OperatorPriority[d];)r.push(a());o(d),l++}else c+=u;l++}for(i();-1!==n;)"("===s()?a():r.push(a());return r},e._OperatorPriority={")":0,"(":1,"||":2,"&&":3},e._Stack=["","","","","","","","","","","","","","","","","","","",""],e}()},"./Engines/Processors/shaderCodeConditionNode.ts":
- /*!*******************************************************!*\
- !*** ./Engines/Processors/shaderCodeConditionNode.ts ***!
- \*******************************************************/
- /*! exports provided: ShaderCodeConditionNode */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderCodeConditionNode",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.process=function(e,t){for(var r=0;r<this.children.length;r++){var n=this.children[r];if(n.isValid(e))return n.process(e,t)}return""},t}(r(/*! ./shaderCodeNode */"./Engines/Processors/shaderCodeNode.ts").ShaderCodeNode)},"./Engines/Processors/shaderCodeCursor.ts":
- /*!************************************************!*\
- !*** ./Engines/Processors/shaderCodeCursor.ts ***!
- \************************************************/
- /*! exports provided: ShaderCodeCursor */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderCodeCursor",(function(){return n}));var n=function(){function e(){}return Object.defineProperty(e.prototype,"currentLine",{get:function(){return this._lines[this.lineIndex]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canRead",{get:function(){return this.lineIndex<this._lines.length-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lines",{set:function(e){this._lines=[];for(var t=0,r=e;t<r.length;t++){var n=r[t];if("#"!==n[0])for(var i=n.split(";"),o=0;o<i.length;o++){var s=i[o];(s=s.trim())&&this._lines.push(s+(o!==i.length-1?";":""))}else this._lines.push(n)}},enumerable:!1,configurable:!0}),e}()},"./Engines/Processors/shaderCodeInliner.ts":
- /*!*************************************************!*\
- !*** ./Engines/Processors/shaderCodeInliner.ts ***!
- \*************************************************/
- /*! exports provided: ShaderCodeInliner */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderCodeInliner",(function(){return n}));var n=function(){function e(e,t){void 0===t&&(t=20),this.debug=!1,this._sourceCode=e,this._numMaxIterations=t,this._functionDescr=[],this.inlineToken="#define inline"}return Object.defineProperty(e.prototype,"code",{get:function(){return this._sourceCode},enumerable:!1,configurable:!0}),e.prototype.processCode=function(){this.debug&&console.log("Start inlining process (code size="+this._sourceCode.length+")..."),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&console.log("End of inlining process.")},e.prototype._collectFunctions=function(){for(var t=0;t<this._sourceCode.length;){var r=this._sourceCode.indexOf(this.inlineToken,t);if(r<0)break;var n=this._sourceCode.indexOf("(",r+this.inlineToken.length);if(n<0)this.debug&&console.warn("Could not find the opening parenthesis after the token. startIndex="+t),t=r+this.inlineToken.length;else{var i=e._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(r+this.inlineToken.length,n));if(i){var o=[i[3],i[4]],s=o[0],a=o[1],l=this._extractBetweenMarkers("(",")",this._sourceCode,n);if(l<0)this.debug&&console.warn("Could not extract the parameters the function '"+a+"' (type="+s+"). funcParamsStartIndex="+n),t=r+this.inlineToken.length;else{var c=this._sourceCode.substring(n+1,l),u=this._skipWhitespaces(this._sourceCode,l+1);if(u!==this._sourceCode.length){var d=this._extractBetweenMarkers("{","}",this._sourceCode,u);if(d<0)this.debug&&console.warn("Could not extract the body of the function '"+a+"' (type="+s+"). funcBodyStartIndex="+u),t=r+this.inlineToken.length;else{for(var h=this._sourceCode.substring(u,d+1),f=this._removeComments(c).split(","),p=[],m=0;m<f.length;++m){var g=f[m].trim(),_=g.lastIndexOf(" ");_>=0&&p.push(g.substring(_+1))}"void"!==s&&p.push("return"),this._functionDescr.push({name:a,type:s,parameters:p,body:h,callIndex:0}),t=d+1;var v=r>0?this._sourceCode.substring(0,r):"",y=d+1<this._sourceCode.length-1?this._sourceCode.substring(d+1):"";this._sourceCode=v+y,t-=d+1-r}}else this.debug&&console.warn("Could not extract the body of the function '"+a+"' (type="+s+"). funcParamsEndIndex="+l),t=r+this.inlineToken.length}}else this.debug&&console.warn("Could not extract the name/type of the function from: "+this._sourceCode.substring(r+this.inlineToken.length,n)),t=r+this.inlineToken.length}}this.debug&&console.log("Collect functions: "+this._functionDescr.length+" functions found. functionDescr=",this._functionDescr)},e.prototype._processInlining=function(e){for(void 0===e&&(e=20);e-- >=0&&this._replaceFunctionCallsByCode(););return this.debug&&console.log("numMaxIterations is "+e+" after inlining process"),e>=0},e.prototype._extractBetweenMarkers=function(e,t,r,n){for(var i=n,o=0,s="";i<r.length;){var a=r.charAt(i);if(s)a===s?'"'===s||"'"===s?"\\"!==r.charAt(i-1)&&(s=""):s="":"*/"===s&&"*"===a&&i+1<r.length&&("/"===r.charAt(i+1)&&(s=""),""===s&&i++);else switch(a){case e:o++;break;case t:o--;break;case'"':case"'":case"`":s=a;break;case"/":if(i+1<r.length){var l=r.charAt(i+1);"/"===l?s="\n":"*"===l&&(s="*/")}}if(i++,0===o)break}return 0===o?i-1:-1},e.prototype._skipWhitespaces=function(e,t){for(;t<e.length;){var r=e[t];if(" "!==r&&"\n"!==r&&"\r"!==r&&"\t"!==r&&"\n"!==r&&" "!==r)break;t++}return t},e.prototype._removeComments=function(e){for(var t=0,r="",n=!1,i=[];t<e.length;){var o=e.charAt(t);if(r)o===r?'"'===r||"'"===r?("\\"!==e.charAt(t-1)&&(r=""),i.push(o)):(r="",n=!1):"*/"===r&&"*"===o&&t+1<e.length?("/"===e.charAt(t+1)&&(r=""),""===r&&(n=!1,t++)):n||i.push(o);else{switch(o){case'"':case"'":case"`":r=o;break;case"/":if(t+1<e.length){var s=e.charAt(t+1);"/"===s?(r="\n",n=!0):"*"===s&&(r="*/",n=!0)}}n||i.push(o)}t++}return i.join("")},e.prototype._replaceFunctionCallsByCode=function(){for(var e=!1,t=0,r=this._functionDescr;t<r.length;t++)for(var n=r[t],i=n.name,o=n.type,s=n.parameters,a=n.body,l=0;l<this._sourceCode.length;){var c=this._sourceCode.indexOf(i,l);if(c<0)break;var u=this._skipWhitespaces(this._sourceCode,c+i.length);if(u!==this._sourceCode.length&&"("===this._sourceCode.charAt(u)){var d=this._extractBetweenMarkers("(",")",this._sourceCode,u);if(d<0)this.debug&&console.warn("Could not extract the parameters of the function call. Function '"+i+"' (type="+o+"). callParamsStartIndex="+u),l=c+i.length;else{for(var h=this._sourceCode.substring(u+1,d),f=this._removeComments(h).split(","),p=[],m=0;m<f.length;++m){var g=f[m].trim();p.push(g)}var _="void"!==o?i+"_"+n.callIndex++:null;if(_&&p.push(_+" ="),p.length===s.length){l=d+1;var v=this._replaceNames(a,s,p),y=c>0?this._sourceCode.substring(0,c):"",b=d+1<this._sourceCode.length-1?this._sourceCode.substring(d+1):"";if(_){var A=this._findBackward(this._sourceCode,c-1,"\n");y=this._sourceCode.substring(0,A+1);var T=this._sourceCode.substring(A+1,c);this._sourceCode=y+o+" "+_+";\n"+v+"\n"+T+_+b,this.debug&&console.log("Replace function call by code. Function '"+i+"' (type="+o+"). injectDeclarationIndex="+A)}else this._sourceCode=y+v+b,l+=v.length-(d+1-c),this.debug&&console.log("Replace function call by code. Function '"+i+"' (type="+o+"). functionCallIndex="+c);e=!0}else this.debug&&console.warn("Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '"+i+"' (type="+o+"). function parameters="+s+", call parameters="+p),l=c+i.length}}else l=c+i.length}return e},e.prototype._findBackward=function(e,t,r){for(;t>=0&&e.charAt(t)!==r;)t--;return t},e.prototype._escapeRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},e.prototype._replaceNames=function(e,t,r){for(var n=0;n<t.length;++n){var i=new RegExp(this._escapeRegExp(t[n]),"g"),o=r[n];e=e.replace(i,o)}return e},e._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/,e}()},"./Engines/Processors/shaderCodeNode.ts":
- /*!**********************************************!*\
- !*** ./Engines/Processors/shaderCodeNode.ts ***!
- \**********************************************/
- /*! exports provided: ShaderCodeNode */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderCodeNode",(function(){return i}));var n=r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts"),i=function(){function e(){this.children=[]}return e.prototype.isValid=function(e){return!0},e.prototype.process=function(e,t){var r="";if(this.line){var i=this.line,o=t.processor;o&&(o.lineProcessor&&(i=o.lineProcessor(i,t.isFragment)),o.attributeProcessor&&n.StringTools.StartsWith(this.line,"attribute")?i=o.attributeProcessor(this.line):o.varyingProcessor&&n.StringTools.StartsWith(this.line,"varying")?i=o.varyingProcessor(this.line,t.isFragment):(o.uniformProcessor||o.uniformBufferProcessor)&&n.StringTools.StartsWith(this.line,"uniform")&&(/uniform (.+) (.+)/.test(this.line)?o.uniformProcessor&&(i=o.uniformProcessor(this.line,t.isFragment)):o.uniformBufferProcessor&&(i=o.uniformBufferProcessor(this.line,t.isFragment),t.lookForClosingBracketForUniformBuffer=!0)),o.endOfUniformBufferProcessor&&t.lookForClosingBracketForUniformBuffer&&-1!==this.line.indexOf("}")&&(t.lookForClosingBracketForUniformBuffer=!1,i=o.endOfUniformBufferProcessor(this.line,t.isFragment))),r+=i+"\r\n"}return this.children.forEach((function(n){r+=n.process(e,t)})),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),r},e}()},"./Engines/Processors/shaderCodeTestNode.ts":
- /*!**************************************************!*\
- !*** ./Engines/Processors/shaderCodeTestNode.ts ***!
- \**************************************************/
- /*! exports provided: ShaderCodeTestNode */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderCodeTestNode",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.isValid=function(e){return this.testExpression.isTrue(e)},t}(r(/*! ./shaderCodeNode */"./Engines/Processors/shaderCodeNode.ts").ShaderCodeNode)},"./Engines/Processors/shaderProcessor.ts":
- /*!***********************************************!*\
- !*** ./Engines/Processors/shaderProcessor.ts ***!
- \***********************************************/
- /*! exports provided: ShaderProcessor */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderProcessor",(function(){return m}));var n=r(/*! ./shaderCodeNode */"./Engines/Processors/shaderCodeNode.ts"),i=r(/*! ./shaderCodeCursor */"./Engines/Processors/shaderCodeCursor.ts"),o=r(/*! ./shaderCodeConditionNode */"./Engines/Processors/shaderCodeConditionNode.ts"),s=r(/*! ./shaderCodeTestNode */"./Engines/Processors/shaderCodeTestNode.ts"),a=r(/*! ./Expressions/Operators/shaderDefineIsDefinedOperator */"./Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.ts"),l=r(/*! ./Expressions/Operators/shaderDefineOrOperator */"./Engines/Processors/Expressions/Operators/shaderDefineOrOperator.ts"),c=r(/*! ./Expressions/Operators/shaderDefineAndOperator */"./Engines/Processors/Expressions/Operators/shaderDefineAndOperator.ts"),u=r(/*! ./Expressions/shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts"),d=r(/*! ./Expressions/Operators/shaderDefineArithmeticOperator */"./Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.ts"),h=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),f=/defined\s*?\((.+?)\)/g,p=/defined\s*?\[(.+?)\]/g,m=function(){function e(){}return e.Process=function(e,t,r){var n=this;this._ProcessIncludes(e,t,(function(e){var i=n._ProcessShaderConversion(e,t);r(i)}))},e._ProcessPrecision=function(e,t){var r=t.shouldUseHighPrecisionShader;return-1===e.indexOf("precision highp float")?e=r?"precision highp float;\n"+e:"precision mediump float;\n"+e:r||(e=e.replace("precision highp float","precision mediump float")),e},e._ExtractOperation=function(e){var t=/defined\((.+)\)/.exec(e);if(t&&t.length)return new a.ShaderDefineIsDefinedOperator(t[1].trim(),"!"===e[0]);for(var r="",n=0,i=0,o=["==",">=","<=","<",">"];i<o.length&&(r=o[i],!((n=e.indexOf(r))>-1));i++);if(-1===n)return new a.ShaderDefineIsDefinedOperator(e);var s=e.substring(0,n).trim(),l=e.substring(n+r.length).trim();return new d.ShaderDefineArithmeticOperator(s,r,l)},e._BuildSubExpression=function(e){e=e.replace(f,"defined[$1]");for(var t=[],r=0,n=u.ShaderDefineExpression.infixToPostfix(e);r<n.length;r++){var i=n[r];if("||"!==i&&"&&"!==i)t.push(i);else if(t.length>=2){var o=t[t.length-1],s=t[t.length-2];t.length-=2;var a="&&"==i?new c.ShaderDefineAndOperator:new l.ShaderDefineOrOperator;"string"==typeof o&&(o=o.replace(p,"defined($1)")),"string"==typeof s&&(s=s.replace(p,"defined($1)")),a.leftOperand="string"==typeof s?this._ExtractOperation(s):s,a.rightOperand="string"==typeof o?this._ExtractOperation(o):o,t.push(a)}}var d=t[t.length-1];return"string"==typeof d&&(d=d.replace(p,"defined($1)")),"string"==typeof d?this._ExtractOperation(d):d},e._BuildExpression=function(e,t){var r=new s.ShaderCodeTestNode,n=e.substring(0,t),i=e.substring(t);return i=i.substring(0,(i.indexOf("//")+1||i.length+1)-1).trim(),r.testExpression="#ifdef"===n?new a.ShaderDefineIsDefinedOperator(i):"#ifndef"===n?new a.ShaderDefineIsDefinedOperator(i,!0):this._BuildSubExpression(i),r},e._MoveCursorWithinIf=function(e,t,r){for(var i=e.currentLine;this._MoveCursor(e,r);){var o=(i=e.currentLine).substring(0,5).toLowerCase();if("#else"===o){var s=new n.ShaderCodeNode;return t.children.push(s),void this._MoveCursor(e,s)}if("#elif"===o){var a=this._BuildExpression(i,5);t.children.push(a),r=a}}},e._MoveCursor=function(e,t){for(;e.canRead;){e.lineIndex++;var r=e.currentLine,i=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(r);if(i&&i.length)switch(i[0]){case"#ifdef":var s=new o.ShaderCodeConditionNode;t.children.push(s);var a=this._BuildExpression(r,6);s.children.push(a),this._MoveCursorWithinIf(e,s,a);break;case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":s=new o.ShaderCodeConditionNode,t.children.push(s),a=this._BuildExpression(r,7),s.children.push(a),this._MoveCursorWithinIf(e,s,a);break;case"#if":s=new o.ShaderCodeConditionNode,a=this._BuildExpression(r,3),t.children.push(s),s.children.push(a),this._MoveCursorWithinIf(e,s,a)}else{var l=new n.ShaderCodeNode;if(l.line=r,t.children.push(l),"#"===r[0]&&"d"===r[1]){var c=r.replace(";","").split(" ");l.additionalDefineKey=c[1],3===c.length&&(l.additionalDefineValue=c[2])}}}return!1},e._EvaluatePreProcessors=function(e,t,r){var o=new n.ShaderCodeNode,s=new i.ShaderCodeCursor;return s.lineIndex=-1,s.lines=e.split("\n"),this._MoveCursor(s,o),o.process(t,r)},e._PreparePreProcessors=function(e){for(var t={},r=0,n=e.defines;r<n.length;r++){var i=n[r].replace("#define","").replace(";","").trim().split(" ");t[i[0]]=i.length>1?i[1]:""}return t.GL_ES="true",t.__VERSION__=e.version,t[e.platformName]="true",t},e._ProcessShaderConversion=function(e,t){var r=this._ProcessPrecision(e,t);if(!t.processor)return r;if(-1!==r.indexOf("#version 3"))return r.replace("#version 300 es","");var n=t.defines,i=this._PreparePreProcessors(t);return t.processor.preProcessor&&(r=t.processor.preProcessor(r,n,t.isFragment)),r=this._EvaluatePreProcessors(r,i,t),t.processor.postProcessor&&(r=t.processor.postProcessor(r,n,t.isFragment)),r},e._ProcessIncludes=function(t,r,n){for(var i=this,o=/#include<(.+)>(\((.*)\))*(\[(.*)\])*/g,s=o.exec(t),a=new String(t),l=!1;null!=s;){var c=s[1];if(-1!==c.indexOf("__decl__")&&(c=c.replace(/__decl__/,""),r.supportsUniformBuffers&&(c=(c=c.replace(/Vertex/,"Ubo")).replace(/Fragment/,"Ubo")),c+="Declaration"),!r.includesShadersStore[c]){var u=r.shadersRepository+"ShadersInclude/"+c+".fx";return void e._FileToolsLoadFile(u,(function(e){r.includesShadersStore[c]=e,i._ProcessIncludes(a,r,n)}))}var d=r.includesShadersStore[c];if(s[2])for(var h=s[3].split(","),f=0;f<h.length;f+=2){var p=new RegExp(h[f],"g"),m=h[f+1];d=d.replace(p,m)}if(s[4]){var g=s[5];if(-1!==g.indexOf("..")){var _=g.split(".."),v=parseInt(_[0]),y=parseInt(_[1]),b=d.slice(0);d="",isNaN(y)&&(y=r.indexParameters[_[1]]);for(var A=v;A<y;A++)r.supportsUniformBuffers||(b=b.replace(/light\{X\}.(\w*)/g,(function(e,t){return t+"{X}"}))),d+=b.replace(/\{X\}/g,A.toString())+"\n"}else r.supportsUniformBuffers||(d=d.replace(/light\{X\}.(\w*)/g,(function(e,t){return t+"{X}"}))),d=d.replace(/\{X\}/g,g)}a=a.replace(s[0],d),l=l||d.indexOf("#include<")>=0,s=o.exec(t)}l?this._ProcessIncludes(a.toString(),r,n):n(a)},e._FileToolsLoadFile=function(e,t,r,n,i,o){throw h._DevTools.WarnImport("FileTools")},e}()},"./Engines/WebGL/webGL2ShaderProcessors.ts":
- /*!*************************************************!*\
- !*** ./Engines/WebGL/webGL2ShaderProcessors.ts ***!
- \*************************************************/
- /*! exports provided: WebGL2ShaderProcessor */function(e,t,r){"use strict";r.r(t),r.d(t,"WebGL2ShaderProcessor",(function(){return n}));var n=function(){function e(){}return e.prototype.attributeProcessor=function(e){return e.replace("attribute","in")},e.prototype.varyingProcessor=function(e,t){return e.replace("varying",t?"in":"out")},e.prototype.postProcessor=function(e,t,r){var n=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),r)e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(n?"":"out vec4 glFragColor;\n")+"void main(");else if(-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e},e}()},"./Engines/WebGL/webGLPipelineContext.ts":
- /*!***********************************************!*\
- !*** ./Engines/WebGL/webGLPipelineContext.ts ***!
- \***********************************************/
- /*! exports provided: WebGLPipelineContext */function(e,t,r){"use strict";r.r(t),r.d(t,"WebGLPipelineContext",(function(){return n}));var n=function(){function e(){this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null}return Object.defineProperty(e.prototype,"isAsync",{get:function(){return this.isParallelCompiled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return!!this.program&&(!this.isParallelCompiled||this.engine._isRenderingStateCompiled(this))},enumerable:!1,configurable:!0}),e.prototype._handlesSpectorRebuildCallback=function(e){e&&this.program&&e(this.program)},e.prototype._getVertexShaderCode=function(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null},e.prototype._getFragmentShaderCode=function(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null},e}()},"./Engines/constants.ts":
- /*!******************************!*\
- !*** ./Engines/constants.ts ***!
- \******************************/
- /*! exports provided: Constants */function(e,t,r){"use strict";r.r(t),r.d(t,"Constants",(function(){return n}));var n=function(){function e(){}return e.ALPHA_DISABLE=0,e.ALPHA_ADD=1,e.ALPHA_COMBINE=2,e.ALPHA_SUBTRACT=3,e.ALPHA_MULTIPLY=4,e.ALPHA_MAXIMIZED=5,e.ALPHA_ONEONE=6,e.ALPHA_PREMULTIPLIED=7,e.ALPHA_PREMULTIPLIED_PORTERDUFF=8,e.ALPHA_INTERPOLATE=9,e.ALPHA_SCREENMODE=10,e.ALPHA_ONEONE_ONEONE=11,e.ALPHA_ALPHATOCOLOR=12,e.ALPHA_REVERSEONEMINUS=13,e.ALPHA_SRC_DSTONEMINUSSRCALPHA=14,e.ALPHA_ONEONE_ONEZERO=15,e.ALPHA_EXCLUSION=16,e.ALPHA_EQUATION_ADD=0,e.ALPHA_EQUATION_SUBSTRACT=1,e.ALPHA_EQUATION_REVERSE_SUBTRACT=2,e.ALPHA_EQUATION_MAX=3,e.ALPHA_EQUATION_MIN=4,e.ALPHA_EQUATION_DARKEN=5,e.DELAYLOADSTATE_NONE=0,e.DELAYLOADSTATE_LOADED=1,e.DELAYLOADSTATE_LOADING=2,e.DELAYLOADSTATE_NOTLOADED=4,e.NEVER=512,e.ALWAYS=519,e.LESS=513,e.EQUAL=514,e.LEQUAL=515,e.GREATER=516,e.GEQUAL=518,e.NOTEQUAL=517,e.KEEP=7680,e.REPLACE=7681,e.INCR=7682,e.DECR=7683,e.INVERT=5386,e.INCR_WRAP=34055,e.DECR_WRAP=34056,e.TEXTURE_CLAMP_ADDRESSMODE=0,e.TEXTURE_WRAP_ADDRESSMODE=1,e.TEXTURE_MIRROR_ADDRESSMODE=2,e.TEXTUREFORMAT_ALPHA=0,e.TEXTUREFORMAT_LUMINANCE=1,e.TEXTUREFORMAT_LUMINANCE_ALPHA=2,e.TEXTUREFORMAT_RGB=4,e.TEXTUREFORMAT_RGBA=5,e.TEXTUREFORMAT_RED=6,e.TEXTUREFORMAT_R=6,e.TEXTUREFORMAT_RG=7,e.TEXTUREFORMAT_RED_INTEGER=8,e.TEXTUREFORMAT_R_INTEGER=8,e.TEXTUREFORMAT_RG_INTEGER=9,e.TEXTUREFORMAT_RGB_INTEGER=10,e.TEXTUREFORMAT_RGBA_INTEGER=11,e.TEXTURETYPE_UNSIGNED_BYTE=0,e.TEXTURETYPE_UNSIGNED_INT=0,e.TEXTURETYPE_FLOAT=1,e.TEXTURETYPE_HALF_FLOAT=2,e.TEXTURETYPE_BYTE=3,e.TEXTURETYPE_SHORT=4,e.TEXTURETYPE_UNSIGNED_SHORT=5,e.TEXTURETYPE_INT=6,e.TEXTURETYPE_UNSIGNED_INTEGER=7,e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,e.TEXTURETYPE_UNSIGNED_INT_24_8=12,e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,e.TEXTURE_NEAREST_SAMPLINGMODE=1,e.TEXTURE_NEAREST_NEAREST=1,e.TEXTURE_BILINEAR_SAMPLINGMODE=2,e.TEXTURE_LINEAR_LINEAR=2,e.TEXTURE_TRILINEAR_SAMPLINGMODE=3,e.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,e.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,e.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,e.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,e.TEXTURE_NEAREST_LINEAR=7,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,e.TEXTURE_LINEAR_NEAREST=12,e.TEXTURE_EXPLICIT_MODE=0,e.TEXTURE_SPHERICAL_MODE=1,e.TEXTURE_PLANAR_MODE=2,e.TEXTURE_CUBIC_MODE=3,e.TEXTURE_PROJECTION_MODE=4,e.TEXTURE_SKYBOX_MODE=5,e.TEXTURE_INVCUBIC_MODE=6,e.TEXTURE_EQUIRECTANGULAR_MODE=7,e.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,e.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,e.TEXTURE_FILTERING_QUALITY_OFFLINE=4096,e.TEXTURE_FILTERING_QUALITY_HIGH=64,e.TEXTURE_FILTERING_QUALITY_MEDIUM=16,e.TEXTURE_FILTERING_QUALITY_LOW=8,e.SCALEMODE_FLOOR=1,e.SCALEMODE_NEAREST=2,e.SCALEMODE_CEILING=3,e.MATERIAL_TextureDirtyFlag=1,e.MATERIAL_LightDirtyFlag=2,e.MATERIAL_FresnelDirtyFlag=4,e.MATERIAL_AttributesDirtyFlag=8,e.MATERIAL_MiscDirtyFlag=16,e.MATERIAL_AllDirtyFlag=31,e.MATERIAL_TriangleFillMode=0,e.MATERIAL_WireFrameFillMode=1,e.MATERIAL_PointFillMode=2,e.MATERIAL_PointListDrawMode=3,e.MATERIAL_LineListDrawMode=4,e.MATERIAL_LineLoopDrawMode=5,e.MATERIAL_LineStripDrawMode=6,e.MATERIAL_TriangleStripDrawMode=7,e.MATERIAL_TriangleFanDrawMode=8,e.MATERIAL_ClockWiseSideOrientation=0,e.MATERIAL_CounterClockWiseSideOrientation=1,e.ACTION_NothingTrigger=0,e.ACTION_OnPickTrigger=1,e.ACTION_OnLeftPickTrigger=2,e.ACTION_OnRightPickTrigger=3,e.ACTION_OnCenterPickTrigger=4,e.ACTION_OnPickDownTrigger=5,e.ACTION_OnDoublePickTrigger=6,e.ACTION_OnPickUpTrigger=7,e.ACTION_OnPickOutTrigger=16,e.ACTION_OnLongPressTrigger=8,e.ACTION_OnPointerOverTrigger=9,e.ACTION_OnPointerOutTrigger=10,e.ACTION_OnEveryFrameTrigger=11,e.ACTION_OnIntersectionEnterTrigger=12,e.ACTION_OnIntersectionExitTrigger=13,e.ACTION_OnKeyDownTrigger=14,e.ACTION_OnKeyUpTrigger=15,e.PARTICLES_BILLBOARDMODE_Y=2,e.PARTICLES_BILLBOARDMODE_ALL=7,e.PARTICLES_BILLBOARDMODE_STRETCHED=8,e.MESHES_CULLINGSTRATEGY_STANDARD=0,e.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,e.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,e.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,e.SCENELOADER_NO_LOGGING=0,e.SCENELOADER_MINIMAL_LOGGING=1,e.SCENELOADER_SUMMARY_LOGGING=2,e.SCENELOADER_DETAILED_LOGGING=3,e.PREPASS_COLOR_INDEX=0,e.PREPASS_IRRADIANCE_INDEX=1,e.PREPASS_DEPTHNORMAL_INDEX=2,e.PREPASS_ALBEDO_INDEX=3,e}()},"./Engines/engine.ts":
- /*!***************************!*\
- !*** ./Engines/engine.ts ***!
- \***************************/
- /*! exports provided: Engine */function(e,t,r){"use strict";r.r(t),r.d(t,"Engine",(function(){return p}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),s=r(/*! ./engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),l=r(/*! ./thinEngine */"./Engines/thinEngine.ts"),c=r(/*! ./constants */"./Engines/constants.ts"),u=r(/*! ../Misc/performanceMonitor */"./Misc/performanceMonitor.ts"),d=r(/*! ../Misc/perfCounter */"./Misc/perfCounter.ts"),h=r(/*! ../Meshes/WebGL/webGLDataBuffer */"./Meshes/WebGL/webGLDataBuffer.ts"),f=r(/*! ../Misc/logger */"./Misc/logger.ts"),p=(r(/*! ./Extensions/engine.alpha */"./Engines/Extensions/engine.alpha.ts"),r(/*! ./Extensions/engine.readTexture */"./Engines/Extensions/engine.readTexture.ts"),function(e){function t(r,n,s,a){void 0===a&&(a=!1);var l=e.call(this,r,n,s,a)||this;if(l.enableOfflineSupport=!1,l.disableManifestCheck=!1,l.scenes=new Array,l.onNewSceneAddedObservable=new i.Observable,l.postProcesses=new Array,l.isPointerLock=!1,l.onResizeObservable=new i.Observable,l.onCanvasBlurObservable=new i.Observable,l.onCanvasFocusObservable=new i.Observable,l.onCanvasPointerOutObservable=new i.Observable,l.onBeginFrameObservable=new i.Observable,l.customAnimationFrameRequester=null,l.onEndFrameObservable=new i.Observable,l.onBeforeShaderCompilationObservable=new i.Observable,l.onAfterShaderCompilationObservable=new i.Observable,l._deterministicLockstep=!1,l._lockstepMaxSteps=4,l._timeStep=1/60,l._fps=60,l._deltaTime=0,l._drawCalls=new d.PerfCounter,l.canvasTabIndex=1,l.disablePerformanceMonitorInBackground=!1,l._performanceMonitor=new u.PerformanceMonitor,!r)return l;if(s=l._creationOptions,t.Instances.push(l),r.getContext){var c=r;if(l._onCanvasFocus=function(){l.onCanvasFocusObservable.notifyObservers(l)},l._onCanvasBlur=function(){l.onCanvasBlurObservable.notifyObservers(l)},c.addEventListener("focus",l._onCanvasFocus),c.addEventListener("blur",l._onCanvasBlur),l._onBlur=function(){l.disablePerformanceMonitorInBackground&&l._performanceMonitor.disable(),l._windowIsBackground=!0},l._onFocus=function(){l.disablePerformanceMonitorInBackground&&l._performanceMonitor.enable(),l._windowIsBackground=!1},l._onCanvasPointerOut=function(e){l.onCanvasPointerOutObservable.notifyObservers(e)},c.addEventListener("pointerout",l._onCanvasPointerOut),o.DomManagement.IsWindowObjectExist()){var h=l.getHostWindow();h.addEventListener("blur",l._onBlur),h.addEventListener("focus",l._onFocus);var f=document;l._onFullscreenChange=function(){void 0!==f.fullscreen?l.isFullscreen=f.fullscreen:void 0!==f.mozFullScreen?l.isFullscreen=f.mozFullScreen:void 0!==f.webkitIsFullScreen?l.isFullscreen=f.webkitIsFullScreen:void 0!==f.msIsFullScreen&&(l.isFullscreen=f.msIsFullScreen),l.isFullscreen&&l._pointerLockRequested&&c&&t._RequestPointerlock(c)},document.addEventListener("fullscreenchange",l._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",l._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",l._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",l._onFullscreenChange,!1),l._onPointerLockChange=function(){l.isPointerLock=f.mozPointerLockElement===c||f.webkitPointerLockElement===c||f.msPointerLockElement===c||f.pointerLockElement===c},document.addEventListener("pointerlockchange",l._onPointerLockChange,!1),document.addEventListener("mspointerlockchange",l._onPointerLockChange,!1),document.addEventListener("mozpointerlockchange",l._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",l._onPointerLockChange,!1),!t.audioEngine&&s.audioEngine&&t.AudioEngineFactory&&(t.audioEngine=t.AudioEngineFactory(l.getRenderingCanvas()))}l._connectVREvents(),l.enableOfflineSupport=void 0!==t.OfflineProviderFactory,s.doNotHandleTouchAction||l._disableTouchAction(),l._deterministicLockstep=!!s.deterministicLockstep,l._lockstepMaxSteps=s.lockstepMaxSteps||0,l._timeStep=s.timeStep||1/60}return l._prepareVRComponent(),s.autoEnableWebVR&&l.initWebVR(),l}return Object(n.__extends)(t,e),Object.defineProperty(t,"NpmPackage",{get:function(){return l.ThinEngine.NpmPackage},enumerable:!1,configurable:!0}),Object.defineProperty(t,"Version",{get:function(){return l.ThinEngine.Version},enumerable:!1,configurable:!0}),Object.defineProperty(t,"Instances",{get:function(){return s.EngineStore.Instances},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LastCreatedEngine",{get:function(){return s.EngineStore.LastCreatedEngine},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LastCreatedScene",{get:function(){return s.EngineStore.LastCreatedScene},enumerable:!1,configurable:!0}),t.MarkAllMaterialsAsDirty=function(e,r){for(var n=0;n<t.Instances.length;n++)for(var i=t.Instances[n],o=0;o<i.scenes.length;o++)i.scenes[o].markAllMaterialsAsDirty(e,r)},t.DefaultLoadingScreenFactory=function(e){throw a._DevTools.WarnImport("LoadingScreen")},Object.defineProperty(t.prototype,"_supportsHardwareTextureRescaling",{get:function(){return!!t._RescalePostProcessFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"performanceMonitor",{get:function(){return this._performanceMonitor},enumerable:!1,configurable:!0}),t.prototype.getInputElement=function(){return this._renderingCanvas},t.prototype.getAspectRatio=function(e,t){void 0===t&&(t=!1);var r=e.viewport;return this.getRenderWidth(t)*r.width/(this.getRenderHeight(t)*r.height)},t.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},t.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},t.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},t.prototype.isDeterministicLockStep=function(){return this._deterministicLockstep},t.prototype.getLockstepMaxSteps=function(){return this._lockstepMaxSteps},t.prototype.getTimeStep=function(){return 1e3*this._timeStep},t.prototype.generateMipMapsForCubemap=function(e,t){if(void 0===t&&(t=!0),e.generateMipMaps){var r=this._gl;this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,e,!0),r.generateMipmap(r.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,null)}},t.prototype.setState=function(e,t,r,n){void 0===t&&(t=0),void 0===n&&(n=!1),(this._depthCullingState.cull!==e||r)&&(this._depthCullingState.cull=e);var i=this.cullBackFaces?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==i||r)&&(this._depthCullingState.cullFace=i),this.setZOffset(t);var o=n?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==o||r)&&(this._depthCullingState.frontFace=o)},t.prototype.setZOffset=function(e){this._depthCullingState.zOffset=e},t.prototype.getZOffset=function(){return this._depthCullingState.zOffset},t.prototype.setDepthBuffer=function(e){this._depthCullingState.depthTest=e},t.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},t.prototype.setDepthWrite=function(e){this._depthCullingState.depthMask=e},t.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},t.prototype.setStencilBuffer=function(e){this._stencilState.stencilTest=e},t.prototype.getStencilMask=function(){return this._stencilState.stencilMask},t.prototype.setStencilMask=function(e){this._stencilState.stencilMask=e},t.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},t.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},t.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},t.prototype.setStencilFunction=function(e){this._stencilState.stencilFunc=e},t.prototype.setStencilFunctionReference=function(e){this._stencilState.stencilFuncRef=e},t.prototype.setStencilFunctionMask=function(e){this._stencilState.stencilFuncMask=e},t.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},t.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},t.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},t.prototype.setStencilOperationFail=function(e){this._stencilState.stencilOpStencilFail=e},t.prototype.setStencilOperationDepthFail=function(e){this._stencilState.stencilOpDepthFail=e},t.prototype.setStencilOperationPass=function(e){this._stencilState.stencilOpStencilDepthPass=e},t.prototype.setDitheringState=function(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)},t.prototype.setRasterizerState=function(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)},t.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},t.prototype.setDepthFunction=function(e){this._depthCullingState.depthFunc=e},t.prototype.setDepthFunctionToGreater=function(){this._depthCullingState.depthFunc=this._gl.GREATER},t.prototype.setDepthFunctionToGreaterOrEqual=function(){this._depthCullingState.depthFunc=this._gl.GEQUAL},t.prototype.setDepthFunctionToLess=function(){this._depthCullingState.depthFunc=this._gl.LESS},t.prototype.setDepthFunctionToLessOrEqual=function(){this._depthCullingState.depthFunc=this._gl.LEQUAL},t.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},t.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)},t.prototype.setDirectViewport=function(e,t,r,n){var i=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,r,n),i},t.prototype.scissorClear=function(e,t,r,n,i){this.enableScissor(e,t,r,n),this.clear(i,!0,!0,!0),this.disableScissor()},t.prototype.enableScissor=function(e,t,r,n){var i=this._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,t,r,n)},t.prototype.disableScissor=function(){var e=this._gl;e.disable(e.SCISSOR_TEST)},t.prototype._reportDrawCall=function(){this._drawCalls.addCount(1,!1)},t.prototype.initWebVR=function(){throw a._DevTools.WarnImport("WebVRCamera")},t.prototype._prepareVRComponent=function(){},t.prototype._connectVREvents=function(e,t){},t.prototype._submitVRFrame=function(){},t.prototype.disableVR=function(){},t.prototype.isVRPresenting=function(){return!1},t.prototype._requestVRFrame=function(){},t.prototype._loadFileAsync=function(e,t,r){var n=this;return new Promise((function(i,o){n._loadFile(e,(function(e){i(e)}),void 0,t,r,(function(e,t){o(t)}))}))},t.prototype.getVertexShaderSource=function(e){var t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null},t.prototype.getFragmentShaderSource=function(e){var t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null},t.prototype.setDepthStencilTexture=function(e,t,r){void 0!==e&&(t&&(this._boundUniforms[e]=t),r&&r.depthStencilTexture?this._setTexture(e,r,!1,!0):this._setTexture(e,null))},t.prototype.setTextureFromPostProcess=function(e,t){this._bindTexture(e,t?t._textures.data[t._currentRenderTextureInd]:null)},t.prototype.setTextureFromPostProcessOutput=function(e,t){this._bindTexture(e,t?t._outputTexture:null)},t.prototype._rebuildBuffers=function(){for(var t=0,r=this.scenes;t<r.length;t++){var n=r[t];n.resetCachedMaterial(),n._rebuildGeometries(),n._rebuildTextures()}e.prototype._rebuildBuffers.call(this)},t.prototype._renderFrame=function(){for(var e=0;e<this._activeRenderLoops.length;e++)(0,this._activeRenderLoops[e])()},t.prototype._renderLoop=function(){if(!this._contextWasLost){var e=!0;!this.renderEvenInBackground&&this._windowIsBackground&&(e=!1),e&&(this.beginFrame(),this._renderViews()||this._renderFrame(),this.endFrame())}this._activeRenderLoops.length>0?this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this.isVRPresenting()?this._requestVRFrame():this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},t.prototype._renderViews=function(){return!1},t.prototype.switchFullscreen=function(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)},t.prototype.enterFullscreen=function(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&t._RequestFullscreen(this._renderingCanvas))},t.prototype.exitFullscreen=function(){this.isFullscreen&&t._ExitFullscreen()},t.prototype.enterPointerlock=function(){this._renderingCanvas&&t._RequestPointerlock(this._renderingCanvas)},t.prototype.exitPointerlock=function(){t._ExitPointerlock()},t.prototype.beginFrame=function(){this._measureFps(),this.onBeginFrameObservable.notifyObservers(this),e.prototype.beginFrame.call(this)},t.prototype.endFrame=function(){e.prototype.endFrame.call(this),this._submitVRFrame(),this.onEndFrameObservable.notifyObservers(this)},t.prototype.resize=function(){this.isVRPresenting()||e.prototype.resize.call(this)},t.prototype.setSize=function(t,r){if(!this._renderingCanvas)return!1;if(!e.prototype.setSize.call(this,t,r))return!1;if(this.scenes){for(var n=0;n<this.scenes.length;n++)for(var i=this.scenes[n],o=0;o<i.cameras.length;o++)i.cameras[o]._currentRenderId=0;this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0},t.prototype.updateDynamicVertexBuffer=function(e,t,r,n){this.bindArrayBuffer(e),void 0===r&&(r=0);var i=t.length||t.byteLength;void 0===n||n>=i&&0===r?t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,new Float32Array(t)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,t):t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,new Float32Array(t).subarray(r,r+n)):(t=t instanceof ArrayBuffer?new Uint8Array(t,r,n):new Uint8Array(t.buffer,t.byteOffset+r,n),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t)),this._resetVertexBufferBinding()},t.prototype._deletePipelineContext=function(t){var r=t;r&&r.program&&r.transformFeedback&&(this.deleteTransformFeedback(r.transformFeedback),r.transformFeedback=null),e.prototype._deletePipelineContext.call(this,t)},t.prototype.createShaderProgram=function(t,r,n,i,o,s){void 0===s&&(s=null),o=o||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);var a=e.prototype.createShaderProgram.call(this,t,r,n,i,o,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),a},t.prototype._createShaderProgram=function(e,t,r,n,i){void 0===i&&(i=null);var o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");if(n.attachShader(o,t),n.attachShader(o,r),this.webGLVersion>1&&i){var s=this.createTransformFeedback();this.bindTransformFeedback(s),this.setTranformFeedbackVaryings(o,i),e.transformFeedback=s}return n.linkProgram(o),this.webGLVersion>1&&i&&this.bindTransformFeedback(null),e.context=n,e.vertexShader=t,e.fragmentShader=r,e.isParallelCompiled||this._finalizePipelineContext(e),o},t.prototype._releaseTexture=function(t){e.prototype._releaseTexture.call(this,t),this.scenes.forEach((function(e){e.postProcesses.forEach((function(e){e._outputTexture==t&&(e._outputTexture=null)})),e.cameras.forEach((function(e){e._postProcesses.forEach((function(e){e&&e._outputTexture==t&&(e._outputTexture=null)}))}))}))},t.prototype._rescaleTexture=function(e,r,n,i,o){var s=this;this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);var a=this.createRenderTargetTexture({width:r.width,height:r.height},{generateMipMaps:!1,type:c.Constants.TEXTURETYPE_UNSIGNED_INT,samplingMode:c.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&t._RescalePostProcessFactory&&(this._rescalePostProcess=t._RescalePostProcessFactory(this)),this._rescalePostProcess.getEffect().executeWhenCompiled((function(){s._rescalePostProcess.onApply=function(t){t._bindTexture("textureSampler",e)};var t=n;t||(t=s.scenes[s.scenes.length-1]),t.postProcessManager.directRender([s._rescalePostProcess],a,!0),s._bindTextureDirectly(s._gl.TEXTURE_2D,r,!0),s._gl.copyTexImage2D(s._gl.TEXTURE_2D,0,i,0,0,r.width,r.height,0),s.unBindFramebuffer(a),s._releaseTexture(a),o&&o()}))},t.prototype.getFps=function(){return this._fps},t.prototype.getDeltaTime=function(){return this._deltaTime},t.prototype._measureFps=function(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0},t.prototype._uploadImageToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=this._gl,o=this._getWebGLTextureType(e.type),s=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,s),l=e.isCube?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D;this._bindTextureDirectly(l,e,!0),this._unpackFlipY(e.invertY);var c=i.TEXTURE_2D;e.isCube&&(c=i.TEXTURE_CUBE_MAP_POSITIVE_X+r),i.texImage2D(c,n,a,s,o,t),this._bindTextureDirectly(l,null,!0)},t.prototype.updateDynamicIndexBuffer=function(e,t,r){var n;void 0===r&&(r=0),this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(e),n=t instanceof Uint16Array||t instanceof Uint32Array?t:e.is32Bits?new Uint32Array(t):new Uint16Array(t),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,n,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},t.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;var r=this._gl;if(t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(r.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(r.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(r.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null),t>1&&r.renderbufferStorageMultisample){var n=r.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=n,this._bindUnboundFramebuffer(e._MSAAFramebuffer);var i=r.createRenderbuffer();if(!i)throw new Error("Unable to create multi sampled framebuffer");r.bindRenderbuffer(r.RENDERBUFFER,i),r.renderbufferStorageMultisample(r.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(e.type),e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i),e._MSAARenderBuffer=i}else this._bindUnboundFramebuffer(e._framebuffer);return e.samples=t,e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t),this._bindUnboundFramebuffer(null),t},t.prototype.updateTextureComparisonFunction=function(e,t){if(1!==this.webGLVersion){var r=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,c.Constants.LEQUAL),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,c.Constants.LEQUAL),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}else f.Logger.Error("WebGL 1 does not support texture comparison.")},t.prototype.createInstancesBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");var r=new h.WebGLDataBuffer(t);return r.capacity=e,this.bindArrayBuffer(r),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),r},t.prototype.deleteInstancesBuffer=function(e){this._gl.deleteBuffer(e)},t.prototype._clientWaitAsync=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=10);var n=this._gl;return new Promise((function(i,o){var s=function(){var a=n.clientWaitSync(e,t,0);a!=n.WAIT_FAILED?a!=n.TIMEOUT_EXPIRED?i():setTimeout(s,r):o()};s()}))},t.prototype._readPixelsAsync=function(e,t,r,n,i,o,s){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");var a=this._gl,l=a.createBuffer();a.bindBuffer(a.PIXEL_PACK_BUFFER,l),a.bufferData(a.PIXEL_PACK_BUFFER,s.byteLength,a.STREAM_READ),a.readPixels(e,t,r,n,i,o,0),a.bindBuffer(a.PIXEL_PACK_BUFFER,null);var c=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);return c?(a.flush(),this._clientWaitAsync(c,0,10).then((function(){return a.deleteSync(c),a.bindBuffer(a.PIXEL_PACK_BUFFER,l),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,s),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),a.deleteBuffer(l),s}))):null},t.prototype.dispose=function(){for(this.hideLoadingUI(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();1===t.Instances.length&&t.audioEngine&&t.audioEngine.dispose(),this.disableVR(),o.DomManagement.IsWindowObjectExist()&&(window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut)),o.DomManagement.IsDocumentAvailable()&&(document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange))),e.prototype.dispose.call(this);var r=t.Instances.indexOf(this);r>=0&&t.Instances.splice(r,1),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()},t.prototype._disableTouchAction=function(){this._renderingCanvas&&this._renderingCanvas.setAttribute&&(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.msTouchAction="none")},t.prototype.displayLoadingUI=function(){if(o.DomManagement.IsWindowObjectExist()){var e=this.loadingScreen;e&&e.displayLoadingUI()}},t.prototype.hideLoadingUI=function(){if(o.DomManagement.IsWindowObjectExist()){var e=this._loadingScreen;e&&e.hideLoadingUI()}},Object.defineProperty(t.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=t.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!1,configurable:!0}),t._RequestPointerlock=function(e){e.requestPointerLock=e.requestPointerLock||e.msRequestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock,e.requestPointerLock&&e.requestPointerLock()},t._ExitPointerlock=function(){var e=document;document.exitPointerLock=document.exitPointerLock||e.msExitPointerLock||e.mozExitPointerLock||e.webkitExitPointerLock,document.exitPointerLock&&document.exitPointerLock()},t._RequestFullscreen=function(e){var t=e.requestFullscreen||e.msRequestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen;t&&t.call(e)},t._ExitFullscreen=function(){var e=document;document.exitFullscreen?document.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.msCancelFullScreen&&e.msCancelFullScreen()},t.ALPHA_DISABLE=c.Constants.ALPHA_DISABLE,t.ALPHA_ADD=c.Constants.ALPHA_ADD,t.ALPHA_COMBINE=c.Constants.ALPHA_COMBINE,t.ALPHA_SUBTRACT=c.Constants.ALPHA_SUBTRACT,t.ALPHA_MULTIPLY=c.Constants.ALPHA_MULTIPLY,t.ALPHA_MAXIMIZED=c.Constants.ALPHA_MAXIMIZED,t.ALPHA_ONEONE=c.Constants.ALPHA_ONEONE,t.ALPHA_PREMULTIPLIED=c.Constants.ALPHA_PREMULTIPLIED,t.ALPHA_PREMULTIPLIED_PORTERDUFF=c.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,t.ALPHA_INTERPOLATE=c.Constants.ALPHA_INTERPOLATE,t.ALPHA_SCREENMODE=c.Constants.ALPHA_SCREENMODE,t.DELAYLOADSTATE_NONE=c.Constants.DELAYLOADSTATE_NONE,t.DELAYLOADSTATE_LOADED=c.Constants.DELAYLOADSTATE_LOADED,t.DELAYLOADSTATE_LOADING=c.Constants.DELAYLOADSTATE_LOADING,t.DELAYLOADSTATE_NOTLOADED=c.Constants.DELAYLOADSTATE_NOTLOADED,t.NEVER=c.Constants.NEVER,t.ALWAYS=c.Constants.ALWAYS,t.LESS=c.Constants.LESS,t.EQUAL=c.Constants.EQUAL,t.LEQUAL=c.Constants.LEQUAL,t.GREATER=c.Constants.GREATER,t.GEQUAL=c.Constants.GEQUAL,t.NOTEQUAL=c.Constants.NOTEQUAL,t.KEEP=c.Constants.KEEP,t.REPLACE=c.Constants.REPLACE,t.INCR=c.Constants.INCR,t.DECR=c.Constants.DECR,t.INVERT=c.Constants.INVERT,t.INCR_WRAP=c.Constants.INCR_WRAP,t.DECR_WRAP=c.Constants.DECR_WRAP,t.TEXTURE_CLAMP_ADDRESSMODE=c.Constants.TEXTURE_CLAMP_ADDRESSMODE,t.TEXTURE_WRAP_ADDRESSMODE=c.Constants.TEXTURE_WRAP_ADDRESSMODE,t.TEXTURE_MIRROR_ADDRESSMODE=c.Constants.TEXTURE_MIRROR_ADDRESSMODE,t.TEXTUREFORMAT_ALPHA=c.Constants.TEXTUREFORMAT_ALPHA,t.TEXTUREFORMAT_LUMINANCE=c.Constants.TEXTUREFORMAT_LUMINANCE,t.TEXTUREFORMAT_LUMINANCE_ALPHA=c.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA,t.TEXTUREFORMAT_RGB=c.Constants.TEXTUREFORMAT_RGB,t.TEXTUREFORMAT_RGBA=c.Constants.TEXTUREFORMAT_RGBA,t.TEXTUREFORMAT_RED=c.Constants.TEXTUREFORMAT_RED,t.TEXTUREFORMAT_R=c.Constants.TEXTUREFORMAT_R,t.TEXTUREFORMAT_RG=c.Constants.TEXTUREFORMAT_RG,t.TEXTUREFORMAT_RED_INTEGER=c.Constants.TEXTUREFORMAT_RED_INTEGER,t.TEXTUREFORMAT_R_INTEGER=c.Constants.TEXTUREFORMAT_R_INTEGER,t.TEXTUREFORMAT_RG_INTEGER=c.Constants.TEXTUREFORMAT_RG_INTEGER,t.TEXTUREFORMAT_RGB_INTEGER=c.Constants.TEXTUREFORMAT_RGB_INTEGER,t.TEXTUREFORMAT_RGBA_INTEGER=c.Constants.TEXTUREFORMAT_RGBA_INTEGER,t.TEXTURETYPE_UNSIGNED_BYTE=c.Constants.TEXTURETYPE_UNSIGNED_BYTE,t.TEXTURETYPE_UNSIGNED_INT=c.Constants.TEXTURETYPE_UNSIGNED_INT,t.TEXTURETYPE_FLOAT=c.Constants.TEXTURETYPE_FLOAT,t.TEXTURETYPE_HALF_FLOAT=c.Constants.TEXTURETYPE_HALF_FLOAT,t.TEXTURETYPE_BYTE=c.Constants.TEXTURETYPE_BYTE,t.TEXTURETYPE_SHORT=c.Constants.TEXTURETYPE_SHORT,t.TEXTURETYPE_UNSIGNED_SHORT=c.Constants.TEXTURETYPE_UNSIGNED_SHORT,t.TEXTURETYPE_INT=c.Constants.TEXTURETYPE_INT,t.TEXTURETYPE_UNSIGNED_INTEGER=c.Constants.TEXTURETYPE_UNSIGNED_INTEGER,t.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=c.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4,t.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=c.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1,t.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=c.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,t.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=c.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV,t.TEXTURETYPE_UNSIGNED_INT_24_8=c.Constants.TEXTURETYPE_UNSIGNED_INT_24_8,t.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=c.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV,t.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=c.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV,t.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=c.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV,t.TEXTURE_NEAREST_SAMPLINGMODE=c.Constants.TEXTURE_NEAREST_SAMPLINGMODE,t.TEXTURE_BILINEAR_SAMPLINGMODE=c.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,t.TEXTURE_TRILINEAR_SAMPLINGMODE=c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,t.TEXTURE_NEAREST_NEAREST_MIPLINEAR=c.Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR,t.TEXTURE_LINEAR_LINEAR_MIPNEAREST=c.Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST,t.TEXTURE_LINEAR_LINEAR_MIPLINEAR=c.Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR,t.TEXTURE_NEAREST_NEAREST_MIPNEAREST=c.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST,t.TEXTURE_NEAREST_LINEAR_MIPNEAREST=c.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST,t.TEXTURE_NEAREST_LINEAR_MIPLINEAR=c.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR,t.TEXTURE_NEAREST_LINEAR=c.Constants.TEXTURE_NEAREST_LINEAR,t.TEXTURE_NEAREST_NEAREST=c.Constants.TEXTURE_NEAREST_NEAREST,t.TEXTURE_LINEAR_NEAREST_MIPNEAREST=c.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST,t.TEXTURE_LINEAR_NEAREST_MIPLINEAR=c.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR,t.TEXTURE_LINEAR_LINEAR=c.Constants.TEXTURE_LINEAR_LINEAR,t.TEXTURE_LINEAR_NEAREST=c.Constants.TEXTURE_LINEAR_NEAREST,t.TEXTURE_EXPLICIT_MODE=c.Constants.TEXTURE_EXPLICIT_MODE,t.TEXTURE_SPHERICAL_MODE=c.Constants.TEXTURE_SPHERICAL_MODE,t.TEXTURE_PLANAR_MODE=c.Constants.TEXTURE_PLANAR_MODE,t.TEXTURE_CUBIC_MODE=c.Constants.TEXTURE_CUBIC_MODE,t.TEXTURE_PROJECTION_MODE=c.Constants.TEXTURE_PROJECTION_MODE,t.TEXTURE_SKYBOX_MODE=c.Constants.TEXTURE_SKYBOX_MODE,t.TEXTURE_INVCUBIC_MODE=c.Constants.TEXTURE_INVCUBIC_MODE,t.TEXTURE_EQUIRECTANGULAR_MODE=c.Constants.TEXTURE_EQUIRECTANGULAR_MODE,t.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=c.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,t.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=c.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,t.SCALEMODE_FLOOR=c.Constants.SCALEMODE_FLOOR,t.SCALEMODE_NEAREST=c.Constants.SCALEMODE_NEAREST,t.SCALEMODE_CEILING=c.Constants.SCALEMODE_CEILING,t._RescalePostProcessFactory=null,t}(l.ThinEngine))},"./Engines/engineCapabilities.ts":
- /*!***************************************!*\
- !*** ./Engines/engineCapabilities.ts ***!
- \***************************************/
- /*! no static exports found */function(e,t){},"./Engines/engineStore.ts":
- /*!********************************!*\
- !*** ./Engines/engineStore.ts ***!
- \********************************/
- /*! exports provided: EngineStore */function(e,t,r){"use strict";r.r(t),r.d(t,"EngineStore",(function(){return n}));var n=function(){function e(){}return Object.defineProperty(e,"LastCreatedEngine",{get:function(){return 0===this.Instances.length?null:this.Instances[this.Instances.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LastCreatedScene",{get:function(){return this._LastCreatedScene},enumerable:!1,configurable:!0}),e.Instances=new Array,e._LastCreatedScene=null,e.UseFallbackTexture=!0,e.FallbackTexture="",e}()},"./Engines/index.ts":
- /*!**************************!*\
- !*** ./Engines/index.ts ***!
- \**************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./constants */"./Engines/constants.ts");r.d(t,"Constants",(function(){return n.Constants}));var i=r(/*! ./engineCapabilities */"./Engines/engineCapabilities.ts");for(var o in i)["Constants","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(o);var s=r(/*! ./instancingAttributeInfo */"./Engines/instancingAttributeInfo.ts");for(var o in s)["Constants","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return s[e]}))}(o);var a=r(/*! ./thinEngine */"./Engines/thinEngine.ts");r.d(t,"ThinEngine",(function(){return a.ThinEngine}));var l=r(/*! ./engine */"./Engines/engine.ts");r.d(t,"Engine",(function(){return l.Engine}));var c=r(/*! ./engineStore */"./Engines/engineStore.ts");r.d(t,"EngineStore",(function(){return c.EngineStore}));var u=r(/*! ./nullEngine */"./Engines/nullEngine.ts");r.d(t,"NullEngineOptions",(function(){return u.NullEngineOptions})),r.d(t,"NullEngine",(function(){return u.NullEngine}));var d=r(/*! ./Extensions/index */"./Engines/Extensions/index.ts");r.d(t,"_OcclusionDataStorage",(function(){return d._OcclusionDataStorage})),r.d(t,"_forceTransformFeedbackToBundle",(function(){return d._forceTransformFeedbackToBundle})),r.d(t,"EngineView",(function(){return d.EngineView}));var h=r(/*! ./IPipelineContext */"./Engines/IPipelineContext.ts");for(var o in h)["Constants","ThinEngine","Engine","EngineStore","NullEngineOptions","NullEngine","_OcclusionDataStorage","_forceTransformFeedbackToBundle","EngineView","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return h[e]}))}(o);var f=r(/*! ./WebGL/webGLPipelineContext */"./Engines/WebGL/webGLPipelineContext.ts");r.d(t,"WebGLPipelineContext",(function(){return f.WebGLPipelineContext}));var p=r(/*! ./WebGL/webGL2ShaderProcessors */"./Engines/WebGL/webGL2ShaderProcessors.ts");r.d(t,"WebGL2ShaderProcessor",(function(){return p.WebGL2ShaderProcessor}));var m=r(/*! ./nativeEngine */"./Engines/nativeEngine.ts");r.d(t,"NativeEngine",(function(){return m.NativeEngine}));var g=r(/*! ./Processors/shaderCodeInliner */"./Engines/Processors/shaderCodeInliner.ts");r.d(t,"ShaderCodeInliner",(function(){return g.ShaderCodeInliner}));var _=r(/*! ./performanceConfigurator */"./Engines/performanceConfigurator.ts");r.d(t,"PerformanceConfigurator",(function(){return _.PerformanceConfigurator}))},"./Engines/instancingAttributeInfo.ts":
- /*!********************************************!*\
- !*** ./Engines/instancingAttributeInfo.ts ***!
- \********************************************/
- /*! no static exports found */function(e,t){},"./Engines/nativeEngine.ts":
- /*!*********************************!*\
- !*** ./Engines/nativeEngine.ts ***!
- \*********************************/
- /*! exports provided: NativeEngine */function(e,t,r){"use strict";r.r(t),r.d(t,"NativeEngine",(function(){return P}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../Meshes/dataBuffer */"./Meshes/dataBuffer.ts"),l=r(/*! ../Misc/tools */"./Misc/tools.ts"),c=r(/*! ../Misc/environmentTextureTools */"./Misc/environmentTextureTools.ts"),u=r(/*! ../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),h=r(/*! ./constants */"./Engines/constants.ts"),f=r(/*! ./thinEngine */"./Engines/thinEngine.ts"),p=r(/*! ./engineStore */"./Engines/engineStore.ts"),m=r(/*! ./Processors/shaderCodeInliner */"./Engines/Processors/shaderCodeInliner.ts"),g=r(/*! ../Engines/WebGL/webGL2ShaderProcessors */"./Engines/WebGL/webGL2ShaderProcessors.ts"),_=function(){function e(){this.isAsync=!1,this.isReady=!1}return e.prototype._getVertexShaderCode=function(){return null},e.prototype._getFragmentShaderCode=function(){return null},e.prototype._handlesSpectorRebuildCallback=function(e){throw new Error("Not implemented")},e}(),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t}(a.DataBuffer),y=function(){function e(){}return e.POINT=0,e.MINPOINT_MAGPOINT_MIPPOINT=e.POINT,e.BILINEAR=1,e.MINLINEAR_MAGLINEAR_MIPPOINT=e.BILINEAR,e.TRILINEAR=2,e.MINLINEAR_MAGLINEAR_MIPLINEAR=e.TRILINEAR,e.ANISOTROPIC=3,e.POINT_COMPARE=4,e.TRILINEAR_COMPARE=5,e.MINBILINEAR_MAGPOINT=6,e.MINLINEAR_MAGPOINT_MIPLINEAR=e.MINBILINEAR_MAGPOINT,e.MINPOINT_MAGPOINT_MIPLINEAR=7,e.MINPOINT_MAGLINEAR_MIPPOINT=8,e.MINPOINT_MAGLINEAR_MIPLINEAR=9,e.MINLINEAR_MAGPOINT_MIPPOINT=10,e}(),b=function(){function e(){}return e.CLEAR_COLOR=1,e.CLEAR_DEPTH=2,e.CLEAR_STENCIL=4,e}(),A=function(){function e(){}return e.WRAP=0,e.MIRROR=1,e.CLAMP=2,e.BORDER=3,e.MIRROR_ONCE=4,e}(),T=function(){function e(){}return e.RGBA8=0,e.RGBA32F=1,e}(),M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getInternalTexture=function(){return this},t.prototype.getViewCount=function(){return 1},t}(o.InternalTexture),P=function(e){function t(){var t=e.call(this,null)||this;return t._native=new _native.Engine,t.INVALID_HANDLE=65535,t._webGLVersion=2,t.disableUniformBuffers=!0,t._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!0,astc:null,pvrtc:null,etc1:null,etc2:null,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!0,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!0,instancedArrays:!1,canUseTimestampForTimerQuery:!1,blendMinMax:!1,maxMSAASamples:1},l.Tools.Log("Babylon Native (v"+i.Engine.Version+") launched"),"undefined"==typeof URL&&(window.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(window.Blob=function(){}),t._shaderProcessor=new g.WebGL2ShaderProcessor,t}return Object(n.__extends)(t,e),t.prototype.getHardwareScalingLevel=function(){return 1},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._native.dispose()},t.prototype._queueNewFrame=function(e,t){return t.requestAnimationFrame&&t!==window?t.requestAnimationFrame(e):this._native.requestAnimationFrame(e),0},t.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._currentFramebuffer&&this._native.unbindFramebuffer(this._currentFramebuffer),e&&this._native.bindFramebuffer(e),this._currentFramebuffer=e)},t.prototype.getHostDocument=function(){return null},t.prototype.clear=function(e,t,r,n){void 0===n&&(n=!1);var i=0;t&&e&&(this._native.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),i|=b.CLEAR_COLOR),r&&(this._native.clearDepth(1),i|=b.CLEAR_DEPTH),n&&(this._native.clearStencil(0),i|=b.CLEAR_STENCIL),this._native.clear(i)},t.prototype.createIndexBuffer=function(e,t){var r=this._normalizeIndexData(e),n=new v;if(n.references=1,n.is32Bits=4===r.BYTES_PER_ELEMENT,n.nativeIndexBuffer=this._native.createIndexBuffer(r,null!=t&&t),n.nativeVertexBuffer===this.INVALID_HANDLE)throw new Error("Could not create a native index buffer.");return n},t.prototype.createVertexBuffer=function(e,t){var r=new v;if(r.references=1,r.nativeVertexBuffer=this._native.createVertexBuffer(ArrayBuffer.isView(e)?e:new Float32Array(e),null!=t&&t),r.nativeVertexBuffer===this.INVALID_HANDLE)throw new Error("Could not create a native vertex buffer.");return r},t.prototype.recordVertexArrayObject=function(e,t,r){var n=this._native.createVertexArray();t&&this._native.recordIndexBuffer(n,t.nativeIndexBuffer);for(var i=r.getAttributesNames(),o=0;o<i.length;o++){var s=r.getAttributeLocation(o);if(s>=0){var a=e[i[o]];if(a){var l=a.getBuffer();l&&this._native.recordVertexBuffer(n,l.nativeVertexBuffer,s,a.byteOffset,a.byteStride,a.getSize(),a.type,a.normalized)}}}return n},t.prototype.bindVertexArrayObject=function(e){this._native.bindVertexArray(e)},t.prototype.releaseVertexArrayObject=function(e){this._native.deleteVertexArray(e)},t.prototype.getAttributes=function(e,t){var r=e;return this._native.getAttributes(r.nativeProgram,t)},t.prototype.drawElementsType=function(e,t,r,n){this._drawCalls.addCount(1,!1),this._native.drawIndexed(e,t,r)},t.prototype.drawArraysType=function(e,t,r,n){this._drawCalls.addCount(1,!1),this._native.draw(e,t,r)},t.prototype.createPipelineContext=function(){return new _},t.prototype._preparePipelineContext=function(e,t,r,n,i,o,s){var a=e;a.nativeProgram=n?this.createRawShaderProgram(e,t,r,void 0,s):this.createShaderProgram(e,t,r,o,void 0,s)},t.prototype._isRenderingStateCompiled=function(e){return!0},t.prototype._executeWhenRenderingStateIsCompiled=function(e,t){t()},t.prototype.createRawShaderProgram=function(e,t,r,n,i){throw void 0===i&&(i=null),new Error("Not Supported")},t.prototype.createShaderProgram=function(e,t,r,n,i,o){void 0===o&&(o=null),this.onBeforeShaderCompilationObservable.notifyObservers(this);var s=new m.ShaderCodeInliner(t);s.processCode(),t=s.code;var a=new m.ShaderCodeInliner(r);a.processCode(),r=a.code,t=f.ThinEngine._ConcatenateShader(t,n),r=f.ThinEngine._ConcatenateShader(r,n);var l=this._native.createProgram(t,r);return this.onAfterShaderCompilationObservable.notifyObservers(this),l},t.prototype._setProgram=function(e){this._currentProgram!==e&&(this._native.setProgram(e),this._currentProgram=e)},t.prototype._releaseEffect=function(e){},t.prototype._deletePipelineContext=function(e){},t.prototype.getUniforms=function(e,t){var r=e;return this._native.getUniforms(r.nativeProgram,t)},t.prototype.bindUniformBlock=function(e,t,r){throw new Error("Not Implemented")},t.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.nativeProgram);for(var r=e.getSamplers(),n=0;n<r.length;n++){var i=e.getUniform(r[n]);i&&(this._boundUniforms[n]=i)}this._currentEffect=null},t.prototype.setMatrix=function(e,t){e&&this._native.setMatrix(e,t.toArray())},t.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._native.getRenderWidth()},t.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._native.getRenderHeight()},t.prototype.setViewport=function(e,t,r){this._cachedViewport=e,this._native.setViewPort(e.x,e.y,e.width,e.height)},t.prototype.setState=function(e,t,r,n){void 0===t&&(t=0),void 0===n&&(n=!1),this._native.setState(e,t,n)},t.prototype.setZOffset=function(e){this._native.setZOffset(e)},t.prototype.getZOffset=function(){return this._native.getZOffset()},t.prototype.setDepthBuffer=function(e){this._native.setDepthTest(e)},t.prototype.getDepthWrite=function(){return this._native.getDepthWrite()},t.prototype.setDepthWrite=function(e){this._native.setDepthWrite(e)},t.prototype.setColorWrite=function(e){this._native.setColorWrite(e),this._colorWrite=e},t.prototype.getColorWrite=function(){return this._colorWrite},t.prototype.setAlphaConstants=function(e,t,r,n){throw new Error("Setting alpha blend constant color not yet implemented.")},t.prototype.setAlphaMode=function(e,t){void 0===t&&(t=!1),this._alphaMode!==e&&(this._native.setBlendMode(e),t||this.setDepthWrite(e===h.Constants.ALPHA_DISABLE),this._alphaMode=e)},t.prototype.getAlphaMode=function(){return this._alphaMode},t.prototype.setInt=function(e,t){e&&this._native.setInt(e,t)},t.prototype.setIntArray=function(e,t){e&&this._native.setIntArray(e,t)},t.prototype.setIntArray2=function(e,t){e&&this._native.setIntArray2(e,t)},t.prototype.setIntArray3=function(e,t){e&&this._native.setIntArray3(e,t)},t.prototype.setIntArray4=function(e,t){e&&this._native.setIntArray4(e,t)},t.prototype.setFloatArray=function(e,t){e&&this._native.setFloatArray(e,t)},t.prototype.setFloatArray2=function(e,t){e&&this._native.setFloatArray2(e,t)},t.prototype.setFloatArray3=function(e,t){e&&this._native.setFloatArray3(e,t)},t.prototype.setFloatArray4=function(e,t){e&&this._native.setFloatArray4(e,t)},t.prototype.setArray=function(e,t){e&&this._native.setFloatArray(e,t)},t.prototype.setArray2=function(e,t){e&&this._native.setFloatArray2(e,t)},t.prototype.setArray3=function(e,t){e&&this._native.setFloatArray3(e,t)},t.prototype.setArray4=function(e,t){e&&this._native.setFloatArray4(e,t)},t.prototype.setMatrices=function(e,t){e&&this._native.setMatrices(e,t)},t.prototype.setMatrix3x3=function(e,t){e&&this._native.setMatrix3x3(e,t)},t.prototype.setMatrix2x2=function(e,t){e&&this._native.setMatrix2x2(e,t)},t.prototype.setFloat=function(e,t){e&&this._native.setFloat(e,t)},t.prototype.setFloat2=function(e,t,r){e&&this._native.setFloat2(e,t,r)},t.prototype.setFloat3=function(e,t,r,n){e&&this._native.setFloat3(e,t,r,n)},t.prototype.setFloat4=function(e,t,r,n,i){e&&this._native.setFloat4(e,t,r,n,i)},t.prototype.setColor3=function(e,t){e&&this._native.setFloat3(e,t.r,t.g,t.b)},t.prototype.setColor4=function(e,t,r){e&&this._native.setFloat4(e,t.r,t.g,t.b,r)},t.prototype.wipeCaches=function(e){this.preventCacheWipeBetweenFrames||(this.resetTextureCache(),this._currentEffect=null,e&&(this._currentProgram=null,this._stencilState.reset(),this._depthCullingState.reset(),this._alphaState.reset()),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)},t.prototype._createTexture=function(){return this._native.createTexture()},t.prototype._deleteTexture=function(e){this._native.deleteTexture(e)},t.prototype.createTexture=function(e,t,r,n,s,a,c,u,f,m,g,_){var v=this;void 0===s&&(s=h.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===a&&(a=null),void 0===c&&(c=null),void 0===u&&(u=null),void 0===f&&(f=null),void 0===m&&(m=null),void 0===g&&(g=null);var y="data:"===(e=e||"").substr(0,5),b=y&&-1!==e.indexOf(";base64,"),A=f||new o.InternalTexture(this,o.InternalTextureSource.Url),T=e;!this._transformTextureUrl||b||f||u||(e=this._transformTextureUrl(e));for(var M=e.lastIndexOf("."),P=g||(M>-1?e.substring(M).toLowerCase():""),S=null,E=0,C=i.Engine._TextureLoaders;E<C.length;E++){var x=C[E];if(x.canLoad(P)){S=x;break}}n&&n._addPendingData(A),A.url=e,A.generateMipMaps=!t,A.samplingMode=s,A.invertY=r,this.doNotHandleContextLost||(A._buffer=u);var R=null;if(a&&!f&&(R=A.onLoadedObservable.add(a)),f||this._internalTexturesCache.push(A),S)throw new Error("Loading textures from IInternalTextureLoader not yet implemented.");var O=function(e){var i=A._webGLTexture;i?v._native.loadTexture(i,e,!t,r,(function(){A.baseWidth=v._native.getTextureWidth(i),A.baseHeight=v._native.getTextureHeight(i),A.width=A.baseWidth,A.height=A.baseHeight,A.isReady=!0;var e=v._getSamplingFilter(s);v._native.setTextureSampling(i,e),n&&n._removePendingData(A),A.onLoadedObservable.notifyObservers(A),A.onLoadedObservable.clear()}),(function(){throw new Error("Could not load a native texture.")})):n&&n._removePendingData(A)};if(y)if(u instanceof ArrayBuffer)O(new Uint8Array(u));else if(ArrayBuffer.isView(u))O(u);else{if("string"!=typeof u)throw new Error("Unsupported buffer type");O(new Uint8Array(l.Tools.DecodeBase64(u)))}else b?O(new Uint8Array(l.Tools.DecodeBase64(e))):this._loadFile(e,(function(e){return O(new Uint8Array(e))}),void 0,void 0,!0,(function(r,i){!function(r,i){n&&n._removePendingData(A),e===T?(R&&A.onLoadedObservable.remove(R),p.EngineStore.UseFallbackTexture&&v.createTexture(p.EngineStore.FallbackTexture,t,A.invertY,n,s,null,c,u,A),c&&c((r||"Unknown error")+(p.EngineStore.UseFallbackTexture?" - Fallback texture was used":""),i)):(d.Logger.Warn("Failed to load "+e+", falling back to "+T),v.createTexture(T,t,A.invertY,n,s,a,c,u,A,m,g,_))}("Unable to load "+(r&&r.responseURL,i))}));return A},t.prototype.createCubeTexture=function(e,t,r,n,i,a,u,d,f,p,m,g){var _=this;void 0===i&&(i=null),void 0===a&&(a=null),void 0===d&&(d=null),void 0===f&&(f=!1),void 0===p&&(p=0),void 0===m&&(m=0),void 0===g&&(g=null);var v=g||new o.InternalTexture(this,o.InternalTextureSource.Cube);v.isCube=!0,v.url=e,v.generateMipMaps=!n,v._lodGenerationScale=p,v._lodGenerationOffset=m,this._doNotHandleContextLost||(v._extension=d,v._files=r);var y=e.lastIndexOf(".");if(".env"===(d||(y>-1?e.substring(y).toLowerCase():""))){if(r&&6===r.length)throw new Error("Multi-file loading not allowed on env files.");this._loadFile(e,(function(e){return function(e){var t=c.EnvironmentTextureTools.GetEnvInfo(e);if(v.width=t.width,v.height=t.width,c.EnvironmentTextureTools.UploadEnvSpherical(v,t),1!==t.version)throw new Error('Unsupported babylon environment map version "'+t.version+'"');var r=t.specular;if(!r)throw new Error("Nothing else parsed so far");v._lodGenerationScale=r.lodGenerationScale;var n=c.EnvironmentTextureTools.CreateImageDataArrayBufferViews(e,t);v.format=h.Constants.TEXTUREFORMAT_RGBA,v.type=h.Constants.TEXTURETYPE_UNSIGNED_INT,v.generateMipMaps=!0,v.getEngine().updateTextureSamplingMode(s.Texture.TRILINEAR_SAMPLINGMODE,v),v._isRGBD=!0,v.invertY=!0,_._native.loadCubeTextureWithMips(v._webGLTexture,n,(function(){v.isReady=!0,i&&i()}),(function(){throw new Error("Could not load a native cube texture.")}))}(new Uint8Array(e))}),void 0,void 0,!0,(function(e,t){a&&e&&a(e.status+" "+e.statusText,t)}))}else{if(!r||6!==r.length)throw new Error("Cannot load cubemap because 6 files were not defined");var b=[r[0],r[3],r[1],r[4],r[2],r[5]];Promise.all(b.map((function(e){return l.Tools.LoadFileAsync(e).then((function(e){return new Uint8Array(e)}))}))).then((function(e){return new Promise((function(t,r){_._native.loadCubeTexture(v._webGLTexture,e,!n,t,r)}))})).then((function(){v.isReady=!0,i&&i()}),(function(e){a&&a("Failed to load cubemap: "+e.message,e)}))}return this._internalTexturesCache.push(v),v},t.prototype._getSamplingFilter=function(e){switch(e){case h.Constants.TEXTURE_BILINEAR_SAMPLINGMODE:return y.MINLINEAR_MAGLINEAR_MIPPOINT;case h.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:return y.MINLINEAR_MAGLINEAR_MIPLINEAR;case h.Constants.TEXTURE_NEAREST_SAMPLINGMODE:return y.MINPOINT_MAGPOINT_MIPLINEAR;case h.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST:return y.MINPOINT_MAGPOINT_MIPPOINT;case h.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST:return y.MINLINEAR_MAGPOINT_MIPPOINT;case h.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR:case h.Constants.TEXTURE_NEAREST_LINEAR:return y.MINLINEAR_MAGPOINT_MIPLINEAR;case h.Constants.TEXTURE_NEAREST_NEAREST:return y.MINPOINT_MAGPOINT_MIPPOINT;case h.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST:return y.MINPOINT_MAGLINEAR_MIPPOINT;case h.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR:return y.MINPOINT_MAGLINEAR_MIPLINEAR;case h.Constants.TEXTURE_LINEAR_LINEAR:return y.MINLINEAR_MAGLINEAR_MIPLINEAR;case h.Constants.TEXTURE_LINEAR_NEAREST:return y.MINPOINT_MAGLINEAR_MIPLINEAR;default:throw new Error("Unexpected sampling mode: "+e+".")}},t._GetNativeTextureFormat=function(e,t){if(e==h.Constants.TEXTUREFORMAT_RGBA&&t==h.Constants.TEXTURETYPE_UNSIGNED_INT)return T.RGBA8;if(e==h.Constants.TEXTUREFORMAT_RGBA&&t==h.Constants.TEXTURETYPE_FLOAT)return T.RGBA32F;throw new Error("Unexpected texture format or type: format "+e+", type "+t+".")},t.prototype.createRenderTargetTexture=function(e,r){var n=new u.RenderTargetCreationOptions;void 0!==r&&"object"==typeof r?(n.generateMipMaps=r.generateMipMaps,n.generateDepthBuffer=void 0===r.generateDepthBuffer||r.generateDepthBuffer,n.generateStencilBuffer=n.generateDepthBuffer&&r.generateStencilBuffer,n.type=void 0===r.type?h.Constants.TEXTURETYPE_UNSIGNED_INT:r.type,n.samplingMode=void 0===r.samplingMode?h.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:r.samplingMode,n.format=void 0===r.format?h.Constants.TEXTUREFORMAT_RGBA:r.format):(n.generateMipMaps=r,n.generateDepthBuffer=!0,n.generateStencilBuffer=!1,n.type=h.Constants.TEXTURETYPE_UNSIGNED_INT,n.samplingMode=h.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,n.format=h.Constants.TEXTUREFORMAT_RGBA),(n.type!==h.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(n.type!==h.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(n.samplingMode=h.Constants.TEXTURE_NEAREST_SAMPLINGMODE);var i=new M(this,o.InternalTextureSource.RenderTarget),s=e.width||e,a=e.height||e;n.type!==h.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(n.type=h.Constants.TEXTURETYPE_UNSIGNED_INT,d.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var l=this._native.createFramebuffer(i._webGLTexture,s,a,t._GetNativeTextureFormat(n.format,n.type),n.samplingMode,!!n.generateStencilBuffer,n.generateDepthBuffer,!!n.generateMipMaps);return i._framebuffer=l,i.baseWidth=s,i.baseHeight=a,i.width=s,i.height=a,i.isReady=!0,i.samples=1,i.generateMipMaps=!!n.generateMipMaps,i.samplingMode=n.samplingMode,i.type=n.type,i.format=n.format,i._generateDepthBuffer=n.generateDepthBuffer,i._generateStencilBuffer=!!n.generateStencilBuffer,this._internalTexturesCache.push(i),i},t.prototype.updateTextureSamplingMode=function(e,t){if(t._webGLTexture){var r=this._getSamplingFilter(e);this._native.setTextureSampling(t._webGLTexture,r)}t.samplingMode=e},t.prototype.bindFramebuffer=function(e,t,r,n,i){if(t)throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");if(r||n)throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");if(i)throw new Error("forceFullscreenViewport for frame buffers not yet supported in NativeEngine.");this._bindUnboundFramebuffer(e._framebuffer)},t.prototype.unBindFramebuffer=function(e,t,r){void 0===t&&(t=!1),t&&d.Logger.Warn("Disabling mipmap generation not yet supported in NativeEngine. Ignoring."),r&&r(),this._bindUnboundFramebuffer(null)},t.prototype.createDynamicVertexBuffer=function(e){return this.createVertexBuffer(e,!0)},t.prototype.updateDynamicIndexBuffer=function(e,t,r){void 0===r&&(r=0);var n=e,i=this._normalizeIndexData(t);n.is32Bits=4===i.BYTES_PER_ELEMENT,this._native.updateDynamicIndexBuffer(n.nativeIndexBuffer,i,r)},t.prototype.updateDynamicVertexBuffer=function(e,t,r,n){var i=e,o=ArrayBuffer.isView(t)?t:new Float32Array(t);this._native.updateDynamicVertexBuffer(i.nativeVertexBuffer,o,null!=r?r:0,null!=n?n:o.byteLength)},t.prototype._setTexture=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);var i,o=this._boundUniforms[e];if(!o)return!1;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._native.setTexture(o,null)),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===h.Constants.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;return i=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,this._activeChannel=e,!(!i||!i._webGLTexture||(this._native.setTextureWrapMode(i._webGLTexture,this._getAddressMode(t.wrapU),this._getAddressMode(t.wrapV),this._getAddressMode(t.wrapR)),this._updateAnisotropicLevel(t),this._native.setTexture(o,i._webGLTexture),0))},t.prototype._updateAnisotropicLevel=function(e){var t=e.getInternalTexture(),r=e.anisotropicFilteringLevel;t&&t._webGLTexture&&t._cachedAnisotropicFilteringLevel!==r&&(this._native.setTextureAnisotropicLevel(t._webGLTexture,r),t._cachedAnisotropicFilteringLevel=r)},t.prototype._getAddressMode=function(e){switch(e){case h.Constants.TEXTURE_WRAP_ADDRESSMODE:return A.WRAP;case h.Constants.TEXTURE_CLAMP_ADDRESSMODE:return A.CLAMP;case h.Constants.TEXTURE_MIRROR_ADDRESSMODE:return A.MIRROR;default:throw new Error("Unexpected wrap mode: "+e+".")}},t.prototype._bindTexture=function(e,t){throw new Error("_bindTexture not implemented.")},t.prototype._deleteBuffer=function(e){e.nativeIndexBuffer&&(this._native.deleteIndexBuffer(e.nativeIndexBuffer),delete e.nativeIndexBuffer),e.nativeVertexBuffer&&(this._native.deleteVertexBuffer(e.nativeVertexBuffer),delete e.nativeVertexBuffer)},t.prototype.releaseEffects=function(){},t.prototype._uploadCompressedDataToTextureDirectly=function(e,t,r,n,i,o,s){throw void 0===o&&(o=0),void 0===s&&(s=0),new Error("_uploadCompressedDataToTextureDirectly not implemented.")},t.prototype._uploadDataToTextureDirectly=function(e,t,r,n){throw void 0===r&&(r=0),void 0===n&&(n=0),new Error("_uploadDataToTextureDirectly not implemented.")},t.prototype._uploadArrayBufferViewToTexture=function(e,t,r,n){throw void 0===r&&(r=0),void 0===n&&(n=0),new Error("_uploadArrayBufferViewToTexture not implemented.")},t.prototype._uploadImageToTexture=function(e,t,r,n){throw void 0===r&&(r=0),void 0===n&&(n=0),new Error("_uploadArrayBufferViewToTexture not implemented.")},t}(i.Engine)},"./Engines/nullEngine.ts":
- /*!*******************************!*\
- !*** ./Engines/nullEngine.ts ***!
- \*******************************/
- /*! exports provided: NullEngineOptions, NullEngine */function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"NullEngineOptions",(function(){return d})),r.d(t,"NullEngine",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),a=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),l=r(/*! ./constants */"./Engines/constants.ts"),c=r(/*! ../Meshes/dataBuffer */"./Meshes/dataBuffer.ts"),u=r(/*! ./performanceConfigurator */"./Engines/performanceConfigurator.ts"),d=function(){this.renderWidth=512,this.renderHeight=256,this.textureSize=512,this.deterministicLockstep=!1,this.lockstepMaxSteps=4},h=function(t){function r(r){void 0===r&&(r=new d);var n=t.call(this,null)||this;o.Engine.Instances.push(n),void 0===r.deterministicLockstep&&(r.deterministicLockstep=!1),void 0===r.lockstepMaxSteps&&(r.lockstepMaxSteps=4),n._options=r,u.PerformanceConfigurator.SetMatrixPrecision(!!r.useHighPrecisionMatrix),n._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!1,astc:null,pvrtc:null,etc1:null,etc2:null,maxAnisotropy:0,uintIndices:!1,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!1,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!1,instancedArrays:!1,canUseTimestampForTimerQuery:!1,maxMSAASamples:1,blendMinMax:!1},i.Logger.Log("Babylon.js v"+o.Engine.Version+" - Null engine");var s="undefined"!=typeof self?self:void 0!==e?e:window;return"undefined"==typeof URL&&(s.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(s.Blob=function(){}),n}return Object(n.__extends)(r,t),r.prototype.isDeterministicLockStep=function(){return this._options.deterministicLockstep},r.prototype.getLockstepMaxSteps=function(){return this._options.lockstepMaxSteps},r.prototype.getHardwareScalingLevel=function(){return 1},r.prototype.createVertexBuffer=function(e){var t=new c.DataBuffer;return t.references=1,t},r.prototype.createIndexBuffer=function(e){var t=new c.DataBuffer;return t.references=1,t},r.prototype.clear=function(e,t,r,n){void 0===n&&(n=!1)},r.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._options.renderWidth},r.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._options.renderHeight},r.prototype.setViewport=function(e,t,r){this._cachedViewport=e},r.prototype.createShaderProgram=function(e,t,r,n,i){return{__SPECTOR_rebuildProgram:null}},r.prototype.getUniforms=function(e,t){return[]},r.prototype.getAttributes=function(e,t){return[]},r.prototype.bindSamplers=function(e){this._currentEffect=null},r.prototype.enableEffect=function(e){this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e)},r.prototype.setState=function(e,t,r,n){void 0===t&&(t=0),void 0===n&&(n=!1)},r.prototype.setIntArray=function(e,t){},r.prototype.setIntArray2=function(e,t){},r.prototype.setIntArray3=function(e,t){},r.prototype.setIntArray4=function(e,t){},r.prototype.setFloatArray=function(e,t){},r.prototype.setFloatArray2=function(e,t){},r.prototype.setFloatArray3=function(e,t){},r.prototype.setFloatArray4=function(e,t){},r.prototype.setArray=function(e,t){},r.prototype.setArray2=function(e,t){},r.prototype.setArray3=function(e,t){},r.prototype.setArray4=function(e,t){},r.prototype.setMatrices=function(e,t){},r.prototype.setMatrix3x3=function(e,t){},r.prototype.setMatrix2x2=function(e,t){},r.prototype.setFloat=function(e,t){},r.prototype.setFloat2=function(e,t,r){},r.prototype.setFloat3=function(e,t,r,n){},r.prototype.setBool=function(e,t){},r.prototype.setFloat4=function(e,t,r,n,i){},r.prototype.setAlphaMode=function(e,t){void 0===t&&(t=!1),this._alphaMode!==e&&(this.alphaState.alphaBlend=e!==l.Constants.ALPHA_DISABLE,t||this.setDepthWrite(e===l.Constants.ALPHA_DISABLE),this._alphaMode=e)},r.prototype.bindBuffers=function(e,t,r){},r.prototype.wipeCaches=function(e){this.preventCacheWipeBetweenFrames||(this.resetTextureCache(),this._currentEffect=null,e&&(this._currentProgram=null,this.stencilState.reset(),this.depthCullingState.reset(),this.alphaState.reset()),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null)},r.prototype.draw=function(e,t,r,n){},r.prototype.drawElementsType=function(e,t,r,n){},r.prototype.drawArraysType=function(e,t,r,n){},r.prototype._createTexture=function(){return{}},r.prototype._releaseTexture=function(e){},r.prototype.createTexture=function(e,t,r,n,i,o,s,c,u,d,h,f){void 0===i&&(i=l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===o&&(o=null),void 0===s&&(s=null),void 0===c&&(c=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===h&&(h=null);var p=new a.InternalTexture(this,a.InternalTextureSource.Url),m=String(e);return p.url=m,p.generateMipMaps=!t,p.samplingMode=i,p.invertY=r,p.baseWidth=this._options.textureSize,p.baseHeight=this._options.textureSize,p.width=this._options.textureSize,p.height=this._options.textureSize,d&&(p.format=d),p.isReady=!0,o&&o(),this._internalTexturesCache.push(p),p},r.prototype.createRenderTargetTexture=function(e,t){var r=new s.RenderTargetCreationOptions;void 0!==t&&"object"==typeof t?(r.generateMipMaps=t.generateMipMaps,r.generateDepthBuffer=void 0===t.generateDepthBuffer||t.generateDepthBuffer,r.generateStencilBuffer=r.generateDepthBuffer&&t.generateStencilBuffer,r.type=void 0===t.type?l.Constants.TEXTURETYPE_UNSIGNED_INT:t.type,r.samplingMode=void 0===t.samplingMode?l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode):(r.generateMipMaps=t,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.type=l.Constants.TEXTURETYPE_UNSIGNED_INT,r.samplingMode=l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE);var n=new a.InternalTexture(this,a.InternalTextureSource.RenderTarget),i=e.width||e,o=e.height||e;return n._depthStencilBuffer={},n._framebuffer={},n.baseWidth=i,n.baseHeight=o,n.width=i,n.height=o,n.isReady=!0,n.samples=1,n.generateMipMaps=!!r.generateMipMaps,n.samplingMode=r.samplingMode,n.type=r.type,n._generateDepthBuffer=r.generateDepthBuffer,n._generateStencilBuffer=!!r.generateStencilBuffer,this._internalTexturesCache.push(n),n},r.prototype.updateTextureSamplingMode=function(e,t){t.samplingMode=e},r.prototype.bindFramebuffer=function(e,t,r,n,i){this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._currentFramebuffer=e._MSAAFramebuffer?e._MSAAFramebuffer:e._framebuffer,this._cachedViewport&&!i&&this.setViewport(this._cachedViewport,r,n)},r.prototype.unBindFramebuffer=function(e,t,r){void 0===t&&(t=!1),this._currentRenderTarget=null,r&&(e._MSAAFramebuffer&&(this._currentFramebuffer=e._framebuffer),r()),this._currentFramebuffer=null},r.prototype.createDynamicVertexBuffer=function(e){var t=new c.DataBuffer;return t.references=1,t.capacity=1,t},r.prototype.updateDynamicTexture=function(e,t,r,n,i){void 0===n&&(n=!1)},r.prototype.areAllEffectsReady=function(){return!0},r.prototype.getError=function(){return 0},r.prototype._getUnpackAlignement=function(){return 1},r.prototype._unpackFlipY=function(e){},r.prototype.updateDynamicIndexBuffer=function(e,t,r){void 0===r&&(r=0)},r.prototype.updateDynamicVertexBuffer=function(e,t,r,n){},r.prototype._bindTextureDirectly=function(e,t){return this._boundTexturesCache[this._activeChannel]!==t&&(this._boundTexturesCache[this._activeChannel]=t,!0)},r.prototype._bindTexture=function(e,t){e<0||this._bindTextureDirectly(0,t)},r.prototype._deleteBuffer=function(e){},r.prototype.releaseEffects=function(){},r.prototype.displayLoadingUI=function(){},r.prototype.hideLoadingUI=function(){},r.prototype._uploadCompressedDataToTextureDirectly=function(e,t,r,n,i,o,s){void 0===o&&(o=0),void 0===s&&(s=0)},r.prototype._uploadDataToTextureDirectly=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0)},r.prototype._uploadArrayBufferViewToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0)},r.prototype._uploadImageToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0)},r}(o.Engine)}.call(this,r(/*! ./../../node_modules/webpack/buildin/global.js */"../node_modules/webpack/buildin/global.js"))},"./Engines/performanceConfigurator.ts":
- /*!********************************************!*\
- !*** ./Engines/performanceConfigurator.ts ***!
- \********************************************/
- /*! exports provided: PerformanceConfigurator */function(e,t,r){"use strict";r.r(t),r.d(t,"PerformanceConfigurator",(function(){return n}));var n=function(){function e(){}return e.SetMatrixPrecision=function(t){if(e.MatrixTrackPrecisionChange=!1,t&&!e.MatrixUse64Bits&&e.MatrixTrackedMatrices)for(var r=0;r<e.MatrixTrackedMatrices.length;++r){var n=e.MatrixTrackedMatrices[r],i=n._m;n._m=new Array(16);for(var o=0;o<16;++o)n._m[o]=i[o]}e.MatrixUse64Bits=t,e.MatrixCurrentType=e.MatrixUse64Bits?Array:Float32Array,e.MatrixTrackedMatrices=null},e.MatrixUse64Bits=!1,e.MatrixTrackPrecisionChange=!0,e.MatrixCurrentType=Float32Array,e.MatrixTrackedMatrices=[],e}()},"./Engines/thinEngine.ts":
- /*!*******************************!*\
- !*** ./Engines/thinEngine.ts ***!
- \*******************************/
- /*! exports provided: ThinEngine */function(e,t,r){"use strict";r.r(t),r.d(t,"ThinEngine",(function(){return b}));var n=r(/*! ./engineStore */"./Engines/engineStore.ts"),i=r(/*! ../Materials/effect */"./Materials/effect.ts"),o=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../States/depthCullingState */"./States/depthCullingState.ts"),l=r(/*! ../States/stencilState */"./States/stencilState.ts"),c=r(/*! ../States/alphaCullingState */"./States/alphaCullingState.ts"),u=r(/*! ./constants */"./Engines/constants.ts"),d=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),h=r(/*! ../Misc/logger */"./Misc/logger.ts"),f=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),p=r(/*! ./WebGL/webGL2ShaderProcessors */"./Engines/WebGL/webGL2ShaderProcessors.ts"),m=r(/*! ../Meshes/WebGL/webGLDataBuffer */"./Meshes/WebGL/webGLDataBuffer.ts"),g=r(/*! ./WebGL/webGLPipelineContext */"./Engines/WebGL/webGLPipelineContext.ts"),_=r(/*! ../Misc/canvasGenerator */"./Misc/canvasGenerator.ts"),v=r(/*! ./performanceConfigurator */"./Engines/performanceConfigurator.ts"),y=function(){},b=function(){function e(t,r,n,i){var o=this;void 0===i&&(i=!1),this.forcePOTTextures=!1,this.isFullscreen=!1,this.cullBackFaces=!0,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this.validateShaderPrograms=!1,this.useReverseDepthBuffer=!1,this.disableUniformBuffers=!1,this._uniformBuffers=new Array,this._webGLVersion=1,this._windowIsBackground=!1,this._highPrecisionShadersAllowed=!0,this._badOS=!1,this._badDesktopOS=!1,this._renderingQueueLaunched=!1,this._activeRenderLoops=new Array,this.onContextLostObservable=new s.Observable,this.onContextRestoredObservable=new s.Observable,this._contextWasLost=!1,this._doNotHandleContextLost=!1,this.disableVertexArrayObjects=!1,this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new a.DepthCullingState,this._stencilState=new l.StencilState,this._alphaState=new c.AlphaState,this._alphaMode=u.Constants.ALPHA_ADD,this._alphaEquation=u.Constants.ALPHA_DISABLE,this._internalTexturesCache=new Array,this._activeChannel=0,this._currentTextureChannel=-1,this._boundTexturesCache={},this._compiledEffects={},this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._activeRequests=new Array,this._transformTextureUrl=null,this.premultipliedAlpha=!0,this.onBeforeTextureInitObservable=new s.Observable,this._viewportCached={x:0,y:0,z:0,w:0},this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._getDepthStencilBuffer=function(e,t,r,n,i,s){var a=o._gl,l=a.createRenderbuffer();return a.bindRenderbuffer(a.RENDERBUFFER,l),r>1&&a.renderbufferStorageMultisample?a.renderbufferStorageMultisample(a.RENDERBUFFER,r,i,e,t):a.renderbufferStorage(a.RENDERBUFFER,n,e,t),a.framebufferRenderbuffer(a.FRAMEBUFFER,s,a.RENDERBUFFER,l),a.bindRenderbuffer(a.RENDERBUFFER,null),l},this._boundUniforms={};var d=null;if(t){if(n=n||{},v.PerformanceConfigurator.SetMatrixPrecision(!!n.useHighPrecisionMatrix),t.getContext){if(d=t,this._renderingCanvas=d,null!=r&&(n.antialias=r),void 0===n.deterministicLockstep&&(n.deterministicLockstep=!1),void 0===n.lockstepMaxSteps&&(n.lockstepMaxSteps=4),void 0===n.timeStep&&(n.timeStep=1/60),void 0===n.preserveDrawingBuffer&&(n.preserveDrawingBuffer=!1),void 0===n.audioEngine&&(n.audioEngine=!0),void 0===n.stencil&&(n.stencil=!0),!1===n.premultipliedAlpha&&(this.premultipliedAlpha=!1),void 0===n.xrCompatible&&(n.xrCompatible=!0),this._doNotHandleContextLost=!!n.doNotHandleContextLost,navigator&&navigator.userAgent)for(var m=navigator.userAgent,g=0,_=e.ExceptionList;g<_.length;g++){var b=_[g],A=b.key,T=b.targets;if(new RegExp(A).test(m)){if(b.capture&&b.captureConstraint){var M=b.capture,P=b.captureConstraint,S=new RegExp(M).exec(m);if(S&&S.length>0&&parseInt(S[S.length-1])>=P)continue}for(var E=0,C=T;E<C.length;E++)switch(C[E]){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0}}}if(this._doNotHandleContextLost||(this._onContextLost=function(e){e.preventDefault(),o._contextWasLost=!0,h.Logger.Warn("WebGL context lost."),o.onContextLostObservable.notifyObservers(o)},this._onContextRestored=function(){setTimeout((function(){o._initGLContext(),o._rebuildEffects(),o._rebuildInternalTextures(),o._rebuildBuffers(),o.wipeCaches(!0),h.Logger.Warn("WebGL context successfully restored."),o.onContextRestoredObservable.notifyObservers(o),o._contextWasLost=!1}),0)},d.addEventListener("webglcontextlost",this._onContextLost,!1),d.addEventListener("webglcontextrestored",this._onContextRestored,!1),n.powerPreference="high-performance"),!n.disableWebGL2Support)try{this._gl=d.getContext("webgl2",n)||d.getContext("experimental-webgl2",n),this._gl&&(this._webGLVersion=2,this._gl.deleteQuery||(this._webGLVersion=1))}catch(e){}if(!this._gl){if(!d)throw new Error("The provided canvas is null or undefined.");try{this._gl=d.getContext("webgl",n)||d.getContext("experimental-webgl",n)}catch(e){throw new Error("WebGL not supported")}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=t,this._renderingCanvas=this._gl.canvas,this._gl.renderbufferStorageMultisample&&(this._webGLVersion=2);var x=this._gl.getContextAttributes();x&&(n.stencil=x.stencil)}this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==n.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=n.useHighPrecisionFloats);var R=f.DomManagement.IsWindowObjectExist()&&window.devicePixelRatio||1,O=n.limitDeviceRatio||R;this._hardwareScalingLevel=i?1/Math.min(O,R):1,this.resize(),this._isStencilEnable=!!n.stencil,this._initGLContext();for(var I=0;I<this._caps.maxVertexAttribs;I++)this._currentBufferPointers[I]=new y;this.webGLVersion>1&&(this._shaderProcessor=new p.WebGL2ShaderProcessor),this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),this._creationOptions=n,console.log("Babylon.js v"+e.Version+" - "+this.description)}}return Object.defineProperty(e,"NpmPackage",{get:function(){return"babylonjs@4.2.0-alpha.26"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"Version",{get:function(){return"4.2.0-alpha.26"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){var e="WebGL"+this.webGLVersion;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShadersRepository",{get:function(){return i.Effect.ShadersRepository},set:function(e){i.Effect.ShadersRepository=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsUniformBuffers",{get:function(){return this.webGLVersion>1&&!this.disableUniformBuffers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_shouldUseHighPrecisionShader",{get:function(){return!(!this._caps.highPrecisionShaderSupported||!this._highPrecisionShadersAllowed)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needPOTTextures",{get:function(){return this._webGLVersion<2||this.forcePOTTextures},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doNotHandleContextLost",{get:function(){return this._doNotHandleContextLost},set:function(e){this._doNotHandleContextLost=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_supportsHardwareTextureRescaling",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"framebufferDimensionsObject",{set:function(e){this._framebufferDimensionsObject=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentViewport",{get:function(){return this._cachedViewport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture",{get:function(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,u.Constants.TEXTUREFORMAT_RGBA,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture3D",{get:function(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,u.Constants.TEXTUREFORMAT_RGBA,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture2DArray",{get:function(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,u.Constants.TEXTUREFORMAT_RGBA,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture2DArray},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,u.Constants.TEXTUREFORMAT_RGBA,u.Constants.TEXTURETYPE_UNSIGNED_INT,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!1,configurable:!0}),e.prototype._rebuildInternalTextures=function(){for(var e=0,t=this._internalTexturesCache.slice();e<t.length;e++)t[e]._rebuild()},e.prototype._rebuildEffects=function(){for(var e in this._compiledEffects)this._compiledEffects[e]._prepareEffect();i.Effect.ResetCache()},e.prototype.areAllEffectsReady=function(){for(var e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0},e.prototype._rebuildBuffers=function(){for(var e=0,t=this._uniformBuffers;e<t.length;e++)t[e]._rebuild()},e.prototype._initGLContext=function(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile"),standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float"),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1},this._glVersion=this._gl.getParameter(this._gl.VERSION);var e=this._gl.getExtension("WEBGL_debug_renderer_info");if(null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor="Unknown vendor"),this._glRenderer||(this._glRenderer="Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._gl.getParameter(this._gl.MAX_SAMPLES);else{var t=this._gl.getExtension("WEBGL_draw_buffers");if(null!==t){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=t.drawBuffersWEBGL.bind(t),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(var r=0;r<16;r++)this._gl["COLOR_ATTACHMENT"+r+"_WEBGL"]=t["COLOR_ATTACHMENT"+r+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{var n=this._gl.getExtension("WEBGL_depth_texture");null!=n&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=n.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{var i=this._gl.getExtension("OES_vertex_array_object");null!=i&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{var o=this._gl.getExtension("ANGLE_instanced_arrays");null!=o?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=o.drawArraysInstancedANGLE.bind(o),this._gl.drawElementsInstanced=o.drawElementsInstancedANGLE.bind(o),this._gl.vertexAttribDivisor=o.vertexAttribDivisorANGLE.bind(o)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){var s=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),a=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);s&&a&&(this._caps.highPrecisionShaderSupported=0!==s.precision&&0!==a.precision)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{var l=this._gl.getExtension("EXT_blend_minmax");null!=l&&(this._caps.blendMinMax=!0,this._gl.MAX=l.MAX_EXT,this._gl.MIN=l.MIN_EXT)}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(var c=0;c<this._maxSimultaneousTextures;c++)this._nextFreeTextureSlots.push(c)},Object.defineProperty(e.prototype,"webGLVersion",{get:function(){return this._webGLVersion},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"ThinEngine"},Object.defineProperty(e.prototype,"isStencilEnable",{get:function(){return this._isStencilEnable},enumerable:!1,configurable:!0}),e.prototype._prepareWorkingCanvas=function(){if(!this._workingCanvas){this._workingCanvas=_.CanvasGenerator.CreateCanvas(1,1);var e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}},e.prototype.resetTextureCache=function(){for(var e in this._boundTexturesCache)this._boundTexturesCache.hasOwnProperty(e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1},e.prototype.getGlInfo=function(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}},e.prototype.setHardwareScalingLevel=function(e){this._hardwareScalingLevel=e,this.resize()},e.prototype.getHardwareScalingLevel=function(){return this._hardwareScalingLevel},e.prototype.getLoadedTexturesCache=function(){return this._internalTexturesCache},e.prototype.getCaps=function(){return this._caps},e.prototype.stopRenderLoop=function(e){if(e){var t=this._activeRenderLoops.indexOf(e);t>=0&&this._activeRenderLoops.splice(t,1)}else this._activeRenderLoops=[]},e.prototype._renderLoop=function(){if(!this._contextWasLost){var e=!0;if(!this.renderEvenInBackground&&this._windowIsBackground&&(e=!1),e){this.beginFrame();for(var t=0;t<this._activeRenderLoops.length;t++)(0,this._activeRenderLoops[t])();this.endFrame()}}this._activeRenderLoops.length>0?this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},e.prototype.getRenderingCanvas=function(){return this._renderingCanvas},e.prototype.getHostWindow=function(){return f.DomManagement.IsWindowObjectExist()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null},e.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth},e.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight},e.prototype._queueNewFrame=function(t,r){return e.QueueNewFrame(t,r)},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._boundRenderFunction=this._renderLoop.bind(this),this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())))},e.prototype.clear=function(e,t,r,n){void 0===n&&(n=!1),this.applyStates();var i=0;t&&e&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),i|=this._gl.COLOR_BUFFER_BIT),r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GREATER,this._gl.clearDepth(0)):this._gl.clearDepth(1),i|=this._gl.DEPTH_BUFFER_BIT),n&&(this._gl.clearStencil(0),i|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(i)},e.prototype._viewport=function(e,t,r,n){e===this._viewportCached.x&&t===this._viewportCached.y&&r===this._viewportCached.z&&n===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=r,this._viewportCached.w=n,this._gl.viewport(e,t,r,n))},e.prototype.setViewport=function(e,t,r){var n=t||this.getRenderWidth(),i=r||this.getRenderHeight(),o=e.x||0,s=e.y||0;this._cachedViewport=e,this._viewport(o*n,s*i,n*e.width,i*e.height)},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){this._badOS&&this.flushFramebuffer()},e.prototype.resize=function(){var e,t;f.DomManagement.IsWindowObjectExist()?(e=this._renderingCanvas?this._renderingCanvas.clientWidth||this._renderingCanvas.width:window.innerWidth,t=this._renderingCanvas?this._renderingCanvas.clientHeight||this._renderingCanvas.height:window.innerHeight):(e=this._renderingCanvas?this._renderingCanvas.width:100,t=this._renderingCanvas?this._renderingCanvas.height:100),this.setSize(e/this._hardwareScalingLevel,t/this._hardwareScalingLevel)},e.prototype.setSize=function(e,t){return!(!this._renderingCanvas||(e|=0,t|=0,this._renderingCanvas.width===e&&this._renderingCanvas.height===t||(this._renderingCanvas.width=e,this._renderingCanvas.height=t,0)))},e.prototype.bindFramebuffer=function(e,t,r,n,i,o,s){void 0===t&&(t=0),void 0===o&&(o=0),void 0===s&&(s=0),this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._MSAAFramebuffer?e._MSAAFramebuffer:e._framebuffer);var a=this._gl;e.is2DArray?a.framebufferTextureLayer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,e._webGLTexture,o,s):e.isCube&&a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,e._webGLTexture,o);var l=e._depthStencilTexture;if(l){var c=l._generateStencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;e.is2DArray?a.framebufferTextureLayer(a.FRAMEBUFFER,c,l._webGLTexture,o,s):e.isCube?a.framebufferTexture2D(a.FRAMEBUFFER,c,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,l._webGLTexture,o):a.framebufferTexture2D(a.FRAMEBUFFER,c,a.TEXTURE_2D,l._webGLTexture,o)}this._cachedViewport&&!i?this.setViewport(this._cachedViewport,r,n):(r||(r=e.width,o&&(r/=Math.pow(2,o))),n||(n=e.height,o&&(n/=Math.pow(2,o))),this._viewport(0,0,r,n)),this.wipeCaches()},e.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)},e.prototype.unBindFramebuffer=function(e,t,r){void 0===t&&(t=!1),this._currentRenderTarget=null;var n=this._gl;if(e._MSAAFramebuffer){if(e._textureArray)return void this.unBindMultiColorAttachmentFramebuffer(e._textureArray,t,r);n.bindFramebuffer(n.READ_FRAMEBUFFER,e._MSAAFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,e._framebuffer),n.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,n.COLOR_BUFFER_BIT,n.NEAREST)}!e.generateMipMaps||t||e.isCube||(this._bindTextureDirectly(n.TEXTURE_2D,e,!0),n.generateMipmap(n.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null)),r&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),r()),this._bindUnboundFramebuffer(null)},e.prototype.flushFramebuffer=function(){this._gl.flush()},e.prototype.restoreDefaultFramebuffer=function(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()},e.prototype._resetVertexBufferBinding=function(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null},e.prototype.createVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)},e.prototype._createVertexBuffer=function(e,t){var r=this._gl.createBuffer();if(!r)throw new Error("Unable to create vertex buffer");var n=new m.WebGLDataBuffer(r);return this.bindArrayBuffer(n),e instanceof Array?this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.STATIC_DRAW),this._resetVertexBufferBinding(),n.references=1,n},e.prototype.createDynamicVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)},e.prototype._resetIndexBufferBinding=function(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null},e.prototype.createIndexBuffer=function(e,t){var r=this._gl.createBuffer(),n=new m.WebGLDataBuffer(r);if(!r)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);var i=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=4===i.BYTES_PER_ELEMENT,n},e.prototype._normalizeIndexData=function(e){if(e instanceof Uint16Array)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(var t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBlock=function(e,t,r){var n=e.program,i=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,i,r)},e.prototype.bindIndexBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)},e.prototype.bindBuffer=function(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)},e.prototype.updateArrayBuffer=function(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)},e.prototype._vertexAttribPointer=function(e,t,r,n,i,o,s){var a=this._currentBufferPointers[t],l=!1;a.active?(a.buffer!==e&&(a.buffer=e,l=!0),a.size!==r&&(a.size=r,l=!0),a.type!==n&&(a.type=n,l=!0),a.normalized!==i&&(a.normalized=i,l=!0),a.stride!==o&&(a.stride=o,l=!0),a.offset!==s&&(a.offset=s,l=!0)):(l=!0,a.active=!0,a.index=t,a.size=r,a.type=n,a.normalized=i,a.stride=o,a.offset=s,a.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),this._gl.vertexAttribPointer(t,r,n,i,o,s))},e.prototype._bindIndexBufferWithCache=function(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)},e.prototype._bindVertexBuffersAttributes=function(e,t){var r=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var n=0;n<r.length;n++){var i=t.getAttributeLocation(n);if(i>=0){var o=e[r[n]];if(!o)continue;this._gl.enableVertexAttribArray(i),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[i]=!0);var s=o.getBuffer();s&&(this._vertexAttribPointer(s,i,o.getSize(),o.type,o.normalized,o.byteStride,o.byteOffset),o.getIsInstanced()&&(this._gl.vertexAttribDivisor(i,o.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(i),this._currentInstanceBuffers.push(s))))}}},e.prototype.recordVertexArrayObject=function(e,t,r){var n=this._gl.createVertexArray();return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,r),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n},e.prototype.bindVertexArrayObject=function(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)},e.prototype.bindBuffersDirectly=function(e,t,r,n,i){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==i){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i;var o=i.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var s=0,a=0;a<o;a++)if(a<r.length){var l=i.getAttributeLocation(a);l>=0&&(this._gl.enableVertexAttribArray(l),this._vertexAttribArraysEnabled[l]=!0,this._vertexAttribPointer(e,l,r[a],this._gl.FLOAT,!1,n,s)),s+=4*r[a]}}this._bindIndexBufferWithCache(t)},e.prototype._unbindVertexArrayObject=function(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))},e.prototype.bindBuffers=function(e,t,r){this._cachedVertexBuffers===e&&this._cachedEffectForVertexBuffers===r||(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r,this._bindVertexBuffersAttributes(e,r)),this._bindIndexBufferWithCache(t)},e.prototype.unbindInstanceAttributes=function(){for(var e,t=0,r=this._currentInstanceLocations.length;t<r;t++){var n=this._currentInstanceBuffers[t];e!=n&&n.references&&(e=n,this.bindArrayBuffer(n));var i=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(i,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0},e.prototype.releaseVertexArrayObject=function(e){this._gl.deleteVertexArray(e)},e.prototype._releaseBuffer=function(e){return e.references--,0===e.references&&(this._deleteBuffer(e),!0)},e.prototype._deleteBuffer=function(e){this._gl.deleteBuffer(e.underlyingResource)},e.prototype.updateAndBindInstancesBuffer=function(e,t,r){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==r[0].index)this.bindInstancesBuffer(e,r,!0);else for(var n=0;n<4;n++){var i=r[n];this._vertexAttribArraysEnabled[i]||(this._gl.enableVertexAttribArray(i),this._vertexAttribArraysEnabled[i]=!0),this._vertexAttribPointer(e,i,4,this._gl.FLOAT,!1,64,16*n),this._gl.vertexAttribDivisor(i,1),this._currentInstanceLocations.push(i),this._currentInstanceBuffers.push(e)}},e.prototype.bindInstancesBuffer=function(e,t,r){void 0===r&&(r=!0),this.bindArrayBuffer(e);var n=0;if(r)for(var i=0;i<t.length;i++)n+=4*(o=t[i]).attributeSize;for(i=0;i<t.length;i++){var o;void 0===(o=t[i]).index&&(o.index=this._currentEffect.getAttributeLocationByName(o.attributeName)),o.index<0||(this._vertexAttribArraysEnabled[o.index]||(this._gl.enableVertexAttribArray(o.index),this._vertexAttribArraysEnabled[o.index]=!0),this._vertexAttribPointer(e,o.index,o.attributeSize,o.attributeType||this._gl.FLOAT,o.normalized||!1,n,o.offset),this._gl.vertexAttribDivisor(o.index,void 0===o.divisor?1:o.divisor),this._currentInstanceLocations.push(o.index),this._currentInstanceBuffers.push(e))}},e.prototype.disableInstanceAttributeByName=function(e){if(this._currentEffect){var t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}},e.prototype.disableInstanceAttribute=function(e){for(var t,r=!1;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),r=!0,t=this._currentInstanceLocations.indexOf(e);r&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))},e.prototype.disableAttributeByIndex=function(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1},e.prototype.draw=function(e,t,r,n){this.drawElementsType(e?u.Constants.MATERIAL_TriangleFillMode:u.Constants.MATERIAL_WireFrameFillMode,t,r,n)},e.prototype.drawPointClouds=function(e,t,r){this.drawArraysType(u.Constants.MATERIAL_PointFillMode,e,t,r)},e.prototype.drawUnIndexed=function(e,t,r,n){this.drawArraysType(e?u.Constants.MATERIAL_TriangleFillMode:u.Constants.MATERIAL_WireFrameFillMode,t,r,n)},e.prototype.drawElementsType=function(e,t,r,n){this.applyStates(),this._reportDrawCall();var i=this._drawMode(e),o=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,s=this._uintIndicesCurrentlySet?4:2;n?this._gl.drawElementsInstanced(i,r,o,t*s,n):this._gl.drawElements(i,r,o,t*s)},e.prototype.drawArraysType=function(e,t,r,n){this.applyStates(),this._reportDrawCall();var i=this._drawMode(e);n?this._gl.drawArraysInstanced(i,t,r,n):this._gl.drawArrays(i,t,r)},e.prototype._drawMode=function(e){switch(e){case u.Constants.MATERIAL_TriangleFillMode:return this._gl.TRIANGLES;case u.Constants.MATERIAL_PointFillMode:return this._gl.POINTS;case u.Constants.MATERIAL_WireFrameFillMode:return this._gl.LINES;case u.Constants.MATERIAL_PointListDrawMode:return this._gl.POINTS;case u.Constants.MATERIAL_LineListDrawMode:return this._gl.LINES;case u.Constants.MATERIAL_LineLoopDrawMode:return this._gl.LINE_LOOP;case u.Constants.MATERIAL_LineStripDrawMode:return this._gl.LINE_STRIP;case u.Constants.MATERIAL_TriangleStripDrawMode:return this._gl.TRIANGLE_STRIP;case u.Constants.MATERIAL_TriangleFanDrawMode:return this._gl.TRIANGLE_FAN;default:return this._gl.TRIANGLES}},e.prototype._reportDrawCall=function(){},e.prototype._releaseEffect=function(e){this._compiledEffects[e._key]&&(delete this._compiledEffects[e._key],this._deletePipelineContext(e.getPipelineContext()))},e.prototype._deletePipelineContext=function(e){var t=e;t&&t.program&&(t.program.__SPECTOR_rebuildProgram=null,this._gl.deleteProgram(t.program))},e.prototype.createEffect=function(e,t,r,n,o,s,a,l,c){var u=(e.vertexElement||e.vertex||e.vertexToken||e)+"+"+(e.fragmentElement||e.fragment||e.fragmentToken||e)+"@"+(o||t.defines);if(this._compiledEffects[u]){var d=this._compiledEffects[u];return a&&d.isReady()&&a(d),d}var h=new i.Effect(e,t,r,n,this,o,s,a,l,c);return h._key=u,this._compiledEffects[u]=h,h},e._ConcatenateShader=function(e,t,r){return void 0===r&&(r=""),r+(t?t+"\n":"")+e},e.prototype._compileShader=function(t,r,n,i){return this._compileRawShader(e._ConcatenateShader(t,n,i),r)},e.prototype._compileRawShader=function(e,t){var r=this._gl,n=r.createShader("vertex"===t?r.VERTEX_SHADER:r.FRAGMENT_SHADER);if(!n)throw new Error("Something went wrong while compile the shader.");return r.shaderSource(n,e),r.compileShader(n),n},e.prototype._getShaderSource=function(e){return this._gl.getShaderSource(e)},e.prototype.createRawShaderProgram=function(e,t,r,n,i){void 0===i&&(i=null),n=n||this._gl;var o=this._compileRawShader(t,"vertex"),s=this._compileRawShader(r,"fragment");return this._createShaderProgram(e,o,s,n,i)},e.prototype.createShaderProgram=function(e,t,r,n,i,o){void 0===o&&(o=null),i=i||this._gl;var s=this._webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"",a=this._compileShader(t,"vertex",n,s),l=this._compileShader(r,"fragment",n,s);return this._createShaderProgram(e,a,l,i,o)},e.prototype.createPipelineContext=function(){var e=new g.WebGLPipelineContext;return e.engine=this,this._caps.parallelShaderCompile&&(e.isParallelCompiled=!0),e},e.prototype._createShaderProgram=function(e,t,r,n,i){void 0===i&&(i=null);var o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");return n.attachShader(o,t),n.attachShader(o,r),n.linkProgram(o),e.context=n,e.vertexShader=t,e.fragmentShader=r,e.isParallelCompiled||this._finalizePipelineContext(e),o},e.prototype._finalizePipelineContext=function(e){var t=e.context,r=e.vertexShader,n=e.fragmentShader,i=e.program;if(!t.getProgramParameter(i,t.LINK_STATUS)){var o,s;if(!this._gl.getShaderParameter(r,this._gl.COMPILE_STATUS)&&(o=this._gl.getShaderInfoLog(r)))throw e.vertexCompilationError=o,new Error("VERTEX SHADER "+o);if(!this._gl.getShaderParameter(n,this._gl.COMPILE_STATUS)&&(o=this._gl.getShaderInfoLog(n)))throw e.fragmentCompilationError=o,new Error("FRAGMENT SHADER "+o);if(s=t.getProgramInfoLog(i))throw e.programLinkError=s,new Error(s)}if(this.validateShaderPrograms&&(t.validateProgram(i),!t.getProgramParameter(i,t.VALIDATE_STATUS)&&(s=t.getProgramInfoLog(i))))throw e.programValidationError=s,new Error(s);t.deleteShader(r),t.deleteShader(n),e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._preparePipelineContext=function(e,t,r,n,i,o,s){var a=e;a.program=n?this.createRawShaderProgram(a,t,r,void 0,s):this.createShaderProgram(a,t,r,o,void 0,s),a.program.__SPECTOR_rebuildProgram=i},e.prototype._isRenderingStateCompiled=function(e){var t=e;return!!this._gl.getProgramParameter(t.program,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)&&(this._finalizePipelineContext(t),!0)},e.prototype._executeWhenRenderingStateIsCompiled=function(e,t){var r=e;if(r.isParallelCompiled){var n=r.onCompiled;r.onCompiled=n?function(){n(),t()}:t}else t()},e.prototype.getUniforms=function(e,t){for(var r=new Array,n=e,i=0;i<t.length;i++)r.push(this._gl.getUniformLocation(n.program,t[i]));return r},e.prototype.getAttributes=function(e,t){for(var r=[],n=e,i=0;i<t.length;i++)try{r.push(this._gl.getAttribLocation(n.program,t[i]))}catch(e){r.push(-1)}return r},e.prototype.enableEffect=function(e){e&&e!==this._currentEffect&&(this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))},e.prototype.setInt=function(e,t){e&&this._gl.uniform1i(e,t)},e.prototype.setIntArray=function(e,t){e&&this._gl.uniform1iv(e,t)},e.prototype.setIntArray2=function(e,t){e&&t.length%2==0&&this._gl.uniform2iv(e,t)},e.prototype.setIntArray3=function(e,t){e&&t.length%3==0&&this._gl.uniform3iv(e,t)},e.prototype.setIntArray4=function(e,t){e&&t.length%4==0&&this._gl.uniform4iv(e,t)},e.prototype.setArray=function(e,t){e&&this._gl.uniform1fv(e,t)},e.prototype.setArray2=function(e,t){e&&t.length%2==0&&this._gl.uniform2fv(e,t)},e.prototype.setArray3=function(e,t){e&&t.length%3==0&&this._gl.uniform3fv(e,t)},e.prototype.setArray4=function(e,t){e&&t.length%4==0&&this._gl.uniform4fv(e,t)},e.prototype.setMatrices=function(e,t){e&&this._gl.uniformMatrix4fv(e,!1,t)},e.prototype.setMatrix3x3=function(e,t){e&&this._gl.uniformMatrix3fv(e,!1,t)},e.prototype.setMatrix2x2=function(e,t){e&&this._gl.uniformMatrix2fv(e,!1,t)},e.prototype.setFloat=function(e,t){e&&this._gl.uniform1f(e,t)},e.prototype.setFloat2=function(e,t,r){e&&this._gl.uniform2f(e,t,r)},e.prototype.setFloat3=function(e,t,r,n){e&&this._gl.uniform3f(e,t,r,n)},e.prototype.setFloat4=function(e,t,r,n,i){e&&this._gl.uniform4f(e,t,r,n,i)},e.prototype.applyStates=function(){if(this._depthCullingState.apply(this._gl),this._stencilState.apply(this._gl),this._alphaState.apply(this._gl),this._colorWriteChanged){this._colorWriteChanged=!1;var e=this._colorWrite;this._gl.colorMask(e,e,e,e)}},e.prototype.setColorWrite=function(e){e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)},e.prototype.getColorWrite=function(){return this._colorWrite},Object.defineProperty(e.prototype,"depthCullingState",{get:function(){return this._depthCullingState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaState",{get:function(){return this._alphaState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilState",{get:function(){return this._stencilState},enumerable:!1,configurable:!0}),e.prototype.clearInternalTexturesCache=function(){this._internalTexturesCache=[]},e.prototype.wipeCaches=function(e){this.preventCacheWipeBetweenFrames&&!e||(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilState.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._alphaMode=u.Constants.ALPHA_ADD,this._alphaEquation=u.Constants.ALPHA_DISABLE,this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))},e.prototype._getSamplingParameters=function(e,t){var r=this._gl,n=r.NEAREST,i=r.NEAREST;switch(e){case u.Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST:n=r.LINEAR,i=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case u.Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR:n=r.LINEAR,i=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case u.Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR:n=r.NEAREST,i=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case u.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST:n=r.NEAREST,i=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case u.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST:n=r.NEAREST,i=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case u.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR:n=r.NEAREST,i=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case u.Constants.TEXTURE_NEAREST_LINEAR:n=r.NEAREST,i=r.LINEAR;break;case u.Constants.TEXTURE_NEAREST_NEAREST:n=r.NEAREST,i=r.NEAREST;break;case u.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST:n=r.LINEAR,i=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case u.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR:n=r.LINEAR,i=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case u.Constants.TEXTURE_LINEAR_LINEAR:n=r.LINEAR,i=r.LINEAR;break;case u.Constants.TEXTURE_LINEAR_NEAREST:n=r.LINEAR,i=r.NEAREST}return{min:i,mag:n}},e.prototype._createTexture=function(){var e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e},e.prototype.createTexture=function(t,r,i,o,s,a,l,c,f,p,m,g){var _=this;void 0===s&&(s=u.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===a&&(a=null),void 0===l&&(l=null),void 0===c&&(c=null),void 0===f&&(f=null),void 0===p&&(p=null),void 0===m&&(m=null);var v="data:"===(t=t||"").substr(0,5),y="blob:"===t.substr(0,5),b=v&&-1!==t.indexOf(";base64,"),A=f||new d.InternalTexture(this,d.InternalTextureSource.Url),T=t;!this._transformTextureUrl||b||f||c||(t=this._transformTextureUrl(t));for(var M=t.lastIndexOf("."),P=m||(M>-1?t.substring(M).toLowerCase():""),S=null,E=0,C=e._TextureLoaders;E<C.length;E++){var x=C[E];if(x.canLoad(P,g)){S=x;break}}o&&o._addPendingData(A),A.url=t,A.generateMipMaps=!r,A.samplingMode=s,A.invertY=i,this._doNotHandleContextLost||(A._buffer=c);var R=null;a&&!f&&(R=A.onLoadedObservable.add(a)),f||this._internalTexturesCache.push(A);var O=function(e,i){o&&o._removePendingData(A),t===T?(R&&A.onLoadedObservable.remove(R),n.EngineStore.UseFallbackTexture&&_.createTexture(n.EngineStore.FallbackTexture,r,A.invertY,o,s,null,l,c,A),l&&l((e||"Unknown error")+(n.EngineStore.UseFallbackTexture?" - Fallback texture was used":""),i)):(h.Logger.Warn("Failed to load "+t+", falling back to "+T),_.createTexture(T,r,A.invertY,o,s,a,l,c,A,p,m,g))};if(S){var I=function(e){S.loadData(e,A,(function(e,t,r,n,i,a){a?O("TextureLoader failed to load data"):_._prepareWebGLTexture(A,o,e,t,A.invertY,!r,n,(function(){return i(),!1}),s)}))};c?c instanceof ArrayBuffer?I(new Uint8Array(c)):ArrayBuffer.isView(c)?I(c):l&&l("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null):this._loadFile(t,(function(e){return I(new Uint8Array(e))}),void 0,o?o.offlineProvider:void 0,!0,(function(e,t){O("Unable to load "+(e&&e.responseURL,t))}))}else{var D=function(e){y&&!_._doNotHandleContextLost&&(A._buffer=e),_._prepareWebGLTexture(A,o,e.width,e.height,A.invertY,r,!1,(function(t,r,n){var i=_._gl,s=e.width===t&&e.height===r,a=p?_._getInternalFormat(p):".jpg"===P?i.RGB:i.RGBA;if(s)return i.texImage2D(i.TEXTURE_2D,0,a,a,i.UNSIGNED_BYTE,e),!1;var l=_._caps.maxTextureSize;if(e.width>l||e.height>l||!_._supportsHardwareTextureRescaling)return _._prepareWorkingCanvas(),!(!_._workingCanvas||!_._workingContext||(_._workingCanvas.width=t,_._workingCanvas.height=r,_._workingContext.drawImage(e,0,0,e.width,e.height,0,0,t,r),i.texImage2D(i.TEXTURE_2D,0,a,a,i.UNSIGNED_BYTE,_._workingCanvas),A.width=t,A.height=r,1));var c=new d.InternalTexture(_,d.InternalTextureSource.Temp);return _._bindTextureDirectly(i.TEXTURE_2D,c,!0),i.texImage2D(i.TEXTURE_2D,0,a,a,i.UNSIGNED_BYTE,e),_._rescaleTexture(c,A,o,a,(function(){_._releaseTexture(c),_._bindTextureDirectly(i.TEXTURE_2D,A,!0),n()})),!0}),s)};!v||b?c&&(c.decoding||c.close)?D(c):e._FileToolsLoadImage(t,D,O,o?o.offlineProvider:null,g):"string"==typeof c||c instanceof ArrayBuffer||ArrayBuffer.isView(c)||c instanceof Blob?e._FileToolsLoadImage(c,D,O,o?o.offlineProvider:null,g):c&&D(c)}return A},e._FileToolsLoadImage=function(e,t,r,n,i){throw o._DevTools.WarnImport("FileTools")},e.prototype._rescaleTexture=function(e,t,r,n,i){},e.prototype.createRawTexture=function(e,t,r,n,i,s,a,l,c){throw void 0===l&&(l=null),void 0===c&&(c=u.Constants.TEXTURETYPE_UNSIGNED_INT),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype.createRawCubeTexture=function(e,t,r,n,i,s,a,l){throw void 0===l&&(l=null),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype.createRawTexture3D=function(e,t,r,n,i,s,a,l,c,d){throw void 0===c&&(c=null),void 0===d&&(d=u.Constants.TEXTURETYPE_UNSIGNED_INT),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype.createRawTexture2DArray=function(e,t,r,n,i,s,a,l,c,d){throw void 0===c&&(c=null),void 0===d&&(d=u.Constants.TEXTURETYPE_UNSIGNED_INT),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype._unpackFlipY=function(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))},e.prototype._getUnpackAlignement=function(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)},e.prototype._getTextureTarget=function(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D},e.prototype.updateTextureSamplingMode=function(e,t,r){void 0===r&&(r=!1);var n=this._getTextureTarget(t),i=this._getSamplingParameters(e,t.generateMipMaps||r);this._setTextureParameterInteger(n,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(n,this._gl.TEXTURE_MIN_FILTER,i.min),r&&(t.generateMipMaps=!0,this._gl.generateMipmap(n)),this._bindTextureDirectly(n,null),t.samplingMode=e},e.prototype.updateTextureWrappingMode=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var i=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(i,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==r&&(this._setTextureParameterInteger(i,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r),e),e._cachedWrapV=r),(e.is2DArray||e.is3D)&&null!==n&&(this._setTextureParameterInteger(i,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(n),e),e._cachedWrapR=n),this._bindTextureDirectly(i,null)},e.prototype._setupDepthStencilTexture=function(e,t,r,n,i){var o=t.width||t,s=t.height||t,a=t.layers||0;e.baseWidth=o,e.baseHeight=s,e.width=o,e.height=s,e.is2DArray=a>0,e.depth=a,e.isReady=!0,e.samples=1,e.generateMipMaps=!1,e._generateDepthBuffer=!0,e._generateStencilBuffer=r,e.samplingMode=n?u.Constants.TEXTURE_BILINEAR_SAMPLINGMODE:u.Constants.TEXTURE_NEAREST_SAMPLINGMODE,e.type=u.Constants.TEXTURETYPE_UNSIGNED_INT,e._comparisonFunction=i;var l=this._gl,c=this._getTextureTarget(e),d=this._getSamplingParameters(e.samplingMode,!1);l.texParameteri(c,l.TEXTURE_MAG_FILTER,d.mag),l.texParameteri(c,l.TEXTURE_MIN_FILTER,d.min),l.texParameteri(c,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(c,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),0===i?(l.texParameteri(c,l.TEXTURE_COMPARE_FUNC,u.Constants.LEQUAL),l.texParameteri(c,l.TEXTURE_COMPARE_MODE,l.NONE)):(l.texParameteri(c,l.TEXTURE_COMPARE_FUNC,i),l.texParameteri(c,l.TEXTURE_COMPARE_MODE,l.COMPARE_REF_TO_TEXTURE))},e.prototype._uploadCompressedDataToTextureDirectly=function(e,t,r,n,i,o,s){void 0===o&&(o=0),void 0===s&&(s=0);var a=this._gl,l=a.TEXTURE_2D;e.isCube&&(l=a.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._gl.compressedTexImage2D(l,s,t,r,n,0,i)},e.prototype._uploadDataToTextureDirectly=function(e,t,r,n,i,o){void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=!1);var s=this._gl,a=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),c=void 0===i?this._getRGBABufferInternalSizedFormat(e.type,e.format):this._getInternalFormat(i);this._unpackFlipY(e.invertY);var u=s.TEXTURE_2D;e.isCube&&(u=s.TEXTURE_CUBE_MAP_POSITIVE_X+r);var d=Math.round(Math.log(e.width)*Math.LOG2E),h=Math.round(Math.log(e.height)*Math.LOG2E),f=o?e.width:Math.pow(2,Math.max(d-n,0)),p=o?e.height:Math.pow(2,Math.max(h-n,0));s.texImage2D(u,n,c,f,p,0,l,a,t)},e.prototype.updateTextureData=function(e,t,r,n,i,o,s,a){void 0===s&&(s=0),void 0===a&&(a=0);var l=this._gl,c=this._getWebGLTextureType(e.type),u=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);var d=l.TEXTURE_2D;e.isCube&&(d=l.TEXTURE_CUBE_MAP_POSITIVE_X+s),l.texSubImage2D(d,a,r,n,i,o,u,c,t)},e.prototype._uploadArrayBufferViewToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=this._gl,o=e.isCube?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,r,n),this._bindTextureDirectly(o,null,!0)},e.prototype._prepareWebGLTextureContinuation=function(e,t,r,n,i){var o=this._gl;if(o){var s=this._getSamplingParameters(i,!r);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,s.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,s.min),r||n||o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t._removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}},e.prototype._prepareWebGLTexture=function(t,r,n,i,o,s,a,l,c){var d=this;void 0===c&&(c=u.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE);var h=this.getCaps().maxTextureSize,f=Math.min(h,this.needPOTTextures?e.GetExponentOfTwo(n,h):n),p=Math.min(h,this.needPOTTextures?e.GetExponentOfTwo(i,h):i),m=this._gl;m&&(t._webGLTexture?(this._bindTextureDirectly(m.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===o||!!o),t.baseWidth=n,t.baseHeight=i,t.width=f,t.height=p,t.isReady=!0,l(f,p,(function(){d._prepareWebGLTextureContinuation(t,r,s,a,c)}))||this._prepareWebGLTextureContinuation(t,r,s,a,c)):r&&r._removePendingData(t))},e.prototype._setupFramebufferDepthAttachments=function(e,t,r,n,i){void 0===i&&(i=1);var o=this._gl;if(e&&t)return this._getDepthStencilBuffer(r,n,i,o.DEPTH_STENCIL,o.DEPTH24_STENCIL8,o.DEPTH_STENCIL_ATTACHMENT);if(t){var s=o.DEPTH_COMPONENT16;return this._webGLVersion>1&&(s=o.DEPTH_COMPONENT32F),this._getDepthStencilBuffer(r,n,i,s,s,o.DEPTH_ATTACHMENT)}return e?this._getDepthStencilBuffer(r,n,i,o.STENCIL_INDEX8,o.STENCIL_INDEX8,o.STENCIL_ATTACHMENT):null},e.prototype._releaseFramebufferObjects=function(e){var t=this._gl;e._framebuffer&&(t.deleteFramebuffer(e._framebuffer),e._framebuffer=null),e._depthStencilBuffer&&(t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(t.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(t.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null)},e.prototype._releaseTexture=function(e){this._releaseFramebufferObjects(e),this._deleteTexture(e._webGLTexture),this.unbindAllTextures();var t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()},e.prototype._deleteTexture=function(e){this._gl.deleteTexture(e)},e.prototype._setProgram=function(e){this._currentProgram!==e&&(this._gl.useProgram(e),this._currentProgram=e)},e.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.program);for(var r=e.getSamplers(),n=0;n<r.length;n++){var i=e.getUniform(r[n]);i&&(this._boundUniforms[n]=i)}this._currentEffect=null},e.prototype._activateCurrentTexture=function(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)},e.prototype._bindTextureDirectly=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);var i=!1,o=t&&t._associatedChannel>-1;return r&&o&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||n?(this._activateCurrentTexture(),t&&t.isMultiview?this._gl.bindTexture(e,t?t._colorTextureArray:null):this._gl.bindTexture(e,t?t._webGLTexture:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)):r&&(i=!0,this._activateCurrentTexture()),o&&!r&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),i},e.prototype._bindTexture=function(e,t){if(void 0!==e){t&&(t._associatedChannel=e),this._activeChannel=e;var r=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(r,t)}},e.prototype.unbindAllTextures=function(){for(var e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))},e.prototype.setTexture=function(e,t,r){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))},e.prototype._bindSamplerUniformToChannel=function(e,t){var r=this._boundUniforms[e];r&&r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)},e.prototype._getTextureWrapMode=function(e){switch(e){case u.Constants.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case u.Constants.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case u.Constants.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(e,t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===u.Constants.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;var i;i=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!r&&i&&(i._associatedChannel=e);var o=!0;this._boundTexturesCache[e]===i&&(r||this._bindSamplerUniformToChannel(i._associatedChannel,e),o=!1),this._activeChannel=e;var s=this._getTextureTarget(i);if(o&&this._bindTextureDirectly(s,i,r),i&&!i.isMultiview){if(i.isCube&&i._cachedCoordinatesMode!==t.coordinatesMode){i._cachedCoordinatesMode=t.coordinatesMode;var a=t.coordinatesMode!==u.Constants.TEXTURE_CUBIC_MODE&&t.coordinatesMode!==u.Constants.TEXTURE_SKYBOX_MODE?u.Constants.TEXTURE_WRAP_ADDRESSMODE:u.Constants.TEXTURE_CLAMP_ADDRESSMODE;t.wrapU=a,t.wrapV=a}i._cachedWrapU!==t.wrapU&&(i._cachedWrapU=t.wrapU,this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),i)),i._cachedWrapV!==t.wrapV&&(i._cachedWrapV=t.wrapV,this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),i)),i.is3D&&i._cachedWrapR!==t.wrapR&&(i._cachedWrapR=t.wrapR,this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),i)),this._setAnisotropicLevel(s,i,t.anisotropicFilteringLevel)}return!0},e.prototype.setTextureArray=function(e,t,r){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(var n=0;n<r.length;n++){var i=r[n].getInternalTexture();i?(this._textureUnits[n]=e+n,i._associatedChannel=e+n):this._textureUnits[n]=-1}this._gl.uniform1iv(t,this._textureUnits);for(var o=0;o<r.length;o++)this._setTexture(this._textureUnits[o],r[o],!0)}},e.prototype._setAnisotropicLevel=function(e,t,r){var n=this._caps.textureAnisotropicFilterExtension;t.samplingMode!==u.Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST&&t.samplingMode!==u.Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR&&t.samplingMode!==u.Constants.TEXTURE_LINEAR_LINEAR&&(r=1),n&&t._cachedAnisotropicFilteringLevel!==r&&(this._setTextureParameterFloat(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=r)},e.prototype._setTextureParameterFloat=function(e,t,r,n){this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameterf(e,t,r)},e.prototype._setTextureParameterInteger=function(e,t,r,n){n&&this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameteri(e,t,r)},e.prototype.unbindAllAttributes=function(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(var e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e)}else{e=0;for(var t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}},e.prototype.releaseEffects=function(){for(var e in this._compiledEffects){var t=this._compiledEffects[e].getPipelineContext();this._deletePipelineContext(t)}this._compiledEffects={}},e.prototype.dispose=function(){this.stopRenderLoop(),this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.releaseEffects(),this.unbindAllAttributes(),this._boundUniforms=[],f.DomManagement.IsWindowObjectExist()&&this._renderingCanvas&&(this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers=[],this._renderingCanvas=null,this._currentProgram=null,this._boundRenderFunction=null,i.Effect.ResetCache();for(var e=0,t=this._activeRequests;e<t.length;e++)t[e].abort()},e.prototype.attachContextLostEvent=function(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)},e.prototype.attachContextRestoredEvent=function(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)},e.prototype.getError=function(){return this._gl.getError()},e.prototype._canRenderToFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(u.Constants.TEXTURETYPE_FLOAT)},e.prototype._canRenderToHalfFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(u.Constants.TEXTURETYPE_HALF_FLOAT)},e.prototype._canRenderToFramebuffer=function(e){for(var t=this._gl;t.getError()!==t.NO_ERROR;);var r=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER);if((r=(r=r&&o===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),r=r&&t.getError()===t.NO_ERROR),r){t.bindFramebuffer(t.FRAMEBUFFER,null);var s=t.RGBA,a=t.UNSIGNED_BYTE,l=new Uint8Array(4);t.readPixels(0,0,1,1,s,a,l),r=r&&t.getError()===t.NO_ERROR}for(t.deleteTexture(n),t.deleteFramebuffer(i),t.bindFramebuffer(t.FRAMEBUFFER,null);!r&&t.getError()!==t.NO_ERROR;);return r},e.prototype._getWebGLTextureType=function(e){if(1===this._webGLVersion){switch(e){case u.Constants.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case u.Constants.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT_OES;case u.Constants.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case u.Constants.TEXTURETYPE_BYTE:return this._gl.BYTE;case u.Constants.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case u.Constants.TEXTURETYPE_SHORT:return this._gl.SHORT;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT:return this._gl.UNSIGNED_SHORT;case u.Constants.TEXTURETYPE_INT:return this._gl.INT;case u.Constants.TEXTURETYPE_UNSIGNED_INTEGER:return this._gl.UNSIGNED_INT;case u.Constants.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case u.Constants.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5;case u.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case u.Constants.TEXTURETYPE_UNSIGNED_INT_24_8:return this._gl.UNSIGNED_INT_24_8;case u.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case u.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case u.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE},e.prototype._getInternalFormat=function(e){var t=this._gl.RGBA;switch(e){case u.Constants.TEXTUREFORMAT_ALPHA:t=this._gl.ALPHA;break;case u.Constants.TEXTUREFORMAT_LUMINANCE:t=this._gl.LUMINANCE;break;case u.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:t=this._gl.LUMINANCE_ALPHA;break;case u.Constants.TEXTUREFORMAT_RED:t=this._gl.RED;break;case u.Constants.TEXTUREFORMAT_RG:t=this._gl.RG;break;case u.Constants.TEXTUREFORMAT_RGB:t=this._gl.RGB;break;case u.Constants.TEXTUREFORMAT_RGBA:t=this._gl.RGBA}if(this._webGLVersion>1)switch(e){case u.Constants.TEXTUREFORMAT_RED_INTEGER:t=this._gl.RED_INTEGER;break;case u.Constants.TEXTUREFORMAT_RG_INTEGER:t=this._gl.RG_INTEGER;break;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:t=this._gl.RGB_INTEGER;break;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:t=this._gl.RGBA_INTEGER}return t},e.prototype._getRGBABufferInternalSizedFormat=function(e,t){if(1===this._webGLVersion){if(void 0!==t)switch(t){case u.Constants.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case u.Constants.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case u.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB}return this._gl.RGBA}switch(e){case u.Constants.TEXTURETYPE_BYTE:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R8_SNORM;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG8_SNORM;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB8_SNORM;case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8I;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8I;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8I;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case u.Constants.TEXTURETYPE_UNSIGNED_BYTE:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R8;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG8;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB8;case u.Constants.TEXTUREFORMAT_RGBA:return this._gl.RGBA8;case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8UI;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8UI;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8UI;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8UI;case u.Constants.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case u.Constants.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case u.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case u.Constants.TEXTURETYPE_SHORT:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16I;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16I;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16I;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16I}case u.Constants.TEXTURETYPE_UNSIGNED_SHORT:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16UI;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16UI;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16UI;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16UI}case u.Constants.TEXTURETYPE_INT:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32I;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32I;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32I;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32I}case u.Constants.TEXTURETYPE_UNSIGNED_INTEGER:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32UI;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32UI;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32UI;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32UI}case u.Constants.TEXTURETYPE_FLOAT:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R32F;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG32F;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB32F;case u.Constants.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA32F}case u.Constants.TEXTURETYPE_HALF_FLOAT:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R16F;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG16F;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB16F;case u.Constants.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA16F}case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.RGB565;case u.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.R11F_G11F_B10F;case u.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.RGB9_E5;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.RGBA4;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.RGB5_A1;case u.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:switch(t){case u.Constants.TEXTUREFORMAT_RGBA:return this._gl.RGB10_A2;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return this._gl.RGBA8},e.prototype._getRGBAMultiSampleBufferFormat=function(e){return e===u.Constants.TEXTURETYPE_FLOAT?this._gl.RGBA32F:e===u.Constants.TEXTURETYPE_HALF_FLOAT?this._gl.RGBA16F:this._gl.RGBA8},e.prototype._loadFile=function(t,r,n,i,o,s){var a=this,l=e._FileToolsLoadFile(t,r,n,i,o,s);return this._activeRequests.push(l),l.onCompleteObservable.add((function(e){a._activeRequests.splice(a._activeRequests.indexOf(e),1)})),l},e._FileToolsLoadFile=function(e,t,r,n,i,s){throw o._DevTools.WarnImport("FileTools")},e.prototype.readPixels=function(e,t,r,n,i){void 0===i&&(i=!0);var o=i?4:3,s=i?this._gl.RGBA:this._gl.RGB,a=new Uint8Array(n*r*o);return this._gl.readPixels(e,t,r,n,s,this._gl.UNSIGNED_BYTE,a),a},e.isSupported=function(){if(null===this._isSupported)try{var e=_.CanvasGenerator.CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._isSupported=null!=t&&!!window.WebGLRenderingContext}catch(e){this._isSupported=!1}return this._isSupported},e.CeilingPOT=function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},e.FloorPOT=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)-(e>>1)},e.NearestPOT=function(t){var r=e.CeilingPOT(t),n=e.FloorPOT(t);return r-t>t-n?n:r},e.GetExponentOfTwo=function(t,r,n){var i;switch(void 0===n&&(n=u.Constants.SCALEMODE_NEAREST),n){case u.Constants.SCALEMODE_FLOOR:i=e.FloorPOT(t);break;case u.Constants.SCALEMODE_NEAREST:i=e.NearestPOT(t);break;case u.Constants.SCALEMODE_CEILING:default:i=e.CeilingPOT(t)}return Math.min(i,r)},e.QueueNewFrame=function(e,t){return f.DomManagement.IsWindowObjectExist()?(t||(t=window),t.requestPostAnimationFrame?t.requestPostAnimationFrame(e):t.requestAnimationFrame?t.requestAnimationFrame(e):t.msRequestAnimationFrame?t.msRequestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.mozRequestAnimationFrame?t.mozRequestAnimationFrame(e):t.oRequestAnimationFrame?t.oRequestAnimationFrame(e):window.setTimeout(e,16)):"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e,16)},e.prototype.getHostDocument=function(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:document},e.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]}],e._TextureLoaders=[],e.CollisionsEpsilon=.001,e._isSupported=null,e}()},"./Events/clipboardEvents.ts":
- /*!***********************************!*\
- !*** ./Events/clipboardEvents.ts ***!
- \***********************************/
- /*! exports provided: ClipboardEventTypes, ClipboardInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"ClipboardEventTypes",(function(){return n})),r.d(t,"ClipboardInfo",(function(){return i}));var n=function(){function e(){}return e.COPY=1,e.CUT=2,e.PASTE=3,e}(),i=function(){function e(e,t){this.type=e,this.event=t}return e.GetTypeFromCharacter=function(e){switch(e){case 67:return n.COPY;case 86:return n.PASTE;case 88:return n.CUT;default:return-1}},e}()},"./Events/index.ts":
- /*!*************************!*\
- !*** ./Events/index.ts ***!
- \*************************/
- /*! exports provided: KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./keyboardEvents */"./Events/keyboardEvents.ts");r.d(t,"KeyboardEventTypes",(function(){return n.KeyboardEventTypes})),r.d(t,"KeyboardInfo",(function(){return n.KeyboardInfo})),r.d(t,"KeyboardInfoPre",(function(){return n.KeyboardInfoPre}));var i=r(/*! ./pointerEvents */"./Events/pointerEvents.ts");r.d(t,"PointerEventTypes",(function(){return i.PointerEventTypes})),r.d(t,"PointerInfoBase",(function(){return i.PointerInfoBase})),r.d(t,"PointerInfoPre",(function(){return i.PointerInfoPre})),r.d(t,"PointerInfo",(function(){return i.PointerInfo}));var o=r(/*! ./clipboardEvents */"./Events/clipboardEvents.ts");r.d(t,"ClipboardEventTypes",(function(){return o.ClipboardEventTypes})),r.d(t,"ClipboardInfo",(function(){return o.ClipboardInfo}))},"./Events/keyboardEvents.ts":
- /*!**********************************!*\
- !*** ./Events/keyboardEvents.ts ***!
- \**********************************/
- /*! exports provided: KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre */function(e,t,r){"use strict";r.r(t),r.d(t,"KeyboardEventTypes",(function(){return i})),r.d(t,"KeyboardInfo",(function(){return o})),r.d(t,"KeyboardInfoPre",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(){function e(){}return e.KEYDOWN=1,e.KEYUP=2,e}(),o=function(e,t){this.type=e,this.event=t},s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type=t,n.event=r,n.skipOnPointerObservable=!1,n}return Object(n.__extends)(t,e),t}(o)},"./Events/pointerEvents.ts":
- /*!*********************************!*\
- !*** ./Events/pointerEvents.ts ***!
- \*********************************/
- /*! exports provided: PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"PointerEventTypes",(function(){return o})),r.d(t,"PointerInfoBase",(function(){return s})),r.d(t,"PointerInfoPre",(function(){return a})),r.d(t,"PointerInfo",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=function(){function e(){}return e.POINTERDOWN=1,e.POINTERUP=2,e.POINTERMOVE=4,e.POINTERWHEEL=8,e.POINTERPICK=16,e.POINTERTAP=32,e.POINTERDOUBLETAP=64,e}(),s=function(e,t){this.type=e,this.event=t},a=function(e){function t(t,r,n,o){var s=e.call(this,t,r)||this;return s.ray=null,s.skipOnPointerObservable=!1,s.localPosition=new i.Vector2(n,o),s}return Object(n.__extends)(t,e),t}(s),l=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.pickInfo=n,i}return Object(n.__extends)(t,e),t}(s)},"./Gamepads/Controllers/daydreamController.ts":
- /*!****************************************************!*\
- !*** ./Gamepads/Controllers/daydreamController.ts ***!
- \****************************************************/
- /*! exports provided: DaydreamController */function(e,t,r){"use strict";r.r(t),r.d(t,"DaydreamController",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),s=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),a=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),l=function(e){function t(t){var r=e.call(this,t)||this;return r.controllerType=a.PoseEnabledControllerType.DAYDREAM,r}return Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;o.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,(function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)}))},t.prototype._handleButtonChange=function(e,t,r){if(0===e){var n=this.onTriggerStateChangedObservable;n&&n.notifyObservers(t)}else i.Logger.Warn("Unrecognized Daydream button index: "+e)},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t.GAMEPAD_ID_PREFIX="Daydream",t}(s.WebVRController);a.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(l.GAMEPAD_ID_PREFIX)},create:function(e){return new l(e)}})},"./Gamepads/Controllers/gearVRController.ts":
- /*!**************************************************!*\
- !*** ./Gamepads/Controllers/gearVRController.ts ***!
- \**************************************************/
- /*! exports provided: GearVRController */function(e,t,r){"use strict";r.r(t),r.d(t,"GearVRController",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),a=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),l=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),c=function(e){function t(t){var r=e.call(this,t)||this;return r._buttonIndexToObservableNameMap=["onPadStateChangedObservable","onTriggerStateChangedObservable"],r.controllerType=l.PoseEnabledControllerType.GEAR_VR,r._calculatedPosition=new i.Vector3("left"==r.hand?-.15:.15,-.5,.25),r._disableTrackPosition(r._calculatedPosition),r}return Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;s.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,(function(t){var i=new o.Mesh("",e);t[1].parent=i,t[1].position.z=-.15,n._defaultModel=i,n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)}))},t.prototype._handleButtonChange=function(e,t,r){if(e<this._buttonIndexToObservableNameMap.length){var n=this[this._buttonIndexToObservableNameMap[e]];n&&n.notifyObservers(t)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t.GAMEPAD_ID_PREFIX="Gear VR",t}(a.WebVRController);l.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(c.GAMEPAD_ID_PREFIX)||-1!==e.id.indexOf("Oculus Go")||-1!==e.id.indexOf("Vive Focus")},create:function(e){return new c(e)}})},"./Gamepads/Controllers/genericController.ts":
- /*!***************************************************!*\
- !*** ./Gamepads/Controllers/genericController.ts ***!
- \***************************************************/
- /*! exports provided: GenericController */function(e,t,r){"use strict";r.r(t),r.d(t,"GenericController",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),o=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),s=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),a=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;i.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,(function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)}))},t.prototype._handleButtonChange=function(e,t,r){console.log("Button id: "+e+"state: "),console.dir(t)},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t}(o.WebVRController);s.PoseEnabledControllerHelper._DefaultControllerFactory=function(e){return new a(e)}},"./Gamepads/Controllers/index.ts":
- /*!***************************************!*\
- !*** ./Gamepads/Controllers/index.ts ***!
- \***************************************/
- /*! exports provided: DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, XRWindowsMotionController */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./daydreamController */"./Gamepads/Controllers/daydreamController.ts");r.d(t,"DaydreamController",(function(){return n.DaydreamController}));var i=r(/*! ./gearVRController */"./Gamepads/Controllers/gearVRController.ts");r.d(t,"GearVRController",(function(){return i.GearVRController}));var o=r(/*! ./genericController */"./Gamepads/Controllers/genericController.ts");r.d(t,"GenericController",(function(){return o.GenericController}));var s=r(/*! ./oculusTouchController */"./Gamepads/Controllers/oculusTouchController.ts");r.d(t,"OculusTouchController",(function(){return s.OculusTouchController}));var a=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts");r.d(t,"PoseEnabledControllerType",(function(){return a.PoseEnabledControllerType})),r.d(t,"PoseEnabledControllerHelper",(function(){return a.PoseEnabledControllerHelper})),r.d(t,"PoseEnabledController",(function(){return a.PoseEnabledController}));var l=r(/*! ./viveController */"./Gamepads/Controllers/viveController.ts");r.d(t,"ViveController",(function(){return l.ViveController}));var c=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts");r.d(t,"WebVRController",(function(){return c.WebVRController}));var u=r(/*! ./windowsMotionController */"./Gamepads/Controllers/windowsMotionController.ts");r.d(t,"WindowsMotionController",(function(){return u.WindowsMotionController})),r.d(t,"XRWindowsMotionController",(function(){return u.XRWindowsMotionController}))},"./Gamepads/Controllers/oculusTouchController.ts":
- /*!*******************************************************!*\
- !*** ./Gamepads/Controllers/oculusTouchController.ts ***!
- \*******************************************************/
- /*! exports provided: OculusTouchController */function(e,t,r){"use strict";r.r(t),r.d(t,"OculusTouchController",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),s=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),a=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),l=r(/*! ../../Engines/engine */"./Engines/engine.ts"),c=function(e){function t(t){var r=e.call(this,t)||this;return r.onSecondaryTriggerStateChangedObservable=new i.Observable,r.onThumbRestChangedObservable=new i.Observable,r.controllerType=a.PoseEnabledControllerType.OCULUS,r}return Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n,i=this;n="left"===this.hand?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,o.SceneLoader.ImportMesh("",t._IsQuest?t.QUEST_MODEL_BASE_URL:t.MODEL_BASE_URL,n,e,(function(e){i._defaultModel=t._IsQuest?e[0]:e[1],i.attachToMesh(i._defaultModel),r&&r(i._defaultModel)}))},Object.defineProperty(t.prototype,"onAButtonStateChangedObservable",{get:function(){if("right"===this.hand)return this.onMainButtonStateChangedObservable;throw new Error("No A button on left hand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBButtonStateChangedObservable",{get:function(){if("right"===this.hand)return this.onSecondaryButtonStateChangedObservable;throw new Error("No B button on left hand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onXButtonStateChangedObservable",{get:function(){if("left"===this.hand)return this.onMainButtonStateChangedObservable;throw new Error("No X button on right hand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onYButtonStateChangedObservable",{get:function(){if("left"===this.hand)return this.onSecondaryButtonStateChangedObservable;throw new Error("No Y button on right hand")},enumerable:!1,configurable:!0}),t.prototype._handleButtonChange=function(e,r,n){var i=r,o="right"===this.hand?-1:1;switch(e){case 0:return void this.onPadStateChangedObservable.notifyObservers(i);case 1:return!t._IsQuest&&this._defaultModel&&(this._defaultModel.getChildren()[3].rotation.x=.2*-i.value,this._defaultModel.getChildren()[3].position.y=.005*-i.value,this._defaultModel.getChildren()[3].position.z=.005*-i.value),void this.onTriggerStateChangedObservable.notifyObservers(i);case 2:return!t._IsQuest&&this._defaultModel&&(this._defaultModel.getChildren()[4].position.x=o*i.value*.0035),void this.onSecondaryTriggerStateChangedObservable.notifyObservers(i);case 3:return!t._IsQuest&&this._defaultModel&&(i.pressed?this._defaultModel.getChildren()[1].position.y=-.001:this._defaultModel.getChildren()[1].position.y=0),void this.onMainButtonStateChangedObservable.notifyObservers(i);case 4:return!t._IsQuest&&this._defaultModel&&(i.pressed?this._defaultModel.getChildren()[2].position.y=-.001:this._defaultModel.getChildren()[2].position.y=0),void this.onSecondaryButtonStateChangedObservable.notifyObservers(i);case 5:return void this.onThumbRestChangedObservable.notifyObservers(i)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",t._IsQuest=!1,t}(s.WebVRController);a.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return l.Engine.LastCreatedEngine&&l.Engine.LastCreatedEngine._vrDisplay&&"Oculus Quest"===l.Engine.LastCreatedEngine._vrDisplay.displayName&&(c._IsQuest=!0),-1!==e.id.indexOf("Oculus Touch")},create:function(e){return new c(e)}})},"./Gamepads/Controllers/poseEnabledController.ts":
- /*!*******************************************************!*\
- !*** ./Gamepads/Controllers/poseEnabledController.ts ***!
- \*******************************************************/
- /*! exports provided: PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController */function(e,t,r){"use strict";r.r(t),r.d(t,"PoseEnabledControllerType",(function(){return n})),r.d(t,"PoseEnabledControllerHelper",(function(){return u})),r.d(t,"PoseEnabledController",(function(){return d}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Culling/ray */"./Culling/ray.ts"),l=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),c=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts");!function(e){e[e.VIVE=0]="VIVE",e[e.OCULUS=1]="OCULUS",e[e.WINDOWS=2]="WINDOWS",e[e.GEAR_VR=3]="GEAR_VR",e[e.DAYDREAM=4]="DAYDREAM",e[e.GENERIC=5]="GENERIC"}(n||(n={}));var u=function(){function e(){}return e.InitiateController=function(e){for(var t=0,r=this._ControllerFactories;t<r.length;t++){var n=r[t];if(n.canCreate(e))return n.create(e)}if(this._DefaultControllerFactory)return this._DefaultControllerFactory(e);throw"The type of gamepad you are trying to load needs to be imported first or is not supported."},e._ControllerFactories=[],e._DefaultControllerFactory=null,e}(),d=function(e){function t(t){var r=e.call(this,t.id,t.index,t)||this;return r.isXR=!1,r._deviceRoomPosition=s.Vector3.Zero(),r._deviceRoomRotationQuaternion=new s.Quaternion,r.devicePosition=s.Vector3.Zero(),r.deviceRotationQuaternion=new s.Quaternion,r.deviceScaleFactor=1,r._trackPosition=!0,r._maxRotationDistFromHeadset=Math.PI/5,r._draggedRoomRotation=0,r._leftHandSystemQuaternion=new s.Quaternion,r._deviceToWorld=s.Matrix.Identity(),r._pointingPoseNode=null,r._workingMatrix=s.Matrix.Identity(),r._meshAttachedObservable=new o.Observable,r.type=c.Gamepad.POSE_ENABLED,r.controllerType=n.GENERIC,r.position=s.Vector3.Zero(),r.rotationQuaternion=new s.Quaternion,r._calculatedPosition=s.Vector3.Zero(),r._calculatedRotation=new s.Quaternion,s.Quaternion.RotationYawPitchRollToRef(Math.PI,0,0,r._leftHandSystemQuaternion),r}return Object(i.__extends)(t,e),t.prototype._disableTrackPosition=function(e){this._trackPosition&&(this._calculatedPosition.copyFrom(e),this._trackPosition=!1)},t.prototype.update=function(){e.prototype.update.call(this),this._updatePoseAndMesh()},t.prototype._updatePoseAndMesh=function(){if(!this.isXR){var e=this.browserGamepad.pose;if(this.updateFromDevice(e),!this._trackPosition&&l.EngineStore.LastCreatedScene&&l.EngineStore.LastCreatedScene.activeCamera&&l.EngineStore.LastCreatedScene.activeCamera.devicePosition&&((t=l.EngineStore.LastCreatedScene.activeCamera)._computeDevicePosition(),this._deviceToWorld.setTranslation(t.devicePosition),t.deviceRotationQuaternion)){var t;(t=t)._deviceRoomRotationQuaternion.toEulerAnglesToRef(s.TmpVectors.Vector3[0]);var r=Math.atan2(Math.sin(s.TmpVectors.Vector3[0].y-this._draggedRoomRotation),Math.cos(s.TmpVectors.Vector3[0].y-this._draggedRoomRotation));if(Math.abs(r)>this._maxRotationDistFromHeadset){var n=r-(r<0?-this._maxRotationDistFromHeadset:this._maxRotationDistFromHeadset);this._draggedRoomRotation+=n;var i=Math.sin(-n),o=Math.cos(-n);this._calculatedPosition.x=this._calculatedPosition.x*o-this._calculatedPosition.z*i,this._calculatedPosition.z=this._calculatedPosition.x*i+this._calculatedPosition.z*o}}s.Vector3.TransformCoordinatesToRef(this._calculatedPosition,this._deviceToWorld,this.devicePosition),this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix),s.Quaternion.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation),this._mesh&&(this._mesh.position.copyFrom(this.devicePosition),this._mesh.rotationQuaternion&&this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion))}},t.prototype.updateFromDevice=function(e){if(!this.isXR&&e){this.rawPose=e,e.position&&(this._deviceRoomPosition.copyFromFloats(e.position[0],e.position[1],-e.position[2]),this._mesh&&this._mesh.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1),this._trackPosition&&this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor,this._calculatedPosition),this._calculatedPosition.addInPlace(this.position));var t=this.rawPose;e.orientation&&t.orientation&&4===t.orientation.length&&(this._deviceRoomRotationQuaternion.copyFromFloats(t.orientation[0],t.orientation[1],-t.orientation[2],-t.orientation[3]),this._mesh&&(this._mesh.getScene().useRightHandedSystem?(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1):this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion,this._deviceRoomRotationQuaternion)),this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion,this._calculatedRotation))}},t.prototype.attachToMesh=function(e){if(this._mesh&&(this._mesh.parent=null),this._mesh=e,this._poseControlledCamera&&(this._mesh.parent=this._poseControlledCamera),this._mesh.rotationQuaternion||(this._mesh.rotationQuaternion=new s.Quaternion),!this.isXR&&(this._updatePoseAndMesh(),this._pointingPoseNode)){for(var t=[],r=this._pointingPoseNode;r.parent;)t.push(r.parent),r=r.parent;t.reverse().forEach((function(e){e.computeWorldMatrix(!0)}))}this._meshAttachedObservable.notifyObservers(e)},t.prototype.attachToPoseControlledCamera=function(e){this._poseControlledCamera=e,this._mesh&&(this._mesh.parent=this._poseControlledCamera)},t.prototype.dispose=function(){this._mesh&&this._mesh.dispose(),this._mesh=null,e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},enumerable:!1,configurable:!0}),t.prototype.getForwardRay=function(e){if(void 0===e&&(e=100),!this.mesh)return new a.Ray(s.Vector3.Zero(),new s.Vector3(0,0,1),e);var t=this._pointingPoseNode?this._pointingPoseNode.getWorldMatrix():this.mesh.getWorldMatrix(),r=t.getTranslation(),n=new s.Vector3(0,0,-1),i=s.Vector3.TransformNormal(n,t),o=s.Vector3.Normalize(i);return new a.Ray(r,o,e)},t.POINTING_POSE="POINTING_POSE",t}(c.Gamepad)},"./Gamepads/Controllers/viveController.ts":
- /*!************************************************!*\
- !*** ./Gamepads/Controllers/viveController.ts ***!
- \************************************************/
- /*! exports provided: ViveController */function(e,t,r){"use strict";r.r(t),r.d(t,"ViveController",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),o=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),s=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),a=function(e){function t(t){var r=e.call(this,t)||this;return r.controllerType=s.PoseEnabledControllerType.VIVE,r._invertLeftStickY=!0,r}return Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;i.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,(function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)}))},Object.defineProperty(t.prototype,"onLeftButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRightButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMenuButtonStateChangedObservable",{get:function(){return this.onSecondaryButtonStateChangedObservable},enumerable:!1,configurable:!0}),t.prototype._handleButtonChange=function(e,t,r){var n=t;switch(e){case 0:return void this.onPadStateChangedObservable.notifyObservers(n);case 1:return this._defaultModel&&(this._defaultModel.getChildren()[6].rotation.x=.15*-n.value),void this.onTriggerStateChangedObservable.notifyObservers(n);case 2:return void this.onMainButtonStateChangedObservable.notifyObservers(n);case 3:return this._defaultModel&&(n.pressed?this._defaultModel.getChildren()[2].position.y=-.001:this._defaultModel.getChildren()[2].position.y=0),void this.onSecondaryButtonStateChangedObservable.notifyObservers(n)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",t.MODEL_FILENAME="wand.babylon",t}(o.WebVRController);s.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return-1!==e.id.toLowerCase().indexOf("openvr")},create:function(e){return new a(e)}})},"./Gamepads/Controllers/webVRController.ts":
- /*!*************************************************!*\
- !*** ./Gamepads/Controllers/webVRController.ts ***!
- \*************************************************/
- /*! exports provided: WebVRController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebVRController",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=function(e){function t(t){var r=e.call(this,t)||this;return r.onTriggerStateChangedObservable=new i.Observable,r.onMainButtonStateChangedObservable=new i.Observable,r.onSecondaryButtonStateChangedObservable=new i.Observable,r.onPadStateChangedObservable=new i.Observable,r.onPadValuesChangedObservable=new i.Observable,r.pad={x:0,y:0},r._changes={pressChanged:!1,touchChanged:!1,valueChanged:!1,changed:!1},r._buttons=new Array(t.buttons.length),r.hand=t.hand,r}return Object(n.__extends)(t,e),t.prototype.onButtonStateChange=function(e){this._onButtonStateChange=e},Object.defineProperty(t.prototype,"defaultModel",{get:function(){return this._defaultModel},enumerable:!1,configurable:!0}),t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;t<this._buttons.length;t++)this._setButtonValue(this.browserGamepad.buttons[t],this._buttons[t],t);this.leftStick.x===this.pad.x&&this.leftStick.y===this.pad.y||(this.pad.x=this.leftStick.x,this.pad.y=this.leftStick.y,this.onPadValuesChangedObservable.notifyObservers(this.pad))},t.prototype._setButtonValue=function(e,t,r){e||(e={pressed:!1,touched:!1,value:0}),t?(this._checkChanges(e,t),this._changes.changed&&(this._onButtonStateChange&&this._onButtonStateChange(this.index,r,e),this._handleButtonChange(r,e,this._changes)),this._buttons[r].pressed=e.pressed,this._buttons[r].touched=e.touched,this._buttons[r].value=e.value<1e-8?0:e.value):this._buttons[r]={pressed:e.pressed,touched:e.touched,value:e.value}},t.prototype._checkChanges=function(e,t){return this._changes.pressChanged=e.pressed!==t.pressed,this._changes.touchChanged=e.touched!==t.touched,this._changes.valueChanged=e.value!==t.value,this._changes.changed=this._changes.pressChanged||this._changes.touchChanged||this._changes.valueChanged,this._changes},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._defaultModel=null,this.onTriggerStateChangedObservable.clear(),this.onMainButtonStateChangedObservable.clear(),this.onSecondaryButtonStateChangedObservable.clear(),this.onPadStateChangedObservable.clear(),this.onPadValuesChangedObservable.clear()},t}(r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts").PoseEnabledController)},"./Gamepads/Controllers/windowsMotionController.ts":
- /*!*********************************************************!*\
- !*** ./Gamepads/Controllers/windowsMotionController.ts ***!
- \*********************************************************/
- /*! exports provided: WindowsMotionController, XRWindowsMotionController */function(e,t,r){"use strict";r.r(t),r.d(t,"WindowsMotionController",(function(){return p})),r.d(t,"XRWindowsMotionController",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../../Culling/ray */"./Culling/ray.ts"),c=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),u=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),d=r(/*! ./genericController */"./Gamepads/Controllers/genericController.ts"),h=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),f=function(){this.buttonMeshes={},this.axisMeshes={}},p=function(e){function t(t){var r=e.call(this,t)||this;return r._mapping={buttons:["thumbstick","trigger","grip","menu","trackpad"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",grip:"GRASP",thumbstick:"THUMBSTICK_PRESS",trackpad:"TOUCHPAD_PRESS"},buttonObservableNames:{trigger:"onTriggerStateChangedObservable",menu:"onSecondaryButtonStateChangedObservable",grip:"onMainButtonStateChangedObservable",thumbstick:"onPadStateChangedObservable",trackpad:"onTrackpadChangedObservable"},axisMeshNames:["THUMBSTICK_X","THUMBSTICK_Y","TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_Y"],pointingPoseMeshName:h.PoseEnabledController.POINTING_POSE},r.onTrackpadChangedObservable=new o.Observable,r.onTrackpadValuesChangedObservable=new o.Observable,r.trackpad={x:0,y:0},r.controllerType=h.PoseEnabledControllerType.WINDOWS,r._loadedMeshInfo=null,r}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"onTriggerButtonStateChangedObservable",{get:function(){return this.onTriggerStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMenuButtonStateChangedObservable",{get:function(){return this.onSecondaryButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGripButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onThumbstickButtonStateChangedObservable",{get:function(){return this.onPadStateChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTouchpadButtonStateChangedObservable",{get:function(){return this.onTrackpadChangedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTouchpadValuesChangedObservable",{get:function(){return this.onTrackpadValuesChangedObservable},enumerable:!1,configurable:!0}),t.prototype._updateTrackpad=function(){!this.browserGamepad.axes||this.browserGamepad.axes[2]==this.trackpad.x&&this.browserGamepad.axes[3]==this.trackpad.y||(this.trackpad.x=this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf("TOUCHPAD_TOUCH_X")],this.trackpad.y=this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf("TOUCHPAD_TOUCH_Y")],this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad))},t.prototype.update=function(){if(e.prototype.update.call(this),this.browserGamepad.axes&&(this._updateTrackpad(),this._loadedMeshInfo))for(var t=0;t<this._mapping.axisMeshNames.length;t++)this._lerpAxisTransform(t,this.browserGamepad.axes[t])},t.prototype._handleButtonChange=function(e,t,r){var n=this._mapping.buttons[e];if(n){this._updateTrackpad();var i=this[this._mapping.buttonObservableNames[n]];i&&i.notifyObservers(t),this._lerpButtonTransform(n,t.value)}},t.prototype._lerpButtonTransform=function(e,t){if(this._loadedMeshInfo){var r=this._loadedMeshInfo.buttonMeshes[e];r&&r.unpressed.rotationQuaternion&&r.pressed.rotationQuaternion&&r.value.rotationQuaternion&&(s.Quaternion.SlerpToRef(r.unpressed.rotationQuaternion,r.pressed.rotationQuaternion,t,r.value.rotationQuaternion),s.Vector3.LerpToRef(r.unpressed.position,r.pressed.position,t,r.value.position))}},t.prototype._lerpAxisTransform=function(e,t){if(this._loadedMeshInfo){var r=this._loadedMeshInfo.axisMeshes[e];if(r&&r.min.rotationQuaternion&&r.max.rotationQuaternion&&r.value.rotationQuaternion){var n=.5*t+.5;s.Quaternion.SlerpToRef(r.min.rotationQuaternion,r.max.rotationQuaternion,n,r.value.rotationQuaternion),s.Vector3.LerpToRef(r.min.position,r.max.position,n,r.value.position)}}},t.prototype.initControllerMesh=function(e,r,n){var o,s,a=this;if(void 0===n&&(n=!1),c.SceneLoader.IsPluginForExtensionAvailable(".glb")){var l="default";if(this.id&&!n){var u=this.id.match(t.GAMEPAD_ID_PATTERN);l=u&&u[0]||l}s="left"===this.hand?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,o=t.MODEL_BASE_URL+l+"/"}else i.Logger.Warn("You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models"),o=d.GenericController.MODEL_BASE_URL,s=d.GenericController.MODEL_FILENAME;c.SceneLoader.ImportMesh("",o,s,e,(function(t){a._loadedMeshInfo=a.processModel(e,t),a._loadedMeshInfo&&(a._defaultModel=a._loadedMeshInfo.rootNode,a.attachToMesh(a._defaultModel),r&&r(a._defaultModel))}),null,(function(e,t){i.Logger.Log(t),i.Logger.Warn("Failed to retrieve controller model from the remote server: "+o+s),n||a.initControllerMesh(e,r,!0)}))},t.prototype.processModel=function(e,t){for(var r=null,n=new a.Mesh(this.id+" "+this.hand,e),o=null,s=0;s<t.length;s++){var l=t[s];if(!l.parent){l.isPickable=!1,o=l;break}}return o?(o.setParent(n),r=this.createMeshInfo(n)):i.Logger.Warn("Could not find root node in model file."),r},t.prototype.createMeshInfo=function(e){var t,r=new f;for(r.rootNode=e,r.buttonMeshes={},r.axisMeshes={},t=0;t<this._mapping.buttons.length;t++){var n=this._mapping.buttonMeshNames[this._mapping.buttons[t]];if(n){var o=u(e,n);if(o){var s={index:t,value:d(o,"VALUE"),pressed:d(o,"PRESSED"),unpressed:d(o,"UNPRESSED")};s.value&&s.pressed&&s.unpressed?r.buttonMeshes[this._mapping.buttons[t]]=s:i.Logger.Warn("Missing button submesh under mesh with name: "+n+"(VALUE: "+!!s.value+", PRESSED: "+!!s.pressed+", UNPRESSED:"+!!s.unpressed+")")}else i.Logger.Warn("Missing button mesh with name: "+n)}else i.Logger.Log("Skipping unknown button at index: "+t+" with mapped name: "+this._mapping.buttons[t])}for(t=0;t<this._mapping.axisMeshNames.length;t++){var a=this._mapping.axisMeshNames[t];if(a){var l=u(e,a);if(l){var c={index:t,value:d(l,"VALUE"),min:d(l,"MIN"),max:d(l,"MAX")};c.value&&c.min&&c.max?r.axisMeshes[t]=c:i.Logger.Warn("Missing axis submesh under mesh with name: "+a+"(VALUE: "+!!c.value+", MIN: "+!!c.min+", MAX:"+!!c.max+")")}else i.Logger.Warn("Missing axis mesh with name: "+a)}else i.Logger.Log("Skipping unknown axis at index: "+t)}return r.pointingPoseNode=u(e,this._mapping.pointingPoseMeshName),r.pointingPoseNode?this._pointingPoseNode=r.pointingPoseNode:i.Logger.Warn("Missing pointing pose mesh with name: "+this._mapping.pointingPoseMeshName),r;function u(e,t){return e.getChildren((function(e){return e.name===t}),!1)[0]}function d(e,t){return e.getChildren((function(e){return e.name==t}),!0)[0]}},t.prototype.getForwardRay=function(t){if(void 0===t&&(t=100),!this._loadedMeshInfo||!this._loadedMeshInfo.pointingPoseNode)return e.prototype.getForwardRay.call(this,t);var r=this._loadedMeshInfo.pointingPoseNode.getWorldMatrix(),n=r.getTranslation(),i=new s.Vector3(0,0,-1),o=s.Vector3.TransformNormal(i,r),a=s.Vector3.Normalize(o);return new l.Ray(n,a,t)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onTrackpadChangedObservable.clear(),this.onTrackpadValuesChangedObservable.clear()},t.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",t.MODEL_LEFT_FILENAME="left.glb",t.MODEL_RIGHT_FILENAME="right.glb",t.GAMEPAD_ID_PREFIX="Spatial Controller (Spatial Interaction Source) ",t.GAMEPAD_ID_PATTERN=/([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/,t}(u.WebVRController),m=function(e){function t(t){var r=e.call(this,t)||this;return r._mapping={buttons:["trigger","grip","trackpad","thumbstick","menu"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",grip:"GRASP",thumbstick:"THUMBSTICK_PRESS",trackpad:"TOUCHPAD_PRESS"},buttonObservableNames:{trigger:"onTriggerStateChangedObservable",menu:"onSecondaryButtonStateChangedObservable",grip:"onMainButtonStateChangedObservable",thumbstick:"onThumbstickStateChangedObservable",trackpad:"onTrackpadChangedObservable"},axisMeshNames:["TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_Y","THUMBSTICK_X","THUMBSTICK_Y"],pointingPoseMeshName:h.PoseEnabledController.POINTING_POSE},r.thumbstickValues={x:0,y:0},r.onThumbstickStateChangedObservable=new o.Observable,r.onThumbstickValuesChangedObservable=new o.Observable,r.onTrackpadChangedObservable=r.onPadStateChangedObservable,r.onTrackpadValuesChangedObservable=r.onPadValuesChangedObservable,r}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"onThumbstickButtonStateChangedObservable",{get:function(){return this.onThumbstickStateChangedObservable},enumerable:!1,configurable:!0}),t.prototype._updateTrackpad=function(){!this.browserGamepad.axes||this.browserGamepad.axes[2]==this.thumbstickValues.x&&this.browserGamepad.axes[3]==this.thumbstickValues.y||(this.trackpad.x=this.browserGamepad.axes[2],this.trackpad.y=this.browserGamepad.axes[3],this.onThumbstickValuesChangedObservable.notifyObservers(this.trackpad))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onThumbstickStateChangedObservable.clear(),this.onThumbstickValuesChangedObservable.clear()},t}(p);h.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(p.GAMEPAD_ID_PREFIX)},create:function(e){return new p(e)}})},"./Gamepads/dualShockGamepad.ts":
- /*!**************************************!*\
- !*** ./Gamepads/dualShockGamepad.ts ***!
- \**************************************/
- /*! exports provided: DualShockButton, DualShockDpad, DualShockPad */function(e,t,r){"use strict";r.r(t),r.d(t,"DualShockButton",(function(){return n})),r.d(t,"DualShockDpad",(function(){return i})),r.d(t,"DualShockPad",(function(){return l}));var n,i,o=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ./gamepad */"./Gamepads/gamepad.ts");!function(e){e[e.Cross=0]="Cross",e[e.Circle=1]="Circle",e[e.Square=2]="Square",e[e.Triangle=3]="Triangle",e[e.L1=4]="L1",e[e.R1=5]="R1",e[e.Share=8]="Share",e[e.Options=9]="Options",e[e.LeftStick=10]="LeftStick",e[e.RightStick=11]="RightStick"}(n||(n={})),function(e){e[e.Up=12]="Up",e[e.Down=13]="Down",e[e.Left=14]="Left",e[e.Right=15]="Right"}(i||(i={}));var l=function(e){function t(t,r,n){var i=e.call(this,t.replace("STANDARD GAMEPAD","SONY PLAYSTATION DUALSHOCK"),r,n,0,1,2,3)||this;return i._leftTrigger=0,i._rightTrigger=0,i.onButtonDownObservable=new s.Observable,i.onButtonUpObservable=new s.Observable,i.onPadDownObservable=new s.Observable,i.onPadUpObservable=new s.Observable,i._buttonCross=0,i._buttonCircle=0,i._buttonSquare=0,i._buttonTriangle=0,i._buttonShare=0,i._buttonOptions=0,i._buttonL1=0,i._buttonR1=0,i._buttonLeftStick=0,i._buttonRightStick=0,i._dPadUp=0,i._dPadDown=0,i._dPadLeft=0,i._dPadRight=0,i.type=a.Gamepad.DUALSHOCK,i}return Object(o.__extends)(t,e),t.prototype.onlefttriggerchanged=function(e){this._onlefttriggerchanged=e},t.prototype.onrighttriggerchanged=function(e){this._onrighttriggerchanged=e},Object.defineProperty(t.prototype,"leftTrigger",{get:function(){return this._leftTrigger},set:function(e){this._onlefttriggerchanged&&this._leftTrigger!==e&&this._onlefttriggerchanged(e),this._leftTrigger=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightTrigger",{get:function(){return this._rightTrigger},set:function(e){this._onrighttriggerchanged&&this._rightTrigger!==e&&this._onrighttriggerchanged(e),this._rightTrigger=e},enumerable:!1,configurable:!0}),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype.ondpaddown=function(e){this._ondpaddown=e},t.prototype.ondpadup=function(e){this._ondpadup=e},t.prototype._setButtonValue=function(e,t,r){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(r),this.onButtonDownObservable.notifyObservers(r)),0===e&&(this._onbuttonup&&this._onbuttonup(r),this.onButtonUpObservable.notifyObservers(r))),e},t.prototype._setDPadValue=function(e,t,r){return e!==t&&(1===e&&(this._ondpaddown&&this._ondpaddown(r),this.onPadDownObservable.notifyObservers(r)),0===e&&(this._ondpadup&&this._ondpadup(r),this.onPadUpObservable.notifyObservers(r))),e},Object.defineProperty(t.prototype,"buttonCross",{get:function(){return this._buttonCross},set:function(e){this._buttonCross=this._setButtonValue(e,this._buttonCross,n.Cross)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonCircle",{get:function(){return this._buttonCircle},set:function(e){this._buttonCircle=this._setButtonValue(e,this._buttonCircle,n.Circle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonSquare",{get:function(){return this._buttonSquare},set:function(e){this._buttonSquare=this._setButtonValue(e,this._buttonSquare,n.Square)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonTriangle",{get:function(){return this._buttonTriangle},set:function(e){this._buttonTriangle=this._setButtonValue(e,this._buttonTriangle,n.Triangle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonOptions",{get:function(){return this._buttonOptions},set:function(e){this._buttonOptions=this._setButtonValue(e,this._buttonOptions,n.Options)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonShare",{get:function(){return this._buttonShare},set:function(e){this._buttonShare=this._setButtonValue(e,this._buttonShare,n.Share)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonL1",{get:function(){return this._buttonL1},set:function(e){this._buttonL1=this._setButtonValue(e,this._buttonL1,n.L1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonR1",{get:function(){return this._buttonR1},set:function(e){this._buttonR1=this._setButtonValue(e,this._buttonR1,n.R1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonLeftStick",{get:function(){return this._buttonLeftStick},set:function(e){this._buttonLeftStick=this._setButtonValue(e,this._buttonLeftStick,n.LeftStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonRightStick",{get:function(){return this._buttonRightStick},set:function(e){this._buttonRightStick=this._setButtonValue(e,this._buttonRightStick,n.RightStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadUp",{get:function(){return this._dPadUp},set:function(e){this._dPadUp=this._setDPadValue(e,this._dPadUp,i.Up)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadDown",{get:function(){return this._dPadDown},set:function(e){this._dPadDown=this._setDPadValue(e,this._dPadDown,i.Down)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadLeft",{get:function(){return this._dPadLeft},set:function(e){this._dPadLeft=this._setDPadValue(e,this._dPadLeft,i.Left)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadRight",{get:function(){return this._dPadRight},set:function(e){this._dPadRight=this._setDPadValue(e,this._dPadRight,i.Right)},enumerable:!1,configurable:!0}),t.prototype.update=function(){e.prototype.update.call(this),this.buttonCross=this.browserGamepad.buttons[0].value,this.buttonCircle=this.browserGamepad.buttons[1].value,this.buttonSquare=this.browserGamepad.buttons[2].value,this.buttonTriangle=this.browserGamepad.buttons[3].value,this.buttonL1=this.browserGamepad.buttons[4].value,this.buttonR1=this.browserGamepad.buttons[5].value,this.leftTrigger=this.browserGamepad.buttons[6].value,this.rightTrigger=this.browserGamepad.buttons[7].value,this.buttonShare=this.browserGamepad.buttons[8].value,this.buttonOptions=this.browserGamepad.buttons[9].value,this.buttonLeftStick=this.browserGamepad.buttons[10].value,this.buttonRightStick=this.browserGamepad.buttons[11].value,this.dPadUp=this.browserGamepad.buttons[12].value,this.dPadDown=this.browserGamepad.buttons[13].value,this.dPadLeft=this.browserGamepad.buttons[14].value,this.dPadRight=this.browserGamepad.buttons[15].value},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear(),this.onPadDownObservable.clear(),this.onPadUpObservable.clear()},t}(a.Gamepad)},"./Gamepads/gamepad.ts":
- /*!*****************************!*\
- !*** ./Gamepads/gamepad.ts ***!
- \*****************************/
- /*! exports provided: StickValues, Gamepad, GenericPad */function(e,t,r){"use strict";r.r(t),r.d(t,"StickValues",(function(){return o})),r.d(t,"Gamepad",(function(){return s})),r.d(t,"GenericPad",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=function(e,t){this.x=e,this.y=t},s=function(){function e(t,r,n,i,o,s,a){void 0===i&&(i=0),void 0===o&&(o=1),void 0===s&&(s=2),void 0===a&&(a=3),this.id=t,this.index=r,this.browserGamepad=n,this._leftStick={x:0,y:0},this._rightStick={x:0,y:0},this._isConnected=!0,this._invertLeftStickY=!1,this.type=e.GAMEPAD,this._leftStickAxisX=i,this._leftStickAxisY=o,this._rightStickAxisX=s,this._rightStickAxisY=a,this.browserGamepad.axes.length>=2&&(this._leftStick={x:this.browserGamepad.axes[this._leftStickAxisX],y:this.browserGamepad.axes[this._leftStickAxisY]}),this.browserGamepad.axes.length>=4&&(this._rightStick={x:this.browserGamepad.axes[this._rightStickAxisX],y:this.browserGamepad.axes[this._rightStickAxisY]})}return Object.defineProperty(e.prototype,"isConnected",{get:function(){return this._isConnected},enumerable:!1,configurable:!0}),e.prototype.onleftstickchanged=function(e){this._onleftstickchanged=e},e.prototype.onrightstickchanged=function(e){this._onrightstickchanged=e},Object.defineProperty(e.prototype,"leftStick",{get:function(){return this._leftStick},set:function(e){!this._onleftstickchanged||this._leftStick.x===e.x&&this._leftStick.y===e.y||this._onleftstickchanged(e),this._leftStick=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightStick",{get:function(){return this._rightStick},set:function(e){!this._onrightstickchanged||this._rightStick.x===e.x&&this._rightStick.y===e.y||this._onrightstickchanged(e),this._rightStick=e},enumerable:!1,configurable:!0}),e.prototype.update=function(){this._leftStick&&(this.leftStick={x:this.browserGamepad.axes[this._leftStickAxisX],y:this.browserGamepad.axes[this._leftStickAxisY]},this._invertLeftStickY&&(this.leftStick.y*=-1)),this._rightStick&&(this.rightStick={x:this.browserGamepad.axes[this._rightStickAxisX],y:this.browserGamepad.axes[this._rightStickAxisY]})},e.prototype.dispose=function(){},e.GAMEPAD=0,e.GENERIC=1,e.XBOX=2,e.POSE_ENABLED=3,e.DUALSHOCK=4,e}(),a=function(e){function t(t,r,n){var o=e.call(this,t,r,n)||this;return o.onButtonDownObservable=new i.Observable,o.onButtonUpObservable=new i.Observable,o.type=s.GENERIC,o._buttons=new Array(n.buttons.length),o}return Object(n.__extends)(t,e),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype._setButtonValue=function(e,t,r){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(r),this.onButtonDownObservable.notifyObservers(r)),0===e&&(this._onbuttonup&&this._onbuttonup(r),this.onButtonUpObservable.notifyObservers(r))),e},t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;t<this._buttons.length;t++)this._buttons[t]=this._setButtonValue(this.browserGamepad.buttons[t].value,this._buttons[t],t)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear()},t}(s)},"./Gamepads/gamepadManager.ts":
- /*!************************************!*\
- !*** ./Gamepads/gamepadManager.ts ***!
- \************************************/
- /*! exports provided: GamepadManager */function(e,t,r){"use strict";r.r(t),r.d(t,"GamepadManager",(function(){return u}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),o=r(/*! ../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),s=r(/*! ./xboxGamepad */"./Gamepads/xboxGamepad.ts"),a=r(/*! ./gamepad */"./Gamepads/gamepad.ts"),l=r(/*! ../Engines/engine */"./Engines/engine.ts"),c=r(/*! ./dualShockGamepad */"./Gamepads/dualShockGamepad.ts"),u=function(){function e(e){var t=this;if(this._scene=e,this._babylonGamepads=[],this._oneGamepadConnected=!1,this._isMonitoring=!1,this.onGamepadDisconnectedObservable=new n.Observable,i.DomManagement.IsWindowObjectExist()?(this._gamepadEventSupported="GamepadEvent"in window,this._gamepadSupport=navigator.getGamepads||navigator.webkitGetGamepads||navigator.msGetGamepads||navigator.webkitGamepads):this._gamepadEventSupported=!1,this.onGamepadConnectedObservable=new n.Observable((function(e){for(var r in t._babylonGamepads){var n=t._babylonGamepads[r];n&&n._isConnected&&t.onGamepadConnectedObservable.notifyObserver(e,n)}})),this._onGamepadConnectedEvent=function(e){var r,n=e.gamepad;n.index in t._babylonGamepads&&t._babylonGamepads[n.index].isConnected||(t._babylonGamepads[n.index]?((r=t._babylonGamepads[n.index]).browserGamepad=n,r._isConnected=!0):r=t._addNewGamepad(n),t.onGamepadConnectedObservable.notifyObservers(r),t._startMonitoringGamepads())},this._onGamepadDisconnectedEvent=function(e){var r=e.gamepad;for(var n in t._babylonGamepads)if(t._babylonGamepads[n].index===r.index){var i=t._babylonGamepads[n];i._isConnected=!1,t.onGamepadDisconnectedObservable.notifyObservers(i),i.dispose&&i.dispose();break}},this._gamepadSupport)if(this._updateGamepadObjects(),this._babylonGamepads.length&&this._startMonitoringGamepads(),this._gamepadEventSupported){var r=this._scene?this._scene.getEngine().getHostWindow():window;r&&(r.addEventListener("gamepadconnected",this._onGamepadConnectedEvent,!1),r.addEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent,!1))}else this._startMonitoringGamepads()}return Object.defineProperty(e.prototype,"gamepads",{get:function(){return this._babylonGamepads},enumerable:!1,configurable:!0}),e.prototype.getGamepadByType=function(e){void 0===e&&(e=a.Gamepad.XBOX);for(var t=0,r=this._babylonGamepads;t<r.length;t++){var n=r[t];if(n&&n.type===e)return n}return null},e.prototype.dispose=function(){this._gamepadEventSupported&&(this._onGamepadConnectedEvent&&window.removeEventListener("gamepadconnected",this._onGamepadConnectedEvent),this._onGamepadDisconnectedEvent&&window.removeEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent),this._onGamepadConnectedEvent=null,this._onGamepadDisconnectedEvent=null),this._babylonGamepads.forEach((function(e){e.dispose()})),this.onGamepadConnectedObservable.clear(),this.onGamepadDisconnectedObservable.clear(),this._oneGamepadConnected=!1,this._stopMonitoringGamepads(),this._babylonGamepads=[]},e.prototype._addNewGamepad=function(e){var t;this._oneGamepadConnected||(this._oneGamepadConnected=!0);var r=-1!==e.id.search("054c"),n=-1!==e.id.search("Xbox One");return t=n||-1!==e.id.search("Xbox 360")||-1!==e.id.search("xinput")?new s.Xbox360Pad(e.id,e.index,e,n):r?new c.DualShockPad(e.id,e.index,e):e.pose?o.PoseEnabledControllerHelper.InitiateController(e):new a.GenericPad(e.id,e.index,e),this._babylonGamepads[t.index]=t,t},e.prototype._startMonitoringGamepads=function(){this._isMonitoring||(this._isMonitoring=!0,this._scene||this._checkGamepadsStatus())},e.prototype._stopMonitoringGamepads=function(){this._isMonitoring=!1},e.prototype._checkGamepadsStatus=function(){var e=this;for(var t in this._updateGamepadObjects(),this._babylonGamepads){var r=this._babylonGamepads[t];r&&r.isConnected&&r.update()}this._isMonitoring&&!this._scene&&l.Engine.QueueNewFrame((function(){e._checkGamepadsStatus()}))},e.prototype._updateGamepadObjects=function(){for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[],t=0;t<e.length;t++){var r=e[t];if(r)if(this._babylonGamepads[r.index])this._babylonGamepads[t].browserGamepad=r,this._babylonGamepads[t].isConnected||(this._babylonGamepads[t]._isConnected=!0,this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[t]));else{var n=this._addNewGamepad(r);this.onGamepadConnectedObservable.notifyObservers(n)}}},e}()},"./Gamepads/gamepadSceneComponent.ts":
- /*!*******************************************!*\
- !*** ./Gamepads/gamepadSceneComponent.ts ***!
- \*******************************************/
- /*! exports provided: GamepadSystemSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"GamepadSystemSceneComponent",(function(){return u}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../sceneComponent */"./sceneComponent.ts"),o=r(/*! ./gamepadManager */"./Gamepads/gamepadManager.ts"),s=r(/*! ../Cameras/freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts"),a=r(/*! ../Cameras/Inputs/freeCameraGamepadInput */"./Cameras/Inputs/freeCameraGamepadInput.ts"),l=r(/*! ../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts"),c=r(/*! ../Cameras/Inputs/arcRotateCameraGamepadInput */"./Cameras/Inputs/arcRotateCameraGamepadInput.ts");Object.defineProperty(n.Scene.prototype,"gamepadManager",{get:function(){if(!this._gamepadManager){this._gamepadManager=new o.GamepadManager(this);var e=this._getComponent(i.SceneComponentConstants.NAME_GAMEPAD);e||(e=new u(this),this._addComponent(e))}return this._gamepadManager},enumerable:!0,configurable:!0}),s.FreeCameraInputsManager.prototype.addGamepad=function(){return this.add(new a.FreeCameraGamepadInput),this},l.ArcRotateCameraInputsManager.prototype.addGamepad=function(){return this.add(new c.ArcRotateCameraGamepadInput),this};var u=function(){function e(e){this.name=i.SceneComponentConstants.NAME_GAMEPAD,this.scene=e}return e.prototype.register=function(){this.scene._beforeCameraUpdateStage.registerStep(i.SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD,this,this._beforeCameraUpdate)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){var e=this.scene._gamepadManager;e&&(e.dispose(),this.scene._gamepadManager=null)},e.prototype._beforeCameraUpdate=function(){var e=this.scene._gamepadManager;e&&e._isMonitoring&&e._checkGamepadsStatus()},e}()},"./Gamepads/index.ts":
- /*!***************************!*\
- !*** ./Gamepads/index.ts ***!
- \***************************/
- /*! exports provided: DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, XRWindowsMotionController, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, DualShockButton, DualShockDpad, DualShockPad */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Controllers/index */"./Gamepads/Controllers/index.ts");r.d(t,"DaydreamController",(function(){return n.DaydreamController})),r.d(t,"GearVRController",(function(){return n.GearVRController})),r.d(t,"GenericController",(function(){return n.GenericController})),r.d(t,"OculusTouchController",(function(){return n.OculusTouchController})),r.d(t,"PoseEnabledControllerType",(function(){return n.PoseEnabledControllerType})),r.d(t,"PoseEnabledControllerHelper",(function(){return n.PoseEnabledControllerHelper})),r.d(t,"PoseEnabledController",(function(){return n.PoseEnabledController})),r.d(t,"ViveController",(function(){return n.ViveController})),r.d(t,"WebVRController",(function(){return n.WebVRController})),r.d(t,"WindowsMotionController",(function(){return n.WindowsMotionController})),r.d(t,"XRWindowsMotionController",(function(){return n.XRWindowsMotionController}));var i=r(/*! ./gamepad */"./Gamepads/gamepad.ts");r.d(t,"StickValues",(function(){return i.StickValues})),r.d(t,"Gamepad",(function(){return i.Gamepad})),r.d(t,"GenericPad",(function(){return i.GenericPad}));var o=r(/*! ./gamepadManager */"./Gamepads/gamepadManager.ts");r.d(t,"GamepadManager",(function(){return o.GamepadManager}));var s=r(/*! ./gamepadSceneComponent */"./Gamepads/gamepadSceneComponent.ts");r.d(t,"GamepadSystemSceneComponent",(function(){return s.GamepadSystemSceneComponent}));var a=r(/*! ./xboxGamepad */"./Gamepads/xboxGamepad.ts");r.d(t,"Xbox360Button",(function(){return a.Xbox360Button})),r.d(t,"Xbox360Dpad",(function(){return a.Xbox360Dpad})),r.d(t,"Xbox360Pad",(function(){return a.Xbox360Pad}));var l=r(/*! ./dualShockGamepad */"./Gamepads/dualShockGamepad.ts");r.d(t,"DualShockButton",(function(){return l.DualShockButton})),r.d(t,"DualShockDpad",(function(){return l.DualShockDpad})),r.d(t,"DualShockPad",(function(){return l.DualShockPad}))},"./Gamepads/xboxGamepad.ts":
- /*!*********************************!*\
- !*** ./Gamepads/xboxGamepad.ts ***!
- \*********************************/
- /*! exports provided: Xbox360Button, Xbox360Dpad, Xbox360Pad */function(e,t,r){"use strict";r.r(t),r.d(t,"Xbox360Button",(function(){return n})),r.d(t,"Xbox360Dpad",(function(){return i})),r.d(t,"Xbox360Pad",(function(){return l}));var n,i,o=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../Gamepads/gamepad */"./Gamepads/gamepad.ts");!function(e){e[e.A=0]="A",e[e.B=1]="B",e[e.X=2]="X",e[e.Y=3]="Y",e[e.LB=4]="LB",e[e.RB=5]="RB",e[e.Back=8]="Back",e[e.Start=9]="Start",e[e.LeftStick=10]="LeftStick",e[e.RightStick=11]="RightStick"}(n||(n={})),function(e){e[e.Up=12]="Up",e[e.Down=13]="Down",e[e.Left=14]="Left",e[e.Right=15]="Right"}(i||(i={}));var l=function(e){function t(t,r,n,i){void 0===i&&(i=!1);var o=e.call(this,t,r,n,0,1,2,3)||this;return o._leftTrigger=0,o._rightTrigger=0,o.onButtonDownObservable=new s.Observable,o.onButtonUpObservable=new s.Observable,o.onPadDownObservable=new s.Observable,o.onPadUpObservable=new s.Observable,o._buttonA=0,o._buttonB=0,o._buttonX=0,o._buttonY=0,o._buttonBack=0,o._buttonStart=0,o._buttonLB=0,o._buttonRB=0,o._buttonLeftStick=0,o._buttonRightStick=0,o._dPadUp=0,o._dPadDown=0,o._dPadLeft=0,o._dPadRight=0,o._isXboxOnePad=!1,o.type=a.Gamepad.XBOX,o._isXboxOnePad=i,o}return Object(o.__extends)(t,e),t.prototype.onlefttriggerchanged=function(e){this._onlefttriggerchanged=e},t.prototype.onrighttriggerchanged=function(e){this._onrighttriggerchanged=e},Object.defineProperty(t.prototype,"leftTrigger",{get:function(){return this._leftTrigger},set:function(e){this._onlefttriggerchanged&&this._leftTrigger!==e&&this._onlefttriggerchanged(e),this._leftTrigger=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightTrigger",{get:function(){return this._rightTrigger},set:function(e){this._onrighttriggerchanged&&this._rightTrigger!==e&&this._onrighttriggerchanged(e),this._rightTrigger=e},enumerable:!1,configurable:!0}),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype.ondpaddown=function(e){this._ondpaddown=e},t.prototype.ondpadup=function(e){this._ondpadup=e},t.prototype._setButtonValue=function(e,t,r){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(r),this.onButtonDownObservable.notifyObservers(r)),0===e&&(this._onbuttonup&&this._onbuttonup(r),this.onButtonUpObservable.notifyObservers(r))),e},t.prototype._setDPadValue=function(e,t,r){return e!==t&&(1===e&&(this._ondpaddown&&this._ondpaddown(r),this.onPadDownObservable.notifyObservers(r)),0===e&&(this._ondpadup&&this._ondpadup(r),this.onPadUpObservable.notifyObservers(r))),e},Object.defineProperty(t.prototype,"buttonA",{get:function(){return this._buttonA},set:function(e){this._buttonA=this._setButtonValue(e,this._buttonA,n.A)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonB",{get:function(){return this._buttonB},set:function(e){this._buttonB=this._setButtonValue(e,this._buttonB,n.B)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonX",{get:function(){return this._buttonX},set:function(e){this._buttonX=this._setButtonValue(e,this._buttonX,n.X)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonY",{get:function(){return this._buttonY},set:function(e){this._buttonY=this._setButtonValue(e,this._buttonY,n.Y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonStart",{get:function(){return this._buttonStart},set:function(e){this._buttonStart=this._setButtonValue(e,this._buttonStart,n.Start)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonBack",{get:function(){return this._buttonBack},set:function(e){this._buttonBack=this._setButtonValue(e,this._buttonBack,n.Back)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonLB",{get:function(){return this._buttonLB},set:function(e){this._buttonLB=this._setButtonValue(e,this._buttonLB,n.LB)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonRB",{get:function(){return this._buttonRB},set:function(e){this._buttonRB=this._setButtonValue(e,this._buttonRB,n.RB)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonLeftStick",{get:function(){return this._buttonLeftStick},set:function(e){this._buttonLeftStick=this._setButtonValue(e,this._buttonLeftStick,n.LeftStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buttonRightStick",{get:function(){return this._buttonRightStick},set:function(e){this._buttonRightStick=this._setButtonValue(e,this._buttonRightStick,n.RightStick)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadUp",{get:function(){return this._dPadUp},set:function(e){this._dPadUp=this._setDPadValue(e,this._dPadUp,i.Up)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadDown",{get:function(){return this._dPadDown},set:function(e){this._dPadDown=this._setDPadValue(e,this._dPadDown,i.Down)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadLeft",{get:function(){return this._dPadLeft},set:function(e){this._dPadLeft=this._setDPadValue(e,this._dPadLeft,i.Left)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dPadRight",{get:function(){return this._dPadRight},set:function(e){this._dPadRight=this._setDPadValue(e,this._dPadRight,i.Right)},enumerable:!1,configurable:!0}),t.prototype.update=function(){e.prototype.update.call(this),this._isXboxOnePad,this.buttonA=this.browserGamepad.buttons[0].value,this.buttonB=this.browserGamepad.buttons[1].value,this.buttonX=this.browserGamepad.buttons[2].value,this.buttonY=this.browserGamepad.buttons[3].value,this.buttonLB=this.browserGamepad.buttons[4].value,this.buttonRB=this.browserGamepad.buttons[5].value,this.leftTrigger=this.browserGamepad.buttons[6].value,this.rightTrigger=this.browserGamepad.buttons[7].value,this.buttonBack=this.browserGamepad.buttons[8].value,this.buttonStart=this.browserGamepad.buttons[9].value,this.buttonLeftStick=this.browserGamepad.buttons[10].value,this.buttonRightStick=this.browserGamepad.buttons[11].value,this.dPadUp=this.browserGamepad.buttons[12].value,this.dPadDown=this.browserGamepad.buttons[13].value,this.dPadLeft=this.browserGamepad.buttons[14].value,this.dPadRight=this.browserGamepad.buttons[15].value},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onButtonDownObservable.clear(),this.onButtonUpObservable.clear(),this.onPadDownObservable.clear(),this.onPadUpObservable.clear()},t}(a.Gamepad)},"./Gizmos/axisDragGizmo.ts":
- /*!*********************************!*\
- !*** ./Gizmos/axisDragGizmo.ts ***!
- \*********************************/
- /*! exports provided: AxisDragGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"AxisDragGizmo",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),a=r(/*! ../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),l=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),c=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),u=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),d=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),h=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),f=function(e){function t(r,n,s,a,c){void 0===n&&(n=h.Color3.Gray()),void 0===s&&(s=u.UtilityLayerRenderer.DefaultUtilityLayer),void 0===a&&(a=null),void 0===c&&(c=1);var f=e.call(this,s)||this;f._pointerObserver=null,f.snapDistance=0,f.onSnapObservable=new i.Observable,f._isEnabled=!0,f._parent=null,f._parent=a,f._coloredMaterial=new d.StandardMaterial("",s.utilityLayerScene),f._coloredMaterial.diffuseColor=n,f._coloredMaterial.specularColor=n.subtract(new h.Color3(.1,.1,.1)),f._hoverMaterial=new d.StandardMaterial("",s.utilityLayerScene),f._hoverMaterial.diffuseColor=n.add(new h.Color3(.3,.3,.3)),f._arrow=t._CreateArrow(s.utilityLayerScene,f._coloredMaterial,c),f._arrow.lookAt(f._rootMesh.position.add(r)),f._arrow.scaling.scaleInPlace(1/3),f._arrow.parent=f._rootMesh;var p=0,m=new o.Vector3,g={snapDistance:0};f.dragBehavior=new l.PointerDragBehavior({dragAxis:r}),f.dragBehavior.moveAttached=!1,f._rootMesh.addBehavior(f.dragBehavior);var _=new o.Vector3,v=new o.Matrix;f.dragBehavior.onDragObservable.add((function(e){if(f.attachedNode){if(f.attachedNode.parent?(f.attachedNode.parent.getWorldMatrix().invertToRef(v),v.setTranslationFromFloats(0,0,0),o.Vector3.TransformCoordinatesToRef(e.delta,v,_)):_.copyFrom(e.delta),0==f.snapDistance)f.attachedNode.getWorldMatrix().addTranslationFromFloats(_.x,_.y,_.z),f.attachedNode.updateCache();else if(p+=e.dragDistance,Math.abs(p)>f.snapDistance){var t=Math.floor(Math.abs(p)/f.snapDistance);p%=f.snapDistance,_.normalizeToRef(m),m.scaleInPlace(f.snapDistance*t),f.attachedNode.getWorldMatrix().addTranslationFromFloats(m.x,m.y,m.z),f.attachedNode.updateCache(),g.snapDistance=f.snapDistance*t,f.onSnapObservable.notifyObservers(g)}f._matrixChanged()}})),f._pointerObserver=s.utilityLayerScene.onPointerObservable.add((function(e){if(!f._customMeshSet){var t=e.pickInfo&&-1!=f._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?f._hoverMaterial:f._coloredMaterial;f._rootMesh.getChildMeshes().forEach((function(e){e.material=t,e.color&&(e.color=t.diffuseColor)}))}}));var y=s._getSharedGizmoLight();return y.includedOnlyMeshes=y.includedOnlyMeshes.concat(f._rootMesh.getChildMeshes(!1)),f}return Object(n.__extends)(t,e),t._CreateArrow=function(e,t,r){void 0===r&&(r=1);var n=new s.TransformNode("arrow",e),i=a.CylinderBuilder.CreateCylinder("cylinder",{diameterTop:0,height:.075,diameterBottom:.0375*(1+(r-1)/4),tessellation:96},e),o=a.CylinderBuilder.CreateCylinder("cylinder",{diameterTop:.005*r,height:.275,diameterBottom:.005*r,tessellation:96},e);return o.material=t,i.parent=n,o.parent=n,i.material=t,i.rotation.x=Math.PI/2,i.position.z+=.3,o.position.z+=.1375,o.rotation.x=Math.PI/2,n},t._CreateArrowInstance=function(e,t){for(var r=new s.TransformNode("arrow",e),n=0,i=t.getChildMeshes();n<i.length;n++){var o=i[n];o.createInstance(o.name).parent=r}return r},t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._arrow&&this._arrow.dispose(),[this._coloredMaterial,this._hoverMaterial].forEach((function(e){e&&e.dispose()})),e.prototype.dispose.call(this)},t}(c.Gizmo)},"./Gizmos/axisScaleGizmo.ts":
- /*!**********************************!*\
- !*** ./Gizmos/axisScaleGizmo.ts ***!
- \**********************************/
- /*! exports provided: AxisScaleGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"AxisScaleGizmo",(function(){return p}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),l=r(/*! ../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),u=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),d=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),h=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),f=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),p=function(e){function t(t,r,n,d,p){void 0===r&&(r=f.Color3.Gray()),void 0===n&&(n=h.UtilityLayerRenderer.DefaultUtilityLayer),void 0===d&&(d=null),void 0===p&&(p=1);var m=e.call(this,n)||this;m._pointerObserver=null,m.snapDistance=0,m.onSnapObservable=new i.Observable,m.uniformScaling=!1,m.sensitivity=1,m._isEnabled=!0,m._parent=null,m._parent=d,m._coloredMaterial=new c.StandardMaterial("",n.utilityLayerScene),m._coloredMaterial.diffuseColor=r,m._coloredMaterial.specularColor=r.subtract(new f.Color3(.1,.1,.1)),m._hoverMaterial=new c.StandardMaterial("",n.utilityLayerScene),m._hoverMaterial.diffuseColor=r.add(new f.Color3(.3,.3,.3)),m._arrow=new s.AbstractMesh("",n.utilityLayerScene);var g=a.BoxBuilder.CreateBox("yPosMesh",{size:.4*(1+(p-1)/4)},n.utilityLayerScene),_=l.CylinderBuilder.CreateCylinder("cylinder",{diameterTop:.005*p,height:.275,diameterBottom:.005*p,tessellation:96},n.utilityLayerScene);_.material=m._coloredMaterial,m._arrow.addChild(g),m._arrow.addChild(_),g.scaling.scaleInPlace(.1),g.material=m._coloredMaterial,g.rotation.x=Math.PI/2,g.position.z+=.3,_.position.z+=.1375,_.rotation.x=Math.PI/2,m._arrow.lookAt(m._rootMesh.position.add(t)),m._rootMesh.addChild(m._arrow),m._arrow.scaling.scaleInPlace(1/3),m.dragBehavior=new u.PointerDragBehavior({dragAxis:t}),m.dragBehavior.moveAttached=!1,m._rootMesh.addBehavior(m.dragBehavior);var v=0,y=new o.Vector3,b={snapDistance:0};m.dragBehavior.onDragObservable.add((function(e){if(m.attachedNode){var r=m.sensitivity*e.dragDistance*(3*m.scaleRatio/m._rootMesh.scaling.length()),n=!1,i=0;m.uniformScaling?(m.attachedNode.getWorldMatrix().decompose(y),y.normalize(),y.y<0&&y.scaleInPlace(-1)):y.copyFrom(t),0==m.snapDistance?y.scaleToRef(r,y):(v+=r,Math.abs(v)>m.snapDistance?(i=Math.floor(Math.abs(v)/m.snapDistance),v<0&&(i*=-1),v%=m.snapDistance,y.scaleToRef(m.snapDistance*i,y),n=!0):y.scaleInPlace(0));var s=new o.Matrix;o.Matrix.ScalingToRef(1+y.x,1+y.y,1+y.z,s),m.attachedNode.getWorldMatrix().copyFrom(s.multiply(m.attachedNode.getWorldMatrix())),n&&(b.snapDistance=m.snapDistance*i,m.onSnapObservable.notifyObservers(b)),m._matrixChanged()}})),m._pointerObserver=n.utilityLayerScene.onPointerObservable.add((function(e){if(!m._customMeshSet){var t=e.pickInfo&&-1!=m._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?m._hoverMaterial:m._coloredMaterial;m._rootMesh.getChildMeshes().forEach((function(e){e.material=t,e.color&&(e.color=t.diffuseColor)}))}}));var A=n._getSharedGizmoLight();return A.includedOnlyMeshes=A.includedOnlyMeshes.concat(m._rootMesh.getChildMeshes()),m}return Object(n.__extends)(t,e),t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._arrow&&this._arrow.dispose(),[this._coloredMaterial,this._hoverMaterial].forEach((function(e){e&&e.dispose()})),e.prototype.dispose.call(this)},t.prototype.setCustomMesh=function(t,r){var n=this;void 0===r&&(r=!1),e.prototype.setCustomMesh.call(this,t),r&&(this._rootMesh.getChildMeshes().forEach((function(e){e.material=n._coloredMaterial,e.color&&(e.color=n._coloredMaterial.diffuseColor)})),this._customMeshSet=!1)},t}(d.Gizmo)},"./Gizmos/boundingBoxGizmo.ts":
- /*!************************************!*\
- !*** ./Gizmos/boundingBoxGizmo.ts ***!
- \************************************/
- /*! exports provided: BoundingBoxGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"BoundingBoxGizmo",(function(){return y}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),u=r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),d=r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),h=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),f=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),p=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),m=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),g=r(/*! ../Misc/pivotTools */"./Misc/pivotTools.ts"),_=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),v=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),y=function(e){function t(t,r){void 0===t&&(t=_.Color3.Gray()),void 0===r&&(r=p.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer);var n=e.call(this,r)||this;n._boundingDimensions=new s.Vector3(1,1,1),n._renderObserver=null,n._pointerObserver=null,n._scaleDragSpeed=.2,n._tmpQuaternion=new s.Quaternion,n._tmpVector=new s.Vector3(0,0,0),n._tmpRotationMatrix=new s.Matrix,n.ignoreChildren=!1,n.includeChildPredicate=null,n.rotationSphereSize=.1,n.scaleBoxSize=.1,n.fixedDragMeshScreenSize=!1,n.fixedDragMeshScreenSizeDistanceFactor=10,n.onDragStartObservable=new i.Observable,n.onScaleBoxDragObservable=new i.Observable,n.onScaleBoxDragEndObservable=new i.Observable,n.onRotationSphereDragObservable=new i.Observable,n.onRotationSphereDragEndObservable=new i.Observable,n.scalePivot=null,n._existingMeshScale=new s.Vector3,n._dragMesh=null,n.pointerDragBehavior=new h.PointerDragBehavior,n.updateScale=!1,n._anchorMesh=new a.AbstractMesh("anchor",r.utilityLayerScene),n.coloredMaterial=new m.StandardMaterial("",r.utilityLayerScene),n.coloredMaterial.disableLighting=!0,n.hoverColoredMaterial=new m.StandardMaterial("",r.utilityLayerScene),n.hoverColoredMaterial.disableLighting=!0,n._lineBoundingBox=new a.AbstractMesh("",r.utilityLayerScene),n._lineBoundingBox.rotationQuaternion=new s.Quaternion;var l=[];l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,0),new s.Vector3(n._boundingDimensions.x,0,0)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,0),new s.Vector3(0,n._boundingDimensions.y,0)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,0),new s.Vector3(0,0,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,0,0),new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,0)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,0,0),new s.Vector3(n._boundingDimensions.x,0,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,n._boundingDimensions.y,0),new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,0)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,n._boundingDimensions.y,0),new s.Vector3(0,n._boundingDimensions.y,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,n._boundingDimensions.z),new s.Vector3(n._boundingDimensions.x,0,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,n._boundingDimensions.z),new s.Vector3(0,n._boundingDimensions.y,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,n._boundingDimensions.z),new s.Vector3(0,n._boundingDimensions.y,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,n._boundingDimensions.z),new s.Vector3(n._boundingDimensions.x,0,n._boundingDimensions.z)]},r.utilityLayerScene)),l.push(d.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,n._boundingDimensions.z),new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,0)]},r.utilityLayerScene)),l.forEach((function(e){e.color=t,e.position.addInPlace(new s.Vector3(-n._boundingDimensions.x/2,-n._boundingDimensions.y/2,-n._boundingDimensions.z/2)),e.isPickable=!1,n._lineBoundingBox.addChild(e)})),n._rootMesh.addChild(n._lineBoundingBox),n.setColor(t),n._rotateSpheresParent=new a.AbstractMesh("",r.utilityLayerScene),n._rotateSpheresParent.rotationQuaternion=new s.Quaternion;for(var f=function(e){var t=c.SphereBuilder.CreateSphere("",{diameter:1},r.utilityLayerScene);t.rotationQuaternion=new s.Quaternion,t.material=v.coloredMaterial,(T=new h.PointerDragBehavior({})).moveAttached=!1,T.updateDragPlane=!1,t.addBehavior(T);var i=new s.Vector3(1,0,0),a=0;T.onDragStartObservable.add((function(){i.copyFrom(t.forward),a=0})),T.onDragObservable.add((function(t){if(n.onRotationSphereDragObservable.notifyObservers({}),n.attachedMesh){var r=n.attachedMesh.parent;if(r&&r.scaling&&r.scaling.isNonUniformWithinEpsilon(.001))return void o.Logger.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");g.PivotTools._RemoveAndStorePivotPoint(n.attachedMesh);var l=i,c=t.dragPlaneNormal.scale(s.Vector3.Dot(t.dragPlaneNormal,l)),u=l.subtract(c).normalizeToNew(),d=s.Vector3.Dot(u,t.delta)<0?Math.abs(t.delta.length()):-Math.abs(t.delta.length());d=d/n._boundingDimensions.length()*n._anchorMesh.scaling.length(),n.attachedMesh.rotationQuaternion||(n.attachedMesh.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(n.attachedMesh.rotation.y,n.attachedMesh.rotation.x,n.attachedMesh.rotation.z)),n._anchorMesh.rotationQuaternion||(n._anchorMesh.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(n._anchorMesh.rotation.y,n._anchorMesh.rotation.x,n._anchorMesh.rotation.z)),a+=d,Math.abs(a)<=2*Math.PI&&(e>=8?s.Quaternion.RotationYawPitchRollToRef(0,0,d,n._tmpQuaternion):e>=4?s.Quaternion.RotationYawPitchRollToRef(d,0,0,n._tmpQuaternion):s.Quaternion.RotationYawPitchRollToRef(0,d,0,n._tmpQuaternion),n._anchorMesh.addChild(n.attachedMesh),n._anchorMesh.rotationQuaternion.multiplyToRef(n._tmpQuaternion,n._anchorMesh.rotationQuaternion),n._anchorMesh.removeChild(n.attachedMesh),n.attachedMesh.setParent(r)),n.updateBoundingBox(),g.PivotTools._RestorePivotPoint(n.attachedMesh)}n._updateDummy()})),T.onDragStartObservable.add((function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(t)})),T.onDragEndObservable.add((function(){n.onRotationSphereDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()})),v._rotateSpheresParent.addChild(t)},v=this,y=0;y<12;y++)f(y);n._rootMesh.addChild(n._rotateSpheresParent),n._scaleBoxesParent=new a.AbstractMesh("",r.utilityLayerScene),n._scaleBoxesParent.rotationQuaternion=new s.Quaternion;for(var b=0;b<3;b++)for(var A=0;A<3;A++)for(var T,M=function(){var e=(1===b?1:0)+(1===A?1:0)+(1===S?1:0);if(1===e||3===e)return"continue";var t=u.BoxBuilder.CreateBox("",{size:1},r.utilityLayerScene);t.material=P.coloredMaterial,t.metadata=2===e;var i=new s.Vector3(b-1,A-1,S-1);(T=new h.PointerDragBehavior({dragAxis:i})).updateDragPlane=!1,T.moveAttached=!1,t.addBehavior(T),T.onDragObservable.add((function(r){if(n.onScaleBoxDragObservable.notifyObservers({}),n.attachedMesh){var a=n.attachedMesh.parent;if(a&&a.scaling&&a.scaling.isNonUniformWithinEpsilon(.001))return void o.Logger.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");g.PivotTools._RemoveAndStorePivotPoint(n.attachedMesh);var l=r.dragDistance/n._boundingDimensions.length()*n._anchorMesh.scaling.length(),c=new s.Vector3(l,l,l);2===e&&(c.x*=Math.abs(i.x),c.y*=Math.abs(i.y),c.z*=Math.abs(i.z)),c.scaleInPlace(n._scaleDragSpeed),n.updateBoundingBox(),n.scalePivot?(n.attachedMesh.getWorldMatrix().getRotationMatrixToRef(n._tmpRotationMatrix),n._boundingDimensions.scaleToRef(.5,n._tmpVector),s.Vector3.TransformCoordinatesToRef(n._tmpVector,n._tmpRotationMatrix,n._tmpVector),n._anchorMesh.position.subtractInPlace(n._tmpVector),n._boundingDimensions.multiplyToRef(n.scalePivot,n._tmpVector),s.Vector3.TransformCoordinatesToRef(n._tmpVector,n._tmpRotationMatrix,n._tmpVector),n._anchorMesh.position.addInPlace(n._tmpVector)):(t.absolutePosition.subtractToRef(n._anchorMesh.position,n._tmpVector),n._anchorMesh.position.subtractInPlace(n._tmpVector)),n._anchorMesh.addChild(n.attachedMesh),n._anchorMesh.scaling.addInPlace(c),(n._anchorMesh.scaling.x<0||n._anchorMesh.scaling.y<0||n._anchorMesh.scaling.z<0)&&n._anchorMesh.scaling.subtractInPlace(c),n._anchorMesh.removeChild(n.attachedMesh),n.attachedMesh.setParent(a),g.PivotTools._RestorePivotPoint(n.attachedMesh)}n._updateDummy()})),T.onDragStartObservable.add((function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(t)})),T.onDragEndObservable.add((function(){n.onScaleBoxDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()})),P._scaleBoxesParent.addChild(t)},P=this,S=0;S<3;S++)M();n._rootMesh.addChild(n._scaleBoxesParent);var E=new Array;return n._pointerObserver=r.utilityLayerScene.onPointerObservable.add((function(e){E[e.event.pointerId]?e.pickInfo&&e.pickInfo.pickedMesh!=E[e.event.pointerId]&&(E[e.event.pointerId].material=n.coloredMaterial,delete E[e.event.pointerId]):n._rotateSpheresParent.getChildMeshes().concat(n._scaleBoxesParent.getChildMeshes()).forEach((function(t){e.pickInfo&&e.pickInfo.pickedMesh==t&&(E[e.event.pointerId]=t,t.material=n.hoverColoredMaterial)}))})),n._renderObserver=n.gizmoLayer.originalScene.onBeforeRenderObservable.add((function(){n.attachedMesh&&!n._existingMeshScale.equals(n.attachedMesh.scaling)?n.updateBoundingBox():n.fixedDragMeshScreenSize&&(n._updateRotationSpheres(),n._updateScaleBoxes()),n._dragMesh&&n.attachedMesh&&n.pointerDragBehavior.dragging&&(n._lineBoundingBox.position.rotateByQuaternionToRef(n._rootMesh.rotationQuaternion,n._tmpVector),n.attachedMesh.setAbsolutePosition(n._dragMesh.position.add(n._tmpVector.scale(-1))))})),n.updateBoundingBox(),n}return Object(n.__extends)(t,e),t.prototype.setColor=function(e){this.coloredMaterial.emissiveColor=e,this.hoverColoredMaterial.emissiveColor=e.clone().add(new _.Color3(.3,.3,.3)),this._lineBoundingBox.getChildren().forEach((function(t){t.color&&(t.color=e)}))},t.prototype._attachedNodeChanged=function(e){var t=this;if(e){g.PivotTools._RemoveAndStorePivotPoint(e);var r=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(r),g.PivotTools._RestorePivotPoint(e),this.updateBoundingBox(),e.getChildMeshes(!1).forEach((function(e){e.markAsDirty("scaling")})),this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce((function(){t._updateDummy()}))}},t.prototype._selectNode=function(e){this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((function(t){t.isVisible=!e||t==e}))},t.prototype.updateBoundingBox=function(){if(this.attachedMesh){g.PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(null);var t=null;this.attachedMesh.skeleton&&(t=this.attachedMesh.skeleton.overrideMesh,this.attachedMesh.skeleton.overrideMesh=null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);var r=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);r.max.subtractToRef(r.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((r.max.x+r.min.x)/2,(r.max.y+r.min.y)/2,(r.max.z+r.min.z)/2),this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position),this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position),this._lineBoundingBox.computeWorldMatrix(),this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),this.attachedMesh.setParent(e),this.attachedMesh.skeleton&&(this.attachedMesh.skeleton.overrideMesh=t)}this._updateRotationSpheres(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),g.PivotTools._RestorePivotPoint(this.attachedMesh))},t.prototype._updateRotationSpheres=function(){for(var e=this._rotateSpheresParent.getChildMeshes(),t=0;t<3;t++)for(var r=0;r<2;r++)for(var n=0;n<2;n++){var i=4*t+2*r+n;if(0==t&&(e[i].position.set(this._boundingDimensions.x/2,this._boundingDimensions.y*r,this._boundingDimensions.z*n),e[i].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[i].lookAt(s.Vector3.Cross(e[i].position.normalizeToNew(),s.Vector3.Right()).normalizeToNew().add(e[i].position))),1==t&&(e[i].position.set(this._boundingDimensions.x*r,this._boundingDimensions.y/2,this._boundingDimensions.z*n),e[i].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[i].lookAt(s.Vector3.Cross(e[i].position.normalizeToNew(),s.Vector3.Up()).normalizeToNew().add(e[i].position))),2==t&&(e[i].position.set(this._boundingDimensions.x*r,this._boundingDimensions.y*n,this._boundingDimensions.z/2),e[i].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[i].lookAt(s.Vector3.Cross(e[i].position.normalizeToNew(),s.Vector3.Forward()).normalizeToNew().add(e[i].position))),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[i].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var o=this.rotationSphereSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[i].scaling.set(o,o,o)}else e[i].scaling.set(this.rotationSphereSize,this.rotationSphereSize,this.rotationSphereSize)}},t.prototype._updateScaleBoxes=function(){for(var e=this._scaleBoxesParent.getChildMeshes(),t=0,r=0;r<3;r++)for(var n=0;n<3;n++)for(var i=0;i<3;i++){var o=(1===r?1:0)+(1===n?1:0)+(1===i?1:0);if(1!==o&&3!==o){if(e[t])if(e[t].position.set(this._boundingDimensions.x*(r/2),this._boundingDimensions.y*(n/2),this._boundingDimensions.z*(i/2)),e[t].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[t].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var a=this.scaleBoxSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[t].scaling.set(a,a,a)}else e[t].scaling.set(this.scaleBoxSize,this.scaleBoxSize,this.scaleBoxSize);t++}}},t.prototype.setEnabledRotationAxis=function(e){this._rotateSpheresParent.getChildMeshes().forEach((function(t,r){r<4?t.setEnabled(-1!=e.indexOf("x")):r<8?t.setEnabled(-1!=e.indexOf("y")):t.setEnabled(-1!=e.indexOf("z"))}))},t.prototype.setEnabledScaling=function(e,t){void 0===t&&(t=!1),this._scaleBoxesParent.getChildMeshes().forEach((function(r,n){var i=e;t&&!0===r.metadata&&(i=!1),r.setEnabled(i)}))},t.prototype._updateDummy=function(){this._dragMesh&&(this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()),this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling),this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion))},t.prototype.enableDragBehavior=function(){this._dragMesh=l.Mesh.CreateBox("dummy",1,this.gizmoLayer.utilityLayerScene),this._dragMesh.visibility=0,this._dragMesh.rotationQuaternion=new s.Quaternion,this.pointerDragBehavior.useObjectOrientationForDragging=!1,this._dragMesh.addBehavior(this.pointerDragBehavior)},t.prototype.dispose=function(){this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),this._lineBoundingBox.dispose(),this._rotateSpheresParent.dispose(),this._scaleBoxesParent.dispose(),this._dragMesh&&this._dragMesh.dispose(),e.prototype.dispose.call(this)},t.MakeNotPickableAndWrapInBoundingBox=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach((function(e){t(e)}))};t(e),e.rotationQuaternion||(e.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z));var r=e.position.clone(),n=e.rotationQuaternion.clone();e.rotationQuaternion.set(0,0,0,1),e.position.set(0,0,0);var i=u.BoxBuilder.CreateBox("box",{size:1},e.getScene()),o=e.getHierarchyBoundingVectors();return o.max.subtractToRef(o.min,i.scaling),0===i.scaling.y&&(i.scaling.y=v.Epsilon),0===i.scaling.x&&(i.scaling.x=v.Epsilon),0===i.scaling.z&&(i.scaling.z=v.Epsilon),i.position.set((o.max.x+o.min.x)/2,(o.max.y+o.min.y)/2,(o.max.z+o.min.z)/2),e.addChild(i),e.rotationQuaternion.copyFrom(n),e.position.copyFrom(r),e.removeChild(i),i.addChild(e),i.visibility=0,i},t.prototype.setCustomMesh=function(e){o.Logger.Error("Custom meshes are not supported on this gizmo")},t}(f.Gizmo)},"./Gizmos/gizmo.ts":
- /*!*************************!*\
- !*** ./Gizmos/gizmo.ts ***!
- \*************************/
- /*! exports provided: Gizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"Gizmo",(function(){return s}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),o=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),s=function(){function e(e){var t=this;void 0===e&&(e=o.UtilityLayerRenderer.DefaultUtilityLayer),this.gizmoLayer=e,this._attachedMesh=null,this._attachedNode=null,this.scaleRatio=1,this._customMeshSet=!1,this.updateGizmoRotationToMatchAttachedMesh=!0,this.updateGizmoPositionToMatchAttachedMesh=!0,this.updateScale=!0,this._interactionsEnabled=!0,this._tempVector=new n.Vector3,this._rootMesh=new i.Mesh("gizmoRootNode",e.utilityLayerScene),this._rootMesh.rotationQuaternion=n.Quaternion.Identity(),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add((function(){t._update()}))}return Object.defineProperty(e.prototype,"attachedMesh",{get:function(){return this._attachedMesh},set:function(e){this._attachedMesh=e,e&&(this._attachedNode=e),this._rootMesh.setEnabled(!!e),this._attachedNodeChanged(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attachedNode",{get:function(){return this._attachedNode},set:function(e){this._attachedNode=e,this._attachedMesh=null,this._rootMesh.setEnabled(!!e),this._attachedNodeChanged(e)},enumerable:!1,configurable:!0}),e.prototype.setCustomMesh=function(e){if(e.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";this._rootMesh.getChildMeshes().forEach((function(e){e.dispose()})),e.parent=this._rootMesh,this._customMeshSet=!0},e.prototype._attachedNodeChanged=function(e){},e.prototype._update=function(){if(this.attachedNode){var e=this.attachedNode;if(this.attachedMesh&&(e=this.attachedMesh._effectiveMesh||this.attachedNode),this.updateGizmoPositionToMatchAttachedMesh){var t=e.getWorldMatrix().getRow(3),r=t?t.toVector3():new n.Vector3(0,0,0);this._rootMesh.position.copyFrom(r)}if(this.updateGizmoRotationToMatchAttachedMesh?e.getWorldMatrix().decompose(void 0,this._rootMesh.rotationQuaternion):this._rootMesh.rotationQuaternion.set(0,0,0,1),this.updateScale){var i=this.gizmoLayer.utilityLayerScene.activeCamera,o=i.globalPosition;i.devicePosition&&(o=i.devicePosition),this._rootMesh.position.subtractToRef(o,this._tempVector);var s=this._tempVector.length()*this.scaleRatio;this._rootMesh.scaling.set(s,s,s),e._getWorldMatrixDeterminant()<0&&(this._rootMesh.scaling.y*=-1)}else this._rootMesh.scaling.setAll(this.scaleRatio)}},e.prototype._matrixChanged=function(){if(this._attachedNode)if("Mesh"===this._attachedNode.getClassName()||"AbstractMesh"===this._attachedNode.getClassName()||"TransformNode"===this._attachedNode.getClassName()){var e=this._attachedNode,t=new n.Quaternion(0,0,0,1);if(e.parent){var r=new n.Matrix,i=new n.Matrix;e.parent.getWorldMatrix().invertToRef(r),this._attachedNode._worldMatrix.multiplyToRef(r,i),i.decompose(e.scaling,t,e.position)}else this._attachedNode._worldMatrix.decompose(e.scaling,t,e.position);e.rotation=t.toEulerAngles(),e.rotationQuaternion&&(e.rotationQuaternion=t)}else if("Bone"===this._attachedNode.getClassName()){var o=this._attachedNode,s=o.getParent();if(s){var a=new n.Matrix,l=new n.Matrix;s.getWorldMatrix().invertToRef(a),o.getWorldMatrix().multiplyToRef(a,l),o.getLocalMatrix().copyFrom(l),o.markAsDirty()}}},e.prototype.dispose=function(){this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)},e}()},"./Gizmos/gizmoManager.ts":
- /*!********************************!*\
- !*** ./Gizmos/gizmoManager.ts ***!
- \********************************/
- /*! exports provided: GizmoManager */function(e,t,r){"use strict";r.r(t),r.d(t,"GizmoManager",(function(){return f}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Events/pointerEvents */"./Events/pointerEvents.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Behaviors/Meshes/sixDofDragBehavior */"./Behaviors/Meshes/sixDofDragBehavior.ts"),c=r(/*! ./rotationGizmo */"./Gizmos/rotationGizmo.ts"),u=r(/*! ./positionGizmo */"./Gizmos/positionGizmo.ts"),d=r(/*! ./scaleGizmo */"./Gizmos/scaleGizmo.ts"),h=r(/*! ./boundingBoxGizmo */"./Gizmos/boundingBoxGizmo.ts"),f=function(){function e(e,t){var r=this;void 0===t&&(t=1),this.scene=e,this.clearGizmoOnEmptyPointerEvent=!1,this.onAttachedToMeshObservable=new n.Observable,this._gizmosEnabled={positionGizmo:!1,rotationGizmo:!1,scaleGizmo:!1,boundingBoxGizmo:!1},this._pointerObserver=null,this._attachedMesh=null,this._boundingBoxColor=a.Color3.FromHexString("#0984e3"),this._thickness=1,this.boundingBoxDragBehavior=new l.SixDofDragBehavior,this.attachableMeshes=null,this.usePointerToAttachGizmos=!0,this._defaultKeepDepthUtilityLayer=new s.UtilityLayerRenderer(e),this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,this._defaultUtilityLayer=new s.UtilityLayerRenderer(e),this._thickness=t,this.gizmos={positionGizmo:null,rotationGizmo:null,scaleGizmo:null,boundingBoxGizmo:null},this._pointerObserver=e.onPointerObservable.add((function(e){if(r.usePointerToAttachGizmos&&e.type==i.PointerEventTypes.POINTERDOWN)if(e.pickInfo&&e.pickInfo.pickedMesh){var t=e.pickInfo.pickedMesh;if(null==r.attachableMeshes)for(;t&&null!=t.parent;)t=t.parent;else{var n=!1;r.attachableMeshes.forEach((function(e){t&&(t==e||t.isDescendantOf(e))&&(t=e,n=!0)})),n||(t=null)}t instanceof o.AbstractMesh?r._attachedMesh!=t&&r.attachToMesh(t):r.clearGizmoOnEmptyPointerEvent&&r.attachToMesh(null)}else r.clearGizmoOnEmptyPointerEvent&&r.attachToMesh(null)}))}return Object.defineProperty(e.prototype,"keepDepthUtilityLayer",{get:function(){return this._defaultKeepDepthUtilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"utilityLayer",{get:function(){return this._defaultUtilityLayer},enumerable:!1,configurable:!0}),e.prototype.attachToMesh=function(e){for(var t in this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh=e,this.gizmos){var r=this.gizmos[t];r&&this._gizmosEnabled[t]&&(r.attachedMesh=e)}this.boundingBoxGizmoEnabled&&this._attachedMesh&&this._attachedMesh.addBehavior(this.boundingBoxDragBehavior),this.onAttachedToMeshObservable.notifyObservers(e)},Object.defineProperty(e.prototype,"positionGizmoEnabled",{get:function(){return this._gizmosEnabled.positionGizmo},set:function(e){e?(this.gizmos.positionGizmo||(this.gizmos.positionGizmo=new u.PositionGizmo(this._defaultUtilityLayer,this._thickness)),this.gizmos.positionGizmo.attachedMesh=this._attachedMesh):this.gizmos.positionGizmo&&(this.gizmos.positionGizmo.attachedMesh=null),this._gizmosEnabled.positionGizmo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationGizmoEnabled",{get:function(){return this._gizmosEnabled.rotationGizmo},set:function(e){e?(this.gizmos.rotationGizmo||(this.gizmos.rotationGizmo=new c.RotationGizmo(this._defaultUtilityLayer,32,!1,this._thickness)),this.gizmos.rotationGizmo.attachedMesh=this._attachedMesh):this.gizmos.rotationGizmo&&(this.gizmos.rotationGizmo.attachedMesh=null),this._gizmosEnabled.rotationGizmo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleGizmoEnabled",{get:function(){return this._gizmosEnabled.scaleGizmo},set:function(e){e?(this.gizmos.scaleGizmo=this.gizmos.scaleGizmo||new d.ScaleGizmo(this._defaultUtilityLayer,this._thickness),this.gizmos.scaleGizmo.attachedMesh=this._attachedMesh):this.gizmos.scaleGizmo&&(this.gizmos.scaleGizmo.attachedMesh=null),this._gizmosEnabled.scaleGizmo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"boundingBoxGizmoEnabled",{get:function(){return this._gizmosEnabled.boundingBoxGizmo},set:function(e){e?(this.gizmos.boundingBoxGizmo=this.gizmos.boundingBoxGizmo||new h.BoundingBoxGizmo(this._boundingBoxColor,this._defaultKeepDepthUtilityLayer),this.gizmos.boundingBoxGizmo.attachedMesh=this._attachedMesh,this._attachedMesh&&(this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh.addBehavior(this.boundingBoxDragBehavior))):this.gizmos.boundingBoxGizmo&&(this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this.gizmos.boundingBoxGizmo.attachedMesh=null),this._gizmosEnabled.boundingBoxGizmo=e},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){for(var e in this.scene.onPointerObservable.remove(this._pointerObserver),this.gizmos){var t=this.gizmos[e];t&&t.dispose()}this._defaultKeepDepthUtilityLayer.dispose(),this._defaultUtilityLayer.dispose(),this.boundingBoxDragBehavior.detach(),this.onAttachedToMeshObservable.clear()},e}()},"./Gizmos/index.ts":
- /*!*************************!*\
- !*** ./Gizmos/index.ts ***!
- \*************************/
- /*! exports provided: AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, PlaneDragGizmo */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./axisDragGizmo */"./Gizmos/axisDragGizmo.ts");r.d(t,"AxisDragGizmo",(function(){return n.AxisDragGizmo}));var i=r(/*! ./axisScaleGizmo */"./Gizmos/axisScaleGizmo.ts");r.d(t,"AxisScaleGizmo",(function(){return i.AxisScaleGizmo}));var o=r(/*! ./boundingBoxGizmo */"./Gizmos/boundingBoxGizmo.ts");r.d(t,"BoundingBoxGizmo",(function(){return o.BoundingBoxGizmo}));var s=r(/*! ./gizmo */"./Gizmos/gizmo.ts");r.d(t,"Gizmo",(function(){return s.Gizmo}));var a=r(/*! ./gizmoManager */"./Gizmos/gizmoManager.ts");r.d(t,"GizmoManager",(function(){return a.GizmoManager}));var l=r(/*! ./planeRotationGizmo */"./Gizmos/planeRotationGizmo.ts");r.d(t,"PlaneRotationGizmo",(function(){return l.PlaneRotationGizmo}));var c=r(/*! ./positionGizmo */"./Gizmos/positionGizmo.ts");r.d(t,"PositionGizmo",(function(){return c.PositionGizmo}));var u=r(/*! ./rotationGizmo */"./Gizmos/rotationGizmo.ts");r.d(t,"RotationGizmo",(function(){return u.RotationGizmo}));var d=r(/*! ./scaleGizmo */"./Gizmos/scaleGizmo.ts");r.d(t,"ScaleGizmo",(function(){return d.ScaleGizmo}));var h=r(/*! ./lightGizmo */"./Gizmos/lightGizmo.ts");r.d(t,"LightGizmo",(function(){return h.LightGizmo}));var f=r(/*! ./planeDragGizmo */"./Gizmos/planeDragGizmo.ts");r.d(t,"PlaneDragGizmo",(function(){return f.PlaneDragGizmo}))},"./Gizmos/lightGizmo.ts":
- /*!******************************!*\
- !*** ./Gizmos/lightGizmo.ts ***!
- \******************************/
- /*! exports provided: LightGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"LightGizmo",(function(){return g}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),u=r(/*! ../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),d=r(/*! ../Lights/directionalLight */"./Lights/directionalLight.ts"),h=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),f=r(/*! ../Meshes/Builders/hemisphereBuilder */"./Meshes/Builders/hemisphereBuilder.ts"),p=r(/*! ../Lights/spotLight */"./Lights/spotLight.ts"),m=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),g=function(e){function t(t){var r=e.call(this,t)||this;return r._cachedPosition=new i.Vector3,r._cachedForward=new i.Vector3(0,0,1),r._light=null,r.attachedMesh=new s.AbstractMesh("",r.gizmoLayer.utilityLayerScene),r._attachedMeshParent=new m.TransformNode("parent",r.gizmoLayer.utilityLayerScene),r.attachedMesh.parent=r._attachedMeshParent,r._material=new c.StandardMaterial("light",r.gizmoLayer.utilityLayerScene),r._material.diffuseColor=new o.Color3(.5,.5,.5),r._material.specularColor=new o.Color3(.1,.1,.1),r}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"light",{get:function(){return this._light},set:function(e){var r=this;if(this._light=e,e){this._lightMesh&&this._lightMesh.dispose(),e instanceof u.HemisphericLight?this._lightMesh=t._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof d.DirectionalLight?this._lightMesh=t._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof p.SpotLight?this._lightMesh=t._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene):this._lightMesh=t._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene),this._lightMesh.getChildMeshes(!1).forEach((function(e){e.material=r._material})),this._lightMesh.parent=this._rootMesh;var n=this.gizmoLayer._getSharedGizmoLight();n.includedOnlyMeshes=n.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)),this._lightMesh.rotationQuaternion=new i.Quaternion,this.attachedMesh.reservedDataStore||(this.attachedMesh.reservedDataStore={}),this.attachedMesh.reservedDataStore.lightGizmo=this,e.parent&&this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()),e.position&&(this.attachedMesh.position.copyFrom(e.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)),e.direction&&(this.attachedMesh.setDirection(e.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(this.attachedMesh.forward)),this._update()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),t.prototype._update=function(){e.prototype._update.call(this),this._light&&(this._light.parent&&this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()),this._light.position&&(this.attachedMesh.position.equals(this._cachedPosition)?(this.attachedMesh.position.copyFrom(this._light.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)):(this._light.position.copyFrom(this.attachedMesh.position),this._cachedPosition.copyFrom(this.attachedMesh.position))),this._light.direction&&(i.Vector3.DistanceSquared(this.attachedMesh.forward,this._cachedForward)>1e-4?(this._light.direction.copyFrom(this.attachedMesh.forward),this._cachedForward.copyFrom(this.attachedMesh.forward)):i.Vector3.DistanceSquared(this.attachedMesh.forward,this._light.direction)>1e-4&&(this.attachedMesh.setDirection(this._light.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(this.attachedMesh.forward))),this._light.isEnabled()?this._material.diffuseColor.set(this._light.diffuse.r/3,this._light.diffuse.g/3,this._light.diffuse.b/3):this._material.diffuseColor.set(0,0,0))},t.prototype.dispose=function(){this._material.dispose(),e.prototype.dispose.call(this),this._attachedMeshParent.dispose()},t._CreateHemisphericLightMesh=function(e){var r=new a.Mesh("hemisphereLight",e),n=f.HemisphereBuilder.CreateHemisphere(r.name,{segments:10,diameter:1},e);n.position.z=-.15,n.rotation.x=Math.PI/2,n.parent=r;var i=this._CreateLightLines(3,e);return i.parent=r,i.position.z,r.scaling.scaleInPlace(t._Scale),r.rotation.x=Math.PI/2,r},t._CreatePointLightMesh=function(e){var r=new a.Mesh("pointLight",e),n=h.SphereBuilder.CreateSphere(r.name,{segments:10,diameter:1},e);return n.rotation.x=Math.PI/2,n.parent=r,this._CreateLightLines(5,e).parent=r,r.scaling.scaleInPlace(t._Scale),r.rotation.x=Math.PI/2,r},t._CreateSpotLightMesh=function(e){var r=new a.Mesh("spotLight",e);h.SphereBuilder.CreateSphere(r.name,{segments:10,diameter:1},e).parent=r;var n=f.HemisphereBuilder.CreateHemisphere(r.name,{segments:10,diameter:2},e);return n.parent=r,n.rotation.x=-Math.PI/2,this._CreateLightLines(2,e).parent=r,r.scaling.scaleInPlace(t._Scale),r.rotation.x=Math.PI/2,r},t._CreateDirectionalLightMesh=function(e){var r=new a.Mesh("directionalLight",e),n=new a.Mesh(r.name,e);n.parent=r,h.SphereBuilder.CreateSphere(r.name,{diameter:1.2,segments:10},e).parent=n;var i=a.Mesh.CreateCylinder(r.name,6,.3,.3,6,1,e);i.parent=n,(o=i.clone(r.name)).scaling.y=.5,o.position.x+=1.25,(s=i.clone(r.name)).scaling.y=.5,s.position.x+=-1.25;var o,s,l=a.Mesh.CreateCylinder(r.name,1,0,.6,6,1,e);return l.position.y+=3,l.parent=n,(o=l.clone(r.name)).position.y=1.5,o.position.x+=1.25,(s=l.clone(r.name)).position.y=1.5,s.position.x+=-1.25,n.scaling.scaleInPlace(t._Scale),n.rotation.z=Math.PI/2,n.rotation.y=Math.PI/2,r},t._Scale=.007,t._CreateLightLines=function(e,t){var r=new a.Mesh("root",t);r.rotation.x=Math.PI/2;var n=new a.Mesh("linePivot",t);n.parent=r;var i=a.Mesh.CreateCylinder("line",2,.2,.3,6,1,t);if(i.position.y=i.scaling.y/2+1.2,i.parent=n,e<2)return n;for(var o=0;o<4;o++)(s=n.clone("lineParentClone")).rotation.z=Math.PI/4,s.rotation.y=Math.PI/2+Math.PI/2*o,s.getChildMeshes()[0].scaling.y=.5,s.getChildMeshes()[0].scaling.x=s.getChildMeshes()[0].scaling.z=.8,s.getChildMeshes()[0].position.y=s.getChildMeshes()[0].scaling.y/2+1.2;if(e<3)return r;for(o=0;o<4;o++)(s=n.clone("linePivotClone")).rotation.z=Math.PI/2,s.rotation.y=Math.PI/2*o;if(e<4)return r;for(o=0;o<4;o++){var s;(s=n.clone("linePivotClone")).rotation.z=Math.PI+Math.PI/4,s.rotation.y=Math.PI/2+Math.PI/2*o,s.getChildMeshes()[0].scaling.y=.5,s.getChildMeshes()[0].scaling.x=s.getChildMeshes()[0].scaling.z=.8,s.getChildMeshes()[0].position.y=s.getChildMeshes()[0].scaling.y/2+1.2}return e<5||((s=n.clone("linePivotClone")).rotation.z=Math.PI),r},t}(l.Gizmo)},"./Gizmos/planeDragGizmo.ts":
- /*!**********************************!*\
- !*** ./Gizmos/planeDragGizmo.ts ***!
- \**********************************/
- /*! exports provided: PlaneDragGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"PlaneDragGizmo",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),l=r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),c=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),u=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),d=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),f=function(e){function t(r,n,a,l){void 0===n&&(n=s.Color3.Gray()),void 0===a&&(a=d.UtilityLayerRenderer.DefaultUtilityLayer),void 0===l&&(l=null);var u=e.call(this,a)||this;u._pointerObserver=null,u.snapDistance=0,u.onSnapObservable=new i.Observable,u._isEnabled=!1,u._parent=null,u._parent=l,u._coloredMaterial=new h.StandardMaterial("",a.utilityLayerScene),u._coloredMaterial.diffuseColor=n,u._coloredMaterial.specularColor=n.subtract(new s.Color3(.1,.1,.1)),u._hoverMaterial=new h.StandardMaterial("",a.utilityLayerScene),u._hoverMaterial.diffuseColor=n.add(new s.Color3(.3,.3,.3)),u._plane=t._CreatePlane(a.utilityLayerScene,u._coloredMaterial),u._plane.lookAt(u._rootMesh.position.add(r)),u._plane.scaling.scaleInPlace(1/3),u._plane.parent=u._rootMesh;var f=0,p=new o.Vector3,m={snapDistance:0};u.dragBehavior=new c.PointerDragBehavior({dragPlaneNormal:r}),u.dragBehavior.moveAttached=!1,u._rootMesh.addBehavior(u.dragBehavior);var g=new o.Vector3,_=new o.Matrix;u.dragBehavior.onDragObservable.add((function(e){if(u.attachedNode){if(u.attachedNode.parent?(u.attachedNode.parent.computeWorldMatrix().invertToRef(_),_.setTranslationFromFloats(0,0,0),o.Vector3.TransformCoordinatesToRef(e.delta,_,g)):g.copyFrom(e.delta),0==u.snapDistance)u.attachedNode.getWorldMatrix().addTranslationFromFloats(g.x,g.y,g.z);else if(f+=e.dragDistance,Math.abs(f)>u.snapDistance){var t=Math.floor(Math.abs(f)/u.snapDistance);f%=u.snapDistance,g.normalizeToRef(p),p.scaleInPlace(u.snapDistance*t),u.attachedNode.getWorldMatrix().addTranslationFromFloats(p.x,p.y,p.z),m.snapDistance=u.snapDistance*t,u.onSnapObservable.notifyObservers(m)}u._matrixChanged()}})),u._pointerObserver=a.utilityLayerScene.onPointerObservable.add((function(e){if(!u._customMeshSet){var t=e.pickInfo&&-1!=u._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?u._hoverMaterial:u._coloredMaterial;u._rootMesh.getChildMeshes().forEach((function(e){e.material=t}))}}));var v=a._getSharedGizmoLight();return v.includedOnlyMeshes=v.includedOnlyMeshes.concat(u._rootMesh.getChildMeshes(!1)),u}return Object(n.__extends)(t,e),t._CreatePlane=function(e,t){var r=new a.TransformNode("plane",e),n=l.PlaneBuilder.CreatePlane("dragPlane",{width:.1375,height:.1375,sideOrientation:2},e);return n.material=t,n.parent=r,n.material=t,r},t._CreateArrowInstance=function(e,t){for(var r=new a.TransformNode("arrow",e),n=0,i=t.getChildMeshes();n<i.length;n++){var o=i[n];o.createInstance(o.name).parent=r}return r},t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedNode=this._parent.attachedNode):this.attachedNode=null},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this),this._plane&&this._plane.dispose(),[this._coloredMaterial,this._hoverMaterial].forEach((function(e){e&&e.dispose()}))},t}(u.Gizmo)},"./Gizmos/planeRotationGizmo.ts":
- /*!**************************************!*\
- !*** ./Gizmos/planeRotationGizmo.ts ***!
- \**************************************/
- /*! exports provided: PlaneRotationGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"PlaneRotationGizmo",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),u=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),d=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),f=(r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),function(e){function t(t,r,n,u,f,p,m){void 0===r&&(r=s.Color3.Gray()),void 0===n&&(n=d.UtilityLayerRenderer.DefaultUtilityLayer),void 0===u&&(u=32),void 0===f&&(f=null),void 0===p&&(p=!1),void 0===m&&(m=1);var g=e.call(this,n)||this;g._pointerObserver=null,g.snapDistance=0,g.onSnapObservable=new i.Observable,g._isEnabled=!0,g._parent=null,g._parent=f;var _=new h.StandardMaterial("",n.utilityLayerScene);_.diffuseColor=r,_.specularColor=r.subtract(new s.Color3(.1,.1,.1));var v=new h.StandardMaterial("",n.utilityLayerScene);v.diffuseColor=r.add(new s.Color3(.3,.3,.3));var y=new a.AbstractMesh("",n.utilityLayerScene),b=l.Mesh.CreateTorus("",.6,.03*m,u,n.utilityLayerScene);b.visibility=0;var A=l.Mesh.CreateTorus("",.6,.005*m,u,n.utilityLayerScene);A.material=_,A.rotation.x=Math.PI/2,b.rotation.x=Math.PI/2,y.addChild(A),y.addChild(b),y.lookAt(g._rootMesh.position.add(t)),g._rootMesh.addChild(y),y.scaling.scaleInPlace(1/3),g.dragBehavior=new c.PointerDragBehavior({dragPlaneNormal:t}),g.dragBehavior.moveAttached=!1,g.dragBehavior.maxDragAngle=9*Math.PI/20,g.dragBehavior._useAlternatePickedPointAboveMaxDragAngle=!0,g._rootMesh.addBehavior(g.dragBehavior);var T=new o.Vector3;g.dragBehavior.onDragStartObservable.add((function(e){g.attachedNode&&T.copyFrom(e.dragPlanePoint)}));var M=new o.Matrix,P=new o.Vector3,S=new o.Vector3,E={snapDistance:0},C=0,x=new o.Matrix,R=new o.Quaternion;g.dragBehavior.onDragObservable.add((function(e){if(g.attachedNode){var r=new o.Vector3(1,1,1),i=new o.Quaternion(0,0,0,1),s=new o.Vector3(0,0,0);g.attachedNode.getWorldMatrix().decompose(r,i,s);var a=e.dragPlanePoint.subtract(s).normalize(),l=T.subtract(s).normalize(),c=o.Vector3.Cross(a,l),u=o.Vector3.Dot(a,l),d=Math.atan2(c.length(),u);if(P.copyFrom(t),S.copyFrom(t),g.updateGizmoRotationToMatchAttachedMesh&&(i.toRotationMatrix(M),S=o.Vector3.TransformCoordinates(P,M)),n.utilityLayerScene.activeCamera){var h=n.utilityLayerScene.activeCamera.position.subtract(s);o.Vector3.Dot(h,S)>0&&(P.scaleInPlace(-1),S.scaleInPlace(-1))}o.Vector3.Dot(S,c)>0&&(d=-d);var f=!1;if(0!=g.snapDistance)if(C+=d,Math.abs(C)>g.snapDistance){var p=Math.floor(Math.abs(C)/g.snapDistance);C<0&&(p*=-1),C%=g.snapDistance,d=g.snapDistance*p,f=!0}else d=0;var m=Math.sin(d/2);if(R.set(P.x*m,P.y*m,P.z*m,Math.cos(d/2)),x.determinant()>0){var _=new o.Vector3;R.toEulerAnglesToRef(_),o.Quaternion.RotationYawPitchRollToRef(_.y,-_.x,-_.z,R)}g.updateGizmoRotationToMatchAttachedMesh?i.multiplyToRef(R,i):R.multiplyToRef(i,i),g.attachedNode.getWorldMatrix().copyFrom(o.Matrix.Compose(r,i,s)),T.copyFrom(e.dragPlanePoint),f&&(E.snapDistance=d,g.onSnapObservable.notifyObservers(E)),g._matrixChanged()}})),g._pointerObserver=n.utilityLayerScene.onPointerObservable.add((function(e){if(!g._customMeshSet){var t=e.pickInfo&&-1!=g._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?v:_;g._rootMesh.getChildMeshes().forEach((function(e){e.material=t,e.color&&(e.color=t.diffuseColor)}))}}));var O=n._getSharedGizmoLight();return O.includedOnlyMeshes=O.includedOnlyMeshes.concat(g._rootMesh.getChildMeshes(!1)),g}return Object(n.__extends)(t,e),t.prototype._attachedNodeChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh):this.attachedMesh=null},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t}(u.Gizmo))},"./Gizmos/positionGizmo.ts":
- /*!*********************************!*\
- !*** ./Gizmos/positionGizmo.ts ***!
- \*********************************/
- /*! exports provided: PositionGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"PositionGizmo",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),c=r(/*! ./axisDragGizmo */"./Gizmos/axisDragGizmo.ts"),u=r(/*! ./planeDragGizmo */"./Gizmos/planeDragGizmo.ts"),d=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=function(e){function t(t,r){void 0===t&&(t=d.UtilityLayerRenderer.DefaultUtilityLayer),void 0===r&&(r=1);var n=e.call(this,t)||this;return n._meshAttached=null,n._nodeAttached=null,n.onDragStartObservable=new o.Observable,n.onDragEndObservable=new o.Observable,n._planarGizmoEnabled=!1,n.xGizmo=new c.AxisDragGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),t,n,r),n.yGizmo=new c.AxisDragGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),t,n,r),n.zGizmo=new c.AxisDragGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),t,n,r),n.xPlaneGizmo=new u.PlaneDragGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),n.gizmoLayer,n),n.yPlaneGizmo=new u.PlaneDragGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),n.gizmoLayer,n),n.zPlaneGizmo=new u.PlaneDragGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),n.gizmoLayer,n),[n.xGizmo,n.yGizmo,n.zGizmo,n.xPlaneGizmo,n.yPlaneGizmo,n.zPlaneGizmo].forEach((function(e){e.dragBehavior.onDragStartObservable.add((function(){n.onDragStartObservable.notifyObservers({})})),e.dragBehavior.onDragEndObservable.add((function(){n.onDragEndObservable.notifyObservers({})}))})),n.attachedMesh=null,n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attachedNode",{get:function(){return this._nodeAttached},set:function(e){this._meshAttached=null,this._nodeAttached=null,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(t){t.isEnabled?t.attachedNode=e:t.attachedNode=null}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"planarGizmoEnabled",{get:function(){return this._planarGizmoEnabled},set:function(e){var t=this;this._planarGizmoEnabled=e,[this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(r){r&&(r.isEnabled=e,e&&(r.attachedMesh?r.attachedMesh=t.attachedMesh:r.attachedNode=t.attachedNode))}),this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){this._updateGizmoRotationToMatchAttachedMesh=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(t){t&&(t.updateGizmoRotationToMatchAttachedMesh=e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this._snapDistance},set:function(e){this._snapDistance=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(t){t&&(t.snapDistance=e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(t){t&&(t.scaleRatio=e)}))},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach((function(e){e&&e.dispose()})),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){i.Logger.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)")},t}(l.Gizmo)},"./Gizmos/rotationGizmo.ts":
- /*!*********************************!*\
- !*** ./Gizmos/rotationGizmo.ts ***!
- \*********************************/
- /*! exports provided: RotationGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"RotationGizmo",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),c=r(/*! ./planeRotationGizmo */"./Gizmos/planeRotationGizmo.ts"),u=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),d=function(e){function t(t,r,n,i){void 0===t&&(t=u.UtilityLayerRenderer.DefaultUtilityLayer),void 0===r&&(r=32),void 0===n&&(n=!1),void 0===i&&(i=1);var l=e.call(this,t)||this;return l.onDragStartObservable=new o.Observable,l.onDragEndObservable=new o.Observable,l.xGizmo=new c.PlaneRotationGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),t,r,l,n,i),l.yGizmo=new c.PlaneRotationGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),t,r,l,n,i),l.zGizmo=new c.PlaneRotationGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),t,r,l,n,i),[l.xGizmo,l.yGizmo,l.zGizmo].forEach((function(e){e.dragBehavior.onDragStartObservable.add((function(){l.onDragStartObservable.notifyObservers({})})),e.dragBehavior.onDragEndObservable.add((function(){l.onDragEndObservable.notifyObservers({})}))})),l.attachedMesh=null,l.attachedNode=null,l}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo].forEach((function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attachedNode",{get:function(){return this._nodeAttached},set:function(e){this._meshAttached=null,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo].forEach((function(t){t.isEnabled?t.attachedNode=e:t.attachedNode=null}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this.xGizmo.snapDistance},set:function(e){this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this.xGizmo.scaleRatio},set:function(e){this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){i.Logger.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)")},t}(l.Gizmo)},"./Gizmos/scaleGizmo.ts":
- /*!******************************!*\
- !*** ./Gizmos/scaleGizmo.ts ***!
- \******************************/
- /*! exports provided: ScaleGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"ScaleGizmo",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Meshes/Builders/polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts"),c=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),u=r(/*! ./axisScaleGizmo */"./Gizmos/axisScaleGizmo.ts"),d=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=function(e){function t(t,r){void 0===t&&(t=d.UtilityLayerRenderer.DefaultUtilityLayer),void 0===r&&(r=1);var n=e.call(this,t)||this;n._meshAttached=null,n._nodeAttached=null,n._sensitivity=1,n.onDragStartObservable=new o.Observable,n.onDragEndObservable=new o.Observable,n.xGizmo=new u.AxisScaleGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),t,n,r),n.yGizmo=new u.AxisScaleGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),t,n,r),n.zGizmo=new u.AxisScaleGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),t,n,r),n.uniformScaleGizmo=new u.AxisScaleGizmo(new s.Vector3(0,1,0),a.Color3.Yellow().scale(.5),t,n),n.uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh=!1,n.uniformScaleGizmo.uniformScaling=!0,n._uniformScalingMesh=l.PolyhedronBuilder.CreatePolyhedron("",{type:1},n.uniformScaleGizmo.gizmoLayer.utilityLayerScene),n._uniformScalingMesh.scaling.scaleInPlace(.02),n._uniformScalingMesh.visibility=0,n._octahedron=l.PolyhedronBuilder.CreatePolyhedron("",{type:1},n.uniformScaleGizmo.gizmoLayer.utilityLayerScene),n._octahedron.scaling.scaleInPlace(.007),n._uniformScalingMesh.addChild(n._octahedron),n.uniformScaleGizmo.setCustomMesh(n._uniformScalingMesh,!0);var i=t._getSharedGizmoLight();return i.includedOnlyMeshes=i.includedOnlyMeshes.concat(n._octahedron),[n.xGizmo,n.yGizmo,n.zGizmo,n.uniformScaleGizmo].forEach((function(e){e.dragBehavior.onDragStartObservable.add((function(){n.onDragStartObservable.notifyObservers({})})),e.dragBehavior.onDragEndObservable.add((function(){n.onDragEndObservable.notifyObservers({})}))})),n.attachedMesh=null,n.attachedNode=null,n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attachedNode",{get:function(){return this._nodeAttached},set:function(e){this._meshAttached=null,this._nodeAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(t){t.isEnabled?t.attachedNode=e:t.attachedNode=null}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){e?(this._updateGizmoRotationToMatchAttachedMesh=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(t){t&&(t.updateGizmoRotationToMatchAttachedMesh=e)}))):i.Logger.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this._snapDistance},set:function(e){this._snapDistance=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(t){t&&(t.snapDistance=e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(t){t&&(t.scaleRatio=e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sensitivity",{get:function(){return this._sensitivity},set:function(e){this._sensitivity=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(t){t&&(t.sensitivity=e)}))},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach((function(e){e&&e.dispose()})),this.onDragStartObservable.clear(),this.onDragEndObservable.clear(),[this._uniformScalingMesh,this._octahedron].forEach((function(e){e&&e.dispose()}))},t}(c.Gizmo)},"./Helpers/environmentHelper.ts":
- /*!**************************************!*\
- !*** ./Helpers/environmentHelper.ts ***!
- \**************************************/
- /*! exports provided: EnvironmentHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"EnvironmentHelper",(function(){return g}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),u=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),d=r(/*! ../Materials/Textures/mirrorTexture */"./Materials/Textures/mirrorTexture.ts"),h=r(/*! ../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),f=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),p=r(/*! ../Engines/constants */"./Engines/constants.ts"),m=(r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),r(/*! ../Maths/math.plane */"./Maths/math.plane.ts")),g=function(){function e(t,r){var o=this;this._errorHandler=function(e,t){o.onErrorObservable.notifyObservers({message:e,exception:t})},this._options=Object(n.__assign)(Object(n.__assign)({},e._getDefaultOptions()),t),this._scene=r,this.onErrorObservable=new i.Observable,this._setupBackground(),this._setupImageProcessing()}return e._getDefaultOptions=function(){return{createGround:!0,groundSize:15,groundTexture:this._groundTextureCDNUrl,groundColor:new a.Color3(.2,.2,.3).toLinearSpace().scale(3),groundOpacity:.9,enableGroundShadow:!0,groundShadowLevel:.5,enableGroundMirror:!1,groundMirrorSizeRatio:.3,groundMirrorBlurKernel:64,groundMirrorAmount:1,groundMirrorFresnelWeight:1,groundMirrorFallOffDistance:0,groundMirrorTextureType:p.Constants.TEXTURETYPE_UNSIGNED_INT,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:this._skyboxTextureCDNUrl,skyboxColor:new a.Color3(.2,.2,.3).toLinearSpace().scale(3),backgroundYRotation:0,sizeAuto:!0,rootPosition:s.Vector3.Zero(),setupImageProcessing:!0,environmentTexture:this._environmentTextureCDNUrl,cameraExposure:.8,cameraContrast:1.2,toneMappingEnabled:!0}},Object.defineProperty(e.prototype,"rootMesh",{get:function(){return this._rootMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skybox",{get:function(){return this._skybox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skyboxTexture",{get:function(){return this._skyboxTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skyboxMaterial",{get:function(){return this._skyboxMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ground",{get:function(){return this._ground},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundTexture",{get:function(){return this._groundTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMirror",{get:function(){return this._groundMirror},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMirrorRenderList",{get:function(){return this._groundMirror?this._groundMirror.renderList:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMaterial",{get:function(){return this._groundMaterial},enumerable:!1,configurable:!0}),e.prototype.updateOptions=function(e){var t=Object(n.__assign)(Object(n.__assign)({},this._options),e);this._ground&&!t.createGround&&(this._ground.dispose(),this._ground=null),this._groundMaterial&&!t.createGround&&(this._groundMaterial.dispose(),this._groundMaterial=null),this._groundTexture&&this._options.groundTexture!=t.groundTexture&&(this._groundTexture.dispose(),this._groundTexture=null),this._skybox&&!t.createSkybox&&(this._skybox.dispose(),this._skybox=null),this._skyboxMaterial&&!t.createSkybox&&(this._skyboxMaterial.dispose(),this._skyboxMaterial=null),this._skyboxTexture&&this._options.skyboxTexture!=t.skyboxTexture&&(this._skyboxTexture.dispose(),this._skyboxTexture=null),this._groundMirror&&!t.enableGroundMirror&&(this._groundMirror.dispose(),this._groundMirror=null),this._scene.environmentTexture&&this._options.environmentTexture!=t.environmentTexture&&this._scene.environmentTexture.dispose(),this._options=t,this._setupBackground(),this._setupImageProcessing()},e.prototype.setMainColor=function(e){this.groundMaterial&&(this.groundMaterial.primaryColor=e),this.skyboxMaterial&&(this.skyboxMaterial.primaryColor=e),this.groundMirror&&(this.groundMirror.clearColor=new a.Color4(e.r,e.g,e.b,1))},e.prototype._setupImageProcessing=function(){this._options.setupImageProcessing&&(this._scene.imageProcessingConfiguration.contrast=this._options.cameraContrast,this._scene.imageProcessingConfiguration.exposure=this._options.cameraExposure,this._scene.imageProcessingConfiguration.toneMappingEnabled=this._options.toneMappingEnabled,this._setupEnvironmentTexture())},e.prototype._setupEnvironmentTexture=function(){if(!this._scene.environmentTexture)if(this._options.environmentTexture instanceof c.BaseTexture)this._scene.environmentTexture=this._options.environmentTexture;else{var e=h.CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture,this._scene);this._scene.environmentTexture=e}},e.prototype._setupBackground=function(){this._rootMesh||(this._rootMesh=new l.Mesh("BackgroundHelper",this._scene)),this._rootMesh.rotation.y=this._options.backgroundYRotation;var e=this._getSceneSize();this._options.createGround&&(this._setupGround(e),this._setupGroundMaterial(),this._setupGroundDiffuseTexture(),this._options.enableGroundMirror&&this._setupGroundMirrorTexture(e),this._setupMirrorInGroundMaterial()),this._options.createSkybox&&(this._setupSkybox(e),this._setupSkyboxMaterial(),this._setupSkyboxReflectionTexture()),this._rootMesh.position.x=e.rootPosition.x,this._rootMesh.position.z=e.rootPosition.z,this._rootMesh.position.y=e.rootPosition.y},e.prototype._getSceneSize=function(){var e=this,t=this._options.groundSize,r=this._options.skyboxSize,n=this._options.rootPosition;if(!this._scene.meshes||1===this._scene.meshes.length)return{groundSize:t,skyboxSize:r,rootPosition:n};var i=this._scene.getWorldExtends((function(t){return t!==e._ground&&t!==e._rootMesh&&t!==e._skybox})),s=i.max.subtract(i.min);if(this._options.sizeAuto){this._scene.activeCamera instanceof o.ArcRotateCamera&&this._scene.activeCamera.upperRadiusLimit&&(r=t=2*this._scene.activeCamera.upperRadiusLimit);var a=s.length();a>t&&(r=t=2*a),t*=1.1,r*=1.5,(n=i.min.add(s.scale(.5))).y=i.min.y-this._options.groundYBias}return{groundSize:t,skyboxSize:r,rootPosition:n}},e.prototype._setupGround=function(e){var t=this;this._ground&&!this._ground.isDisposed()||(this._ground=l.Mesh.CreatePlane("BackgroundPlane",e.groundSize,this._scene),this._ground.rotation.x=Math.PI/2,this._ground.parent=this._rootMesh,this._ground.onDisposeObservable.add((function(){t._ground=null}))),this._ground.receiveShadows=this._options.enableGroundShadow},e.prototype._setupGroundMaterial=function(){this._groundMaterial||(this._groundMaterial=new f.BackgroundMaterial("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=p.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,this._groundMaterial.shadowLevel=this._options.groundShadowLevel,this._groundMaterial.primaryColor=this._options.groundColor,this._groundMaterial.useRGBColor=!1,this._groundMaterial.enableNoise=!0,this._ground&&(this._ground.material=this._groundMaterial)},e.prototype._setupGroundDiffuseTexture=function(){if(this._groundMaterial&&!this._groundTexture)if(this._options.groundTexture instanceof c.BaseTexture)this._groundMaterial.diffuseTexture=this._options.groundTexture;else{var e=new u.Texture(this._options.groundTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler);e.gammaSpace=!1,e.hasAlpha=!0,this._groundMaterial.diffuseTexture=e}},e.prototype._setupGroundMirrorTexture=function(e){var t=u.Texture.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new d.MirrorTexture("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,u.Texture.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new m.Plane(0,-1,0,e.rootPosition.y),this._groundMirror.anisotropicFilteringLevel=1,this._groundMirror.wrapU=t,this._groundMirror.wrapV=t,this._groundMirror.gammaSpace=!1,this._groundMirror.renderList))for(var r=0;r<this._scene.meshes.length;r++){var n=this._scene.meshes[r];n!==this._ground&&n!==this._skybox&&n!==this._rootMesh&&this._groundMirror.renderList.push(n)}this._groundMirror.clearColor=new a.Color4(this._options.groundColor.r,this._options.groundColor.g,this._options.groundColor.b,1),this._groundMirror.adaptiveBlurKernel=this._options.groundMirrorBlurKernel},e.prototype._setupMirrorInGroundMaterial=function(){this._groundMaterial&&(this._groundMaterial.reflectionTexture=this._groundMirror,this._groundMaterial.reflectionFresnel=!0,this._groundMaterial.reflectionAmount=this._options.groundMirrorAmount,this._groundMaterial.reflectionStandardFresnelWeight=this._options.groundMirrorFresnelWeight,this._groundMaterial.reflectionFalloffDistance=this._options.groundMirrorFallOffDistance)},e.prototype._setupSkybox=function(e){var t=this;this._skybox&&!this._skybox.isDisposed()||(this._skybox=l.Mesh.CreateBox("BackgroundSkybox",e.skyboxSize,this._scene,void 0,l.Mesh.BACKSIDE),this._skybox.onDisposeObservable.add((function(){t._skybox=null}))),this._skybox.parent=this._rootMesh},e.prototype._setupSkyboxMaterial=function(){this._skybox&&(this._skyboxMaterial||(this._skyboxMaterial=new f.BackgroundMaterial("BackgroundSkyboxMaterial",this._scene)),this._skyboxMaterial.useRGBColor=!1,this._skyboxMaterial.primaryColor=this._options.skyboxColor,this._skyboxMaterial.enableNoise=!0,this._skybox.material=this._skyboxMaterial)},e.prototype._setupSkyboxReflectionTexture=function(){this._skyboxMaterial&&(this._skyboxTexture||(this._options.skyboxTexture instanceof c.BaseTexture?this._skyboxMaterial.reflectionTexture=this._options.skyboxTexture:(this._skyboxTexture=new h.CubeTexture(this._options.skyboxTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler),this._skyboxTexture.coordinatesMode=u.Texture.SKYBOX_MODE,this._skyboxTexture.gammaSpace=!1,this._skyboxMaterial.reflectionTexture=this._skyboxTexture)))},e.prototype.dispose=function(){this._groundMaterial&&this._groundMaterial.dispose(!0,!0),this._skyboxMaterial&&this._skyboxMaterial.dispose(!0,!0),this._rootMesh.dispose(!1)},e._groundTextureCDNUrl="https://assets.babylonjs.com/environments/backgroundGround.png",e._skyboxTextureCDNUrl="https://assets.babylonjs.com/environments/backgroundSkybox.dds",e._environmentTextureCDNUrl="https://assets.babylonjs.com/environments/environmentSpecular.env",e}()},"./Helpers/index.ts":
- /*!**************************!*\
- !*** ./Helpers/index.ts ***!
- \**************************/
- /*! exports provided: EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./environmentHelper */"./Helpers/environmentHelper.ts");r.d(t,"EnvironmentHelper",(function(){return n.EnvironmentHelper}));var i=r(/*! ./photoDome */"./Helpers/photoDome.ts");r.d(t,"PhotoDome",(function(){return i.PhotoDome}));var o=r(/*! ./sceneHelpers */"./Helpers/sceneHelpers.ts");r.d(t,"_forceSceneHelpersToBundle",(function(){return o._forceSceneHelpersToBundle}));var s=r(/*! ./videoDome */"./Helpers/videoDome.ts");r.d(t,"VideoDome",(function(){return s.VideoDome}))},"./Helpers/photoDome.ts":
- /*!******************************!*\
- !*** ./Helpers/photoDome.ts ***!
- \******************************/
- /*! exports provided: PhotoDome */function(e,t,r){"use strict";r.r(t),r.d(t,"PhotoDome",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),c=(r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),r(/*! ../Maths/math.vector */"./Maths/math.vector.ts")),u=function(e){function t(r,n,o,u,d){void 0===d&&(d=null);var h=e.call(this,r,u)||this;h._useDirectMapping=!1,h.onLoadErrorObservable=new i.Observable,h._imageMode=t.MODE_MONOSCOPIC,h._onBeforeCameraRenderObserver=null,r=r||"photoDome",o.resolution=0|Math.abs(o.resolution)||32,o.size=Math.abs(o.size)||(u.activeCamera?.48*u.activeCamera.maxZ:1e3),void 0===o.useDirectMapping?h._useDirectMapping=!0:h._useDirectMapping=o.useDirectMapping,void 0===o.faceForward&&(o.faceForward=!0),h._setReady(!1);var f=h._material=new l.BackgroundMaterial(r+"_material",u);if(h._mesh=s.Mesh.CreateSphere(r+"_mesh",o.resolution,o.size,u,!1,s.Mesh.BACKSIDE),f.opacityFresnel=!1,f.useEquirectangularFOV=!0,f.fovMultiplier=1,h.photoTexture=new a.Texture(n,u,!0,!h._useDirectMapping,void 0,void 0,(function(e,t){h.onLoadErrorObservable.notifyObservers(e||"Unknown error occured"),d&&d(e,t)})),h.photoTexture.anisotropicFilteringLevel=1,h.photoTexture.onLoadObservable.addOnce((function(){h._setReady(!0)})),h._mesh.material=f,h._mesh.parent=h,o.faceForward&&u.activeCamera){var p=u.activeCamera,m=c.Vector3.Forward(),g=c.Vector3.TransformNormal(m,p.getViewMatrix());g.normalize(),h.rotation.y=Math.acos(c.Vector3.Dot(m,g))}return h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"photoTexture",{get:function(){return this._photoTexture},set:function(e){this._photoTexture!==e&&(this._photoTexture=e,this._useDirectMapping?(this._photoTexture.wrapU=a.Texture.CLAMP_ADDRESSMODE,this._photoTexture.wrapV=a.Texture.CLAMP_ADDRESSMODE,this._material.diffuseTexture=this._photoTexture):(this._photoTexture.coordinatesMode=a.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,this._photoTexture.wrapV=a.Texture.CLAMP_ADDRESSMODE,this._material.reflectionTexture=this._photoTexture))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageMode",{get:function(){return this._imageMode},set:function(e){this._imageMode!==e&&this._changeImageMode(e)},enumerable:!1,configurable:!0}),t.prototype._changeImageMode=function(e){var r=this;switch(this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._imageMode=e,this._photoTexture.uScale=1,this._photoTexture.vScale=1,this._photoTexture.uOffset=0,this._photoTexture.vOffset=0,e){case t.MODE_SIDEBYSIDE:this._photoTexture.uScale=.5,this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add((function(e){r._photoTexture.uOffset=e.isRightCamera?.5:0}));break;case t.MODE_TOPBOTTOM:this._photoTexture.vScale=.5,this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add((function(e){r._photoTexture.vOffset=e.isRightCamera?.5:0}))}},t.prototype.dispose=function(t,r){void 0===r&&(r=!1),this._photoTexture.dispose(),this._mesh.dispose(),this._material.dispose(),this.onLoadErrorObservable.clear(),this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),e.prototype.dispose.call(this,t,r)},t.MODE_MONOSCOPIC=0,t.MODE_TOPBOTTOM=1,t.MODE_SIDEBYSIDE=2,t}(o.TransformNode)},"./Helpers/sceneHelpers.ts":
- /*!*********************************!*\
- !*** ./Helpers/sceneHelpers.ts ***!
- \*********************************/
- /*! exports provided: _forceSceneHelpersToBundle */function(e,t,r){"use strict";r.r(t),r.d(t,"_forceSceneHelpersToBundle",(function(){return g}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../scene */"./scene.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),c=r(/*! ../Materials/PBR/pbrMaterial */"./Materials/PBR/pbrMaterial.ts"),u=r(/*! ../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),d=r(/*! ./environmentHelper */"./Helpers/environmentHelper.ts"),h=r(/*! ../Cameras/freeCamera */"./Cameras/freeCamera.ts"),f=r(/*! ../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),p=r(/*! ../Cameras/VR/vrExperienceHelper */"./Cameras/VR/vrExperienceHelper.ts"),m=(r(/*! ../Materials/Textures/Loaders/ddsTextureLoader */"./Materials/Textures/Loaders/ddsTextureLoader.ts"),r(/*! ../Materials/Textures/Loaders/envTextureLoader */"./Materials/Textures/Loaders/envTextureLoader.ts"),r(/*! ../Materials/Textures/Loaders/ktxTextureLoader */"./Materials/Textures/Loaders/ktxTextureLoader.ts"),r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),r(/*! ../XR/webXRDefaultExperience */"./XR/webXRDefaultExperience.ts")),g=!0;i.Scene.prototype.createDefaultLight=function(e){if(void 0===e&&(e=!1),e&&this.lights)for(var t=0;t<this.lights.length;t++)this.lights[t].dispose();0===this.lights.length&&new u.HemisphericLight("default light",o.Vector3.Up(),this)},i.Scene.prototype.createDefaultCamera=function(e,t,r){if(void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===r&&(r=!1),t&&this.activeCamera&&(this.activeCamera.dispose(),this.activeCamera=null),!this.activeCamera){var n,i=this.getWorldExtends((function(e){return e.isVisible&&e.isEnabled()})),s=i.max.subtract(i.min),a=i.min.add(s.scale(.5)),l=1.5*s.length();if(isFinite(l)||(l=1,a.copyFromFloats(0,0,0)),e){var c=new f.ArcRotateCamera("default camera",-Math.PI/2,Math.PI/2,l,a,this);c.lowerRadiusLimit=.01*l,c.wheelPrecision=100/l,n=c}else{var u=new h.FreeCamera("default camera",new o.Vector3(a.x,a.y,-l),this);u.setTarget(a),n=u}n.minZ=.01*l,n.maxZ=1e3*l,n.speed=.2*l,this.activeCamera=n;var d=this.getEngine().getInputElement();r&&d&&n.attachControl(d)}},i.Scene.prototype.createDefaultCameraOrLight=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===r&&(r=!1),this.createDefaultLight(t),this.createDefaultCamera(e,t,r)},i.Scene.prototype.createDefaultSkybox=function(e,t,r,i,o){if(void 0===t&&(t=!1),void 0===r&&(r=1e3),void 0===i&&(i=0),void 0===o&&(o=!0),!e)return n.Logger.Warn("Can not create default skybox without environment texture."),null;o&&e&&(this.environmentTexture=e);var u=s.Mesh.CreateBox("hdrSkyBox",r,this);if(t){var d=new c.PBRMaterial("skyBox",this);d.backFaceCulling=!1,d.reflectionTexture=e.clone(),d.reflectionTexture&&(d.reflectionTexture.coordinatesMode=a.Texture.SKYBOX_MODE),d.microSurface=1-i,d.disableLighting=!0,d.twoSidedLighting=!0,u.infiniteDistance=!0,u.material=d}else{var h=new l.StandardMaterial("skyBox",this);h.backFaceCulling=!1,h.reflectionTexture=e.clone(),h.reflectionTexture&&(h.reflectionTexture.coordinatesMode=a.Texture.SKYBOX_MODE),h.disableLighting=!0,u.infiniteDistance=!0,u.material=h}return u.isPickable=!1,u},i.Scene.prototype.createDefaultEnvironment=function(e){return d.EnvironmentHelper?new d.EnvironmentHelper(e,this):null},i.Scene.prototype.createDefaultVRExperience=function(e){return void 0===e&&(e={}),new p.VRExperienceHelper(this,e)},i.Scene.prototype.createDefaultXRExperienceAsync=function(e){return void 0===e&&(e={}),m.WebXRDefaultExperience.CreateAsync(this,e).then((function(e){return e}))}},"./Helpers/videoDome.ts":
- /*!******************************!*\
- !*** ./Helpers/videoDome.ts ***!
- \******************************/
- /*! exports provided: VideoDome */function(e,t,r){"use strict";r.r(t),r.d(t,"VideoDome",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),o=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../Materials/Textures/videoTexture */"./Materials/Textures/videoTexture.ts"),l=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),c=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),u=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),d=r(/*! ../Maths/math */"./Maths/math.ts"),h=function(e){function t(r,n,i,h){var f=e.call(this,r,h)||this;f._halfDome=!1,f._useDirectMapping=!1,f._videoMode=t.MODE_MONOSCOPIC,f._onBeforeCameraRenderObserver=null,h=f.getScene(),r=r||"videoDome",i.resolution=0|Math.abs(i.resolution)||32,i.clickToPlay=Boolean(i.clickToPlay),i.autoPlay=void 0===i.autoPlay||Boolean(i.autoPlay),i.loop=void 0===i.loop||Boolean(i.loop),i.size=Math.abs(i.size)||(h.activeCamera?.48*h.activeCamera.maxZ:1e3),void 0===i.useDirectMapping?f._useDirectMapping=!0:f._useDirectMapping=i.useDirectMapping,void 0===i.faceForward&&(i.faceForward=!0),f._setReady(!1);var p={loop:i.loop,autoPlay:i.autoPlay,autoUpdateTexture:!0,poster:i.poster},m=f._material=new l.BackgroundMaterial(r+"_material",h),g=f._videoTexture=new a.VideoTexture(r+"_texture",n,h,!1,f._useDirectMapping,s.Texture.TRILINEAR_SAMPLINGMODE,p);if(f._mesh=o.Mesh.CreateSphere(r+"_mesh",i.resolution,i.size,h,!1,o.Mesh.BACKSIDE),g.anisotropicFilteringLevel=1,g.onLoadObservable.addOnce((function(){f._setReady(!0)})),m.useEquirectangularFOV=!0,m.fovMultiplier=1,m.opacityFresnel=!1,f._useDirectMapping?(g.wrapU=s.Texture.CLAMP_ADDRESSMODE,g.wrapV=s.Texture.CLAMP_ADDRESSMODE,m.diffuseTexture=g):(g.coordinatesMode=s.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,g.wrapV=s.Texture.CLAMP_ADDRESSMODE,m.reflectionTexture=g),f._mesh.material=m,f._mesh.parent=f,f._halfDomeMask=c.SphereBuilder.CreateSphere("",{slice:.5,diameter:.99*i.size,segments:i.resolution,sideOrientation:o.Mesh.BACKSIDE},h),f._halfDomeMask.rotate(d.Axis.X,-Math.PI/2),f._halfDomeMask.parent=f._mesh,f._halfDome=!!i.halfDomeMode,f._halfDomeMask.setEnabled(f._halfDome),i.clickToPlay&&(h.onPointerUp=function(){f._videoTexture.video.play()}),i.faceForward&&h.activeCamera){var _=h.activeCamera,v=u.Vector3.Forward(),y=u.Vector3.TransformNormal(v,_.getViewMatrix());y.normalize(),f.rotation.y=Math.acos(u.Vector3.Dot(v,y))}return f._changeVideoMode(f._videoMode),f}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"videoTexture",{get:function(){return this._videoTexture},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoMode",{get:function(){return this._videoMode},set:function(e){this._videoMode!==e&&this._changeVideoMode(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"halfDome",{get:function(){return this._halfDome},set:function(e){this._halfDome=e,this._halfDomeMask.setEnabled(e)},enumerable:!1,configurable:!0}),t.prototype._changeVideoMode=function(e){var r=this;switch(this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._videoMode=e,this._videoTexture.uScale=1,this._videoTexture.vScale=1,this._videoTexture.uOffset=0,this._videoTexture.vOffset=0,e){case t.MODE_MONOSCOPIC:this._halfDome&&(this._videoTexture.uScale=2);break;case t.MODE_SIDEBYSIDE:this._videoTexture.uScale=this._halfDome?.99999:.5;var n=this._halfDome?0:.5,i=this._halfDome?.5:0;this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add((function(e){r._videoTexture.uOffset=e.isRightCamera?n:i}));break;case t.MODE_TOPBOTTOM:this._videoTexture.vScale=this._halfDome?.99999:.5,this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add((function(e){r._videoTexture.vOffset=e.isRightCamera?.5:0}))}},t.prototype.dispose=function(t,r){void 0===r&&(r=!1),this._videoTexture.dispose(),this._mesh.dispose(),this._material.dispose(),this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),e.prototype.dispose.call(this,t,r)},t.MODE_MONOSCOPIC=0,t.MODE_TOPBOTTOM=1,t.MODE_SIDEBYSIDE=2,t}(i.TransformNode)},"./Inputs/scene.inputManager.ts":
- /*!**************************************!*\
- !*** ./Inputs/scene.inputManager.ts ***!
- \**************************************/
- /*! exports provided: InputManager */function(e,t,r){"use strict";r.r(t),r.d(t,"InputManager",(function(){return d}));var n=r(/*! ../Events/pointerEvents */"./Events/pointerEvents.ts"),i=r(/*! ../Actions/abstractActionManager */"./Actions/abstractActionManager.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../Actions/actionEvent */"./Actions/actionEvent.ts"),l=r(/*! ../Misc/tools */"./Misc/tools.ts"),c=r(/*! ../Events/keyboardEvents */"./Events/keyboardEvents.ts"),u=function(){function e(){this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}return Object.defineProperty(e.prototype,"singleClick",{get:function(){return this._singleClick},set:function(e){this._singleClick=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doubleClick",{get:function(){return this._doubleClick},set:function(e){this._doubleClick=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasSwiped",{get:function(){return this._hasSwiped},set:function(e){this._hasSwiped=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ignore",{get:function(){return this._ignore},set:function(e){this._ignore=e},enumerable:!1,configurable:!0}),e}(),d=function(){function e(e){this._alreadyAttached=!1,this._wheelEventName="",this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._totalPointersPressed=0,this._doubleClickOccured=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new o.Vector2(0,0),this._previousStartingPointerPosition=new o.Vector2(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._scene=e}return Object.defineProperty(e.prototype,"meshUnderPointer",{get:function(){return this._pointerOverMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unTranslatedPointer",{get:function(){return new o.Vector2(this._unTranslatedPointerX,this._unTranslatedPointerY)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointerX",{get:function(){return this._pointerX},set:function(e){this._pointerX=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointerY",{get:function(){return this._pointerY},set:function(e){this._pointerY=e},enumerable:!1,configurable:!0}),e.prototype._updatePointerPosition=function(e){var t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)},e.prototype._processPointerMove=function(e,t){var r=this._scene,i=r.getEngine(),o=i.getInputElement();if(o){o.tabIndex=i.canvasTabIndex,r.doNotHandleCursors||(o.style.cursor=r.defaultCursor);var s=!!(e&&e.hit&&e.pickedMesh);s?(r.setPointerOverMesh(e.pickedMesh),this._pointerOverMesh&&this._pointerOverMesh.actionManager&&this._pointerOverMesh.actionManager.hasPointerTriggers&&(r.doNotHandleCursors||(this._pointerOverMesh.actionManager.hoverCursor?o.style.cursor=this._pointerOverMesh.actionManager.hoverCursor:o.style.cursor=r.hoverCursor))):r.setPointerOverMesh(null);for(var a=0,l=r._pointerMoveStage;a<l.length;a++)e=l[a].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,s,o);if(e){var c=t.type===this._wheelEventName?n.PointerEventTypes.POINTERWHEEL:n.PointerEventTypes.POINTERMOVE;if(r.onPointerMove&&r.onPointerMove(t,e,c),r.onPointerObservable.hasObservers()){var u=new n.PointerInfo(c,t,e);this._setRayOnPointerInfo(u),r.onPointerObservable.notifyObservers(u,c)}}}},e.prototype._setRayOnPointerInfo=function(e){var t=this._scene;e.pickInfo&&!e.pickInfo._pickingUnavailable&&(e.pickInfo.ray||(e.pickInfo.ray=t.createPickingRay(e.event.offsetX,e.event.offsetY,o.Matrix.Identity(),t.activeCamera)))},e.prototype._checkPrePointerObservable=function(e,t,r){var i=this._scene,o=new n.PointerInfoPre(r,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(o.ray=e.ray),i.onPrePointerObservable.notifyObservers(o,r),!!o.skipOnPointerObservable},e.prototype.simulatePointerMove=function(e,t){var r=new PointerEvent("pointermove",t);this._checkPrePointerObservable(e,r,n.PointerEventTypes.POINTERMOVE)||this._processPointerMove(e,r)},e.prototype.simulatePointerDown=function(e,t){var r=new PointerEvent("pointerdown",t);this._checkPrePointerObservable(e,r,n.PointerEventTypes.POINTERDOWN)||this._processPointerDown(e,r)},e.prototype._processPointerDown=function(t,r){var i=this,o=this._scene;if(t&&t.hit&&t.pickedMesh){this._pickedDownMesh=t.pickedMesh;var l=t.pickedMesh._getActionManagerForTrigger();if(l){if(l.hasPickTriggers)switch(l.processTrigger(s.Constants.ACTION_OnPickDownTrigger,a.ActionEvent.CreateNew(t.pickedMesh,r)),r.button){case 0:l.processTrigger(s.Constants.ACTION_OnLeftPickTrigger,a.ActionEvent.CreateNew(t.pickedMesh,r));break;case 1:l.processTrigger(s.Constants.ACTION_OnCenterPickTrigger,a.ActionEvent.CreateNew(t.pickedMesh,r));break;case 2:l.processTrigger(s.Constants.ACTION_OnRightPickTrigger,a.ActionEvent.CreateNew(t.pickedMesh,r))}l.hasSpecificTrigger(s.Constants.ACTION_OnLongPressTrigger)&&window.setTimeout((function(){var t=o.pick(i._unTranslatedPointerX,i._unTranslatedPointerY,(function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.actionManager&&e.actionManager.hasSpecificTrigger(s.Constants.ACTION_OnLongPressTrigger)&&e==i._pickedDownMesh}),!1,o.cameraToUseForPointers);t&&t.hit&&t.pickedMesh&&l&&0!==i._totalPointersPressed&&Date.now()-i._startingPointerTime>e.LongPressDelay&&!i._isPointerSwiping()&&(i._startingPointerTime=0,l.processTrigger(s.Constants.ACTION_OnLongPressTrigger,a.ActionEvent.CreateNew(t.pickedMesh,r)))}),e.LongPressDelay)}}else for(var c=0,u=o._pointerDownStage;c<u.length;c++)t=u[c].action(this._unTranslatedPointerX,this._unTranslatedPointerY,t,r);if(t){var d=n.PointerEventTypes.POINTERDOWN;if(o.onPointerDown&&o.onPointerDown(r,t,d),o.onPointerObservable.hasObservers()){var h=new n.PointerInfo(d,r,t);this._setRayOnPointerInfo(h),o.onPointerObservable.notifyObservers(h,d)}}},e.prototype._isPointerSwiping=function(){return Math.abs(this._startingPointerPosition.x-this._pointerX)>e.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>e.DragMovementThreshold},e.prototype.simulatePointerUp=function(e,t,r){var i=new PointerEvent("pointerup",t),o=new u;r?o.doubleClick=!0:o.singleClick=!0,this._checkPrePointerObservable(e,i,n.PointerEventTypes.POINTERUP)||this._processPointerUp(e,i,o)},e.prototype._processPointerUp=function(e,t,r){var i=this._scene;if(e&&e&&e.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(i.onPointerPick&&i.onPointerPick(t,e),r.singleClick&&!r.ignore&&i.onPointerObservable.hasObservers())){var o=n.PointerEventTypes.POINTERPICK,l=new n.PointerInfo(o,t,e);this._setRayOnPointerInfo(l),i.onPointerObservable.notifyObservers(l,o)}var c=e.pickedMesh._getActionManagerForTrigger();if(c&&!r.ignore){c.processTrigger(s.Constants.ACTION_OnPickUpTrigger,a.ActionEvent.CreateNew(e.pickedMesh,t)),!r.hasSwiped&&r.singleClick&&c.processTrigger(s.Constants.ACTION_OnPickTrigger,a.ActionEvent.CreateNew(e.pickedMesh,t));var u=e.pickedMesh._getActionManagerForTrigger(s.Constants.ACTION_OnDoublePickTrigger);r.doubleClick&&u&&u.processTrigger(s.Constants.ACTION_OnDoublePickTrigger,a.ActionEvent.CreateNew(e.pickedMesh,t))}}else if(!r.ignore)for(var d=0,h=i._pointerUpStage;d<h.length;d++)e=h[d].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){var f=this._pickedDownMesh._getActionManagerForTrigger(s.Constants.ACTION_OnPickOutTrigger);f&&f.processTrigger(s.Constants.ACTION_OnPickOutTrigger,a.ActionEvent.CreateNew(this._pickedDownMesh,t))}var p=0;i.onPointerObservable.hasObservers()&&(r.ignore||r.hasSwiped||(r.singleClick&&i.onPointerObservable.hasSpecificMask(n.PointerEventTypes.POINTERTAP)?p=n.PointerEventTypes.POINTERTAP:r.doubleClick&&i.onPointerObservable.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)&&(p=n.PointerEventTypes.POINTERDOUBLETAP),!p)||(l=new n.PointerInfo(p,t,e),this._setRayOnPointerInfo(l),i.onPointerObservable.notifyObservers(l,p)),r.ignore||(p=n.PointerEventTypes.POINTERUP,l=new n.PointerInfo(p,t,e),this._setRayOnPointerInfo(l),i.onPointerObservable.notifyObservers(l,p))),i.onPointerUp&&!r.ignore&&i.onPointerUp(t,e,p)},e.prototype.isPointerCaptured=function(e){return void 0===e&&(e=0),this._pointerCaptures[e]},e.prototype.attachControl=function(t,r,o,d){var h=this;void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===d&&(d=null);var f=this._scene;if(d||(d=f.getEngine().getInputElement()),d){this._alreadyAttached&&this.detachControl();var p,m=f.getEngine();this._initActionManager=function(e,t){if(!h._meshPickProceed){var r=f.pick(h._unTranslatedPointerX,h._unTranslatedPointerY,f.pointerDownPredicate,!1,f.cameraToUseForPointers);h._currentPickResult=r,r&&(e=r.hit&&r.pickedMesh?r.pickedMesh._getActionManagerForTrigger():null),h._meshPickProceed=!0}return e},this._delayedSimpleClick=function(t,r,n){(Date.now()-h._previousStartingPointerTime>e.DoubleClickDelay&&!h._doubleClickOccured||t!==h._previousButtonPressed)&&(h._doubleClickOccured=!1,r.singleClick=!0,r.ignore=!1,n(r,h._currentPickResult))},this._initClickEvent=function(t,r,o,a){var l=new u;h._currentPickResult=null;var c=null,d=t.hasSpecificMask(n.PointerEventTypes.POINTERPICK)||r.hasSpecificMask(n.PointerEventTypes.POINTERPICK)||t.hasSpecificMask(n.PointerEventTypes.POINTERTAP)||r.hasSpecificMask(n.PointerEventTypes.POINTERTAP)||t.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)||r.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP);!d&&i.AbstractActionManager&&(c=h._initActionManager(c,l))&&(d=c.hasPickTriggers);var f=!1;if(d){var p=o.button;if(l.hasSwiped=h._isPointerSwiping(),!l.hasSwiped){var m=!e.ExclusiveDoubleClickMode;m||(m=!t.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)&&!r.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP))&&!i.AbstractActionManager.HasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)&&(c=h._initActionManager(c,l))&&(m=!c.hasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)),m?(Date.now()-h._previousStartingPointerTime>e.DoubleClickDelay||p!==h._previousButtonPressed)&&(l.singleClick=!0,a(l,h._currentPickResult),f=!0):(h._previousDelayedSimpleClickTimeout=h._delayedSimpleClickTimeout,h._delayedSimpleClickTimeout=window.setTimeout(h._delayedSimpleClick.bind(h,p,l,a),e.DoubleClickDelay));var g=t.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)||r.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP);!g&&i.AbstractActionManager.HasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)&&(c=h._initActionManager(c,l))&&(g=c.hasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)),g&&(p===h._previousButtonPressed&&Date.now()-h._previousStartingPointerTime<e.DoubleClickDelay&&!h._doubleClickOccured?(l.hasSwiped||h._isPointerSwiping()?(h._doubleClickOccured=!1,h._previousStartingPointerTime=h._startingPointerTime,h._previousStartingPointerPosition.x=h._startingPointerPosition.x,h._previousStartingPointerPosition.y=h._startingPointerPosition.y,h._previousButtonPressed=p,e.ExclusiveDoubleClickMode?(h._previousDelayedSimpleClickTimeout&&clearTimeout(h._previousDelayedSimpleClickTimeout),h._previousDelayedSimpleClickTimeout=h._delayedSimpleClickTimeout,a(l,h._previousPickResult)):a(l,h._currentPickResult)):(h._previousStartingPointerTime=0,h._doubleClickOccured=!0,l.doubleClick=!0,l.ignore=!1,e.ExclusiveDoubleClickMode&&h._previousDelayedSimpleClickTimeout&&clearTimeout(h._previousDelayedSimpleClickTimeout),h._previousDelayedSimpleClickTimeout=h._delayedSimpleClickTimeout,a(l,h._currentPickResult)),f=!0):(h._doubleClickOccured=!1,h._previousStartingPointerTime=h._startingPointerTime,h._previousStartingPointerPosition.x=h._startingPointerPosition.x,h._previousStartingPointerPosition.y=h._startingPointerPosition.y,h._previousButtonPressed=p))}}f||a(l,h._currentPickResult)},this._onPointerMove=function(e){if(h._updatePointerPosition(e),!h._checkPrePointerObservable(null,e,e.type===h._wheelEventName?n.PointerEventTypes.POINTERWHEEL:n.PointerEventTypes.POINTERMOVE)&&(f.cameraToUseForPointers||f.activeCamera)){f.pointerMovePredicate||(f.pointerMovePredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(e.enablePointerMoveEvents||f.constantlyUpdateMeshUnderPointer||null!=e._getActionManagerForTrigger())&&(!f.cameraToUseForPointers||0!=(f.cameraToUseForPointers.layerMask&e.layerMask))});var t=f.pick(h._unTranslatedPointerX,h._unTranslatedPointerY,f.pointerMovePredicate,!1,f.cameraToUseForPointers);h._processPointerMove(t,e)}},this._onPointerDown=function(e){if(h._totalPointersPressed++,h._pickedDownMesh=null,h._meshPickProceed=!1,h._updatePointerPosition(e),f.preventDefaultOnPointerDown&&d&&(e.preventDefault(),d.focus()),h._startingPointerPosition.x=h._pointerX,h._startingPointerPosition.y=h._pointerY,h._startingPointerTime=Date.now(),!h._checkPrePointerObservable(null,e,n.PointerEventTypes.POINTERDOWN)&&(f.cameraToUseForPointers||f.activeCamera)){h._pointerCaptures[e.pointerId]=!0,f.pointerDownPredicate||(f.pointerDownPredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!f.cameraToUseForPointers||0!=(f.cameraToUseForPointers.layerMask&e.layerMask))}),h._pickedDownMesh=null;var t=f.pick(h._unTranslatedPointerX,h._unTranslatedPointerY,f.pointerDownPredicate,!1,f.cameraToUseForPointers);h._processPointerDown(t,e)}},this._onPointerUp=function(e){0!==h._totalPointersPressed&&(h._totalPointersPressed--,h._pickedUpMesh=null,h._meshPickProceed=!1,h._updatePointerPosition(e),f.preventDefaultOnPointerUp&&d&&(e.preventDefault(),d.focus()),h._initClickEvent(f.onPrePointerObservable,f.onPointerObservable,e,(function(t,r){if(f.onPrePointerObservable.hasObservers()&&!t.ignore){if(!t.hasSwiped){if(t.singleClick&&f.onPrePointerObservable.hasSpecificMask(n.PointerEventTypes.POINTERTAP)&&h._checkPrePointerObservable(null,e,n.PointerEventTypes.POINTERTAP))return;if(t.doubleClick&&f.onPrePointerObservable.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)&&h._checkPrePointerObservable(null,e,n.PointerEventTypes.POINTERDOUBLETAP))return}if(h._checkPrePointerObservable(null,e,n.PointerEventTypes.POINTERUP))return}h._pointerCaptures[e.pointerId]&&(h._pointerCaptures[e.pointerId]=!1,(f.cameraToUseForPointers||f.activeCamera)&&(f.pointerUpPredicate||(f.pointerUpPredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!f.cameraToUseForPointers||0!=(f.cameraToUseForPointers.layerMask&e.layerMask))}),!h._meshPickProceed&&(i.AbstractActionManager&&i.AbstractActionManager.HasTriggers||f.onPointerObservable.hasObservers())&&h._initActionManager(null,t),r||(r=h._currentPickResult),h._processPointerUp(r,e,t),h._previousPickResult=h._currentPickResult))})))},this._onKeyDown=function(e){var t=c.KeyboardEventTypes.KEYDOWN;if(f.onPreKeyboardObservable.hasObservers()){var r=new c.KeyboardInfoPre(t,e);if(f.onPreKeyboardObservable.notifyObservers(r,t),r.skipOnPointerObservable)return}f.onKeyboardObservable.hasObservers()&&(r=new c.KeyboardInfo(t,e),f.onKeyboardObservable.notifyObservers(r,t)),f.actionManager&&f.actionManager.processTrigger(s.Constants.ACTION_OnKeyDownTrigger,a.ActionEvent.CreateNewFromScene(f,e))},this._onKeyUp=function(e){var t=c.KeyboardEventTypes.KEYUP;if(f.onPreKeyboardObservable.hasObservers()){var r=new c.KeyboardInfoPre(t,e);if(f.onPreKeyboardObservable.notifyObservers(r,t),r.skipOnPointerObservable)return}f.onKeyboardObservable.hasObservers()&&(r=new c.KeyboardInfo(t,e),f.onKeyboardObservable.notifyObservers(r,t)),f.actionManager&&f.actionManager.processTrigger(s.Constants.ACTION_OnKeyUpTrigger,a.ActionEvent.CreateNewFromScene(f,e))},this._onCanvasFocusObserver=m.onCanvasFocusObservable.add((p=function(){d&&(d.addEventListener("keydown",h._onKeyDown,!1),d.addEventListener("keyup",h._onKeyUp,!1))},document.activeElement===d&&p(),p)),this._onCanvasBlurObserver=m.onCanvasBlurObservable.add((function(){d&&(d.removeEventListener("keydown",h._onKeyDown),d.removeEventListener("keyup",h._onKeyUp))}));var g=l.Tools.GetPointerPrefix(m);if(o&&(d.addEventListener(g+"move",this._onPointerMove,!1),this._wheelEventName="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",d.addEventListener(this._wheelEventName,this._onPointerMove,!1)),r&&d.addEventListener(g+"down",this._onPointerDown,!1),t){var _=f.getEngine().getHostWindow();_&&_.addEventListener(g+"up",this._onPointerUp,!1)}this._alreadyAttached=!0}},e.prototype.detachControl=function(){var e=this._scene.getEngine().getInputElement(),t=this._scene.getEngine(),r=l.Tools.GetPointerPrefix(t);e&&this._alreadyAttached&&(e.removeEventListener(r+"move",this._onPointerMove),e.removeEventListener(this._wheelEventName,this._onPointerMove),e.removeEventListener(r+"down",this._onPointerDown),window.removeEventListener(r+"up",this._onPointerUp),this._onCanvasBlurObserver&&t.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onCanvasFocusObserver&&t.onCanvasFocusObservable.remove(this._onCanvasFocusObserver),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("keyup",this._onKeyUp),this._scene.doNotHandleCursors||(e.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1)},e.prototype.setPointerOverMesh=function(e){var t;this._pointerOverMesh!==e&&(this._pointerOverMesh&&(t=this._pointerOverMesh._getActionManagerForTrigger(s.Constants.ACTION_OnPointerOutTrigger))&&t.processTrigger(s.Constants.ACTION_OnPointerOutTrigger,a.ActionEvent.CreateNew(this._pointerOverMesh)),this._pointerOverMesh=e,this._pointerOverMesh&&(t=this._pointerOverMesh._getActionManagerForTrigger(s.Constants.ACTION_OnPointerOverTrigger))&&t.processTrigger(s.Constants.ACTION_OnPointerOverTrigger,a.ActionEvent.CreateNew(this._pointerOverMesh)))},e.prototype.getPointerOverMesh=function(){return this._pointerOverMesh},e.DragMovementThreshold=10,e.LongPressDelay=500,e.DoubleClickDelay=300,e.ExclusiveDoubleClickMode=!1,e}()},"./Instrumentation/engineInstrumentation.ts":
- /*!**************************************************!*\
- !*** ./Instrumentation/engineInstrumentation.ts ***!
- \**************************************************/
- /*! exports provided: EngineInstrumentation */function(e,t,r){"use strict";r.r(t),r.d(t,"EngineInstrumentation",(function(){return i}));var n=r(/*! ../Misc/perfCounter */"./Misc/perfCounter.ts"),i=function(){function e(e){this.engine=e,this._captureGPUFrameTime=!1,this._gpuFrameTime=new n.PerfCounter,this._captureShaderCompilationTime=!1,this._shaderCompilationTime=new n.PerfCounter,this._onBeginFrameObserver=null,this._onEndFrameObserver=null,this._onBeforeShaderCompilationObserver=null,this._onAfterShaderCompilationObserver=null}return Object.defineProperty(e.prototype,"gpuFrameTimeCounter",{get:function(){return this._gpuFrameTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureGPUFrameTime",{get:function(){return this._captureGPUFrameTime},set:function(e){var t=this;e!==this._captureGPUFrameTime&&(this._captureGPUFrameTime=e,e?(this._onBeginFrameObserver=this.engine.onBeginFrameObservable.add((function(){t._gpuFrameTimeToken||(t._gpuFrameTimeToken=t.engine.startTimeQuery())})),this._onEndFrameObserver=this.engine.onEndFrameObservable.add((function(){if(t._gpuFrameTimeToken){var e=t.engine.endTimeQuery(t._gpuFrameTimeToken);e>-1&&(t._gpuFrameTimeToken=null,t._gpuFrameTime.fetchNewFrame(),t._gpuFrameTime.addCount(e,!0))}}))):(this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shaderCompilationTimeCounter",{get:function(){return this._shaderCompilationTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureShaderCompilationTime",{get:function(){return this._captureShaderCompilationTime},set:function(e){var t=this;e!==this._captureShaderCompilationTime&&(this._captureShaderCompilationTime=e,e?(this._onBeforeShaderCompilationObserver=this.engine.onBeforeShaderCompilationObservable.add((function(){t._shaderCompilationTime.fetchNewFrame(),t._shaderCompilationTime.beginMonitoring()})),this._onAfterShaderCompilationObserver=this.engine.onAfterShaderCompilationObservable.add((function(){t._shaderCompilationTime.endMonitoring()}))):(this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null))},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null,this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null,this.engine=null},e}()},"./Instrumentation/index.ts":
- /*!**********************************!*\
- !*** ./Instrumentation/index.ts ***!
- \**********************************/
- /*! exports provided: EngineInstrumentation, SceneInstrumentation, _TimeToken */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./engineInstrumentation */"./Instrumentation/engineInstrumentation.ts");r.d(t,"EngineInstrumentation",(function(){return n.EngineInstrumentation}));var i=r(/*! ./sceneInstrumentation */"./Instrumentation/sceneInstrumentation.ts");r.d(t,"SceneInstrumentation",(function(){return i.SceneInstrumentation}));var o=r(/*! ./timeToken */"./Instrumentation/timeToken.ts");r.d(t,"_TimeToken",(function(){return o._TimeToken}))},"./Instrumentation/sceneInstrumentation.ts":
- /*!*************************************************!*\
- !*** ./Instrumentation/sceneInstrumentation.ts ***!
- \*************************************************/
- /*! exports provided: SceneInstrumentation */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneInstrumentation",(function(){return o}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/perfCounter */"./Misc/perfCounter.ts"),o=function(){function e(e){var t=this;this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new i.PerfCounter,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new i.PerfCounter,this._captureFrameTime=!1,this._frameTime=new i.PerfCounter,this._captureRenderTime=!1,this._renderTime=new i.PerfCounter,this._captureInterFrameTime=!1,this._interFrameTime=new i.PerfCounter,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new i.PerfCounter,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new i.PerfCounter,this._capturePhysicsTime=!1,this._physicsTime=new i.PerfCounter,this._captureAnimationsTime=!1,this._animationsTime=new i.PerfCounter,this._captureCameraRenderTime=!1,this._cameraRenderTime=new i.PerfCounter,this._onBeforeActiveMeshesEvaluationObserver=null,this._onAfterActiveMeshesEvaluationObserver=null,this._onBeforeRenderTargetsRenderObserver=null,this._onAfterRenderTargetsRenderObserver=null,this._onAfterRenderObserver=null,this._onBeforeDrawPhaseObserver=null,this._onAfterDrawPhaseObserver=null,this._onBeforeAnimationsObserver=null,this._onBeforeParticlesRenderingObserver=null,this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver=null,this._onAfterSpritesRenderingObserver=null,this._onBeforePhysicsObserver=null,this._onAfterPhysicsObserver=null,this._onAfterAnimationsObserver=null,this._onBeforeCameraRenderObserver=null,this._onAfterCameraRenderObserver=null,this._onBeforeAnimationsObserver=e.onBeforeAnimationsObservable.add((function(){t._captureActiveMeshesEvaluationTime&&t._activeMeshesEvaluationTime.fetchNewFrame(),t._captureRenderTargetsRenderTime&&t._renderTargetsRenderTime.fetchNewFrame(),t._captureFrameTime&&(n.Tools.StartPerformanceCounter("Scene rendering"),t._frameTime.beginMonitoring()),t._captureInterFrameTime&&t._interFrameTime.endMonitoring(),t._captureParticlesRenderTime&&t._particlesRenderTime.fetchNewFrame(),t._captureSpritesRenderTime&&t._spritesRenderTime.fetchNewFrame(),t._captureAnimationsTime&&t._animationsTime.beginMonitoring(),t.scene.getEngine()._drawCalls.fetchNewFrame()})),this._onAfterRenderObserver=e.onAfterRenderObservable.add((function(){t._captureFrameTime&&(n.Tools.EndPerformanceCounter("Scene rendering"),t._frameTime.endMonitoring()),t._captureRenderTime&&t._renderTime.endMonitoring(!1),t._captureInterFrameTime&&t._interFrameTime.beginMonitoring()}))}return Object.defineProperty(e.prototype,"activeMeshesEvaluationTimeCounter",{get:function(){return this._activeMeshesEvaluationTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureActiveMeshesEvaluationTime",{get:function(){return this._captureActiveMeshesEvaluationTime},set:function(e){var t=this;e!==this._captureActiveMeshesEvaluationTime&&(this._captureActiveMeshesEvaluationTime=e,e?(this._onBeforeActiveMeshesEvaluationObserver=this.scene.onBeforeActiveMeshesEvaluationObservable.add((function(){n.Tools.StartPerformanceCounter("Active meshes evaluation"),t._activeMeshesEvaluationTime.beginMonitoring()})),this._onAfterActiveMeshesEvaluationObserver=this.scene.onAfterActiveMeshesEvaluationObservable.add((function(){n.Tools.EndPerformanceCounter("Active meshes evaluation"),t._activeMeshesEvaluationTime.endMonitoring()}))):(this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderTargetsRenderTimeCounter",{get:function(){return this._renderTargetsRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureRenderTargetsRenderTime",{get:function(){return this._captureRenderTargetsRenderTime},set:function(e){var t=this;e!==this._captureRenderTargetsRenderTime&&(this._captureRenderTargetsRenderTime=e,e?(this._onBeforeRenderTargetsRenderObserver=this.scene.onBeforeRenderTargetsRenderObservable.add((function(){n.Tools.StartPerformanceCounter("Render targets rendering"),t._renderTargetsRenderTime.beginMonitoring()})),this._onAfterRenderTargetsRenderObserver=this.scene.onAfterRenderTargetsRenderObservable.add((function(){n.Tools.EndPerformanceCounter("Render targets rendering"),t._renderTargetsRenderTime.endMonitoring(!1)}))):(this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"particlesRenderTimeCounter",{get:function(){return this._particlesRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureParticlesRenderTime",{get:function(){return this._captureParticlesRenderTime},set:function(e){var t=this;e!==this._captureParticlesRenderTime&&(this._captureParticlesRenderTime=e,e?(this._onBeforeParticlesRenderingObserver=this.scene.onBeforeParticlesRenderingObservable.add((function(){n.Tools.StartPerformanceCounter("Particles"),t._particlesRenderTime.beginMonitoring()})),this._onAfterParticlesRenderingObserver=this.scene.onAfterParticlesRenderingObservable.add((function(){n.Tools.EndPerformanceCounter("Particles"),t._particlesRenderTime.endMonitoring(!1)}))):(this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spritesRenderTimeCounter",{get:function(){return this._spritesRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureSpritesRenderTime",{get:function(){return this._captureSpritesRenderTime},set:function(e){var t=this;e!==this._captureSpritesRenderTime&&(this._captureSpritesRenderTime=e,this.scene.spriteManagers&&(e?(this._onBeforeSpritesRenderingObserver=this.scene.onBeforeSpritesRenderingObservable.add((function(){n.Tools.StartPerformanceCounter("Sprites"),t._spritesRenderTime.beginMonitoring()})),this._onAfterSpritesRenderingObserver=this.scene.onAfterSpritesRenderingObservable.add((function(){n.Tools.EndPerformanceCounter("Sprites"),t._spritesRenderTime.endMonitoring(!1)}))):(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null,this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"physicsTimeCounter",{get:function(){return this._physicsTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capturePhysicsTime",{get:function(){return this._capturePhysicsTime},set:function(e){var t=this;e!==this._capturePhysicsTime&&this.scene.onBeforePhysicsObservable&&(this._capturePhysicsTime=e,e?(this._onBeforePhysicsObserver=this.scene.onBeforePhysicsObservable.add((function(){n.Tools.StartPerformanceCounter("Physics"),t._physicsTime.beginMonitoring()})),this._onAfterPhysicsObserver=this.scene.onAfterPhysicsObservable.add((function(){n.Tools.EndPerformanceCounter("Physics"),t._physicsTime.endMonitoring()}))):(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null,this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationsTimeCounter",{get:function(){return this._animationsTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureAnimationsTime",{get:function(){return this._captureAnimationsTime},set:function(e){var t=this;e!==this._captureAnimationsTime&&(this._captureAnimationsTime=e,e?this._onAfterAnimationsObserver=this.scene.onAfterAnimationsObservable.add((function(){t._animationsTime.endMonitoring()})):(this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameTimeCounter",{get:function(){return this._frameTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureFrameTime",{get:function(){return this._captureFrameTime},set:function(e){this._captureFrameTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"interFrameTimeCounter",{get:function(){return this._interFrameTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureInterFrameTime",{get:function(){return this._captureInterFrameTime},set:function(e){this._captureInterFrameTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureRenderTime",{get:function(){return this._captureRenderTime},set:function(e){var t=this;e!==this._captureRenderTime&&(this._captureRenderTime=e,e?(this._onBeforeDrawPhaseObserver=this.scene.onBeforeDrawPhaseObservable.add((function(){t._renderTime.beginMonitoring(),n.Tools.StartPerformanceCounter("Main render")})),this._onAfterDrawPhaseObserver=this.scene.onAfterDrawPhaseObservable.add((function(){t._renderTime.endMonitoring(!1),n.Tools.EndPerformanceCounter("Main render")}))):(this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cameraRenderTimeCounter",{get:function(){return this._cameraRenderTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"captureCameraRenderTime",{get:function(){return this._captureCameraRenderTime},set:function(e){var t=this;e!==this._captureCameraRenderTime&&(this._captureCameraRenderTime=e,e?(this._onBeforeCameraRenderObserver=this.scene.onBeforeCameraRenderObservable.add((function(e){t._cameraRenderTime.beginMonitoring(),n.Tools.StartPerformanceCounter("Rendering camera "+e.name)})),this._onAfterCameraRenderObserver=this.scene.onAfterCameraRenderObservable.add((function(e){t._cameraRenderTime.endMonitoring(!1),n.Tools.EndPerformanceCounter("Rendering camera "+e.name)}))):(this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCallsCounter",{get:function(){return this.scene.getEngine()._drawCalls},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=null,this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null,this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null,this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver&&(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null),this._onAfterSpritesRenderingObserver&&(this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null),this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null,this._onBeforePhysicsObserver&&(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null),this._onAfterPhysicsObserver&&(this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null),this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null,this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null,this.scene=null},e}()},"./Instrumentation/timeToken.ts":
- /*!**************************************!*\
- !*** ./Instrumentation/timeToken.ts ***!
- \**************************************/
- /*! exports provided: _TimeToken */function(e,t,r){"use strict";r.r(t),r.d(t,"_TimeToken",(function(){return n}));var n=function(){this._timeElapsedQueryEnded=!1}},"./Layers/effectLayer.ts":
- /*!*******************************!*\
- !*** ./Layers/effectLayer.ts ***!
- \*******************************/
- /*! exports provided: EffectLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectLayer",(function(){return v}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Engines/engine */"./Engines/engine.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),d=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),h=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),f=r(/*! ../Materials/material */"./Materials/material.ts"),p=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),m=r(/*! ../Engines/constants */"./Engines/constants.ts"),g=(r(/*! ../Shaders/glowMapGeneration.fragment */"./Shaders/glowMapGeneration.fragment.ts"),r(/*! ../Shaders/glowMapGeneration.vertex */"./Shaders/glowMapGeneration.vertex.ts"),r(/*! ../Misc/devTools */"./Misc/devTools.ts")),_=r(/*! ../Materials/effectFallbacks */"./Materials/effectFallbacks.ts"),v=function(){function e(t,r){this._vertexBuffers={},this._maxSize=0,this._mainTextureDesiredSize={width:0,height:0},this._shouldRender=!0,this._postProcesses=[],this._textures=[],this._emissiveTextureAndColor={texture:null,color:new a.Color4},this.neutralColor=new a.Color4,this.isEnabled=!0,this.onDisposeObservable=new s.Observable,this.onBeforeRenderMainTextureObservable=new s.Observable,this.onBeforeComposeObservable=new s.Observable,this.onBeforeRenderMeshToEffect=new s.Observable,this.onAfterRenderMeshToEffect=new s.Observable,this.onAfterComposeObservable=new s.Observable,this.onSizeChangedObservable=new s.Observable,this.name=t,this._scene=r||c.EngineStore.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._engine=this._scene.getEngine(),this._maxSize=this._engine.getCaps().maxTextureSize,this._scene.effectLayers.push(this),this._generateIndexBuffer(),this._generateVertexBuffer()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._effectLayerOptions.camera},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._effectLayerOptions.renderingGroupId},set:function(e){this._effectLayerOptions.renderingGroupId=e},enumerable:!1,configurable:!0}),e.prototype._init=function(e){this._effectLayerOptions=Object(n.__assign)({mainTextureRatio:.5,alphaBlendingMode:m.Constants.ALPHA_COMBINE,camera:null,renderingGroupId:-1},e),this._setMainTextureSize(),this._createMainTexture(),this._createTextureAndPostProcesses(),this._mergeEffect=this._createMergeEffect()},e.prototype._generateIndexBuffer=function(){var e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._engine.createIndexBuffer(e)},e.prototype._generateVertexBuffer=function(){var e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1);var t=new u.VertexBuffer(this._engine,e,u.VertexBuffer.PositionKind,!1,!1,2);this._vertexBuffers[u.VertexBuffer.PositionKind]=t},e.prototype._setMainTextureSize=function(){this._effectLayerOptions.mainTextureFixedSize?(this._mainTextureDesiredSize.width=this._effectLayerOptions.mainTextureFixedSize,this._mainTextureDesiredSize.height=this._effectLayerOptions.mainTextureFixedSize):(this._mainTextureDesiredSize.width=this._engine.getRenderWidth()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.height=this._engine.getRenderHeight()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.width=this._engine.needPOTTextures?l.Engine.GetExponentOfTwo(this._mainTextureDesiredSize.width,this._maxSize):this._mainTextureDesiredSize.width,this._mainTextureDesiredSize.height=this._engine.needPOTTextures?l.Engine.GetExponentOfTwo(this._mainTextureDesiredSize.height,this._maxSize):this._mainTextureDesiredSize.height),this._mainTextureDesiredSize.width=Math.floor(this._mainTextureDesiredSize.width),this._mainTextureDesiredSize.height=Math.floor(this._mainTextureDesiredSize.height)},e.prototype._createMainTexture=function(){var e=this;this._mainTexture=new h.RenderTargetTexture("HighlightLayerMainRTT",{width:this._mainTextureDesiredSize.width,height:this._mainTextureDesiredSize.height},this._scene,!1,!0,m.Constants.TEXTURETYPE_UNSIGNED_INT),this._mainTexture.activeCamera=this._effectLayerOptions.camera,this._mainTexture.wrapU=d.Texture.CLAMP_ADDRESSMODE,this._mainTexture.wrapV=d.Texture.CLAMP_ADDRESSMODE,this._mainTexture.anisotropicFilteringLevel=1,this._mainTexture.updateSamplingMode(d.Texture.BILINEAR_SAMPLINGMODE),this._mainTexture.renderParticles=!1,this._mainTexture.renderList=null,this._mainTexture.ignoreCameraViewport=!0,this._mainTexture.customRenderFunction=function(t,r,n,i){var o;e.onBeforeRenderMainTextureObservable.notifyObservers(e);var s=e._scene.getEngine();if(i.length){for(s.setColorWrite(!1),o=0;o<i.length;o++)e._renderSubMesh(i.data[o]);s.setColorWrite(!0)}for(o=0;o<t.length;o++)e._renderSubMesh(t.data[o]);for(o=0;o<r.length;o++)e._renderSubMesh(r.data[o]);var a=s.getAlphaMode();for(o=0;o<n.length;o++)e._renderSubMesh(n.data[o],!0);s.setAlphaMode(a)},this._mainTexture.onClearObservable.add((function(t){t.clear(e.neutralColor,!0,!0,!0)}))},e.prototype._addCustomEffectDefines=function(e){},e.prototype._isReady=function(e,t,r){var n=e.getMaterial();if(!n)return!1;if(!n.isReadyForSubMesh(e.getMesh(),e,t))return!1;var i=[],o=[u.VertexBuffer.PositionKind],s=e.getMesh(),a=!1,l=!1;if(n){var c=n.needAlphaTesting(),d=n.getAlphaTestTexture(),h=d&&d.hasAlpha&&(n.useAlphaFromDiffuseTexture||n._useAlphaFromAlbedoTexture);d&&(c||h)&&(i.push("#define DIFFUSE"),s.isVerticesDataPresent(u.VertexBuffer.UV2Kind)&&1===d.coordinatesIndex?(i.push("#define DIFFUSEUV2"),l=!0):s.isVerticesDataPresent(u.VertexBuffer.UVKind)&&(i.push("#define DIFFUSEUV1"),a=!0),c&&(i.push("#define ALPHATEST"),i.push("#define ALPHATESTVALUE 0.4")));var f=n.opacityTexture;f&&(i.push("#define OPACITY"),s.isVerticesDataPresent(u.VertexBuffer.UV2Kind)&&1===f.coordinatesIndex?(i.push("#define OPACITYUV2"),l=!0):s.isVerticesDataPresent(u.VertexBuffer.UVKind)&&(i.push("#define OPACITYUV1"),a=!0))}r&&(i.push("#define EMISSIVE"),s.isVerticesDataPresent(u.VertexBuffer.UV2Kind)&&1===r.coordinatesIndex?(i.push("#define EMISSIVEUV2"),l=!0):s.isVerticesDataPresent(u.VertexBuffer.UVKind)&&(i.push("#define EMISSIVEUV1"),a=!0)),s.isVerticesDataPresent(u.VertexBuffer.ColorKind)&&s.hasVertexAlpha&&(o.push(u.VertexBuffer.ColorKind),i.push("#define VERTEXALPHA")),a&&(o.push(u.VertexBuffer.UVKind),i.push("#define UV1")),l&&(o.push(u.VertexBuffer.UV2Kind),i.push("#define UV2"));var m=new _.EffectFallbacks;if(s.useBones&&s.computeBonesUsingShaders){o.push(u.VertexBuffer.MatricesIndicesKind),o.push(u.VertexBuffer.MatricesWeightsKind),s.numBoneInfluencers>4&&(o.push(u.VertexBuffer.MatricesIndicesExtraKind),o.push(u.VertexBuffer.MatricesWeightsExtraKind)),i.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers);var g=s.skeleton;g&&g.isUsingTextureForMatrices?i.push("#define BONETEXTURE"):i.push("#define BonesPerMesh "+(g?g.bones.length+1:0)),s.numBoneInfluencers>0&&m.addCPUSkinningFallback(0,s)}else i.push("#define NUM_BONE_INFLUENCERS 0");var v=s.morphTargetManager,y=0;v&&v.numInfluencers>0&&(i.push("#define MORPHTARGETS"),y=v.numInfluencers,i.push("#define NUM_MORPH_INFLUENCERS "+y),p.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(o,s,y)),t&&(i.push("#define INSTANCES"),p.MaterialHelper.PushAttributesForInstances(o),e.getRenderingMesh().hasThinInstances&&i.push("#define THIN_INSTANCES")),this._addCustomEffectDefines(i);var b=i.join("\n");return this._cachedDefines!==b&&(this._cachedDefines=b,this._effectLayerMapGenerationEffect=this._scene.getEngine().createEffect("glowMapGeneration",o,["world","mBones","viewProjection","glowColor","morphTargetInfluences","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity"],["diffuseSampler","emissiveSampler","opacitySampler","boneSampler"],b,m,void 0,void 0,{maxSimultaneousMorphTargets:y})),this._effectLayerMapGenerationEffect.isReady()},e.prototype.render=function(){var e=this._mergeEffect;if(e.isReady()){for(var t=0;t<this._postProcesses.length;t++)if(!this._postProcesses[t].isReady())return;var r=this._scene.getEngine();this.onBeforeComposeObservable.notifyObservers(this),r.enableEffect(e),r.setState(!1),r.bindBuffers(this._vertexBuffers,this._indexBuffer,e);var n=r.getAlphaMode();r.setAlphaMode(this._effectLayerOptions.alphaBlendingMode),this._internalRender(e),r.setAlphaMode(n),this.onAfterComposeObservable.notifyObservers(this);var i=this._mainTexture.getSize();this._setMainTextureSize(),i.width===this._mainTextureDesiredSize.width&&i.height===this._mainTextureDesiredSize.height||(this.onSizeChangedObservable.notifyObservers(this),this._disposeTextureAndPostProcesses(),this._createMainTexture(),this._createTextureAndPostProcesses())}},e.prototype.hasMesh=function(e){return-1===this.renderingGroupId||e.renderingGroupId===this.renderingGroupId},e.prototype.shouldRender=function(){return this.isEnabled&&this._shouldRender},e.prototype._shouldRenderMesh=function(e){return!0},e.prototype._canRenderMesh=function(e,t){return!t.needAlphaBlendingForMesh(e)},e.prototype._shouldRenderEmissiveTextureForMesh=function(){return!0},e.prototype._renderSubMesh=function(e,t){var r,n=this;if(void 0===t&&(t=!1),this.shouldRender()){var i=e.getMaterial(),o=e.getMesh(),s=e.getReplacementMesh(),a=e.getRenderingMesh(),l=e.getEffectiveMesh(),c=this._scene,u=c.getEngine();if(l._internalAbstractMeshDataInfo._isActiveIntermediate=!1,i&&this._canRenderMesh(a,i)){var d=null!==(r=a.overrideMaterialSideOrientation)&&void 0!==r?r:i.sideOrientation;a._getWorldMatrixDeterminant()<0&&(d=d===f.Material.ClockWiseSideOrientation?f.Material.CounterClockWiseSideOrientation:f.Material.ClockWiseSideOrientation);var h=d===f.Material.ClockWiseSideOrientation;u.setState(i.backFaceCulling,i.zOffset,void 0,h);var m=a._getInstancesRenderList(e._id,!!s);if(!m.mustReturn&&this._shouldRenderMesh(a)){var g=m.hardwareInstancedRendering[e._id]||a.hasThinInstances;if(this._setEmissiveTextureAndColor(a,e,i),this.onBeforeRenderMeshToEffect.notifyObservers(o),this._useMeshMaterial(a))a.render(e,g,s||void 0);else if(this._isReady(e,g,this._emissiveTextureAndColor.texture)){u.enableEffect(this._effectLayerMapGenerationEffect),a._bind(e,this._effectLayerMapGenerationEffect,f.Material.TriangleFillMode),this._effectLayerMapGenerationEffect.setMatrix("viewProjection",c.getTransformMatrix()),this._effectLayerMapGenerationEffect.setFloat4("glowColor",this._emissiveTextureAndColor.color.r,this._emissiveTextureAndColor.color.g,this._emissiveTextureAndColor.color.b,this._emissiveTextureAndColor.color.a);var _=i.needAlphaTesting(),v=i.getAlphaTestTexture(),y=v&&v.hasAlpha&&(i.useAlphaFromDiffuseTexture||i._useAlphaFromAlbedoTexture);v&&(_||y)&&(this._effectLayerMapGenerationEffect.setTexture("diffuseSampler",v),(b=v.getTextureMatrix())&&this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix",b));var b,A=i.opacityTexture;if(A&&(this._effectLayerMapGenerationEffect.setTexture("opacitySampler",A),this._effectLayerMapGenerationEffect.setFloat("opacityIntensity",A.level),(b=A.getTextureMatrix())&&this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix",b)),this._emissiveTextureAndColor.texture&&(this._effectLayerMapGenerationEffect.setTexture("emissiveSampler",this._emissiveTextureAndColor.texture),this._effectLayerMapGenerationEffect.setMatrix("emissiveMatrix",this._emissiveTextureAndColor.texture.getTextureMatrix())),a.useBones&&a.computeBonesUsingShaders&&a.skeleton){var T=a.skeleton;if(T.isUsingTextureForMatrices){var M=T.getTransformMatrixTexture(a);if(!M)return;this._effectLayerMapGenerationEffect.setTexture("boneSampler",M),this._effectLayerMapGenerationEffect.setFloat("boneTextureWidth",4*(T.bones.length+1))}else this._effectLayerMapGenerationEffect.setMatrices("mBones",T.getTransformMatrices(a))}p.MaterialHelper.BindMorphTargetParameters(a,this._effectLayerMapGenerationEffect),t&&u.setAlphaMode(i.alphaMode),a._processRendering(l,e,this._effectLayerMapGenerationEffect,i.fillMode,m,g,(function(e,t){return n._effectLayerMapGenerationEffect.setMatrix("world",t)}))}else this._mainTexture.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(o)}}}},e.prototype._useMeshMaterial=function(e){return!1},e.prototype._rebuild=function(){var e=this._vertexBuffers[u.VertexBuffer.PositionKind];e&&e._rebuild(),this._generateIndexBuffer()},e.prototype._disposeTextureAndPostProcesses=function(){this._mainTexture.dispose();for(var e=0;e<this._postProcesses.length;e++)this._postProcesses[e]&&this._postProcesses[e].dispose();for(this._postProcesses=[],e=0;e<this._textures.length;e++)this._textures[e]&&this._textures[e].dispose();this._textures=[]},e.prototype.dispose=function(){var e=this._vertexBuffers[u.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[u.VertexBuffer.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._disposeTextureAndPostProcesses();var t=this._scene.effectLayers.indexOf(this,0);t>-1&&this._scene.effectLayers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderMainTextureObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()},e.prototype.getClassName=function(){return"EffectLayer"},e.Parse=function(e,t,r){return o.Tools.Instantiate(e.customType).Parse(e,t,r)},e._SceneComponentInitialization=function(e){throw g._DevTools.WarnImport("EffectLayerSceneComponent")},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"name",void 0),Object(n.__decorate)([Object(i.serializeAsColor4)()],e.prototype,"neutralColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serializeAsCameraReference)()],e.prototype,"camera",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"renderingGroupId",null),e}()},"./Layers/effectLayerSceneComponent.ts":
- /*!*********************************************!*\
- !*** ./Layers/effectLayerSceneComponent.ts ***!
- \*********************************************/
- /*! exports provided: EffectLayerSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectLayerSceneComponent",(function(){return a}));var n=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),i=r(/*! ../sceneComponent */"./sceneComponent.ts"),o=r(/*! ./effectLayer */"./Layers/effectLayer.ts"),s=r(/*! ../abstractScene */"./abstractScene.ts");s.AbstractScene.AddParser(i.SceneComponentConstants.NAME_EFFECTLAYER,(function(e,t,r,n){if(e.effectLayers){r.effectLayers||(r.effectLayers=new Array);for(var i=0;i<e.effectLayers.length;i++){var s=o.EffectLayer.Parse(e.effectLayers[i],t,n);r.effectLayers.push(s)}}})),s.AbstractScene.prototype.removeEffectLayer=function(e){var t=this.effectLayers.indexOf(e);return-1!==t&&this.effectLayers.splice(t,1),t},s.AbstractScene.prototype.addEffectLayer=function(e){this.effectLayers.push(e)};var a=function(){function e(e){this.name=i.SceneComponentConstants.NAME_EFFECTLAYER,this._renderEffects=!1,this._needStencil=!1,this._previousStencilState=!1,this.scene=e,this._engine=e.getEngine(),e.effectLayers=new Array}return e.prototype.register=function(){this.scene._isReadyForMeshStage.registerStep(i.SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER,this,this._isReadyForMesh),this.scene._cameraDrawRenderTargetStage.registerStep(i.SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER,this,this._renderMainTexture),this.scene._beforeCameraDrawStage.registerStep(i.SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER,this,this._setStencil),this.scene._afterRenderingGroupDrawStage.registerStep(i.SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW,this,this._drawRenderingGroup),this.scene._afterCameraDrawStage.registerStep(i.SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER,this,this._setStencilBack),this.scene._afterCameraDrawStage.registerStep(i.SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW,this,this._drawCamera)},e.prototype.rebuild=function(){for(var e=0,t=this.scene.effectLayers;e<t.length;e++)t[e]._rebuild()},e.prototype.serialize=function(e){e.effectLayers=[];for(var t=0,r=this.scene.effectLayers;t<r.length;t++){var n=r[t];n.serialize&&e.effectLayers.push(n.serialize())}},e.prototype.addFromContainer=function(e){var t=this;e.effectLayers&&e.effectLayers.forEach((function(e){t.scene.addEffectLayer(e)}))},e.prototype.removeFromContainer=function(e,t){var r=this;e.effectLayers&&e.effectLayers.forEach((function(e){r.scene.removeEffectLayer(e),t&&e.dispose()}))},e.prototype.dispose=function(){for(var e=this.scene.effectLayers;e.length;)e[0].dispose()},e.prototype._isReadyForMesh=function(e,t){for(var r=0,n=this.scene.effectLayers;r<n.length;r++){var i=n[r];if(i.hasMesh(e))for(var o=0,s=e.subMeshes;o<s.length;o++){var a=s[o];if(!i.isReady(a,t))return!1}}return!0},e.prototype._renderMainTexture=function(e){this._renderEffects=!1,this._needStencil=!1;var t=!1,r=this.scene.effectLayers;if(r&&r.length>0){this._previousStencilState=this._engine.getStencilBuffer();for(var i=0,o=r;i<o.length;i++){var s=o[i];if(s.shouldRender()&&(!s.camera||s.camera.cameraRigMode===n.Camera.RIG_MODE_NONE&&e===s.camera||s.camera.cameraRigMode!==n.Camera.RIG_MODE_NONE&&s.camera._rigCameras.indexOf(e)>-1)){this._renderEffects=!0,this._needStencil=this._needStencil||s.needStencil();var a=s._mainTexture;a._shouldRender()&&(this.scene.incrementRenderId(),a.render(!1,!1),t=!0)}}this.scene.incrementRenderId()}return t},e.prototype._setStencil=function(){this._needStencil&&this._engine.setStencilBuffer(!0)},e.prototype._setStencilBack=function(){this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)},e.prototype._draw=function(e){if(this._renderEffects){this._engine.setDepthBuffer(!1);for(var t=this.scene.effectLayers,r=0;r<t.length;r++){var n=t[r];n.renderingGroupId===e&&n.shouldRender()&&n.render()}this._engine.setDepthBuffer(!0)}},e.prototype._drawCamera=function(){this._renderEffects&&this._draw(-1)},e.prototype._drawRenderingGroup=function(e){!this.scene._isInIntermediateRendering()&&this._renderEffects&&this._draw(e)},e}();o.EffectLayer._SceneComponentInitialization=function(e){var t=e._getComponent(i.SceneComponentConstants.NAME_EFFECTLAYER);t||(t=new a(e),e._addComponent(t))}},"./Layers/glowLayer.ts":
- /*!*****************************!*\
- !*** ./Layers/glowLayer.ts ***!
- \*****************************/
- /*! exports provided: GlowLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"GlowLayer",(function(){return _}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),c=r(/*! ../Materials/material */"./Materials/material.ts"),u=r(/*! ../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),d=r(/*! ./effectLayer */"./Layers/effectLayer.ts"),h=r(/*! ../abstractScene */"./abstractScene.ts"),f=r(/*! ../Engines/constants */"./Engines/constants.ts"),p=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),m=r(/*! ../Engines/engine */"./Engines/engine.ts"),g=r(/*! ../Maths/math.color */"./Maths/math.color.ts");r(/*! ../Shaders/glowMapMerge.fragment */"./Shaders/glowMapMerge.fragment.ts"),r(/*! ../Shaders/glowMapMerge.vertex */"./Shaders/glowMapMerge.vertex.ts"),r(/*! ../Layers/effectLayerSceneComponent */"./Layers/effectLayerSceneComponent.ts"),h.AbstractScene.prototype.getGlowLayerByName=function(e){for(var t=0;t<this.effectLayers.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===_.EffectName)return this.effectLayers[t];return null};var _=function(e){function t(r,i,o){var s=e.call(this,r,i)||this;return s._intensity=1,s._includedOnlyMeshes=[],s._excludedMeshes=[],s._meshesUsingTheirOwnMaterials=[],s.neutralColor=new g.Color4(0,0,0,1),s._options=Object(n.__assign)({mainTextureRatio:t.DefaultTextureRatio,blurKernelSize:32,mainTextureFixedSize:void 0,camera:null,mainTextureSamples:1,renderingGroupId:-1},o),s._init({alphaBlendingMode:f.Constants.ALPHA_ADD,camera:s._options.camera,mainTextureFixedSize:s._options.mainTextureFixedSize,mainTextureRatio:s._options.mainTextureRatio,renderingGroupId:s._options.renderingGroupId}),s}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"blurKernelSize",{get:function(){return this._horizontalBlurPostprocess1.kernel},set:function(e){this._horizontalBlurPostprocess1.kernel=e,this._verticalBlurPostprocess1.kernel=e,this._horizontalBlurPostprocess2.kernel=e,this._verticalBlurPostprocess2.kernel=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensity",{get:function(){return this._intensity},set:function(e){this._intensity=e},enumerable:!1,configurable:!0}),t.prototype.getEffectName=function(){return t.EffectName},t.prototype._createMergeEffect=function(){return this._engine.createEffect("glowMapMerge",[s.VertexBuffer.PositionKind],["offset"],["textureSampler","textureSampler2"],"#define EMISSIVE \n")},t.prototype._createTextureAndPostProcesses=function(){var e=this,t=this._mainTextureDesiredSize.width,r=this._mainTextureDesiredSize.height;t=this._engine.needPOTTextures?m.Engine.GetExponentOfTwo(t,this._maxSize):t,r=this._engine.needPOTTextures?m.Engine.GetExponentOfTwo(r,this._maxSize):r;var n=0;n=this._engine.getCaps().textureHalfFloatRender?f.Constants.TEXTURETYPE_HALF_FLOAT:f.Constants.TEXTURETYPE_UNSIGNED_INT,this._blurTexture1=new l.RenderTargetTexture("GlowLayerBlurRTT",{width:t,height:r},this._scene,!1,!0,n),this._blurTexture1.wrapU=a.Texture.CLAMP_ADDRESSMODE,this._blurTexture1.wrapV=a.Texture.CLAMP_ADDRESSMODE,this._blurTexture1.updateSamplingMode(a.Texture.BILINEAR_SAMPLINGMODE),this._blurTexture1.renderParticles=!1,this._blurTexture1.ignoreCameraViewport=!0;var i=Math.floor(t/2),s=Math.floor(r/2);this._blurTexture2=new l.RenderTargetTexture("GlowLayerBlurRTT2",{width:i,height:s},this._scene,!1,!0,n),this._blurTexture2.wrapU=a.Texture.CLAMP_ADDRESSMODE,this._blurTexture2.wrapV=a.Texture.CLAMP_ADDRESSMODE,this._blurTexture2.updateSamplingMode(a.Texture.BILINEAR_SAMPLINGMODE),this._blurTexture2.renderParticles=!1,this._blurTexture2.ignoreCameraViewport=!0,this._textures=[this._blurTexture1,this._blurTexture2],this._horizontalBlurPostprocess1=new u.BlurPostProcess("GlowLayerHBP1",new o.Vector2(1,0),this._options.blurKernelSize/2,{width:t,height:r},null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess1.width=t,this._horizontalBlurPostprocess1.height=r,this._horizontalBlurPostprocess1.onApplyObservable.add((function(t){t.setTexture("textureSampler",e._mainTexture)})),this._verticalBlurPostprocess1=new u.BlurPostProcess("GlowLayerVBP1",new o.Vector2(0,1),this._options.blurKernelSize/2,{width:t,height:r},null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess2=new u.BlurPostProcess("GlowLayerHBP2",new o.Vector2(1,0),this._options.blurKernelSize/2,{width:i,height:s},null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess2.width=i,this._horizontalBlurPostprocess2.height=s,this._horizontalBlurPostprocess2.onApplyObservable.add((function(t){t.setTexture("textureSampler",e._blurTexture1)})),this._verticalBlurPostprocess2=new u.BlurPostProcess("GlowLayerVBP2",new o.Vector2(0,1),this._options.blurKernelSize/2,{width:i,height:s},null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._postProcesses=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1,this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2],this._postProcesses1=[this._horizontalBlurPostprocess1,this._verticalBlurPostprocess1],this._postProcesses2=[this._horizontalBlurPostprocess2,this._verticalBlurPostprocess2],this._mainTexture.samples=this._options.mainTextureSamples,this._mainTexture.onAfterUnbindObservable.add((function(){var t=e._blurTexture1.getInternalTexture();if(t){e._scene.postProcessManager.directRender(e._postProcesses1,t,!0);var r=e._blurTexture2.getInternalTexture();r&&e._scene.postProcessManager.directRender(e._postProcesses2,r,!0),e._engine.unBindFramebuffer(null!=r?r:t,!0)}})),this._postProcesses.map((function(e){e.autoClear=!1}))},t.prototype.isReady=function(t,r){var n=t.getMaterial(),i=t.getRenderingMesh();if(!n||!i)return!1;var o=n.emissiveTexture;return e.prototype._isReady.call(this,t,r,o)},t.prototype.needStencil=function(){return!1},t.prototype._canRenderMesh=function(e,t){return!0},t.prototype._internalRender=function(e){e.setTexture("textureSampler",this._blurTexture1),e.setTexture("textureSampler2",this._blurTexture2),e.setFloat("offset",this._intensity);var t=this._engine,r=t.getStencilBuffer();t.setStencilBuffer(!1),t.drawElementsType(c.Material.TriangleFillMode,0,6),t.setStencilBuffer(r)},t.prototype._setEmissiveTextureAndColor=function(e,t,r){var n=1;this.customEmissiveTextureSelector?this._emissiveTextureAndColor.texture=this.customEmissiveTextureSelector(e,t,r):r?(this._emissiveTextureAndColor.texture=r.emissiveTexture,this._emissiveTextureAndColor.texture&&(n=this._emissiveTextureAndColor.texture.level)):this._emissiveTextureAndColor.texture=null,this.customEmissiveColorSelector?this.customEmissiveColorSelector(e,t,r,this._emissiveTextureAndColor.color):r.emissiveColor?this._emissiveTextureAndColor.color.set(r.emissiveColor.r*n,r.emissiveColor.g*n,r.emissiveColor.b*n,r.alpha):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a)},t.prototype._shouldRenderMesh=function(e){return this.hasMesh(e)},t.prototype._addCustomEffectDefines=function(e){e.push("#define GLOW")},t.prototype.addExcludedMesh=function(e){-1===this._excludedMeshes.indexOf(e.uniqueId)&&this._excludedMeshes.push(e.uniqueId)},t.prototype.removeExcludedMesh=function(e){var t=this._excludedMeshes.indexOf(e.uniqueId);-1!==t&&this._excludedMeshes.splice(t,1)},t.prototype.addIncludedOnlyMesh=function(e){-1===this._includedOnlyMeshes.indexOf(e.uniqueId)&&this._includedOnlyMeshes.push(e.uniqueId)},t.prototype.removeIncludedOnlyMesh=function(e){var t=this._includedOnlyMeshes.indexOf(e.uniqueId);-1!==t&&this._includedOnlyMeshes.splice(t,1)},t.prototype.hasMesh=function(t){return!!e.prototype.hasMesh.call(this,t)&&(this._includedOnlyMeshes.length?-1!==this._includedOnlyMeshes.indexOf(t.uniqueId):!this._excludedMeshes.length||-1===this._excludedMeshes.indexOf(t.uniqueId))},t.prototype._useMeshMaterial=function(e){return 0!=this._meshesUsingTheirOwnMaterials.length&&this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId)>-1},t.prototype.referenceMeshToUseItsOwnMaterial=function(e){this._meshesUsingTheirOwnMaterials.push(e.uniqueId)},t.prototype.unReferenceMeshFromUsingItsOwnMaterial=function(e){for(var t=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);t>=0;)this._meshesUsingTheirOwnMaterials.splice(t,1),t=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId)},t.prototype._disposeMesh=function(e){this.removeIncludedOnlyMesh(e),this.removeExcludedMesh(e)},t.prototype.getClassName=function(){return"GlowLayer"},t.prototype.serialize=function(){var e,t=i.SerializationHelper.Serialize(this);if(t.customType="BABYLON.GlowLayer",t.includedMeshes=[],this._includedOnlyMeshes.length)for(e=0;e<this._includedOnlyMeshes.length;e++)(r=this._scene.getMeshByUniqueID(this._includedOnlyMeshes[e]))&&t.includedMeshes.push(r.id);if(t.excludedMeshes=[],this._excludedMeshes.length)for(e=0;e<this._excludedMeshes.length;e++){var r;(r=this._scene.getMeshByUniqueID(this._excludedMeshes[e]))&&t.excludedMeshes.push(r.id)}return t},t.Parse=function(e,r,n){var o,s=i.SerializationHelper.Parse((function(){return new t(e.name,r,e.options)}),e,r,n);for(o=0;o<e.excludedMeshes.length;o++)(a=r.getMeshByID(e.excludedMeshes[o]))&&s.addExcludedMesh(a);for(o=0;o<e.includedMeshes.length;o++){var a;(a=r.getMeshByID(e.includedMeshes[o]))&&s.addIncludedOnlyMesh(a)}return s},t.EffectName="GlowLayer",t.DefaultBlurKernelSize=32,t.DefaultTextureRatio=.5,Object(n.__decorate)([Object(i.serialize)()],t.prototype,"blurKernelSize",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"intensity",null),Object(n.__decorate)([Object(i.serialize)("options")],t.prototype,"_options",void 0),t}(d.EffectLayer);p._TypeStore.RegisteredTypes["BABYLON.GlowLayer"]=_},"./Layers/highlightLayer.ts":
- /*!**********************************!*\
- !*** ./Layers/highlightLayer.ts ***!
- \**********************************/
- /*! exports provided: HighlightLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"HighlightLayer",(function(){return T}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Engines/engine */"./Engines/engine.ts"),l=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Materials/material */"./Materials/material.ts"),u=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),d=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),h=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),f=r(/*! ../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),p=r(/*! ../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),m=r(/*! ./effectLayer */"./Layers/effectLayer.ts"),g=r(/*! ../abstractScene */"./abstractScene.ts"),_=r(/*! ../Engines/constants */"./Engines/constants.ts"),v=r(/*! ../Misc/logger */"./Misc/logger.ts"),y=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),b=r(/*! ../Maths/math.color */"./Maths/math.color.ts");r(/*! ../Shaders/glowMapMerge.fragment */"./Shaders/glowMapMerge.fragment.ts"),r(/*! ../Shaders/glowMapMerge.vertex */"./Shaders/glowMapMerge.vertex.ts"),r(/*! ../Shaders/glowBlurPostProcess.fragment */"./Shaders/glowBlurPostProcess.fragment.ts"),g.AbstractScene.prototype.getHighlightLayerByName=function(e){for(var t=0;t<this.effectLayers.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===T.EffectName)return this.effectLayers[t];return null};var A=function(e){function t(t,r,n,i,o,s,a,l){void 0===s&&(s=u.Texture.BILINEAR_SAMPLINGMODE);var c=e.call(this,t,"glowBlurPostProcess",["screenSize","direction","blurWidth"],null,i,o,s,a,l)||this;return c.direction=r,c.kernel=n,c.onApplyObservable.add((function(e){e.setFloat2("screenSize",c.width,c.height),e.setVector2("direction",c.direction),e.setFloat("blurWidth",c.kernel)})),c}return Object(n.__extends)(t,e),t}(h.PostProcess),T=function(e){function t(r,i,s){var a=e.call(this,r,i)||this;return a.name=r,a.innerGlow=!0,a.outerGlow=!0,a.onBeforeBlurObservable=new o.Observable,a.onAfterBlurObservable=new o.Observable,a._instanceGlowingMeshStencilReference=t.GlowingMeshStencilReference++,a._meshes={},a._excludedMeshes={},a.neutralColor=t.NeutralColor,a._engine.isStencilEnable||v.Logger.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"),a._options=Object(n.__assign)({mainTextureRatio:.5,blurTextureSizeRatio:.5,blurHorizontalSize:1,blurVerticalSize:1,alphaBlendingMode:_.Constants.ALPHA_COMBINE,camera:null,renderingGroupId:-1},s),a._init({alphaBlendingMode:a._options.alphaBlendingMode,camera:a._options.camera,mainTextureFixedSize:a._options.mainTextureFixedSize,mainTextureRatio:a._options.mainTextureRatio,renderingGroupId:a._options.renderingGroupId}),a._shouldRender=!1,a}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"blurHorizontalSize",{get:function(){return this._horizontalBlurPostprocess.kernel},set:function(e){this._horizontalBlurPostprocess.kernel=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurVerticalSize",{get:function(){return this._verticalBlurPostprocess.kernel},set:function(e){this._verticalBlurPostprocess.kernel=e},enumerable:!1,configurable:!0}),t.prototype.getEffectName=function(){return t.EffectName},t.prototype._createMergeEffect=function(){return this._engine.createEffect("glowMapMerge",[l.VertexBuffer.PositionKind],["offset"],["textureSampler"],this._options.isStroke?"#define STROKE \n":void 0)},t.prototype._createTextureAndPostProcesses=function(){var e=this,t=this._mainTextureDesiredSize.width*this._options.blurTextureSizeRatio,r=this._mainTextureDesiredSize.height*this._options.blurTextureSizeRatio;t=this._engine.needPOTTextures?a.Engine.GetExponentOfTwo(t,this._maxSize):t,r=this._engine.needPOTTextures?a.Engine.GetExponentOfTwo(r,this._maxSize):r;var n=0;n=this._engine.getCaps().textureHalfFloatRender?_.Constants.TEXTURETYPE_HALF_FLOAT:_.Constants.TEXTURETYPE_UNSIGNED_INT,this._blurTexture=new d.RenderTargetTexture("HighlightLayerBlurRTT",{width:t,height:r},this._scene,!1,!0,n),this._blurTexture.wrapU=u.Texture.CLAMP_ADDRESSMODE,this._blurTexture.wrapV=u.Texture.CLAMP_ADDRESSMODE,this._blurTexture.anisotropicFilteringLevel=16,this._blurTexture.updateSamplingMode(u.Texture.TRILINEAR_SAMPLINGMODE),this._blurTexture.renderParticles=!1,this._blurTexture.ignoreCameraViewport=!0,this._textures=[this._blurTexture],this._options.alphaBlendingMode===_.Constants.ALPHA_COMBINE?(this._downSamplePostprocess=new f.PassPostProcess("HighlightLayerPPP",this._options.blurTextureSizeRatio,null,u.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._downSamplePostprocess.onApplyObservable.add((function(t){t.setTexture("textureSampler",e._mainTexture)})),this._horizontalBlurPostprocess=new A("HighlightLayerHBP",new s.Vector2(1,0),this._options.blurHorizontalSize,1,null,u.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._horizontalBlurPostprocess.onApplyObservable.add((function(e){e.setFloat2("screenSize",t,r)})),this._verticalBlurPostprocess=new A("HighlightLayerVBP",new s.Vector2(0,1),this._options.blurVerticalSize,1,null,u.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._verticalBlurPostprocess.onApplyObservable.add((function(e){e.setFloat2("screenSize",t,r)})),this._postProcesses=[this._downSamplePostprocess,this._horizontalBlurPostprocess,this._verticalBlurPostprocess]):(this._horizontalBlurPostprocess=new p.BlurPostProcess("HighlightLayerHBP",new s.Vector2(1,0),this._options.blurHorizontalSize/2,{width:t,height:r},null,u.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess.width=t,this._horizontalBlurPostprocess.height=r,this._horizontalBlurPostprocess.onApplyObservable.add((function(t){t.setTexture("textureSampler",e._mainTexture)})),this._verticalBlurPostprocess=new p.BlurPostProcess("HighlightLayerVBP",new s.Vector2(0,1),this._options.blurVerticalSize/2,{width:t,height:r},null,u.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._postProcesses=[this._horizontalBlurPostprocess,this._verticalBlurPostprocess]),this._mainTexture.onAfterUnbindObservable.add((function(){e.onBeforeBlurObservable.notifyObservers(e);var t=e._blurTexture.getInternalTexture();t&&(e._scene.postProcessManager.directRender(e._postProcesses,t,!0),e._engine.unBindFramebuffer(t,!0)),e.onAfterBlurObservable.notifyObservers(e)})),this._postProcesses.map((function(e){e.autoClear=!1}))},t.prototype.needStencil=function(){return!0},t.prototype.isReady=function(t,r){var n=t.getMaterial(),i=t.getRenderingMesh();if(!n||!i||!this._meshes)return!1;var o=null,s=this._meshes[i.uniqueId];return s&&s.glowEmissiveOnly&&n&&(o=n.emissiveTexture),e.prototype._isReady.call(this,t,r,o)},t.prototype._internalRender=function(e){e.setTexture("textureSampler",this._blurTexture);var t=this._engine;t.cacheStencilState(),t.setStencilOperationPass(_.Constants.REPLACE),t.setStencilOperationFail(_.Constants.KEEP),t.setStencilOperationDepthFail(_.Constants.KEEP),t.setStencilMask(0),t.setStencilBuffer(!0),t.setStencilFunctionReference(this._instanceGlowingMeshStencilReference),this.outerGlow&&(e.setFloat("offset",0),t.setStencilFunction(_.Constants.NOTEQUAL),t.drawElementsType(c.Material.TriangleFillMode,0,6)),this.innerGlow&&(e.setFloat("offset",1),t.setStencilFunction(_.Constants.EQUAL),t.drawElementsType(c.Material.TriangleFillMode,0,6)),t.restoreStencilState()},t.prototype.shouldRender=function(){return!!e.prototype.shouldRender.call(this)&&!!this._meshes},t.prototype._shouldRenderMesh=function(t){return!(this._excludedMeshes&&this._excludedMeshes[t.uniqueId]||!e.prototype.hasMesh.call(this,t))},t.prototype._canRenderMesh=function(e,t){return!0},t.prototype._addCustomEffectDefines=function(e){e.push("#define HIGHLIGHT")},t.prototype._setEmissiveTextureAndColor=function(e,t,r){var n=this._meshes[e.uniqueId];n?this._emissiveTextureAndColor.color.set(n.color.r,n.color.g,n.color.b,1):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a),n&&n.glowEmissiveOnly&&r?(this._emissiveTextureAndColor.texture=r.emissiveTexture,this._emissiveTextureAndColor.color.set(1,1,1,1)):this._emissiveTextureAndColor.texture=null},t.prototype.addExcludedMesh=function(e){this._excludedMeshes&&(this._excludedMeshes[e.uniqueId]||(this._excludedMeshes[e.uniqueId]={mesh:e,beforeBind:e.onBeforeBindObservable.add((function(e){e.getEngine().setStencilBuffer(!1)})),afterRender:e.onAfterRenderObservable.add((function(e){e.getEngine().setStencilBuffer(!0)}))}))},t.prototype.removeExcludedMesh=function(e){if(this._excludedMeshes){var t=this._excludedMeshes[e.uniqueId];t&&(t.beforeBind&&e.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&e.onAfterRenderObservable.remove(t.afterRender)),this._excludedMeshes[e.uniqueId]=null}},t.prototype.hasMesh=function(t){return!!this._meshes&&!!e.prototype.hasMesh.call(this,t)&&void 0!==this._meshes[t.uniqueId]&&null!==this._meshes[t.uniqueId]},t.prototype.addMesh=function(e,t,r){var n=this;if(void 0===r&&(r=!1),this._meshes){var i=this._meshes[e.uniqueId];i?i.color=t:(this._meshes[e.uniqueId]={mesh:e,color:t,observerHighlight:e.onBeforeBindObservable.add((function(e){n.isEnabled&&(n._excludedMeshes&&n._excludedMeshes[e.uniqueId]?n._defaultStencilReference(e):e.getScene().getEngine().setStencilFunctionReference(n._instanceGlowingMeshStencilReference))})),observerDefault:e.onAfterRenderObservable.add((function(e){n.isEnabled&&n._defaultStencilReference(e)})),glowEmissiveOnly:r},e.onDisposeObservable.add((function(){n._disposeMesh(e)}))),this._shouldRender=!0}},t.prototype.removeMesh=function(e){if(this._meshes){var t=this._meshes[e.uniqueId];for(var r in t&&(t.observerHighlight&&e.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&e.onAfterRenderObservable.remove(t.observerDefault),delete this._meshes[e.uniqueId]),this._shouldRender=!1,this._meshes)if(this._meshes[r]){this._shouldRender=!0;break}}},t.prototype.removeAllMeshes=function(){if(this._meshes)for(var e in this._meshes)if(this._meshes.hasOwnProperty(e)){var t=this._meshes[e];t&&this.removeMesh(t.mesh)}},t.prototype._defaultStencilReference=function(e){e.getScene().getEngine().setStencilFunctionReference(t.NormalMeshStencilReference)},t.prototype._disposeMesh=function(e){this.removeMesh(e),this.removeExcludedMesh(e)},t.prototype.dispose=function(){if(this._meshes){for(var t in this._meshes)(r=this._meshes[t])&&r.mesh&&(r.observerHighlight&&r.mesh.onBeforeBindObservable.remove(r.observerHighlight),r.observerDefault&&r.mesh.onAfterRenderObservable.remove(r.observerDefault));this._meshes=null}if(this._excludedMeshes){for(var t in this._excludedMeshes){var r;(r=this._excludedMeshes[t])&&(r.beforeBind&&r.mesh.onBeforeBindObservable.remove(r.beforeBind),r.afterRender&&r.mesh.onAfterRenderObservable.remove(r.afterRender))}this._excludedMeshes=null}e.prototype.dispose.call(this)},t.prototype.getClassName=function(){return"HighlightLayer"},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);if(e.customType="BABYLON.HighlightLayer",e.meshes=[],this._meshes)for(var t in this._meshes){var r=this._meshes[t];r&&e.meshes.push({glowEmissiveOnly:r.glowEmissiveOnly,color:r.color.asArray(),meshId:r.mesh.id})}if(e.excludedMeshes=[],this._excludedMeshes)for(var n in this._excludedMeshes){var o=this._excludedMeshes[n];o&&e.excludedMeshes.push(o.mesh.id)}return e},t.Parse=function(e,r,n){var o,s=i.SerializationHelper.Parse((function(){return new t(e.name,r,e.options)}),e,r,n);for(o=0;o<e.excludedMeshes.length;o++)(a=r.getMeshByID(e.excludedMeshes[o]))&&s.addExcludedMesh(a);for(o=0;o<e.meshes.length;o++){var a,l=e.meshes[o];(a=r.getMeshByID(l.meshId))&&s.addMesh(a,b.Color3.FromArray(l.color),l.glowEmissiveOnly)}return s},t.EffectName="HighlightLayer",t.NeutralColor=new b.Color4(0,0,0,0),t.GlowingMeshStencilReference=2,t.NormalMeshStencilReference=1,Object(n.__decorate)([Object(i.serialize)()],t.prototype,"innerGlow",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"outerGlow",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"blurHorizontalSize",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"blurVerticalSize",null),Object(n.__decorate)([Object(i.serialize)("options")],t.prototype,"_options",void 0),t}(m.EffectLayer);y._TypeStore.RegisteredTypes["BABYLON.HighlightLayer"]=T},"./Layers/index.ts":
- /*!*************************!*\
- !*** ./Layers/index.ts ***!
- \*************************/
- /*! exports provided: EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./effectLayer */"./Layers/effectLayer.ts");r.d(t,"EffectLayer",(function(){return n.EffectLayer}));var i=r(/*! ./effectLayerSceneComponent */"./Layers/effectLayerSceneComponent.ts");r.d(t,"EffectLayerSceneComponent",(function(){return i.EffectLayerSceneComponent}));var o=r(/*! ./glowLayer */"./Layers/glowLayer.ts");r.d(t,"GlowLayer",(function(){return o.GlowLayer}));var s=r(/*! ./highlightLayer */"./Layers/highlightLayer.ts");r.d(t,"HighlightLayer",(function(){return s.HighlightLayer}));var a=r(/*! ./layer */"./Layers/layer.ts");r.d(t,"Layer",(function(){return a.Layer}));var l=r(/*! ./layerSceneComponent */"./Layers/layerSceneComponent.ts");r.d(t,"LayerSceneComponent",(function(){return l.LayerSceneComponent}))},"./Layers/layer.ts":
- /*!*************************!*\
- !*** ./Layers/layer.ts ***!
- \*************************/
- /*! exports provided: Layer */function(e,t,r){"use strict";r.r(t),r.d(t,"Layer",(function(){return f}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Materials/material */"./Materials/material.ts"),c=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../sceneComponent */"./sceneComponent.ts"),d=r(/*! ./layerSceneComponent */"./Layers/layerSceneComponent.ts"),h=r(/*! ../Engines/constants */"./Engines/constants.ts"),f=(r(/*! ../Shaders/layer.fragment */"./Shaders/layer.fragment.ts"),r(/*! ../Shaders/layer.vertex */"./Shaders/layer.vertex.ts"),function(){function e(e,t,r,l,f){this.name=e,this.scale=new i.Vector2(1,1),this.offset=new i.Vector2(0,0),this.alphaBlendingMode=h.Constants.ALPHA_COMBINE,this.layerMask=268435455,this.renderTargetTextures=[],this.renderOnlyInRenderTargetTextures=!1,this._vertexBuffers={},this.onDisposeObservable=new n.Observable,this.onBeforeRenderObservable=new n.Observable,this.onAfterRenderObservable=new n.Observable,this.texture=t?new c.Texture(t,r,!0):null,this.isBackground=void 0===l||l,this.color=void 0===f?new o.Color4(1,1,1,1):f,this._scene=r||s.EngineStore.LastCreatedScene;var p=this._scene._getComponent(u.SceneComponentConstants.NAME_LAYER);p||(p=new d.LayerSceneComponent(this._scene),this._scene._addComponent(p)),this._scene.layers.push(this);var m=this._scene.getEngine(),g=[];g.push(1,1),g.push(-1,1),g.push(-1,-1),g.push(1,-1);var _=new a.VertexBuffer(m,g,a.VertexBuffer.PositionKind,!1,!1,2);this._vertexBuffers[a.VertexBuffer.PositionKind]=_,this._createIndexBuffer()}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype._createIndexBuffer=function(){var e=this._scene.getEngine(),t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},e.prototype._rebuild=function(){var e=this._vertexBuffers[a.VertexBuffer.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.render=function(){var e=this._scene.getEngine(),t="";this.alphaTest&&(t="#define ALPHATEST"),this.texture&&!this.texture.gammaSpace&&(t+="\r\n#define LINEAR"),this._previousDefines!==t&&(this._previousDefines=t,this._effect=e.createEffect("layer",[a.VertexBuffer.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],t));var r=this._effect;r&&r.isReady()&&this.texture&&this.texture.isReady()&&(e=this._scene.getEngine(),this.onBeforeRenderObservable.notifyObservers(this),e.enableEffect(r),e.setState(!1),r.setTexture("textureSampler",this.texture),r.setMatrix("textureMatrix",this.texture.getTextureMatrix()),r.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),r.setVector2("offset",this.offset),r.setVector2("scale",this.scale),e.bindBuffers(this._vertexBuffers,this._indexBuffer,r),this.alphaTest?e.drawElementsType(l.Material.TriangleFillMode,0,6):(e.setAlphaMode(this.alphaBlendingMode),e.drawElementsType(l.Material.TriangleFillMode,0,6),e.setAlphaMode(h.Constants.ALPHA_DISABLE)),this.onAfterRenderObservable.notifyObservers(this))},e.prototype.dispose=function(){var e=this._vertexBuffers[a.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[a.VertexBuffer.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this.texture&&(this.texture.dispose(),this.texture=null),this.renderTargetTextures=[];var t=this._scene.layers.indexOf(this);this._scene.layers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderObservable.clear()},e}())},"./Layers/layerSceneComponent.ts":
- /*!***************************************!*\
- !*** ./Layers/layerSceneComponent.ts ***!
- \***************************************/
- /*! exports provided: LayerSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"LayerSceneComponent",(function(){return i}));var n=r(/*! ../sceneComponent */"./sceneComponent.ts"),i=function(){function e(e){this.name=n.SceneComponentConstants.NAME_LAYER,this.scene=e,this._engine=e.getEngine(),e.layers=new Array}return e.prototype.register=function(){this.scene._beforeCameraDrawStage.registerStep(n.SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER,this,this._drawCameraBackground),this.scene._afterCameraDrawStage.registerStep(n.SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER,this,this._drawCameraForeground),this.scene._beforeRenderTargetDrawStage.registerStep(n.SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_LAYER,this,this._drawRenderTargetBackground),this.scene._afterRenderTargetDrawStage.registerStep(n.SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_LAYER,this,this._drawRenderTargetForeground)},e.prototype.rebuild=function(){for(var e=0,t=this.scene.layers;e<t.length;e++)t[e]._rebuild()},e.prototype.dispose=function(){for(var e=this.scene.layers;e.length;)e[0].dispose()},e.prototype._draw=function(e){var t=this.scene.layers;if(t.length){this._engine.setDepthBuffer(!1);for(var r=0,n=t;r<n.length;r++){var i=n[r];e(i)&&i.render()}this._engine.setDepthBuffer(!0)}},e.prototype._drawCameraPredicate=function(e,t,r){return!e.renderOnlyInRenderTargetTextures&&e.isBackground===t&&0!=(e.layerMask&r)},e.prototype._drawCameraBackground=function(e){var t=this;this._draw((function(r){return t._drawCameraPredicate(r,!0,e.layerMask)}))},e.prototype._drawCameraForeground=function(e){var t=this;this._draw((function(r){return t._drawCameraPredicate(r,!1,e.layerMask)}))},e.prototype._drawRenderTargetPredicate=function(e,t,r,n){return e.renderTargetTextures.length>0&&e.isBackground===t&&e.renderTargetTextures.indexOf(n)>-1&&0!=(e.layerMask&r)},e.prototype._drawRenderTargetBackground=function(e){var t=this;this._draw((function(r){return t._drawRenderTargetPredicate(r,!0,t.scene.activeCamera.layerMask,e)}))},e.prototype._drawRenderTargetForeground=function(e){var t=this;this._draw((function(r){return t._drawRenderTargetPredicate(r,!1,t.scene.activeCamera.layerMask,e)}))},e.prototype.addFromContainer=function(e){var t=this;e.layers&&e.layers.forEach((function(e){t.scene.layers.push(e)}))},e.prototype.removeFromContainer=function(e,t){var r=this;void 0===t&&(t=!1),e.layers&&e.layers.forEach((function(e){var n=r.scene.layers.indexOf(e);-1!==n&&r.scene.layers.splice(n,1),t&&e.dispose()}))},e}()},"./Legacy/legacy.ts":
- /*!**************************!*\
- !*** ./Legacy/legacy.ts ***!
- \**************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"Debug",(function(){return u}));var n=r(/*! ../index */"./index.ts"),i=r(/*! ../Debug/index */"./Debug/index.ts");for(var o in n)["Debug","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return n[e]}))}(o);var s=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==s){s.BABYLON=a,s.BABYLON=s.BABYLON||{};var a=s.BABYLON;a.Debug=a.Debug||{};var l=[];for(var c in i)a.Debug[c]=i[c],l.push(c);for(var c in n)a[c]=n[c]}var u={AxesViewer:i.AxesViewer,BoneAxesViewer:i.BoneAxesViewer,PhysicsViewer:i.PhysicsViewer,SkeletonViewer:i.SkeletonViewer}}.call(this,r(/*! ./../../node_modules/webpack/buildin/global.js */"../node_modules/webpack/buildin/global.js"))},"./LensFlares/index.ts":
- /*!*****************************!*\
- !*** ./LensFlares/index.ts ***!
- \*****************************/
- /*! exports provided: LensFlare, LensFlareSystem, LensFlareSystemSceneComponent */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./lensFlare */"./LensFlares/lensFlare.ts");r.d(t,"LensFlare",(function(){return n.LensFlare}));var i=r(/*! ./lensFlareSystem */"./LensFlares/lensFlareSystem.ts");r.d(t,"LensFlareSystem",(function(){return i.LensFlareSystem}));var o=r(/*! ./lensFlareSystemSceneComponent */"./LensFlares/lensFlareSystemSceneComponent.ts");r.d(t,"LensFlareSystemSceneComponent",(function(){return o.LensFlareSystemSceneComponent}))},"./LensFlares/lensFlare.ts":
- /*!*********************************!*\
- !*** ./LensFlares/lensFlare.ts ***!
- \*********************************/
- /*! exports provided: LensFlare */function(e,t,r){"use strict";r.r(t),r.d(t,"LensFlare",(function(){return s}));var n=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=function(){function e(e,t,r,s,a){this.size=e,this.position=t,this.alphaMode=o.Constants.ALPHA_ONEONE,this.color=r||new n.Color3(1,1,1),this.texture=s?new i.Texture(s,a.getScene(),!0):null,this._system=a,a.lensFlares.push(this)}return e.AddFlare=function(t,r,n,i,o){return new e(t,r,n,i,o)},e.prototype.dispose=function(){this.texture&&this.texture.dispose();var e=this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(e,1)},e}()},"./LensFlares/lensFlareSystem.ts":
- /*!***************************************!*\
- !*** ./LensFlares/lensFlareSystem.ts ***!
- \***************************************/
- /*! exports provided: LensFlareSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"LensFlareSystem",(function(){return p}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Culling/ray */"./Culling/ray.ts"),c=r(/*! ../Materials/material */"./Materials/material.ts"),u=r(/*! ./lensFlare */"./LensFlares/lensFlare.ts"),d=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=(r(/*! ../Shaders/lensFlare.fragment */"./Shaders/lensFlare.fragment.ts"),r(/*! ../Shaders/lensFlare.vertex */"./Shaders/lensFlare.vertex.ts"),r(/*! ../Misc/devTools */"./Misc/devTools.ts")),f=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),p=function(){function e(t,r,n){this.name=t,this.lensFlares=new Array,this.borderLimit=300,this.viewportBorder=0,this.layerMask=268435455,this._vertexBuffers={},this._isEnabled=!0,this._scene=n||s.EngineStore.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._emitter=r,this.id=t,n.lensFlareSystems.push(this),this.meshesSelectionPredicate=function(e){return n.activeCamera&&e.material&&e.isVisible&&e.isEnabled()&&e.isBlocker&&0!=(e.layerMask&n.activeCamera.layerMask)};var i=n.getEngine(),o=[];o.push(1,1),o.push(-1,1),o.push(-1,-1),o.push(1,-1),this._vertexBuffers[a.VertexBuffer.PositionKind]=new a.VertexBuffer(i,o,a.VertexBuffer.PositionKind,!1,!1,2);var l=[];l.push(0),l.push(1),l.push(2),l.push(0),l.push(2),l.push(3),this._indexBuffer=i.createIndexBuffer(l),this._effect=i.createEffect("lensFlare",[a.VertexBuffer.PositionKind],["color","viewportMatrix"],["textureSampler"],"")}return Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEmitter=function(){return this._emitter},e.prototype.setEmitter=function(e){this._emitter=e},e.prototype.getEmitterPosition=function(){return this._emitter.getAbsolutePosition?this._emitter.getAbsolutePosition():this._emitter.position},e.prototype.computeEffectivePosition=function(e){var t=this.getEmitterPosition();return t=i.Vector3.Project(t,i.Matrix.Identity(),this._scene.getTransformMatrix(),e),this._positionX=t.x,this._positionY=t.y,t=i.Vector3.TransformCoordinates(this.getEmitterPosition(),this._scene.getViewMatrix()),this.viewportBorder>0&&(e.x-=this.viewportBorder,e.y-=this.viewportBorder,e.width+=2*this.viewportBorder,e.height+=2*this.viewportBorder,t.x+=this.viewportBorder,t.y+=this.viewportBorder,this._positionX+=this.viewportBorder,this._positionY+=this.viewportBorder),t.z>0&&(this._positionX>e.x&&this._positionX<e.x+e.width&&this._positionY>e.y&&(this._positionY,e.y,e.height),!0)},e.prototype._isVisible=function(){if(!this._isEnabled||!this._scene.activeCamera)return!1;var e=this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition),t=e.length();e.normalize();var r=new l.Ray(this._scene.activeCamera.globalPosition,e),n=this._scene.pickWithRay(r,this.meshesSelectionPredicate,!0);return!n||!n.hit||n.distance>t},e.prototype.render=function(){if(!this._effect.isReady()||!this._scene.activeCamera)return!1;var e,t,r=this._scene.getEngine(),n=this._scene.activeCamera.viewport.toGlobal(r.getRenderWidth(!0),r.getRenderHeight(!0));if(!this.computeEffectivePosition(n))return!1;if(!this._isVisible())return!1;var s=(e=this._positionX<this.borderLimit+n.x?this.borderLimit+n.x-this._positionX:this._positionX>n.x+n.width-this.borderLimit?this._positionX-n.x-n.width+this.borderLimit:0)>(t=this._positionY<this.borderLimit+n.y?this.borderLimit+n.y-this._positionY:this._positionY>n.y+n.height-this.borderLimit?this._positionY-n.y-n.height+this.borderLimit:0)?e:t;(s-=this.viewportBorder)>this.borderLimit&&(s=this.borderLimit);var a=1-o.Scalar.Clamp(s/this.borderLimit,0,1);if(a<0)return!1;a>1&&(a=1),this.viewportBorder>0&&(n.x+=this.viewportBorder,n.y+=this.viewportBorder,n.width-=2*this.viewportBorder,n.height-=2*this.viewportBorder,this._positionX-=this.viewportBorder,this._positionY-=this.viewportBorder);var l=n.x+n.width/2,u=n.y+n.height/2,h=l-this._positionX,f=u-this._positionY;r.enableEffect(this._effect),r.setState(!1),r.setDepthBuffer(!1),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect);for(var p=0;p<this.lensFlares.length;p++){var m=this.lensFlares[p];if(!m.texture||m.texture.isReady()){r.setAlphaMode(m.alphaMode);var g=l-h*m.position,_=u-f*m.position,v=m.size,y=m.size*r.getAspectRatio(this._scene.activeCamera,!0),b=g/(n.width+2*n.x)*2-1,A=1-_/(n.height+2*n.y)*2,T=i.Matrix.FromValues(v/2,0,0,0,0,y/2,0,0,0,0,1,0,b,A,0,1);this._effect.setMatrix("viewportMatrix",T),this._effect.setTexture("textureSampler",m.texture),this._effect.setFloat4("color",m.color.r*a,m.color.g*a,m.color.b*a,1),r.drawElementsType(c.Material.TriangleFillMode,0,6)}}return r.setDepthBuffer(!0),r.setAlphaMode(d.Constants.ALPHA_DISABLE),!0},e.prototype.dispose=function(){var e=this._vertexBuffers[a.VertexBuffer.PositionKind];for(e&&(e.dispose(),this._vertexBuffers[a.VertexBuffer.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null);this.lensFlares.length;)this.lensFlares[0].dispose();var t=this._scene.lensFlareSystems.indexOf(this);this._scene.lensFlareSystems.splice(t,1)},e.Parse=function(t,r,n){var i=r.getLastEntryByID(t.emitterId),o=t.name||"lensFlareSystem#"+t.emitterId,s=new e(o,i,r);s.id=t.id||o,s.borderLimit=t.borderLimit;for(var a=0;a<t.flares.length;a++){var l=t.flares[a];u.LensFlare.AddFlare(l.size,l.position,f.Color3.FromArray(l.color),l.textureName?n+l.textureName:"",s)}return s},e.prototype.serialize=function(){var e={};e.id=this.id,e.name=this.name,e.emitterId=this.getEmitter().id,e.borderLimit=this.borderLimit,e.flares=[];for(var t=0;t<this.lensFlares.length;t++){var r=this.lensFlares[t];e.flares.push({size:r.size,position:r.position,color:r.color.asArray(),textureName:n.Tools.GetFilename(r.texture?r.texture.name:"")})}return e},e._SceneComponentInitialization=function(e){throw h._DevTools.WarnImport("LensFlareSystemSceneComponent")},e}()},"./LensFlares/lensFlareSystemSceneComponent.ts":
- /*!*****************************************************!*\
- !*** ./LensFlares/lensFlareSystemSceneComponent.ts ***!
- \*****************************************************/
- /*! exports provided: LensFlareSystemSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"LensFlareSystemSceneComponent",(function(){return a}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../sceneComponent */"./sceneComponent.ts"),o=r(/*! ../abstractScene */"./abstractScene.ts"),s=r(/*! ./lensFlareSystem */"./LensFlares/lensFlareSystem.ts");o.AbstractScene.AddParser(i.SceneComponentConstants.NAME_LENSFLARESYSTEM,(function(e,t,r,n){if(void 0!==e.lensFlareSystems&&null!==e.lensFlareSystems){r.lensFlareSystems||(r.lensFlareSystems=new Array);for(var i=0,o=e.lensFlareSystems.length;i<o;i++){var a=e.lensFlareSystems[i],l=s.LensFlareSystem.Parse(a,t,n);r.lensFlareSystems.push(l)}}})),o.AbstractScene.prototype.getLensFlareSystemByName=function(e){for(var t=0;t<this.lensFlareSystems.length;t++)if(this.lensFlareSystems[t].name===e)return this.lensFlareSystems[t];return null},o.AbstractScene.prototype.getLensFlareSystemByID=function(e){for(var t=0;t<this.lensFlareSystems.length;t++)if(this.lensFlareSystems[t].id===e)return this.lensFlareSystems[t];return null},o.AbstractScene.prototype.removeLensFlareSystem=function(e){var t=this.lensFlareSystems.indexOf(e);return-1!==t&&this.lensFlareSystems.splice(t,1),t},o.AbstractScene.prototype.addLensFlareSystem=function(e){this.lensFlareSystems.push(e)};var a=function(){function e(e){this.name=i.SceneComponentConstants.NAME_LENSFLARESYSTEM,this.scene=e,e.lensFlareSystems=new Array}return e.prototype.register=function(){this.scene._afterCameraDrawStage.registerStep(i.SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM,this,this._draw)},e.prototype.rebuild=function(){},e.prototype.addFromContainer=function(e){var t=this;e.lensFlareSystems&&e.lensFlareSystems.forEach((function(e){t.scene.addLensFlareSystem(e)}))},e.prototype.removeFromContainer=function(e,t){var r=this;e.lensFlareSystems&&e.lensFlareSystems.forEach((function(e){r.scene.removeLensFlareSystem(e),t&&e.dispose()}))},e.prototype.serialize=function(e){e.lensFlareSystems=[];for(var t=0,r=this.scene.lensFlareSystems;t<r.length;t++){var n=r[t];e.lensFlareSystems.push(n.serialize())}},e.prototype.dispose=function(){for(var e=this.scene.lensFlareSystems;e.length;)e[0].dispose()},e.prototype._draw=function(e){if(this.scene.lensFlaresEnabled){var t=this.scene.lensFlareSystems;n.Tools.StartPerformanceCounter("Lens flares",t.length>0);for(var r=0,i=t;r<i.length;r++){var o=i[r];0!=(e.layerMask&o.layerMask)&&o.render()}n.Tools.EndPerformanceCounter("Lens flares",t.length>0)}},e}();s.LensFlareSystem._SceneComponentInitialization=function(e){var t=e._getComponent(i.SceneComponentConstants.NAME_LENSFLARESYSTEM);t||(t=new a(e),e._addComponent(t))}},"./Lights/Shadows/cascadedShadowGenerator.ts":
- /*!***************************************************!*\
- !*** ./Lights/Shadows/cascadedShadowGenerator.ts ***!
- \***************************************************/
- /*! exports provided: CascadedShadowGenerator */function(e,t,r){"use strict";r.r(t),r.d(t,"CascadedShadowGenerator",(function(){return y}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../../Shaders/shadowMap.fragment */"./Shaders/shadowMap.fragment.ts"),r(/*! ../../Shaders/shadowMap.vertex */"./Shaders/shadowMap.vertex.ts"),r(/*! ../../Shaders/depthBoxBlur.fragment */"./Shaders/depthBoxBlur.fragment.ts"),r(/*! ../../Misc/devTools */"./Misc/devTools.ts")),l=r(/*! ./shadowGenerator */"./Lights/Shadows/shadowGenerator.ts"),c=r(/*! ../../Culling/boundingInfo */"./Culling/boundingInfo.ts"),u=r(/*! ../../Misc/depthReducer */"./Misc/depthReducer.ts"),d=r(/*! ../../Misc/logger */"./Misc/logger.ts"),h=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),f=i.Vector3.Up(),p=i.Vector3.Zero(),m=new i.Vector3,g=new i.Vector3,_=new i.Matrix,v=new i.Matrix,y=function(e){function t(r,n,i){var o=e.call(this,r,n,i)||this;return t.IsSupported?(o.usePercentageCloserFiltering=!0,o):(d.Logger.Error("CascadedShadowMap needs WebGL 2 support."),o)}return Object(n.__extends)(t,e),t.prototype._validateFilter=function(e){return e===l.ShadowGenerator.FILTER_NONE||e===l.ShadowGenerator.FILTER_PCF||e===l.ShadowGenerator.FILTER_PCSS?e:(console.error('Unsupported filter "'+e+'"!'),l.ShadowGenerator.FILTER_NONE)},Object.defineProperty(t.prototype,"numCascades",{get:function(){return this._numCascades},set:function(e){(e=Math.min(Math.max(e,t.MIN_CASCADES_COUNT),t.MAX_CASCADES_COUNT))!==this._numCascades&&(this._numCascades=e,this.recreateShadowMap())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"freezeShadowCastersBoundingInfo",{get:function(){return this._freezeShadowCastersBoundingInfo},set:function(e){this._freezeShadowCastersBoundingInfoObservable&&e&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._freezeShadowCastersBoundingInfoObservable||e||(this._freezeShadowCastersBoundingInfoObservable=this._scene.onBeforeRenderObservable.add(this._computeShadowCastersBoundingInfo.bind(this))),this._freezeShadowCastersBoundingInfo=e,e&&this._computeShadowCastersBoundingInfo()},enumerable:!1,configurable:!0}),t.prototype._computeShadowCastersBoundingInfo=function(){if(this._scbiMin.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._scbiMax.copyFromFloats(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),this._shadowMap&&this._shadowMap.renderList){for(var e=this._shadowMap.renderList,t=0;t<e.length;t++)if(i=e[t]){var r=i.getBoundingInfo().boundingBox;this._scbiMin.minimizeInPlace(r.minimumWorld),this._scbiMax.maximizeInPlace(r.maximumWorld)}var n=this._scene.meshes;for(t=0;t<n.length;t++){var i;(i=n[t])&&i.isVisible&&i.isEnabled&&i.receiveShadows&&(r=i.getBoundingInfo().boundingBox,this._scbiMin.minimizeInPlace(r.minimumWorld),this._scbiMax.maximizeInPlace(r.maximumWorld))}}this._shadowCastersBoundingInfo.reConstruct(this._scbiMin,this._scbiMax)},Object.defineProperty(t.prototype,"shadowCastersBoundingInfo",{get:function(){return this._shadowCastersBoundingInfo},set:function(e){this._shadowCastersBoundingInfo=e},enumerable:!1,configurable:!0}),t.prototype.setMinMaxDistance=function(e,t){this._minDistance===e&&this._maxDistance===t||(e>t&&(e=0,t=1),e<0&&(e=0),t>1&&(t=1),this._minDistance=e,this._maxDistance=t,this._breaksAreDirty=!0)},Object.defineProperty(t.prototype,"minDistance",{get:function(){return this._minDistance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDistance",{get:function(){return this._maxDistance},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return t.CLASSNAME},t.prototype.getCascadeMinExtents=function(e){return e>=0&&e<this._numCascades?this._cascadeMinExtents[e]:null},t.prototype.getCascadeMaxExtents=function(e){return e>=0&&e<this._numCascades?this._cascadeMaxExtents[e]:null},Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._scene&&this._scene.activeCamera?this._shadowMaxZ:0},set:function(e){this._scene&&this._scene.activeCamera?this._shadowMaxZ===e||e<this._scene.activeCamera.minZ||e>this._scene.activeCamera.maxZ||(this._shadowMaxZ=e,this._light._markMeshesAsLightDirty(),this._breaksAreDirty=!0):this._shadowMaxZ=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debug",{get:function(){return this._debug},set:function(e){this._debug=e,this._light._markMeshesAsLightDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthClamp",{get:function(){return this._depthClamp},set:function(e){this._depthClamp=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cascadeBlendPercentage",{get:function(){return this._cascadeBlendPercentage},set:function(e){this._cascadeBlendPercentage=e,this._light._markMeshesAsLightDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lambda",{get:function(){return this._lambda},set:function(e){var t=Math.min(Math.max(e,0),1);this._lambda!=t&&(this._lambda=t,this._breaksAreDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.getCascadeViewMatrix=function(e){return e>=0&&e<this._numCascades?this._viewMatrices[e]:null},t.prototype.getCascadeProjectionMatrix=function(e){return e>=0&&e<this._numCascades?this._projectionMatrices[e]:null},t.prototype.getCascadeTransformMatrix=function(e){return e>=0&&e<this._numCascades?this._transformMatrices[e]:null},t.prototype.setDepthRenderer=function(e){this._depthRenderer=e,this._depthReducer&&this._depthReducer.setDepthRenderer(this._depthRenderer)},Object.defineProperty(t.prototype,"autoCalcDepthBounds",{get:function(){return this._autoCalcDepthBounds},set:function(e){var t=this,r=this._scene.activeCamera;if(r){if(this._autoCalcDepthBounds=e,!e)return this._depthReducer&&this._depthReducer.deactivate(),void this.setMinMaxDistance(0,1);this._depthReducer||(this._depthReducer=new u.DepthReducer(r),this._depthReducer.onAfterReductionPerformed.add((function(e){var r=e.min,n=e.max;r>=n&&(r=0,n=1),r==t._minDistance&&n==t._maxDistance||t.setMinMaxDistance(r,n)})),this._depthReducer.setDepthRenderer(this._depthRenderer)),this._depthReducer.activate()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoCalcDepthBoundsRefreshRate",{get:function(){var e,t,r;return null!==(r=null===(t=null===(e=this._depthReducer)||void 0===e?void 0:e.depthRenderer)||void 0===t?void 0:t.getDepthMap().refreshRate)&&void 0!==r?r:-1},set:function(e){var t;(null===(t=this._depthReducer)||void 0===t?void 0:t.depthRenderer)&&(this._depthReducer.depthRenderer.getDepthMap().refreshRate=e)},enumerable:!1,configurable:!0}),t.prototype.splitFrustum=function(){this._breaksAreDirty=!0},t.prototype._splitFrustum=function(){var e=this._scene.activeCamera;if(e){for(var t=e.minZ,r=e.maxZ,n=r-t,i=this._minDistance,o=t+i*n,s=t+(this._shadowMaxZ<r&&this._shadowMaxZ>=t?Math.min((this._shadowMaxZ-t)/(r-t),this._maxDistance):this._maxDistance)*n,a=s-o,l=s/o,c=0;c<this._cascades.length;++c){var u=(c+1)/this._numCascades,d=o*Math.pow(l,u),h=o+a*u,f=this._lambda*(d-h)+h;this._cascades[c].prevBreakDistance=0===c?i:this._cascades[c-1].breakDistance,this._cascades[c].breakDistance=(f-t)/n,this._viewSpaceFrustumsZ[c]=t+this._cascades[c].breakDistance*n,this._frustumLengths[c]=(this._cascades[c].breakDistance-this._cascades[c].prevBreakDistance)*n}this._breaksAreDirty=!1}},t.prototype._computeMatrices=function(){if(this._scene.activeCamera){i.Vector3.NormalizeToRef(this._light.getShadowDirection(0),this._lightDirection),1===Math.abs(i.Vector3.Dot(this._lightDirection,i.Vector3.Up()))&&(this._lightDirection.z=1e-13),this._cachedDirection.copyFrom(this._lightDirection);for(var e=0;e<this._numCascades;++e){this._computeFrustumInWorldSpace(e),this._computeCascadeFrustum(e),this._cascadeMaxExtents[e].subtractToRef(this._cascadeMinExtents[e],m),this._frustumCenter[e].addToRef(this._lightDirection.scale(this._cascadeMinExtents[e].z),this._shadowCameraPos[e]),i.Matrix.LookAtLHToRef(this._shadowCameraPos[e],this._frustumCenter[e],f,this._viewMatrices[e]);var t=0,r=m.z,n=this._shadowCastersBoundingInfo;n.update(this._viewMatrices[e]),r=Math.min(r,n.boundingBox.maximumWorld.z),t=this._depthClamp&&this.filter!==l.ShadowGenerator.FILTER_PCSS?Math.max(t,n.boundingBox.minimumWorld.z):Math.min(t,n.boundingBox.minimumWorld.z),i.Matrix.OrthoOffCenterLHToRef(this._cascadeMinExtents[e].x,this._cascadeMaxExtents[e].x,this._cascadeMinExtents[e].y,this._cascadeMaxExtents[e].y,t,r,this._projectionMatrices[e]),this._cascadeMinExtents[e].z=t,this._cascadeMaxExtents[e].z=r,this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e],this._transformMatrices[e]),i.Vector3.TransformCoordinatesToRef(p,this._transformMatrices[e],m),m.scaleInPlace(this._mapSize/2),g.copyFromFloats(Math.round(m.x),Math.round(m.y),Math.round(m.z)),g.subtractInPlace(m).scaleInPlace(2/this._mapSize),i.Matrix.TranslationToRef(g.x,g.y,0,_),this._projectionMatrices[e].multiplyToRef(_,this._projectionMatrices[e]),this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e],this._transformMatrices[e]),this._transformMatrices[e].copyToArray(this._transformMatricesAsArray,16*e)}}},t.prototype._computeFrustumInWorldSpace=function(e){if(this._scene.activeCamera){var r=this._cascades[e].prevBreakDistance,n=this._cascades[e].breakDistance;this._scene.activeCamera.getViewMatrix();for(var o=i.Matrix.Invert(this._scene.activeCamera.getTransformationMatrix()),s=0;s<t.frustumCornersNDCSpace.length;++s)i.Vector3.TransformCoordinatesToRef(t.frustumCornersNDCSpace[s],o,this._frustumCornersWorldSpace[e][s]);for(s=0;s<t.frustumCornersNDCSpace.length/2;++s)m.copyFrom(this._frustumCornersWorldSpace[e][s+4]).subtractInPlace(this._frustumCornersWorldSpace[e][s]),g.copyFrom(m).scaleInPlace(r),m.scaleInPlace(n),m.addInPlace(this._frustumCornersWorldSpace[e][s]),this._frustumCornersWorldSpace[e][s+4].copyFrom(m),this._frustumCornersWorldSpace[e][s].addInPlace(g)}},t.prototype._computeCascadeFrustum=function(e){if(this._cascadeMinExtents[e].copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cascadeMaxExtents[e].copyFromFloats(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),this._frustumCenter[e].copyFromFloats(0,0,0),this._scene.activeCamera){for(var t=0;t<this._frustumCornersWorldSpace[e].length;++t)this._frustumCenter[e].addInPlace(this._frustumCornersWorldSpace[e][t]);if(this._frustumCenter[e].scaleInPlace(1/this._frustumCornersWorldSpace[e].length),this.stabilizeCascades){var r=0;for(t=0;t<this._frustumCornersWorldSpace[e].length;++t){var n=this._frustumCornersWorldSpace[e][t].subtractToRef(this._frustumCenter[e],m).length();r=Math.max(r,n)}r=Math.ceil(16*r)/16,this._cascadeMaxExtents[e].copyFromFloats(r,r,r),this._cascadeMinExtents[e].copyFromFloats(-r,-r,-r)}else{var o=this._frustumCenter[e];for(this._frustumCenter[e].addToRef(this._lightDirection,m),i.Matrix.LookAtLHToRef(o,m,f,_),t=0;t<this._frustumCornersWorldSpace[e].length;++t)i.Vector3.TransformCoordinatesToRef(this._frustumCornersWorldSpace[e][t],_,m),this._cascadeMinExtents[e].minimizeInPlace(m),this._cascadeMaxExtents[e].maximizeInPlace(m)}}},Object.defineProperty(t,"IsSupported",{get:function(){var e=h.EngineStore.LastCreatedEngine;return!!e&&1!=e.webGLVersion},enumerable:!1,configurable:!0}),t.prototype._initializeGenerator=function(){var r,n,o,s,a,l,u,d,h,f,p,m,g,_,v,y,b,A,T,M;this.penumbraDarkness=null!==(r=this.penumbraDarkness)&&void 0!==r?r:1,this._numCascades=null!==(n=this._numCascades)&&void 0!==n?n:t.DEFAULT_CASCADES_COUNT,this.stabilizeCascades=null!==(o=this.stabilizeCascades)&&void 0!==o&&o,this._freezeShadowCastersBoundingInfoObservable=null!==(s=this._freezeShadowCastersBoundingInfoObservable)&&void 0!==s?s:null,this.freezeShadowCastersBoundingInfo=null!==(a=this.freezeShadowCastersBoundingInfo)&&void 0!==a&&a,this._scbiMin=null!==(l=this._scbiMin)&&void 0!==l?l:new i.Vector3(0,0,0),this._scbiMax=null!==(u=this._scbiMax)&&void 0!==u?u:new i.Vector3(0,0,0),this._shadowCastersBoundingInfo=null!==(d=this._shadowCastersBoundingInfo)&&void 0!==d?d:new c.BoundingInfo(new i.Vector3(0,0,0),new i.Vector3(0,0,0)),this._breaksAreDirty=null===(h=this._breaksAreDirty)||void 0===h||h,this._minDistance=null!==(f=this._minDistance)&&void 0!==f?f:0,this._maxDistance=null!==(p=this._maxDistance)&&void 0!==p?p:1,this._currentLayer=null!==(m=this._currentLayer)&&void 0!==m?m:0,this._shadowMaxZ=null!==(v=null!==(g=this._shadowMaxZ)&&void 0!==g?g:null===(_=this._scene.activeCamera)||void 0===_?void 0:_.maxZ)&&void 0!==v?v:1e4,this._debug=null!==(y=this._debug)&&void 0!==y&&y,this._depthClamp=null===(b=this._depthClamp)||void 0===b||b,this._cascadeBlendPercentage=null!==(A=this._cascadeBlendPercentage)&&void 0!==A?A:.1,this._lambda=null!==(T=this._lambda)&&void 0!==T?T:.5,this._autoCalcDepthBounds=null!==(M=this._autoCalcDepthBounds)&&void 0!==M&&M,e.prototype._initializeGenerator.call(this)},t.prototype._createTargetRenderTexture=function(){var e={width:this._mapSize,height:this._mapSize,layers:this.numCascades};this._shadowMap=new o.RenderTargetTexture(this._light.name+"_shadowMap",e,this._scene,!1,!0,this._textureType,!1,void 0,!1,!1,void 0),this._shadowMap.createDepthStencilTexture(s.Constants.LESS,!0)},t.prototype._initializeShadowMap=function(){var r=this;if(e.prototype._initializeShadowMap.call(this),null!==this._shadowMap){this._transformMatricesAsArray=new Float32Array(16*this._numCascades),this._viewSpaceFrustumsZ=new Array(this._numCascades),this._frustumLengths=new Array(this._numCascades),this._lightSizeUVCorrection=new Array(2*this._numCascades),this._depthCorrection=new Array(this._numCascades),this._cascades=[],this._viewMatrices=[],this._projectionMatrices=[],this._transformMatrices=[],this._cascadeMinExtents=[],this._cascadeMaxExtents=[],this._frustumCenter=[],this._shadowCameraPos=[],this._frustumCornersWorldSpace=[];for(var n=0;n<this._numCascades;++n){this._cascades[n]={prevBreakDistance:0,breakDistance:0},this._viewMatrices[n]=i.Matrix.Zero(),this._projectionMatrices[n]=i.Matrix.Zero(),this._transformMatrices[n]=i.Matrix.Zero(),this._cascadeMinExtents[n]=new i.Vector3,this._cascadeMaxExtents[n]=new i.Vector3,this._frustumCenter[n]=new i.Vector3,this._shadowCameraPos[n]=new i.Vector3,this._frustumCornersWorldSpace[n]=new Array(t.frustumCornersNDCSpace.length);for(var o=0;o<t.frustumCornersNDCSpace.length;++o)this._frustumCornersWorldSpace[n][o]=new i.Vector3}this._shadowMap.onBeforeRenderObservable.add((function(e){if(r._currentLayer=e,r._scene.getSceneUniformBuffer().useUbo){var t=r._scene.getSceneUniformBuffer();t.updateMatrix("viewProjection",r.getCascadeTransformMatrix(e)),t.updateMatrix("view",r.getCascadeViewMatrix(e)),t.update()}})),this._shadowMap.onBeforeBindObservable.add((function(){r._breaksAreDirty&&r._splitFrustum(),r._computeMatrices()})),this._splitFrustum()}},t.prototype._bindCustomEffectForRenderSubMeshForShadowMap=function(e,t,r,n){var i,o,s,a,l;t.setMatrix(null!==(i=null==r?void 0:r.viewProjection)&&void 0!==i?i:"viewProjection",this.getCascadeTransformMatrix(this._currentLayer)),t.setMatrix(null!==(o=null==r?void 0:r.view)&&void 0!==o?o:"view",this.getCascadeViewMatrix(this._currentLayer)),t.setMatrix(null!==(s=null==r?void 0:r.projection)&&void 0!==s?s:"projection",this.getCascadeProjectionMatrix(this._currentLayer));var c=n.getWorldMatrix();c.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer),_),t.setMatrix(null!==(a=null==r?void 0:r.worldViewProjection)&&void 0!==a?a:"worldViewProjection",_),c.multiplyToRef(this.getCascadeViewMatrix(this._currentLayer),v),t.setMatrix(null!==(l=null==r?void 0:r.worldView)&&void 0!==l?l:"worldView",v)},t.prototype._isReadyCustomDefines=function(e,t,r){e.push("#define SM_DEPTHCLAMP "+(this._depthClamp&&this._filter!==l.ShadowGenerator.FILTER_PCSS?"1":"0"))},t.prototype.prepareDefines=function(t,r){e.prototype.prepareDefines.call(this,t,r);var n=this._scene,i=this._light;if(n.shadowsEnabled&&i.shadowEnabled){t["SHADOWCSM"+r]=!0,t["SHADOWCSMDEBUG"+r]=this.debug,t["SHADOWCSMNUM_CASCADES"+r]=this.numCascades,t["SHADOWCSM_RIGHTHANDED"+r]=n.useRightHandedSystem;var o=n.activeCamera;o&&this._shadowMaxZ<o.maxZ&&(t["SHADOWCSMUSESHADOWMAXZ"+r]=!0),0===this.cascadeBlendPercentage&&(t["SHADOWCSMNOBLEND"+r]=!0)}},t.prototype.bindShadowLight=function(e,t){var r=this._light,n=this._scene;if(n.shadowsEnabled&&r.shadowEnabled){var i=n.activeCamera;if(i){var o=this.getShadowMap();if(o){var s=o.getSize().width;if(t.setMatrices("lightMatrix"+e,this._transformMatricesAsArray),t.setArray("viewFrustumZ"+e,this._viewSpaceFrustumsZ),t.setFloat("cascadeBlendFactor"+e,0===this.cascadeBlendPercentage?1e4:1/this.cascadeBlendPercentage),t.setArray("frustumLengths"+e,this._frustumLengths),this._filter===l.ShadowGenerator.FILTER_PCF)t.setDepthStencilTexture("shadowSampler"+e,o),r._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),s,1/s,this.frustumEdgeFalloff,e);else if(this._filter===l.ShadowGenerator.FILTER_PCSS){for(var a=0;a<this._numCascades;++a)this._lightSizeUVCorrection[2*a+0]=0===a?1:(this._cascadeMaxExtents[0].x-this._cascadeMinExtents[0].x)/(this._cascadeMaxExtents[a].x-this._cascadeMinExtents[a].x),this._lightSizeUVCorrection[2*a+1]=0===a?1:(this._cascadeMaxExtents[0].y-this._cascadeMinExtents[0].y)/(this._cascadeMaxExtents[a].y-this._cascadeMinExtents[a].y),this._depthCorrection[a]=0===a?1:(this._cascadeMaxExtents[a].z-this._cascadeMinExtents[a].z)/(this._cascadeMaxExtents[0].z-this._cascadeMinExtents[0].z);t.setDepthStencilTexture("shadowSampler"+e,o),t.setTexture("depthSampler"+e,o),t.setArray2("lightSizeUVCorrection"+e,this._lightSizeUVCorrection),t.setArray("depthCorrection"+e,this._depthCorrection),t.setFloat("penumbraDarkness"+e,this.penumbraDarkness),r._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/s,this._contactHardeningLightSizeUVRatio*s,this.frustumEdgeFalloff,e)}else t.setTexture("shadowSampler"+e,o),r._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),s,1/s,this.frustumEdgeFalloff,e);r._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(i),this.getLight().getDepthMinZ(i)+this.getLight().getDepthMaxZ(i),e)}}}},t.prototype.getTransformMatrix=function(){return this.getCascadeTransformMatrix(0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._freezeShadowCastersBoundingInfoObservable&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._depthReducer&&(this._depthReducer.dispose(),this._depthReducer=null)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this),r=this.getShadowMap();if(!r)return t;if(t.numCascades=this._numCascades,t.debug=this._debug,t.stabilizeCascades=this.stabilizeCascades,t.lambda=this._lambda,t.cascadeBlendPercentage=this.cascadeBlendPercentage,t.depthClamp=this._depthClamp,t.autoCalcDepthBounds=this.autoCalcDepthBounds,t.shadowMaxZ=this._shadowMaxZ,t.penumbraDarkness=this.penumbraDarkness,t.freezeShadowCastersBoundingInfo=this._freezeShadowCastersBoundingInfo,t.minDistance=this.minDistance,t.maxDistance=this.maxDistance,t.renderList=[],r.renderList)for(var n=0;n<r.renderList.length;n++){var i=r.renderList[n];t.renderList.push(i.id)}return t},t.Parse=function(e,r){var n=l.ShadowGenerator.Parse(e,r,(function(e,r){return new t(e,r)}));return void 0!==e.numCascades&&(n.numCascades=e.numCascades),void 0!==e.debug&&(n.debug=e.debug),void 0!==e.stabilizeCascades&&(n.stabilizeCascades=e.stabilizeCascades),void 0!==e.lambda&&(n.lambda=e.lambda),void 0!==e.cascadeBlendPercentage&&(n.cascadeBlendPercentage=e.cascadeBlendPercentage),void 0!==e.depthClamp&&(n.depthClamp=e.depthClamp),void 0!==e.autoCalcDepthBounds&&(n.autoCalcDepthBounds=e.autoCalcDepthBounds),void 0!==e.shadowMaxZ&&(n.shadowMaxZ=e.shadowMaxZ),void 0!==e.penumbraDarkness&&(n.penumbraDarkness=e.penumbraDarkness),void 0!==e.freezeShadowCastersBoundingInfo&&(n.freezeShadowCastersBoundingInfo=e.freezeShadowCastersBoundingInfo),void 0!==e.minDistance&&void 0!==e.maxDistance&&n.setMinMaxDistance(e.minDistance,e.maxDistance),n},t.frustumCornersNDCSpace=[new i.Vector3(-1,1,-1),new i.Vector3(1,1,-1),new i.Vector3(1,-1,-1),new i.Vector3(-1,-1,-1),new i.Vector3(-1,1,1),new i.Vector3(1,1,1),new i.Vector3(1,-1,1),new i.Vector3(-1,-1,1)],t.CLASSNAME="CascadedShadowGenerator",t.DEFAULT_CASCADES_COUNT=4,t.MIN_CASCADES_COUNT=2,t.MAX_CASCADES_COUNT=4,t._SceneComponentInitialization=function(e){throw a._DevTools.WarnImport("ShadowGeneratorSceneComponent")},t}(l.ShadowGenerator)},"./Lights/Shadows/index.ts":
- /*!*********************************!*\
- !*** ./Lights/Shadows/index.ts ***!
- \*********************************/
- /*! exports provided: ShadowGenerator, CascadedShadowGenerator, ShadowGeneratorSceneComponent */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./shadowGenerator */"./Lights/Shadows/shadowGenerator.ts");r.d(t,"ShadowGenerator",(function(){return n.ShadowGenerator}));var i=r(/*! ./cascadedShadowGenerator */"./Lights/Shadows/cascadedShadowGenerator.ts");r.d(t,"CascadedShadowGenerator",(function(){return i.CascadedShadowGenerator}));var o=r(/*! ./shadowGeneratorSceneComponent */"./Lights/Shadows/shadowGeneratorSceneComponent.ts");r.d(t,"ShadowGeneratorSceneComponent",(function(){return o.ShadowGeneratorSceneComponent}))},"./Lights/Shadows/shadowGenerator.ts":
- /*!*******************************************!*\
- !*** ./Lights/Shadows/shadowGenerator.ts ***!
- \*******************************************/
- /*! exports provided: ShadowGenerator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShadowGenerator",(function(){return b}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../../Lights/light */"./Lights/light.ts"),l=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),c=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),d=r(/*! ../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),h=r(/*! ../../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),f=r(/*! ../../Engines/constants */"./Engines/constants.ts"),p=(r(/*! ../../Shaders/shadowMap.fragment */"./Shaders/shadowMap.fragment.ts"),r(/*! ../../Shaders/shadowMap.vertex */"./Shaders/shadowMap.vertex.ts"),r(/*! ../../Shaders/depthBoxBlur.fragment */"./Shaders/depthBoxBlur.fragment.ts"),r(/*! ../../Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow */"./Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.ts"),r(/*! ../../Misc/observable */"./Misc/observable.ts")),m=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),g=r(/*! ../../Materials/effectFallbacks */"./Materials/effectFallbacks.ts"),_=r(/*! ../../Rendering/renderingManager */"./Rendering/renderingManager.ts"),v=new i.Matrix,y=new i.Matrix,b=function(){function e(t,r,n){this.onBeforeShadowMapRenderObservable=new p.Observable,this.onAfterShadowMapRenderObservable=new p.Observable,this.onBeforeShadowMapRenderMeshObservable=new p.Observable,this.onAfterShadowMapRenderMeshObservable=new p.Observable,this._bias=5e-5,this._normalBias=0,this._blurBoxOffset=1,this._blurScale=2,this._blurKernel=1,this._useKernelBlur=!1,this._filter=e.FILTER_NONE,this._filteringQuality=e.QUALITY_HIGH,this._contactHardeningLightSizeUVRatio=.1,this._darkness=0,this._transparencyShadow=!1,this.enableSoftTransparentShadow=!1,this.frustumEdgeFalloff=0,this.forceBackFacesOnly=!1,this._lightDirection=i.Vector3.Zero(),this._viewMatrix=i.Matrix.Zero(),this._projectionMatrix=i.Matrix.Zero(),this._transformMatrix=i.Matrix.Zero(),this._cachedPosition=new i.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cachedDirection=new i.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._currentFaceIndex=0,this._currentFaceIndexCache=0,this._defaultTextureMatrix=i.Matrix.Identity(),this._mapSize=t,this._light=r,this._scene=r.getScene(),r._shadowGenerator=this,e._SceneComponentInitialization(this._scene);var o=this._scene.getEngine().getCaps();n?o.textureFloatRender&&o.textureFloatLinearFiltering?this._textureType=f.Constants.TEXTURETYPE_FLOAT:o.textureHalfFloatRender&&o.textureHalfFloatLinearFiltering?this._textureType=f.Constants.TEXTURETYPE_HALF_FLOAT:this._textureType=f.Constants.TEXTURETYPE_UNSIGNED_INT:o.textureHalfFloatRender&&o.textureHalfFloatLinearFiltering?this._textureType=f.Constants.TEXTURETYPE_HALF_FLOAT:o.textureFloatRender&&o.textureFloatLinearFiltering?this._textureType=f.Constants.TEXTURETYPE_FLOAT:this._textureType=f.Constants.TEXTURETYPE_UNSIGNED_INT,this._initializeGenerator(),this._applyFilterValues()}return Object.defineProperty(e.prototype,"bias",{get:function(){return this._bias},set:function(e){this._bias=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"normalBias",{get:function(){return this._normalBias},set:function(e){this._normalBias=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurBoxOffset",{get:function(){return this._blurBoxOffset},set:function(e){this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurScale",{get:function(){return this._blurScale},set:function(e){this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurKernel",{get:function(){return this._blurKernel},set:function(e){this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useKernelBlur",{get:function(){return this._useKernelBlur},set:function(e){this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthScale",{get:function(){return void 0!==this._depthScale?this._depthScale:this._light.getDepthScale()},set:function(e){this._depthScale=e},enumerable:!1,configurable:!0}),e.prototype._validateFilter=function(e){return e},Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},set:function(t){if(t=this._validateFilter(t),this._light.needCube()){if(t===e.FILTER_BLUREXPONENTIALSHADOWMAP)return void(this.useExponentialShadowMap=!0);if(t===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)return void(this.useCloseExponentialShadowMap=!0);if(t===e.FILTER_PCF||t===e.FILTER_PCSS)return void(this.usePoissonSampling=!0)}t!==e.FILTER_PCF&&t!==e.FILTER_PCSS||1!==this._scene.getEngine().webGLVersion?this._filter!==t&&(this._filter=t,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty()):this.usePoissonSampling=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usePoissonSampling",{get:function(){return this.filter===e.FILTER_POISSONSAMPLING},set:function(t){var r=this._validateFilter(e.FILTER_POISSONSAMPLING);(t||this.filter===e.FILTER_POISSONSAMPLING)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useExponentialShadowMap",{get:function(){return this.filter===e.FILTER_EXPONENTIALSHADOWMAP},set:function(t){var r=this._validateFilter(e.FILTER_EXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_EXPONENTIALSHADOWMAP)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useBlurExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP},set:function(t){var r=this._validateFilter(e.FILTER_BLUREXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP},set:function(t){var r=this._validateFilter(e.FILTER_CLOSEEXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useBlurCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP},set:function(t){var r=this._validateFilter(e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);(t||this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usePercentageCloserFiltering",{get:function(){return this.filter===e.FILTER_PCF},set:function(t){var r=this._validateFilter(e.FILTER_PCF);(t||this.filter===e.FILTER_PCF)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteringQuality",{get:function(){return this._filteringQuality},set:function(e){this._filteringQuality!==e&&(this._filteringQuality=e,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useContactHardeningShadow",{get:function(){return this.filter===e.FILTER_PCSS},set:function(t){var r=this._validateFilter(e.FILTER_PCSS);(t||this.filter===e.FILTER_PCSS)&&(this.filter=t?r:e.FILTER_NONE)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contactHardeningLightSizeUVRatio",{get:function(){return this._contactHardeningLightSizeUVRatio},set:function(e){this._contactHardeningLightSizeUVRatio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"darkness",{get:function(){return this._darkness},set:function(e){this.setDarkness(e)},enumerable:!1,configurable:!0}),e.prototype.getDarkness=function(){return this._darkness},e.prototype.setDarkness=function(e){return this._darkness=e>=1?1:e<=0?0:e,this},Object.defineProperty(e.prototype,"transparencyShadow",{get:function(){return this._transparencyShadow},set:function(e){this.setTransparencyShadow(e)},enumerable:!1,configurable:!0}),e.prototype.setTransparencyShadow=function(e){return this._transparencyShadow=e,this},e.prototype.getShadowMap=function(){return this._shadowMap},e.prototype.getShadowMapForRendering=function(){return this._shadowMap2?this._shadowMap2:this._shadowMap},e.prototype.getClassName=function(){return e.CLASSNAME},e.prototype.addShadowCaster=function(e,t){var r;return void 0===t&&(t=!0),this._shadowMap?(this._shadowMap.renderList||(this._shadowMap.renderList=[]),this._shadowMap.renderList.push(e),t&&(r=this._shadowMap.renderList).push.apply(r,e.getChildMeshes()),this):this},e.prototype.removeShadowCaster=function(e,t){if(void 0===t&&(t=!0),!this._shadowMap||!this._shadowMap.renderList)return this;var r=this._shadowMap.renderList.indexOf(e);if(-1!==r&&this._shadowMap.renderList.splice(r,1),t)for(var n=0,i=e.getChildren();n<i.length;n++){var o=i[n];this.removeShadowCaster(o)}return this},e.prototype.getLight=function(){return this._light},e.prototype._initializeGenerator=function(){this._light._markMeshesAsLightDirty(),this._initializeShadowMap()},e.prototype._createTargetRenderTexture=function(){this._scene.getEngine().webGLVersion>1?(this._shadowMap=new u.RenderTargetTexture(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1),this._shadowMap.createDepthStencilTexture(f.Constants.LESS,!0)):this._shadowMap=new u.RenderTargetTexture(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube())},e.prototype._initializeShadowMap=function(){var t=this;if(this._createTargetRenderTexture(),null!==this._shadowMap){this._shadowMap.wrapU=c.Texture.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=c.Texture.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(c.Texture.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._storedUniqueId&&(this._shadowMap.uniqueId=this._storedUniqueId),this._shadowMap.customRenderFunction=this._renderForShadowMap.bind(this),this._shadowMap.customIsReadyFunction=function(e,t){return!0};var r=this._scene.getEngine();this._shadowMap.onBeforeRenderObservable.add((function(n){if(t._currentFaceIndex=n,t._filter===e.FILTER_PCF&&r.setColorWrite(!1),t._scene.getSceneUniformBuffer().useUbo){var i=t._scene.getSceneUniformBuffer();i.updateMatrix("viewProjection",t.getTransformMatrix()),i.updateMatrix("view",t._viewMatrix),i.update()}})),this._shadowMap.onAfterUnbindObservable.add((function(){if(t._scene.getSceneUniformBuffer().useUbo){var n=t._scene.getSceneUniformBuffer();n.updateMatrix("viewProjection",t._scene.getTransformMatrix()),n.updateMatrix("view",t._scene.getViewMatrix()),n.update()}if(t._filter===e.FILTER_PCF&&r.setColorWrite(!0),t.useBlurExponentialShadowMap||t.useBlurCloseExponentialShadowMap){var i=t.getShadowMapForRendering();if(i){var o=i.getInternalTexture();t._scene.postProcessManager.directRender(t._blurPostProcesses,o,!0),r.unBindFramebuffer(o,!0)}}}));var n=new o.Color4(0,0,0,0),i=new o.Color4(1,1,1,1);this._shadowMap.onClearObservable.add((function(r){t._filter===e.FILTER_PCF?r.clear(i,!1,!0,!1):t.useExponentialShadowMap||t.useBlurExponentialShadowMap?r.clear(n,!0,!0,!1):r.clear(i,!0,!0,!1)})),this._shadowMap.onResizeObservable.add((function(e){t._storedUniqueId=t._shadowMap.uniqueId,t._mapSize=e.getRenderSize(),t._light._markMeshesAsLightDirty(),t.recreateShadowMap()}));for(var s=_.RenderingManager.MIN_RENDERINGGROUPS;s<_.RenderingManager.MAX_RENDERINGGROUPS;s++)this._shadowMap.setRenderingAutoClearDepthStencil(s,!1)}},e.prototype._initializeBlurRTTAndPostProcesses=function(){var e=this,t=this._scene.getEngine(),r=this._mapSize/this.blurScale;this.useKernelBlur&&1===this.blurScale||(this._shadowMap2=new u.RenderTargetTexture(this._light.name+"_shadowMap2",r,this._scene,!1,!0,this._textureType),this._shadowMap2.wrapU=c.Texture.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=c.Texture.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(c.Texture.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new h.BlurPostProcess(this._light.name+"KernelBlurX",new i.Vector2(1,0),this.blurKernel,1,null,c.Texture.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.width=r,this._kernelBlurXPostprocess.height=r,this._kernelBlurXPostprocess.onApplyObservable.add((function(t){t.setTexture("textureSampler",e._shadowMap)})),this._kernelBlurYPostprocess=new h.BlurPostProcess(this._light.name+"KernelBlurY",new i.Vector2(0,1),this.blurKernel,1,null,c.Texture.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.autoClear=!1,this._kernelBlurYPostprocess.autoClear=!1,this._textureType===f.Constants.TEXTURETYPE_UNSIGNED_INT&&(this._kernelBlurXPostprocess.packedFloat=!0,this._kernelBlurYPostprocess.packedFloat=!0),this._blurPostProcesses=[this._kernelBlurXPostprocess,this._kernelBlurYPostprocess]):(this._boxBlurPostprocess=new d.PostProcess(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,c.Texture.BILINEAR_SAMPLINGMODE,t,!1,"#define OFFSET "+this._blurBoxOffset,this._textureType),this._boxBlurPostprocess.onApplyObservable.add((function(t){t.setFloat2("screenSize",r,r),t.setTexture("textureSampler",e._shadowMap)})),this._boxBlurPostprocess.autoClear=!1,this._blurPostProcesses=[this._boxBlurPostprocess])},e.prototype._renderForShadowMap=function(e,t,r,n){var i,o=this._scene.getEngine(),s=o.getColorWrite();if(n.length){for(o.setColorWrite(!1),i=0;i<n.length;i++)this._renderSubMeshForShadowMap(n.data[i]);o.setColorWrite(s)}for(i=0;i<e.length;i++)this._renderSubMeshForShadowMap(e.data[i]);for(i=0;i<t.length;i++)this._renderSubMeshForShadowMap(t.data[i]);if(this._transparencyShadow)for(i=0;i<r.length;i++)this._renderSubMeshForShadowMap(r.data[i],!0);else for(i=0;i<r.length;i++)r.data[i].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate=!1},e.prototype._bindCustomEffectForRenderSubMeshForShadowMap=function(e,t,r,n){var i,o,s,a,l,c;t.setMatrix(null!==(i=null==r?void 0:r.viewProjection)&&void 0!==i?i:"viewProjection",this.getTransformMatrix()),t.setMatrix(null!==(o=null==r?void 0:r.view)&&void 0!==o?o:"view",this._viewMatrix),t.setMatrix(null!==(s=null==r?void 0:r.projection)&&void 0!==s?s:"projection",this._projectionMatrix);var u=n.getWorldMatrix();t.setMatrix(null!==(a=null==r?void 0:r.world)&&void 0!==a?a:"world",u),u.multiplyToRef(this.getTransformMatrix(),v),t.setMatrix(null!==(l=null==r?void 0:r.worldViewProjection)&&void 0!==l?l:"worldViewProjection",v),u.multiplyToRef(this._viewMatrix,y),t.setMatrix(null!==(c=null==r?void 0:r.worldView)&&void 0!==c?c:"worldView",y)},e.prototype._renderSubMeshForShadowMap=function(e,t){var r,n;void 0===t&&(t=!1);var i=e.getRenderingMesh(),o=e.getEffectiveMesh(),s=this._scene,c=s.getEngine(),u=e.getMaterial();if(o._internalAbstractMeshDataInfo._isActiveIntermediate=!1,u&&0!==e.verticesCount){c.setState(u.backFaceCulling);var d=i._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(!d.mustReturn){var h=c.getCaps().instancedArrays&&(null!==d.visibleInstances[e._id]&&void 0!==d.visibleInstances[e._id]||i.hasThinInstances);if(this.isReady(e,h,t)){var f=null===(r=i.material)||void 0===r?void 0:r.shadowDepthWrapper,p=null!==(n=null==f?void 0:f.getEffect(e,this))&&void 0!==n?n:this._effect;if(c.enableEffect(p),i._bind(e,p,u.fillMode),this.getTransformMatrix(),p.setFloat3("biasAndScaleSM",this.bias,this.normalBias,this.depthScale),this.getLight().getTypeID()===a.Light.LIGHTTYPEID_DIRECTIONALLIGHT?p.setVector3("lightDataSM",this._cachedDirection):p.setVector3("lightDataSM",this._cachedPosition),s.activeCamera&&p.setFloat2("depthValuesSM",this.getLight().getDepthMinZ(s.activeCamera),this.getLight().getDepthMinZ(s.activeCamera)+this.getLight().getDepthMaxZ(s.activeCamera)),t&&this.enableSoftTransparentShadow&&p.setFloat("softTransparentShadowSM",o.visibility),f)e._effectOverride=p,f.standalone?f.baseMaterial.bindForSubMesh(o.getWorldMatrix(),i,e):u.bindForSubMesh(o.getWorldMatrix(),i,e),e._effectOverride=null;else{if(p.setMatrix("viewProjection",this.getTransformMatrix()),u&&u.needAlphaTesting()){var m=u.getAlphaTestTexture();m&&(p.setTexture("diffuseSampler",m),p.setMatrix("diffuseMatrix",m.getTextureMatrix()||this._defaultTextureMatrix))}if(i.useBones&&i.computeBonesUsingShaders&&i.skeleton){var g=i.skeleton;if(g.isUsingTextureForMatrices){var _=g.getTransformMatrixTexture(i);if(!_)return;p.setTexture("boneSampler",_),p.setFloat("boneTextureWidth",4*(g.bones.length+1))}else p.setMatrices("mBones",g.getTransformMatrices(i))}l.MaterialHelper.BindMorphTargetParameters(i,p),l.MaterialHelper.BindClipPlane(p,s)}this._bindCustomEffectForRenderSubMeshForShadowMap(e,p,null==f?void 0:f._matriceNames,o),this.forceBackFacesOnly&&c.setState(!0,0,!1,!0),this.onBeforeShadowMapRenderMeshObservable.notifyObservers(i),this.onBeforeShadowMapRenderObservable.notifyObservers(p),i._processRendering(o,e,p,u.fillMode,d,h,(function(e,t){return p.setMatrix("world",t)})),this.forceBackFacesOnly&&c.setState(!0,0,!1,!1),this.onAfterShadowMapRenderObservable.notifyObservers(p),this.onAfterShadowMapRenderMeshObservable.notifyObservers(i)}else this._shadowMap&&this._shadowMap.resetRefreshCounter()}}},e.prototype._applyFilterValues=function(){this._shadowMap&&(this.filter===e.FILTER_NONE||this.filter===e.FILTER_PCSS?this._shadowMap.updateSamplingMode(c.Texture.NEAREST_SAMPLINGMODE):this._shadowMap.updateSamplingMode(c.Texture.BILINEAR_SAMPLINGMODE))},e.prototype.forceCompilation=function(e,t){var r=this,i=Object(n.__assign)({useInstances:!1},t),o=this.getShadowMap();if(o){var s=o.renderList;if(s){for(var a=new Array,l=0,c=s;l<c.length;l++){var u=c[l];a.push.apply(a,u.subMeshes)}if(0!==a.length){var d=0,h=function(){var t,n;if(r._scene&&r._scene.getEngine()){for(;r.isReady(a[d],i.useInstances,null!==(n=null===(t=a[d].getMaterial())||void 0===t?void 0:t.needAlphaBlendingForMesh(a[d].getMesh()))&&void 0!==n&&n);)if(++d>=a.length)return void(e&&e(r));setTimeout(h,16)}};h()}else e&&e(this)}else e&&e(this)}else e&&e(this)},e.prototype.forceCompilationAsync=function(e){var t=this;return new Promise((function(r){t.forceCompilation((function(){r()}),e)}))},e.prototype._isReadyCustomDefines=function(e,t,r){},e.prototype._prepareShadowDefines=function(e,t,r,n){r.push("#define SM_FLOAT "+(this._textureType!==f.Constants.TEXTURETYPE_UNSIGNED_INT?"1":"0")),r.push("#define SM_ESM "+(this.useExponentialShadowMap||this.useBlurExponentialShadowMap?"1":"0")),r.push("#define SM_DEPTHTEXTURE "+(this.usePercentageCloserFiltering||this.useContactHardeningShadow?"1":"0"));var i=e.getMesh();return r.push("#define SM_NORMALBIAS "+(this.normalBias&&i.isVerticesDataPresent(s.VertexBuffer.NormalKind)?"1":"0")),r.push("#define SM_DIRECTIONINLIGHTDATA "+(this.getLight().getTypeID()===a.Light.LIGHTTYPEID_DIRECTIONALLIGHT?"1":"0")),r.push("#define SM_USEDISTANCE "+(this._light.needCube()?"1":"0")),r.push("#define SM_SOFTTRANSPARENTSHADOW "+(this.enableSoftTransparentShadow&&n?"1":"0")),this._isReadyCustomDefines(r,e,t),r},e.prototype.isReady=function(e,t,r){var n=e.getMaterial(),i=null==n?void 0:n.shadowDepthWrapper,o=[];if(this._prepareShadowDefines(e,t,o,r),i){if(!i.isReadyForSubMesh(e,o,this,t))return!1}else{var a=[s.VertexBuffer.PositionKind],c=e.getMesh();if(this.normalBias&&c.isVerticesDataPresent(s.VertexBuffer.NormalKind)&&(a.push(s.VertexBuffer.NormalKind),o.push("#define NORMAL"),c.nonUniformScaling&&o.push("#define NONUNIFORMSCALING")),n&&n.needAlphaTesting()){var u=n.getAlphaTestTexture();if(u){if(!u.isReady())return!1;o.push("#define ALPHATEST"),c.isVerticesDataPresent(s.VertexBuffer.UVKind)&&(a.push(s.VertexBuffer.UVKind),o.push("#define UV1")),c.isVerticesDataPresent(s.VertexBuffer.UV2Kind)&&1===u.coordinatesIndex&&(a.push(s.VertexBuffer.UV2Kind),o.push("#define UV2"))}}var d=new g.EffectFallbacks;if(c.useBones&&c.computeBonesUsingShaders&&c.skeleton){a.push(s.VertexBuffer.MatricesIndicesKind),a.push(s.VertexBuffer.MatricesWeightsKind),c.numBoneInfluencers>4&&(a.push(s.VertexBuffer.MatricesIndicesExtraKind),a.push(s.VertexBuffer.MatricesWeightsExtraKind));var h=c.skeleton;o.push("#define NUM_BONE_INFLUENCERS "+c.numBoneInfluencers),c.numBoneInfluencers>0&&d.addCPUSkinningFallback(0,c),h.isUsingTextureForMatrices?o.push("#define BONETEXTURE"):o.push("#define BonesPerMesh "+(h.bones.length+1))}else o.push("#define NUM_BONE_INFLUENCERS 0");var f=c.morphTargetManager,p=0;f&&f.numInfluencers>0&&(o.push("#define MORPHTARGETS"),p=f.numInfluencers,o.push("#define NUM_MORPH_INFLUENCERS "+p),l.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(a,c,p));var m=this._scene;if(m.clipPlane&&o.push("#define CLIPPLANE"),m.clipPlane2&&o.push("#define CLIPPLANE2"),m.clipPlane3&&o.push("#define CLIPPLANE3"),m.clipPlane4&&o.push("#define CLIPPLANE4"),m.clipPlane5&&o.push("#define CLIPPLANE5"),m.clipPlane6&&o.push("#define CLIPPLANE6"),t&&(o.push("#define INSTANCES"),l.MaterialHelper.PushAttributesForInstances(a),e.getRenderingMesh().hasThinInstances&&o.push("#define THIN_INSTANCES")),this.customShaderOptions&&this.customShaderOptions.defines)for(var _=0,v=this.customShaderOptions.defines;_<v.length;_++){var y=v[_];-1===o.indexOf(y)&&o.push(y)}var b=o.join("\n");if(this._cachedDefines!==b){this._cachedDefines=b;var A="shadowMap",T=["world","mBones","viewProjection","diffuseMatrix","lightDataSM","depthValuesSM","biasAndScaleSM","morphTargetInfluences","boneTextureWidth","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","softTransparentShadowSM"],M=["diffuseSampler","boneSampler"];if(this.customShaderOptions){if(A=this.customShaderOptions.shaderName,this.customShaderOptions.attributes)for(var P=0,S=this.customShaderOptions.attributes;P<S.length;P++){var E=S[P];-1===a.indexOf(E)&&a.push(E)}if(this.customShaderOptions.uniforms)for(var C=0,x=this.customShaderOptions.uniforms;C<x.length;C++){var R=x[C];-1===T.indexOf(R)&&T.push(R)}if(this.customShaderOptions.samplers)for(var O=0,I=this.customShaderOptions.samplers;O<I.length;O++){var D=I[O];-1===M.indexOf(D)&&M.push(D)}}this._effect=this._scene.getEngine().createEffect(A,a,T,M,b,d,void 0,void 0,{maxSimultaneousMorphTargets:p})}if(!this._effect.isReady())return!1}return(this.useBlurExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(this._blurPostProcesses&&this._blurPostProcesses.length||this._initializeBlurRTTAndPostProcesses()),!(this._kernelBlurXPostprocess&&!this._kernelBlurXPostprocess.isReady()||this._kernelBlurYPostprocess&&!this._kernelBlurYPostprocess.isReady()||this._boxBlurPostprocess&&!this._boxBlurPostprocess.isReady())},e.prototype.prepareDefines=function(t,r){var n=this._scene,i=this._light;n.shadowsEnabled&&i.shadowEnabled&&(t["SHADOW"+r]=!0,this.useContactHardeningShadow?(t["SHADOWPCSS"+r]=!0,this._filteringQuality===e.QUALITY_LOW?t["SHADOWLOWQUALITY"+r]=!0:this._filteringQuality===e.QUALITY_MEDIUM&&(t["SHADOWMEDIUMQUALITY"+r]=!0)):this.usePercentageCloserFiltering?(t["SHADOWPCF"+r]=!0,this._filteringQuality===e.QUALITY_LOW?t["SHADOWLOWQUALITY"+r]=!0:this._filteringQuality===e.QUALITY_MEDIUM&&(t["SHADOWMEDIUMQUALITY"+r]=!0)):this.usePoissonSampling?t["SHADOWPOISSON"+r]=!0:this.useExponentialShadowMap||this.useBlurExponentialShadowMap?t["SHADOWESM"+r]=!0:(this.useCloseExponentialShadowMap||this.useBlurCloseExponentialShadowMap)&&(t["SHADOWCLOSEESM"+r]=!0),i.needCube()&&(t["SHADOWCUBE"+r]=!0))},e.prototype.bindShadowLight=function(t,r){var n=this._light,i=this._scene;if(i.shadowsEnabled&&n.shadowEnabled){var o=i.activeCamera;if(o){var s=this.getShadowMap();s&&(n.needCube()||r.setMatrix("lightMatrix"+t,this.getTransformMatrix()),this._filter===e.FILTER_PCF?(r.setDepthStencilTexture("shadowSampler"+t,this.getShadowMapForRendering()),n._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),s.getSize().width,1/s.getSize().width,this.frustumEdgeFalloff,t)):this._filter===e.FILTER_PCSS?(r.setDepthStencilTexture("shadowSampler"+t,this.getShadowMapForRendering()),r.setTexture("depthSampler"+t,this.getShadowMapForRendering()),n._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),1/s.getSize().width,this._contactHardeningLightSizeUVRatio*s.getSize().width,this.frustumEdgeFalloff,t)):(r.setTexture("shadowSampler"+t,this.getShadowMapForRendering()),n._uniformBuffer.updateFloat4("shadowsInfo",this.getDarkness(),this.blurScale/s.getSize().width,this.depthScale,this.frustumEdgeFalloff,t)),n._uniformBuffer.updateFloat2("depthValues",this.getLight().getDepthMinZ(o),this.getLight().getDepthMinZ(o)+this.getLight().getDepthMaxZ(o),t))}}},e.prototype.getTransformMatrix=function(){var e=this._scene;if(this._currentRenderID===e.getRenderId()&&this._currentFaceIndexCache===this._currentFaceIndex)return this._transformMatrix;this._currentRenderID=e.getRenderId(),this._currentFaceIndexCache=this._currentFaceIndex;var t=this._light.position;if(this._light.computeTransformedInformation()&&(t=this._light.transformedPosition),i.Vector3.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex),this._lightDirection),1===Math.abs(i.Vector3.Dot(this._lightDirection,i.Vector3.Up()))&&(this._lightDirection.z=1e-13),this._light.needProjectionMatrixCompute()||!this._cachedPosition||!this._cachedDirection||!t.equals(this._cachedPosition)||!this._lightDirection.equals(this._cachedDirection)){this._cachedPosition.copyFrom(t),this._cachedDirection.copyFrom(this._lightDirection),i.Matrix.LookAtLHToRef(t,t.add(this._lightDirection),i.Vector3.Up(),this._viewMatrix);var r=this.getShadowMap();if(r){var n=r.renderList;n&&this._light.setShadowProjectionMatrix(this._projectionMatrix,this._viewMatrix,n)}this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix)}return this._transformMatrix},e.prototype.recreateShadowMap=function(){var e=this._shadowMap;if(e){var t=e.renderList;this._disposeRTTandPostProcesses(),this._initializeGenerator(),this.filter=this.filter,this._applyFilterValues(),this._shadowMap.renderList=t}},e.prototype._disposeBlurPostProcesses=function(){this._shadowMap2&&(this._shadowMap2.dispose(),this._shadowMap2=null),this._boxBlurPostprocess&&(this._boxBlurPostprocess.dispose(),this._boxBlurPostprocess=null),this._kernelBlurXPostprocess&&(this._kernelBlurXPostprocess.dispose(),this._kernelBlurXPostprocess=null),this._kernelBlurYPostprocess&&(this._kernelBlurYPostprocess.dispose(),this._kernelBlurYPostprocess=null),this._blurPostProcesses=[]},e.prototype._disposeRTTandPostProcesses=function(){this._shadowMap&&(this._shadowMap.dispose(),this._shadowMap=null),this._disposeBlurPostProcesses()},e.prototype.dispose=function(){this._disposeRTTandPostProcesses(),this._light&&(this._light._shadowGenerator=null,this._light._markMeshesAsLightDirty()),this.onBeforeShadowMapRenderMeshObservable.clear(),this.onBeforeShadowMapRenderObservable.clear(),this.onAfterShadowMapRenderMeshObservable.clear(),this.onAfterShadowMapRenderObservable.clear()},e.prototype.serialize=function(){var e={},t=this.getShadowMap();if(!t)return e;if(e.className=this.getClassName(),e.lightId=this._light.id,e.mapSize=t.getRenderSize(),e.forceBackFacesOnly=this.forceBackFacesOnly,e.darkness=this.getDarkness(),e.transparencyShadow=this._transparencyShadow,e.frustumEdgeFalloff=this.frustumEdgeFalloff,e.bias=this.bias,e.normalBias=this.normalBias,e.usePercentageCloserFiltering=this.usePercentageCloserFiltering,e.useContactHardeningShadow=this.useContactHardeningShadow,e.contactHardeningLightSizeUVRatio=this.contactHardeningLightSizeUVRatio,e.filteringQuality=this.filteringQuality,e.useExponentialShadowMap=this.useExponentialShadowMap,e.useBlurExponentialShadowMap=this.useBlurExponentialShadowMap,e.useCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.useBlurCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.usePoissonSampling=this.usePoissonSampling,e.depthScale=this.depthScale,e.blurBoxOffset=this.blurBoxOffset,e.blurKernel=this.blurKernel,e.blurScale=this.blurScale,e.useKernelBlur=this.useKernelBlur,e.renderList=[],t.renderList)for(var r=0;r<t.renderList.length;r++){var n=t.renderList[r];e.renderList.push(n.id)}return e},e.Parse=function(t,r,n){for(var i=r.getLightByID(t.lightId),o=n?n(t.mapSize,i):new e(t.mapSize,i),s=o.getShadowMap(),a=0;a<t.renderList.length;a++)r.getMeshesByID(t.renderList[a]).forEach((function(e){s&&(s.renderList||(s.renderList=[]),s.renderList.push(e))}));return o.forceBackFacesOnly=!!t.forceBackFacesOnly,void 0!==t.darkness&&o.setDarkness(t.darkness),t.transparencyShadow&&o.setTransparencyShadow(!0),void 0!==t.frustumEdgeFalloff&&(o.frustumEdgeFalloff=t.frustumEdgeFalloff),void 0!==t.bias&&(o.bias=t.bias),void 0!==t.normalBias&&(o.normalBias=t.normalBias),t.usePercentageCloserFiltering?o.usePercentageCloserFiltering=!0:t.useContactHardeningShadow?o.useContactHardeningShadow=!0:t.usePoissonSampling?o.usePoissonSampling=!0:t.useExponentialShadowMap?o.useExponentialShadowMap=!0:t.useBlurExponentialShadowMap?o.useBlurExponentialShadowMap=!0:t.useCloseExponentialShadowMap?o.useCloseExponentialShadowMap=!0:t.useBlurCloseExponentialShadowMap?o.useBlurCloseExponentialShadowMap=!0:t.useVarianceShadowMap?o.useExponentialShadowMap=!0:t.useBlurVarianceShadowMap&&(o.useBlurExponentialShadowMap=!0),void 0!==t.contactHardeningLightSizeUVRatio&&(o.contactHardeningLightSizeUVRatio=t.contactHardeningLightSizeUVRatio),void 0!==t.filteringQuality&&(o.filteringQuality=t.filteringQuality),t.depthScale&&(o.depthScale=t.depthScale),t.blurScale&&(o.blurScale=t.blurScale),t.blurBoxOffset&&(o.blurBoxOffset=t.blurBoxOffset),t.useKernelBlur&&(o.useKernelBlur=t.useKernelBlur),t.blurKernel&&(o.blurKernel=t.blurKernel),o},e.CLASSNAME="ShadowGenerator",e.FILTER_NONE=0,e.FILTER_EXPONENTIALSHADOWMAP=1,e.FILTER_POISSONSAMPLING=2,e.FILTER_BLUREXPONENTIALSHADOWMAP=3,e.FILTER_CLOSEEXPONENTIALSHADOWMAP=4,e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP=5,e.FILTER_PCF=6,e.FILTER_PCSS=7,e.QUALITY_HIGH=0,e.QUALITY_MEDIUM=1,e.QUALITY_LOW=2,e._SceneComponentInitialization=function(e){throw m._DevTools.WarnImport("ShadowGeneratorSceneComponent")},e}()},"./Lights/Shadows/shadowGeneratorSceneComponent.ts":
- /*!*********************************************************!*\
- !*** ./Lights/Shadows/shadowGeneratorSceneComponent.ts ***!
- \*********************************************************/
- /*! exports provided: ShadowGeneratorSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"ShadowGeneratorSceneComponent",(function(){return s}));var n=r(/*! ./shadowGenerator */"./Lights/Shadows/shadowGenerator.ts"),i=r(/*! ./cascadedShadowGenerator */"./Lights/Shadows/cascadedShadowGenerator.ts"),o=r(/*! ../../sceneComponent */"./sceneComponent.ts");r(/*! ../../abstractScene */"./abstractScene.ts").AbstractScene.AddParser(o.SceneComponentConstants.NAME_SHADOWGENERATOR,(function(e,t){if(void 0!==e.shadowGenerators&&null!==e.shadowGenerators)for(var r=0,o=e.shadowGenerators.length;r<o;r++){var s=e.shadowGenerators[r];s.className===i.CascadedShadowGenerator.CLASSNAME?i.CascadedShadowGenerator.Parse(s,t):n.ShadowGenerator.Parse(s,t)}}));var s=function(){function e(e){this.name=o.SceneComponentConstants.NAME_SHADOWGENERATOR,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(o.SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR,this,this._gatherRenderTargets)},e.prototype.rebuild=function(){},e.prototype.serialize=function(e){e.shadowGenerators=[];for(var t=0,r=this.scene.lights;t<r.length;t++){var n=r[t].getShadowGenerator();n&&e.shadowGenerators.push(n.serialize())}},e.prototype.addFromContainer=function(e){},e.prototype.removeFromContainer=function(e,t){},e.prototype.dispose=function(){},e.prototype._gatherRenderTargets=function(e){var t=this.scene;if(this.scene.shadowsEnabled)for(var r=0;r<t.lights.length;r++){var n=t.lights[r],i=n.getShadowGenerator();if(n.isEnabled()&&n.shadowEnabled&&i){var o=i.getShadowMap();-1!==t.textures.indexOf(o)&&e.push(o)}}},e}();n.ShadowGenerator._SceneComponentInitialization=function(e){var t=e._getComponent(o.SceneComponentConstants.NAME_SHADOWGENERATOR);t||(t=new s(e),e._addComponent(t))}},"./Lights/directionalLight.ts":
- /*!************************************!*\
- !*** ./Lights/directionalLight.ts ***!
- \************************************/
- /*! exports provided: DirectionalLight */function(e,t,r){"use strict";r.r(t),r.d(t,"DirectionalLight",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts"),l=r(/*! ./shadowLight */"./Lights/shadowLight.ts");s.Node.AddNodeConstructor("Light_Type_1",(function(e,t){return function(){return new c(e,o.Vector3.Zero(),t)}}));var c=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i._shadowFrustumSize=0,i._shadowOrthoScale=.1,i.autoUpdateExtends=!0,i.autoCalcShadowZBounds=!1,i._orthoLeft=Number.MAX_VALUE,i._orthoRight=Number.MIN_VALUE,i._orthoTop=Number.MIN_VALUE,i._orthoBottom=Number.MAX_VALUE,i.position=r.scale(-1),i.direction=r,i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"shadowFrustumSize",{get:function(){return this._shadowFrustumSize},set:function(e){this._shadowFrustumSize=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowOrthoScale",{get:function(){return this._shadowOrthoScale},set:function(e){this._shadowOrthoScale=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"DirectionalLight"},t.prototype.getTypeID=function(){return a.Light.LIGHTTYPEID_DIRECTIONALLIGHT},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,r){this.shadowFrustumSize>0?this._setDefaultFixedFrustumShadowProjectionMatrix(e):this._setDefaultAutoExtendShadowProjectionMatrix(e,t,r)},t.prototype._setDefaultFixedFrustumShadowProjectionMatrix=function(e){var t=this.getScene().activeCamera;t&&o.Matrix.OrthoLHToRef(this.shadowFrustumSize,this.shadowFrustumSize,void 0!==this.shadowMinZ?this.shadowMinZ:t.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:t.maxZ,e)},t.prototype._setDefaultAutoExtendShadowProjectionMatrix=function(e,t,r){var n=this.getScene().activeCamera;if(n){if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){var i=o.Vector3.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE;for(var s=Number.MAX_VALUE,a=Number.MIN_VALUE,l=0;l<r.length;l++){var c=r[l];if(c)for(var u=c.getBoundingInfo().boundingBox,d=0;d<u.vectorsWorld.length;d++)o.Vector3.TransformCoordinatesToRef(u.vectorsWorld[d],t,i),i.x<this._orthoLeft&&(this._orthoLeft=i.x),i.y<this._orthoBottom&&(this._orthoBottom=i.y),i.x>this._orthoRight&&(this._orthoRight=i.x),i.y>this._orthoTop&&(this._orthoTop=i.y),this.autoCalcShadowZBounds&&(i.z<s&&(s=i.z),i.z>a&&(a=i.z))}this.autoCalcShadowZBounds&&(this._shadowMinZ=s,this._shadowMaxZ=a)}var h=this._orthoRight-this._orthoLeft,f=this._orthoTop-this._orthoBottom;o.Matrix.OrthoOffCenterLHToRef(this._orthoLeft-h*this.shadowOrthoScale,this._orthoRight+h*this.shadowOrthoScale,this._orthoBottom-f*this.shadowOrthoScale,this._orthoTop+f*this.shadowOrthoScale,void 0!==this.shadowMinZ?this.shadowMinZ:n.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:n.maxZ,e)}},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,t),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,t),this)},t.prototype.transferToNodeMaterialEffect=function(e,t){return this.computeTransformedInformation()?(e.setFloat3(t,this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z),this):(e.setFloat3(t,this.direction.x,this.direction.y,this.direction.z),this)},t.prototype.getDepthMinZ=function(e){return 1},t.prototype.getDepthMaxZ=function(e){return 1},t.prototype.prepareLightSpecificDefines=function(e,t){e["DIRLIGHT"+t]=!0},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowFrustumSize",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowOrthoScale",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"autoUpdateExtends",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"autoCalcShadowZBounds",void 0),t}(l.ShadowLight)},"./Lights/hemisphericLight.ts":
- /*!************************************!*\
- !*** ./Lights/hemisphericLight.ts ***!
- \************************************/
- /*! exports provided: HemisphericLight */function(e,t,r){"use strict";r.r(t),r.d(t,"HemisphericLight",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../node */"./node.ts"),l=r(/*! ./light */"./Lights/light.ts");a.Node.AddNodeConstructor("Light_Type_3",(function(e,t){return function(){return new c(e,o.Vector3.Zero(),t)}}));var c=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i.groundColor=new s.Color3(0,0,0),i.direction=r||o.Vector3.Up(),i}return Object(n.__extends)(t,e),t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.getClassName=function(){return"HemisphericLight"},t.prototype.setDirectionToTarget=function(e){return this.direction=o.Vector3.Normalize(e.subtract(o.Vector3.Zero())),this.direction},t.prototype.getShadowGenerator=function(){return null},t.prototype.transferToEffect=function(e,t){var r=o.Vector3.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",r.x,r.y,r.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){var r=o.Vector3.Normalize(this.direction);return e.setFloat3(t,r.x,r.y,r.z),this},t.prototype.computeWorldMatrix=function(){return this._worldMatrix||(this._worldMatrix=o.Matrix.Identity()),this._worldMatrix},t.prototype.getTypeID=function(){return l.Light.LIGHTTYPEID_HEMISPHERICLIGHT},t.prototype.prepareLightSpecificDefines=function(e,t){e["HEMILIGHT"+t]=!0},Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"groundColor",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"direction",void 0),t}(l.Light)},"./Lights/index.ts":
- /*!*************************!*\
- !*** ./Lights/index.ts ***!
- \*************************/
- /*! exports provided: Light, ShadowLight, ShadowGenerator, CascadedShadowGenerator, ShadowGeneratorSceneComponent, DirectionalLight, HemisphericLight, PointLight, SpotLight */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./light */"./Lights/light.ts");r.d(t,"Light",(function(){return n.Light}));var i=r(/*! ./shadowLight */"./Lights/shadowLight.ts");r.d(t,"ShadowLight",(function(){return i.ShadowLight}));var o=r(/*! ./Shadows/index */"./Lights/Shadows/index.ts");r.d(t,"ShadowGenerator",(function(){return o.ShadowGenerator})),r.d(t,"CascadedShadowGenerator",(function(){return o.CascadedShadowGenerator})),r.d(t,"ShadowGeneratorSceneComponent",(function(){return o.ShadowGeneratorSceneComponent}));var s=r(/*! ./directionalLight */"./Lights/directionalLight.ts");r.d(t,"DirectionalLight",(function(){return s.DirectionalLight}));var a=r(/*! ./hemisphericLight */"./Lights/hemisphericLight.ts");r.d(t,"HemisphericLight",(function(){return a.HemisphericLight}));var l=r(/*! ./pointLight */"./Lights/pointLight.ts");r.d(t,"PointLight",(function(){return l.PointLight}));var c=r(/*! ./spotLight */"./Lights/spotLight.ts");r.d(t,"SpotLight",(function(){return c.SpotLight}))},"./Lights/light.ts":
- /*!*************************!*\
- !*** ./Lights/light.ts ***!
- \*************************/
- /*! exports provided: Light */function(e,t,r){"use strict";r.r(t),r.d(t,"Light",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../node */"./node.ts"),l=r(/*! ../Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),c=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),u=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i.diffuse=new s.Color3(1,1,1),i.specular=new s.Color3(1,1,1),i.falloffType=t.FALLOFF_DEFAULT,i.intensity=1,i._range=Number.MAX_VALUE,i._inverseSquaredRange=0,i._photometricScale=1,i._intensityMode=t.INTENSITYMODE_AUTOMATIC,i._radius=1e-5,i.renderPriority=0,i._shadowEnabled=!0,i._excludeWithLayerMask=0,i._includeOnlyWithLayerMask=0,i._lightmapMode=0,i._excludedMeshesIds=new Array,i._includedOnlyMeshesIds=new Array,i._isLight=!0,i.getScene().addLight(i),i._uniformBuffer=new l.UniformBuffer(i.getScene().getEngine()),i._buildUniformLayout(),i.includedOnlyMeshes=new Array,i.excludedMeshes=new Array,i._resyncMeshes(),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"range",{get:function(){return this._range},set:function(e){this._range=e,this._inverseSquaredRange=1/(this.range*this.range)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensityMode",{get:function(){return this._intensityMode},set:function(e){this._intensityMode=e,this._computePhotometricScale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},set:function(e){this._radius=e,this._computePhotometricScale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowEnabled",{get:function(){return this._shadowEnabled},set:function(e){this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"includedOnlyMeshes",{get:function(){return this._includedOnlyMeshes},set:function(e){this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"excludedMeshes",{get:function(){return this._excludedMeshes},set:function(e){this._excludedMeshes=e,this._hookArrayForExcluded(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"excludeWithLayerMask",{get:function(){return this._excludeWithLayerMask},set:function(e){this._excludeWithLayerMask=e,this._resyncMeshes()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"includeOnlyWithLayerMask",{get:function(){return this._includeOnlyWithLayerMask},set:function(e){this._includeOnlyWithLayerMask=e,this._resyncMeshes()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightmapMode",{get:function(){return this._lightmapMode},set:function(e){this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())},enumerable:!1,configurable:!0}),t.prototype.transferTexturesToEffect=function(e,t){return this},t.prototype._bindLight=function(e,t,r,n,i){void 0===i&&(i=!1);var o=e.toString(),a=!1;if(!i||!this._uniformBuffer._alreadyBound){if(this._uniformBuffer.bindToEffect(r,"Light"+o),this._renderId!==t.getRenderId()||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId();var l=this.getScaledIntensity();this.transferToEffect(r,o),this.diffuse.scaleToRef(l,s.TmpColors.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",s.TmpColors.Color3[0],this.range,o),n&&(this.specular.scaleToRef(l,s.TmpColors.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",s.TmpColors.Color3[1],this.radius,o)),a=!0}if(this.transferTexturesToEffect(r,o),t.shadowsEnabled&&this.shadowEnabled){var c=this.getShadowGenerator();c&&(c.bindShadowLight(o,r),a=!0)}a&&this._uniformBuffer.update()}},t.prototype.getClassName=function(){return"Light"},t.prototype.toString=function(e){var t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric"][this.getTypeID()],this.animations)for(var r=0;r<this.animations.length;r++)t+=", animation[0]: "+this.animations[r].toString(e);return t},t.prototype._syncParentEnabledState=function(){e.prototype._syncParentEnabledState.call(this),this.isDisposed()||this._resyncMeshes()},t.prototype.setEnabled=function(t){e.prototype.setEnabled.call(this,t),this._resyncMeshes()},t.prototype.getShadowGenerator=function(){return this._shadowGenerator},t.prototype.getAbsolutePosition=function(){return o.Vector3.Zero()},t.prototype.canAffectMesh=function(e){return!(e&&(this.includedOnlyMeshes&&this.includedOnlyMeshes.length>0&&-1===this.includedOnlyMeshes.indexOf(e)||this.excludedMeshes&&this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e)||0!==this.includeOnlyWithLayerMask&&0==(this.includeOnlyWithLayerMask&e.layerMask)||0!==this.excludeWithLayerMask&&this.excludeWithLayerMask&e.layerMask))},t.CompareLightsPriority=function(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority},t.prototype.dispose=function(t,r){void 0===r&&(r=!1),this._shadowGenerator&&(this._shadowGenerator.dispose(),this._shadowGenerator=null),this.getScene().stopAnimation(this);for(var n=0,i=this.getScene().meshes;n<i.length;n++)i[n]._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),e.prototype.dispose.call(this,t,r)},t.prototype.getTypeID=function(){return 0},t.prototype.getScaledIntensity=function(){return this._photometricScale*this.intensity},t.prototype.clone=function(e,r){void 0===r&&(r=null);var n=t.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!n)return null;var o=i.SerializationHelper.Clone(n,this);return r&&(o.parent=r),o.setEnabled(this.isEnabled()),o},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.type=this.getTypeID(),this.parent&&(e.parentId=this.parent.id),this.excludedMeshes.length>0&&(e.excludedMeshesIds=[],this.excludedMeshes.forEach((function(t){e.excludedMeshesIds.push(t.id)}))),this.includedOnlyMeshes.length>0&&(e.includedOnlyMeshesIds=[],this.includedOnlyMeshes.forEach((function(t){e.includedOnlyMeshesIds.push(t.id)}))),i.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.GetConstructorFromName=function(e,t,r){var n=a.Node.Construct("Light_Type_"+e,t,r);return n||null},t.Parse=function(e,r){var n=t.GetConstructorFromName(e.type,e.name,r);if(!n)return null;var o=i.SerializationHelper.Parse(n,e,r);if(e.excludedMeshesIds&&(o._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(o._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId&&(o._waitingParentId=e.parentId),void 0!==e.falloffType&&(o.falloffType=e.falloffType),void 0!==e.lightmapMode&&(o.lightmapMode=e.lightmapMode),e.animations){for(var s=0;s<e.animations.length;s++){var l=e.animations[s],u=c._TypeStore.GetClass("BABYLON.Animation");u&&o.animations.push(u.Parse(l))}a.Node.ParseAnimationRanges(o,e,r)}return e.autoAnimate&&r.beginAnimation(o,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),o},t.prototype._hookArrayForExcluded=function(e){var t=this,r=e.push;e.push=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=r.apply(e,n),s=0,a=n;s<a.length;s++){var l=a[s];l._resyncLightSource(t)}return o};var n=e.splice;e.splice=function(r,i){for(var o=n.apply(e,[r,i]),s=0,a=o;s<a.length;s++)a[s]._resyncLightSource(t);return o};for(var i=0,o=e;i<o.length;i++)o[i]._resyncLightSource(this)},t.prototype._hookArrayForIncludedOnly=function(e){var t=this,r=e.push;e.push=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r.apply(e,n);return t._resyncMeshes(),o};var n=e.splice;e.splice=function(r,i){var o=n.apply(e,[r,i]);return t._resyncMeshes(),o},this._resyncMeshes()},t.prototype._resyncMeshes=function(){for(var e=0,t=this.getScene().meshes;e<t.length;e++)t[e]._resyncLightSource(this)},t.prototype._markMeshesAsLightDirty=function(){for(var e=0,t=this.getScene().meshes;e<t.length;e++){var r=t[e];-1!==r.lightSources.indexOf(this)&&r._markSubMeshesAsLightDirty()}},t.prototype._computePhotometricScale=function(){this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()},t.prototype._getPhotometricScale=function(){var e=0,r=this.getTypeID(),n=this.intensityMode;switch(n===t.INTENSITYMODE_AUTOMATIC&&(n=r===t.LIGHTTYPEID_DIRECTIONALLIGHT?t.INTENSITYMODE_ILLUMINANCE:t.INTENSITYMODE_LUMINOUSINTENSITY),r){case t.LIGHTTYPEID_POINTLIGHT:case t.LIGHTTYPEID_SPOTLIGHT:switch(n){case t.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case t.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case t.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius}break;case t.LIGHTTYPEID_DIRECTIONALLIGHT:switch(n){case t.INTENSITYMODE_ILLUMINANCE:e=1;break;case t.INTENSITYMODE_LUMINANCE:var i=this.radius;i=Math.max(i,.001),e=2*Math.PI*(1-Math.cos(i))}break;case t.LIGHTTYPEID_HEMISPHERICLIGHT:e=1}return e},t.prototype._reorderLightsInScene=function(){var e=this.getScene();0!=this._renderPriority&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()},t.FALLOFF_DEFAULT=0,t.FALLOFF_PHYSICAL=1,t.FALLOFF_GLTF=2,t.FALLOFF_STANDARD=3,t.LIGHTMAP_DEFAULT=0,t.LIGHTMAP_SPECULAR=1,t.LIGHTMAP_SHADOWSONLY=2,t.INTENSITYMODE_AUTOMATIC=0,t.INTENSITYMODE_LUMINOUSPOWER=1,t.INTENSITYMODE_LUMINOUSINTENSITY=2,t.INTENSITYMODE_ILLUMINANCE=3,t.INTENSITYMODE_LUMINANCE=4,t.LIGHTTYPEID_POINTLIGHT=0,t.LIGHTTYPEID_DIRECTIONALLIGHT=1,t.LIGHTTYPEID_SPOTLIGHT=2,t.LIGHTTYPEID_HEMISPHERICLIGHT=3,Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"diffuse",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"specular",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"falloffType",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"range",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"intensityMode",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"radius",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_renderPriority",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_reorderLightsInScene")],t.prototype,"renderPriority",void 0),Object(n.__decorate)([Object(i.serialize)("shadowEnabled")],t.prototype,"_shadowEnabled",void 0),Object(n.__decorate)([Object(i.serialize)("excludeWithLayerMask")],t.prototype,"_excludeWithLayerMask",void 0),Object(n.__decorate)([Object(i.serialize)("includeOnlyWithLayerMask")],t.prototype,"_includeOnlyWithLayerMask",void 0),Object(n.__decorate)([Object(i.serialize)("lightmapMode")],t.prototype,"_lightmapMode",void 0),t}(a.Node)},"./Lights/pointLight.ts":
- /*!******************************!*\
- !*** ./Lights/pointLight.ts ***!
- \******************************/
- /*! exports provided: PointLight */function(e,t,r){"use strict";r.r(t),r.d(t,"PointLight",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts"),l=r(/*! ./shadowLight */"./Lights/shadowLight.ts");s.Node.AddNodeConstructor("Light_Type_0",(function(e,t){return function(){return new c(e,o.Vector3.Zero(),t)}}));var c=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i._shadowAngle=Math.PI/2,i.position=r,i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"shadowAngle",{get:function(){return this._shadowAngle},set:function(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){var t=this.needCube();this._direction=e,this.needCube()!==t&&this._shadowGenerator&&this._shadowGenerator.recreateShadowMap()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PointLight"},t.prototype.getTypeID=function(){return a.Light.LIGHTTYPEID_POINTLIGHT},t.prototype.needCube=function(){return!this.direction},t.prototype.getShadowDirection=function(t){if(this.direction)return e.prototype.getShadowDirection.call(this,t);switch(t){case 0:return new o.Vector3(1,0,0);case 1:return new o.Vector3(-1,0,0);case 2:return new o.Vector3(0,-1,0);case 3:return new o.Vector3(0,1,0);case 4:return new o.Vector3(0,0,1);case 5:return new o.Vector3(0,0,-1)}return o.Vector3.Zero()},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,r){var n=this.getScene().activeCamera;n&&o.Matrix.PerspectiveFovLHToRef(this.shadowAngle,1,this.getDepthMinZ(n),this.getDepthMaxZ(n),e)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){return this.computeTransformedInformation()?e.setFloat3(t,this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z):e.setFloat3(t,this.position.x,this.position.y,this.position.z),this},t.prototype.prepareLightSpecificDefines=function(e,t){e["POINTLIGHT"+t]=!0},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowAngle",null),t}(l.ShadowLight)},"./Lights/shadowLight.ts":
- /*!*******************************!*\
- !*** ./Lights/shadowLight.ts ***!
- \*******************************/
- /*! exports provided: ShadowLight */function(e,t,r){"use strict";r.r(t),r.d(t,"ShadowLight",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ./light */"./Lights/light.ts"),a=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._needProjectionMatrixCompute=!0,t}return Object(n.__extends)(t,e),t.prototype._setPosition=function(e){this._position=e},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._setPosition(e)},enumerable:!1,configurable:!0}),t.prototype._setDirection=function(e){this._direction=e},Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){this._setDirection(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowMinZ",{get:function(){return this._shadowMinZ},set:function(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._shadowMaxZ},set:function(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),t.prototype.computeTransformedInformation=function(){return!(!this.parent||!this.parent.getWorldMatrix||(this.transformedPosition||(this.transformedPosition=o.Vector3.Zero()),o.Vector3.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=o.Vector3.Zero()),o.Vector3.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),0))},t.prototype.getDepthScale=function(){return 50},t.prototype.getShadowDirection=function(e){return this.transformedDirection?this.transformedDirection:this.direction},t.prototype.getAbsolutePosition=function(){return this.transformedPosition?this.transformedPosition:this.position},t.prototype.setDirectionToTarget=function(e){return this.direction=o.Vector3.Normalize(e.subtract(this.position)),this.direction},t.prototype.getRotation=function(){this.direction.normalize();var e=o.Vector3.Cross(this.direction,a.Axis.Y),t=o.Vector3.Cross(e,this.direction);return o.Vector3.RotationFromAxis(e,t,this.direction)},t.prototype.needCube=function(){return!1},t.prototype.needProjectionMatrixCompute=function(){return this._needProjectionMatrixCompute},t.prototype.forceProjectionMatrixCompute=function(){this._needProjectionMatrixCompute=!0},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.position=o.Vector3.Zero()},t.prototype._isSynchronized=function(){return!!this._cache.position.equals(this.position)},t.prototype.computeWorldMatrix=function(e){return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=o.Matrix.Identity()),o.Matrix.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix)},t.prototype.getDepthMinZ=function(e){return void 0!==this.shadowMinZ?this.shadowMinZ:e.minZ},t.prototype.getDepthMaxZ=function(e){return void 0!==this.shadowMaxZ?this.shadowMaxZ:e.maxZ},t.prototype.setShadowProjectionMatrix=function(e,t,r){return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,r,e):this._setDefaultShadowProjectionMatrix(e,t,r),this},Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"position",null),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"direction",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowMinZ",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowMaxZ",null),t}(s.Light)},"./Lights/spotLight.ts":
- /*!*****************************!*\
- !*** ./Lights/spotLight.ts ***!
- \*****************************/
- /*! exports provided: SpotLight */function(e,t,r){"use strict";r.r(t),r.d(t,"SpotLight",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts"),l=r(/*! ./shadowLight */"./Lights/shadowLight.ts"),c=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts");s.Node.AddNodeConstructor("Light_Type_2",(function(e,t){return function(){return new u(e,o.Vector3.Zero(),o.Vector3.Zero(),0,0,t)}}));var u=function(e){function t(t,r,n,i,s,a){var l=e.call(this,t,a)||this;return l._innerAngle=0,l._projectionTextureMatrix=o.Matrix.Zero(),l._projectionTextureLightNear=1e-6,l._projectionTextureLightFar=1e3,l._projectionTextureUpDirection=o.Vector3.Up(),l._projectionTextureViewLightDirty=!0,l._projectionTextureProjectionLightDirty=!0,l._projectionTextureDirty=!0,l._projectionTextureViewTargetVector=o.Vector3.Zero(),l._projectionTextureViewLightMatrix=o.Matrix.Zero(),l._projectionTextureProjectionLightMatrix=o.Matrix.Zero(),l._projectionTextureScalingMatrix=o.Matrix.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),l.position=r,l.direction=n,l.angle=i,l.exponent=s,l}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._cosHalfAngle=Math.cos(.5*e),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerAngle",{get:function(){return this._innerAngle},set:function(e){this._innerAngle=e,this._computeAngleValues()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowAngleScale",{get:function(){return this._shadowAngleScale},set:function(e){this._shadowAngleScale=e,this.forceProjectionMatrixCompute()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureMatrix",{get:function(){return this._projectionTextureMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightNear",{get:function(){return this._projectionTextureLightNear},set:function(e){this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightFar",{get:function(){return this._projectionTextureLightFar},set:function(e){this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureUpDirection",{get:function(){return this._projectionTextureUpDirection},set:function(e){this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"projectionTexture",{get:function(){return this._projectionTexture},set:function(e){var t=this;if(this._projectionTexture!==e&&(this._projectionTexture=e,this._projectionTextureDirty=!0,this._projectionTexture&&!this._projectionTexture.isReady())){var r=this._projectionTexture;r.onLoadObservable&&r.onLoadObservable.addOnce((function(){t._markMeshesAsLightDirty()}))}},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"SpotLight"},t.prototype.getTypeID=function(){return a.Light.LIGHTTYPEID_SPOTLIGHT},t.prototype._setDirection=function(t){e.prototype._setDirection.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setPosition=function(t){e.prototype._setPosition.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,r){var n=this.getScene().activeCamera;if(n){this._shadowAngleScale=this._shadowAngleScale||1;var i=this._shadowAngleScale*this._angle;o.Matrix.PerspectiveFovLHToRef(i,1,this.getDepthMinZ(n),this.getDepthMaxZ(n),e)}},t.prototype._computeProjectionTextureViewLightMatrix=function(){this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.position.addToRef(this.direction,this._projectionTextureViewTargetVector),o.Matrix.LookAtLHToRef(this.position,this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)},t.prototype._computeProjectionTextureProjectionLightMatrix=function(){this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;var e=this.projectionTextureLightFar,t=this.projectionTextureLightNear,r=e/(e-t),n=-r*t,i=1/Math.tan(this._angle/2);o.Matrix.FromValuesToRef(i/1,0,0,0,0,i,0,0,0,0,r,1,0,0,n,0,this._projectionTextureProjectionLightMatrix)},t.prototype._computeProjectionTextureMatrix=function(){if(this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTexture instanceof c.Texture){var e=this._projectionTexture.uScale/2,t=this._projectionTexture.vScale/2;o.Matrix.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,.5,0,.5,.5,.5,1,this._projectionTextureScalingMatrix)}this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype._computeAngleValues=function(){this._lightAngleScale=1/Math.max(.001,Math.cos(.5*this._innerAngle)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale},t.prototype.transferTexturesToEffect=function(e,t){return this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),e.setMatrix("textureProjectionMatrix"+t,this._projectionTextureMatrix),e.setTexture("projectionLightSampler"+t,this.projectionTexture)),this},t.prototype.transferToEffect=function(e,t){var r;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,this.exponent,t),r=o.Vector3.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,this.exponent,t),r=o.Vector3.Normalize(this.direction)),this.getScene().useRightHandedSystem?this._uniformBuffer.updateFloat4("vLightDirection",-r.x,-r.y,-r.z,this._cosHalfAngle,t):this._uniformBuffer.updateFloat4("vLightDirection",r.x,r.y,r.z,this._cosHalfAngle,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){var r;return r=this.computeTransformedInformation()?o.Vector3.Normalize(this.transformedDirection):o.Vector3.Normalize(this.direction),this.getScene().useRightHandedSystem?e.setFloat3(t,-r.x,-r.y,-r.z):e.setFloat3(t,r.x,r.y,r.z),this},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._projectionTexture&&this._projectionTexture.dispose()},t.prototype.prepareLightSpecificDefines=function(e,t){e["SPOTLIGHT"+t]=!0,e["PROJECTEDLIGHTTEXTURE"+t]=!(!this.projectionTexture||!this.projectionTexture.isReady())},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angle",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"innerAngle",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowAngleScale",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"exponent",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"projectionTextureLightNear",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"projectionTextureLightFar",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"projectionTextureUpDirection",null),Object(n.__decorate)([Object(i.serializeAsTexture)("projectedLightTexture")],t.prototype,"_projectionTexture",void 0),t}(l.ShadowLight)},"./Loading/Plugins/babylonFileLoader.ts":
- /*!**********************************************!*\
- !*** ./Loading/Plugins/babylonFileLoader.ts ***!
- \**********************************************/
- /*! exports provided: _BabylonLoaderRegistered, BabylonFileLoaderConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"_BabylonLoaderRegistered",(function(){return O})),r.d(t,"BabylonFileLoaderConfiguration",(function(){return I}));var n=r(/*! ../../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../../Meshes/geometry */"./Meshes/geometry.ts"),c=r(/*! ../../Meshes/transformNode */"./Meshes/transformNode.ts"),u=r(/*! ../../Materials/material */"./Materials/material.ts"),d=r(/*! ../../Materials/multiMaterial */"./Materials/multiMaterial.ts"),h=r(/*! ../../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),f=r(/*! ../../Materials/Textures/hdrCubeTexture */"./Materials/Textures/hdrCubeTexture.ts"),p=r(/*! ../../Animations/animationGroup */"./Animations/animationGroup.ts"),m=r(/*! ../../Lights/light */"./Lights/light.ts"),g=r(/*! ../../sceneComponent */"./sceneComponent.ts"),_=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),v=r(/*! ../../abstractScene */"./abstractScene.ts"),y=r(/*! ../../assetContainer */"./assetContainer.ts"),b=r(/*! ../../Actions/actionManager */"./Actions/actionManager.ts"),A=r(/*! ../../Bones/skeleton */"./Bones/skeleton.ts"),T=r(/*! ../../Morph/morphTargetManager */"./Morph/morphTargetManager.ts"),M=r(/*! ../../Physics/Plugins/cannonJSPlugin */"./Physics/Plugins/cannonJSPlugin.ts"),P=r(/*! ../../Physics/Plugins/oimoJSPlugin */"./Physics/Plugins/oimoJSPlugin.ts"),S=r(/*! ../../Physics/Plugins/ammoJSPlugin */"./Physics/Plugins/ammoJSPlugin.ts"),E=r(/*! ../../Probes/reflectionProbe */"./Probes/reflectionProbe.ts"),C=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),x=r(/*! ../../Misc/tools */"./Misc/tools.ts"),R=r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts"),O=!0,I=function(){function e(){}return e.LoaderInjectedPhysicsEngine=void 0,e}(),D=function(e,t,r,n){for(var i=0,o=t.materials.length;i<o;i++){var s=t.materials[i];if(s.id===e)return u.Material.Parse(s,r,n)}return null},B=function(e,t,r){for(var n in t)if(e.name===t[n])return r.push(e.id),!0;return!(!e.parentId||-1===r.indexOf(e.parentId)||(r.push(e.id),0))},N=function(e,t){return e+" of "+(t?t.file+" from "+t.name+" version: "+t.version+", exporter version: "+t.exporter_version:"unknown")},L=function(e,t){var r=t;if(t._waitingData.lods){if(t._waitingData.lods.ids&&t._waitingData.lods.ids.length>0){var n=t._waitingData.lods.ids,i=r.isEnabled(!1);if(t._waitingData.lods.distances){var o=t._waitingData.lods.distances;if(o.length>=n.length){var s=o.length>n.length?o[o.length-1]:0;r.setEnabled(!1);for(var a=0;a<n.length;a++){var l=n[a],c=e.getMeshByID(l);null!=c&&r.addLODLevel(o[a],c)}s>0&&r.addLODLevel(s,null),!0===i&&r.setEnabled(!0)}else x.Tools.Warn("Invalid level of detail distances for "+t.name)}}t._waitingData.lods=null}},w=function(e,t,r,o,s){void 0===s&&(s=!1);var g=new y.AssetContainer(e),M="importScene has failed JSON parse";try{var P=JSON.parse(t);M="";var S,x,O=_.SceneLoader.loggingLevel===_.SceneLoader.DETAILED_LOGGING;if(void 0!==P.environmentTexture&&null!==P.environmentTexture){var I=void 0===P.isPBR||P.isPBR;if(P.environmentTextureType&&"BABYLON.HDRCubeTexture"===P.environmentTextureType){var D=P.environmentTextureSize?P.environmentTextureSize:128,B=new f.HDRCubeTexture((P.environmentTexture.match(/https?:\/\//g)?"":r)+P.environmentTexture,e,D,!0,!I);P.environmentTextureRotationY&&(B.rotationY=P.environmentTextureRotationY),e.environmentTexture=B}else if(R.StringTools.EndsWith(P.environmentTexture,".env")){var w=new h.CubeTexture((P.environmentTexture.match(/https?:\/\//g)?"":r)+P.environmentTexture,e);P.environmentTextureRotationY&&(w.rotationY=P.environmentTextureRotationY),e.environmentTexture=w}else{var F=h.CubeTexture.CreateFromPrefilteredData((P.environmentTexture.match(/https?:\/\//g)?"":r)+P.environmentTexture,e);P.environmentTextureRotationY&&(F.rotationY=P.environmentTextureRotationY),e.environmentTexture=F}if(!0===P.createDefaultSkybox){var V=void 0!==e.activeCamera&&null!==e.activeCamera?(e.activeCamera.maxZ-e.activeCamera.minZ)/2:1e3,k=P.skyboxBlurLevel||0;e.createDefaultSkybox(e.environmentTexture,I,V,k)}g.environmentTexture=e.environmentTexture}if(void 0!==P.environmentIntensity&&null!==P.environmentIntensity&&(e.environmentIntensity=P.environmentIntensity),void 0!==P.lights&&null!==P.lights)for(S=0,x=P.lights.length;S<x;S++){var U=P.lights[S],z=m.Light.Parse(U,e);z&&(g.lights.push(z),M+=0===S?"\n\tLights:":"",M+="\n\t\t"+z.toString(O))}if(void 0!==P.reflectionProbes&&null!==P.reflectionProbes)for(S=0,x=P.reflectionProbes.length;S<x;S++){var G=P.reflectionProbes[S],j=E.ReflectionProbe.Parse(G,e,r);j&&(g.reflectionProbes.push(j),M+=0===S?"\n\tReflection Probes:":"",M+="\n\t\t"+j.toString(O))}if(void 0!==P.animations&&null!==P.animations)for(S=0,x=P.animations.length;S<x;S++){var H=P.animations[S],W=C._TypeStore.GetClass("BABYLON.Animation");if(W){var X=W.Parse(H);e.animations.push(X),g.animations.push(X),M+=0===S?"\n\tAnimations:":"",M+="\n\t\t"+X.toString(O)}}if(void 0!==P.materials&&null!==P.materials)for(S=0,x=P.materials.length;S<x;S++){var Y=P.materials[S],Q=u.Material.Parse(Y,e,r);Q&&(g.materials.push(Q),M+=0===S?"\n\tMaterials:":"",M+="\n\t\t"+Q.toString(O),Q.getActiveTextures().forEach((function(e){-1==g.textures.indexOf(e)&&g.textures.push(e)})))}if(void 0!==P.multiMaterials&&null!==P.multiMaterials)for(S=0,x=P.multiMaterials.length;S<x;S++){var K=P.multiMaterials[S],q=d.MultiMaterial.ParseMultiMaterial(K,e);g.multiMaterials.push(q),M+=0===S?"\n\tMultiMaterials:":"",M+="\n\t\t"+q.toString(O),q.getActiveTextures().forEach((function(e){-1==g.textures.indexOf(e)&&g.textures.push(e)}))}if(void 0!==P.morphTargetManagers&&null!==P.morphTargetManagers)for(var Z=0,J=P.morphTargetManagers;Z<J.length;Z++){var $=J[Z];g.morphTargetManagers.push(T.MorphTargetManager.Parse($,e))}if(void 0!==P.skeletons&&null!==P.skeletons)for(S=0,x=P.skeletons.length;S<x;S++){var ee=P.skeletons[S],te=A.Skeleton.Parse(ee,e);g.skeletons.push(te),M+=0===S?"\n\tSkeletons:":"",M+="\n\t\t"+te.toString(O)}var re=P.geometries;if(null!=re){var ne=new Array,ie=re.vertexData;if(null!=ie)for(S=0,x=ie.length;S<x;S++){var oe=ie[S];ne.push(l.Geometry.Parse(oe,e,r))}ne.forEach((function(e){e&&g.geometries.push(e)}))}if(void 0!==P.transformNodes&&null!==P.transformNodes)for(S=0,x=P.transformNodes.length;S<x;S++){var se=P.transformNodes[S],ae=c.TransformNode.Parse(se,e,r);g.transformNodes.push(ae)}if(void 0!==P.meshes&&null!==P.meshes)for(S=0,x=P.meshes.length;S<x;S++){var le=P.meshes[S],ce=a.Mesh.Parse(le,e,r);g.meshes.push(ce),M+=0===S?"\n\tMeshes:":"",M+="\n\t\t"+ce.toString(O)}if(void 0!==P.cameras&&null!==P.cameras)for(S=0,x=P.cameras.length;S<x;S++){var ue=P.cameras[S],de=i.Camera.Parse(ue,e);g.cameras.push(de),M+=0===S?"\n\tCameras:":"",M+="\n\t\t"+de.toString(O)}if(void 0!==P.animationGroups&&null!==P.animationGroups)for(S=0,x=P.animationGroups.length;S<x;S++){var he=P.animationGroups[S],fe=p.AnimationGroup.Parse(he,e);g.animationGroups.push(fe),M+=0===S?"\n\tAnimationGroups:":"",M+="\n\t\t"+fe.toString(O)}for(S=0,x=e.cameras.length;S<x;S++)(de=e.cameras[S])._waitingParentId&&(de.parent=e.getLastEntryByID(de._waitingParentId),de._waitingParentId=null);for(S=0,x=e.lights.length;S<x;S++){var pe=e.lights[S];pe&&pe._waitingParentId&&(pe.parent=e.getLastEntryByID(pe._waitingParentId),pe._waitingParentId=null)}for(S=0,x=e.transformNodes.length;S<x;S++){var me=e.transformNodes[S];me._waitingParentId&&(me.parent=e.getLastEntryByID(me._waitingParentId),me._waitingParentId=null)}for(S=0,x=e.meshes.length;S<x;S++)(ce=e.meshes[S])._waitingParentId&&(ce.parent=e.getLastEntryByID(ce._waitingParentId),ce._waitingParentId=null),ce._waitingData.lods&&L(e,ce);for(S=0,x=e.skeletons.length;S<x;S++)(te=e.skeletons[S])._hasWaitingData&&(null!=te.bones&&te.bones.forEach((function(t){if(t._waitingTransformNodeId){var r=e.getLastEntryByID(t._waitingTransformNodeId);r&&t.linkTransformNode(r),t._waitingTransformNodeId=null}})),te._hasWaitingData=null);for(S=0,x=e.meshes.length;S<x;S++){var ge=e.meshes[S];ge._waitingData.freezeWorldMatrix?(ge.freezeWorldMatrix(),ge._waitingData.freezeWorldMatrix=null):ge.computeWorldMatrix(!0)}for(S=0,x=e.lights.length;S<x;S++){var _e=e.lights[S];if(_e._excludedMeshesIds.length>0){for(var ve=0;ve<_e._excludedMeshesIds.length;ve++){var ye=e.getMeshByID(_e._excludedMeshesIds[ve]);ye&&_e.excludedMeshes.push(ye)}_e._excludedMeshesIds=[]}if(_e._includedOnlyMeshesIds.length>0){for(var be=0;be<_e._includedOnlyMeshesIds.length;be++){var Ae=e.getMeshByID(_e._includedOnlyMeshesIds[be]);Ae&&_e.includedOnlyMeshes.push(Ae)}_e._includedOnlyMeshesIds=[]}}for(v.AbstractScene.Parse(P,e,g,r),S=0,x=e.meshes.length;S<x;S++)(ce=e.meshes[S])._waitingData.actions&&(b.ActionManager.Parse(ce._waitingData.actions,ce,e),ce._waitingData.actions=null);void 0!==P.actions&&null!==P.actions&&b.ActionManager.Parse(P.actions,null,e)}catch(e){var Te=N("loadAssets",P?P.producer:"Unknown")+M;if(!o)throw n.Logger.Log(Te),e;o(Te,e)}finally{s||g.removeAllFromScene(),null!==M&&_.SceneLoader.loggingLevel!==_.SceneLoader.NO_LOGGING&&n.Logger.Log(N("loadAssets",P?P.producer:"Unknown")+(_.SceneLoader.loggingLevel!==_.SceneLoader.MINIMAL_LOGGING?M:""))}return g};_.SceneLoader.RegisterPlugin({name:"babylon.js",extensions:".babylon",canDirectLoad:function(e){return-1!==e.indexOf("babylon")},importMesh:function(e,t,r,i,o,s,c,u){var h="importMesh has failed JSON parse";try{var f=JSON.parse(r);h="";var p=_.SceneLoader.loggingLevel===_.SceneLoader.DETAILED_LOGGING;e?Array.isArray(e)||(e=[e]):e=null;var m=new Array;if(void 0!==f.meshes&&null!==f.meshes){var y,b,M,P=[],S=[];for(y=0,b=f.meshes.length;y<b;y++){var E=f.meshes[y];if(null===e||B(E,e,m)){if(null!==e&&delete e[e.indexOf(E.name)],void 0!==E.geometryId&&null!==E.geometryId&&void 0!==f.geometries&&null!==f.geometries){var C=!1;["boxes","spheres","cylinders","toruses","grounds","planes","torusKnots","vertexData"].forEach((function(e){!0!==C&&f.geometries[e]&&Array.isArray(f.geometries[e])&&f.geometries[e].forEach((function(r){if(r.id===E.geometryId){switch(e){case"vertexData":l.Geometry.Parse(r,t,i)}C=!0}}))})),!1===C&&n.Logger.Warn("Geometry not found for mesh "+E.id)}if(E.materialId){var x=-1!==S.indexOf(E.materialId);if(!1===x&&void 0!==f.multiMaterials&&null!==f.multiMaterials)for(var R=0,O=f.multiMaterials.length;R<O;R++){var I=f.multiMaterials[R];if(I.id===E.materialId){for(var w=0,F=I.materials.length;w<F;w++){var V,k=I.materials[w];S.push(k),(V=D(k,f,t,i))&&(h+="\n\tMaterial "+V.toString(p))}S.push(I.id);var U=d.MultiMaterial.ParseMultiMaterial(I,t);U&&(x=!0,h+="\n\tMulti-Material "+U.toString(p));break}}!1===x&&(S.push(E.materialId),(V=D(E.materialId,f,t,i))?h+="\n\tMaterial "+V.toString(p):n.Logger.Warn("Material not found for mesh "+E.id))}if(E.skeletonId>-1&&void 0!==f.skeletons&&null!==f.skeletons&&!1==P.indexOf(E.skeletonId)>-1)for(var z=0,G=f.skeletons.length;z<G;z++){var j=f.skeletons[z];if(j.id===E.skeletonId){var H=A.Skeleton.Parse(j,t);c.push(H),P.push(j.id),h+="\n\tSkeleton "+H.toString(p)}}if(void 0!==f.morphTargetManagers&&null!==f.morphTargetManagers)for(var W=0,X=f.morphTargetManagers;W<X.length;W++){var Y=X[W];T.MorphTargetManager.Parse(Y,t)}var Q=a.Mesh.Parse(E,t,i);o.push(Q),h+="\n\tMesh "+Q.toString(p)}}for(y=0,b=t.meshes.length;y<b;y++)(M=t.meshes[y])._waitingParentId&&(M.parent=t.getLastEntryByID(M._waitingParentId),M._waitingParentId=null),M._waitingData.lods&&L(t,M);for(y=0,b=t.skeletons.length;y<b;y++)(H=t.skeletons[y])._hasWaitingData&&(null!=H.bones&&H.bones.forEach((function(e){if(e._waitingTransformNodeId){var r=t.getLastEntryByID(e._waitingTransformNodeId);r&&e.linkTransformNode(r),e._waitingTransformNodeId=null}})),H._hasWaitingData=null);for(y=0,b=t.meshes.length;y<b;y++)(M=t.meshes[y])._waitingData.freezeWorldMatrix?(M.freezeWorldMatrix(),M._waitingData.freezeWorldMatrix=null):M.computeWorldMatrix(!0)}if(void 0!==f.particleSystems&&null!==f.particleSystems){var K=v.AbstractScene.GetIndividualParser(g.SceneComponentConstants.NAME_PARTICLESYSTEM);if(K)for(y=0,b=f.particleSystems.length;y<b;y++){var q=f.particleSystems[y];-1!==m.indexOf(q.emitterId)&&s.push(K(q,t,i))}}return!0}catch(e){var Z=N("importMesh",f?f.producer:"Unknown")+h;if(!u)throw n.Logger.Log(Z),e;u(Z,e)}finally{null!==h&&_.SceneLoader.loggingLevel!==_.SceneLoader.NO_LOGGING&&n.Logger.Log(N("importMesh",f?f.producer:"Unknown")+(_.SceneLoader.loggingLevel!==_.SceneLoader.MINIMAL_LOGGING?h:""))}return!1},load:function(e,t,r,i){var a="importScene has failed JSON parse";try{var l=JSON.parse(t);if(a="",void 0!==l.useDelayedTextureLoading&&null!==l.useDelayedTextureLoading&&(e.useDelayedTextureLoading=l.useDelayedTextureLoading&&!_.SceneLoader.ForceFullSceneLoadingForIncremental),void 0!==l.autoClear&&null!==l.autoClear&&(e.autoClear=l.autoClear),void 0!==l.clearColor&&null!==l.clearColor&&(e.clearColor=s.Color4.FromArray(l.clearColor)),void 0!==l.ambientColor&&null!==l.ambientColor&&(e.ambientColor=s.Color3.FromArray(l.ambientColor)),void 0!==l.gravity&&null!==l.gravity&&(e.gravity=o.Vector3.FromArray(l.gravity)),l.fogMode&&0!==l.fogMode)switch(e.fogMode=l.fogMode,e.fogColor=s.Color3.FromArray(l.fogColor),e.fogStart=l.fogStart,e.fogEnd=l.fogEnd,e.fogDensity=l.fogDensity,a+="\tFog mode for scene: ",e.fogMode){case 1:a+="exp\n";break;case 2:a+="exp2\n";break;case 3:a+="linear\n"}if(l.physicsEnabled){var c;"cannon"===l.physicsEngine?c=new M.CannonJSPlugin(void 0,void 0,I.LoaderInjectedPhysicsEngine):"oimo"===l.physicsEngine?c=new P.OimoJSPlugin(void 0,I.LoaderInjectedPhysicsEngine):"ammo"===l.physicsEngine&&(c=new S.AmmoJSPlugin(void 0,I.LoaderInjectedPhysicsEngine,void 0)),a="\tPhysics engine "+(l.physicsEngine?l.physicsEngine:"oimo")+" enabled\n";var u=l.physicsGravity?o.Vector3.FromArray(l.physicsGravity):null;e.enablePhysics(u,c)}return void 0!==l.metadata&&null!==l.metadata&&(e.metadata=l.metadata),void 0!==l.collisionsEnabled&&null!==l.collisionsEnabled&&(e.collisionsEnabled=l.collisionsEnabled),!!w(e,t,r,i,!0)&&(l.autoAnimate&&e.beginAnimation(e,l.autoAnimateFrom,l.autoAnimateTo,l.autoAnimateLoop,l.autoAnimateSpeed||1),void 0!==l.activeCameraID&&null!==l.activeCameraID&&e.setActiveCameraByID(l.activeCameraID),!0)}catch(e){var d=N("importScene",l?l.producer:"Unknown")+a;if(!i)throw n.Logger.Log(d),e;i(d,e)}finally{null!==a&&_.SceneLoader.loggingLevel!==_.SceneLoader.NO_LOGGING&&n.Logger.Log(N("importScene",l?l.producer:"Unknown")+(_.SceneLoader.loggingLevel!==_.SceneLoader.MINIMAL_LOGGING?a:""))}return!1},loadAssetContainer:function(e,t,r,n){return w(e,t,r,n)}})},"./Loading/Plugins/index.ts":
- /*!**********************************!*\
- !*** ./Loading/Plugins/index.ts ***!
- \**********************************/
- /*! exports provided: _BabylonLoaderRegistered, BabylonFileLoaderConfiguration */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./babylonFileLoader */"./Loading/Plugins/babylonFileLoader.ts");r.d(t,"_BabylonLoaderRegistered",(function(){return n._BabylonLoaderRegistered})),r.d(t,"BabylonFileLoaderConfiguration",(function(){return n.BabylonFileLoaderConfiguration}))},"./Loading/index.ts":
- /*!**************************!*\
- !*** ./Loading/index.ts ***!
- \**************************/
- /*! exports provided: DefaultLoadingScreen, _BabylonLoaderRegistered, BabylonFileLoaderConfiguration, SceneLoaderAnimationGroupLoadingMode, SceneLoader, SceneLoaderFlags */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./loadingScreen */"./Loading/loadingScreen.ts");r.d(t,"DefaultLoadingScreen",(function(){return n.DefaultLoadingScreen}));var i=r(/*! ./Plugins/index */"./Loading/Plugins/index.ts");r.d(t,"_BabylonLoaderRegistered",(function(){return i._BabylonLoaderRegistered})),r.d(t,"BabylonFileLoaderConfiguration",(function(){return i.BabylonFileLoaderConfiguration}));var o=r(/*! ./sceneLoader */"./Loading/sceneLoader.ts");r.d(t,"SceneLoaderAnimationGroupLoadingMode",(function(){return o.SceneLoaderAnimationGroupLoadingMode})),r.d(t,"SceneLoader",(function(){return o.SceneLoader}));var s=r(/*! ./sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts");r.d(t,"SceneLoaderFlags",(function(){return s.SceneLoaderFlags}))},"./Loading/loadingScreen.ts":
- /*!**********************************!*\
- !*** ./Loading/loadingScreen.ts ***!
- \**********************************/
- /*! exports provided: DefaultLoadingScreen */function(e,t,r){"use strict";r.r(t),r.d(t,"DefaultLoadingScreen",(function(){return i}));var n=r(/*! ../Engines/engine */"./Engines/engine.ts"),i=function(){function e(e,t,r){var n=this;void 0===t&&(t=""),void 0===r&&(r="black"),this._renderingCanvas=e,this._loadingText=t,this._loadingDivBackgroundColor=r,this._resizeLoadingUI=function(){var e=n._renderingCanvas.getBoundingClientRect(),t=window.getComputedStyle(n._renderingCanvas).position;n._loadingDiv&&(n._loadingDiv.style.position="fixed"===t?"fixed":"absolute",n._loadingDiv.style.left=e.left+"px",n._loadingDiv.style.top=e.top+"px",n._loadingDiv.style.width=e.width+"px",n._loadingDiv.style.height=e.height+"px")}}return e.prototype.displayLoadingUI=function(){if(!this._loadingDiv){this._loadingDiv=document.createElement("div"),this._loadingDiv.id="babylonjsLoadingDiv",this._loadingDiv.style.opacity="0",this._loadingDiv.style.transition="opacity 1.5s ease",this._loadingDiv.style.pointerEvents="none",this._loadingTextDiv=document.createElement("div"),this._loadingTextDiv.style.position="absolute",this._loadingTextDiv.style.left="0",this._loadingTextDiv.style.top="50%",this._loadingTextDiv.style.marginTop="80px",this._loadingTextDiv.style.width="100%",this._loadingTextDiv.style.height="20px",this._loadingTextDiv.style.fontFamily="Arial",this._loadingTextDiv.style.fontSize="14px",this._loadingTextDiv.style.color="white",this._loadingTextDiv.style.textAlign="center",this._loadingTextDiv.innerHTML="Loading",this._loadingDiv.appendChild(this._loadingTextDiv),this._loadingTextDiv.innerHTML=this._loadingText;var t=document.createElement("style");t.type="text/css",t.innerHTML="@-webkit-keyframes spin1 { 0% { -webkit-transform: rotate(0deg);}\n 100% { -webkit-transform: rotate(360deg);}\n } @keyframes spin1 { 0% { transform: rotate(0deg);}\n 100% { transform: rotate(360deg);}\n }",document.getElementsByTagName("head")[0].appendChild(t);var r=!!window.SVGSVGElement,n=new Image;e.DefaultLogoUrl?n.src=e.DefaultLogoUrl:n.src=r?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+":"https://cdn.babylonjs.com/Assets/babylonLogo.png",n.style.position="absolute",n.style.left="40%",n.style.top="40%",n.style.width="20%",n.style.height="20%";var i=new Image;if(e.DefaultSpinnerUrl?i.src=e.DefaultSpinnerUrl:i.src=r?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==":"https://cdn.babylonjs.com/Assets/loadingIcon.png",i.style.position="absolute",i.style.left="30%",i.style.top="30%",i.style.width="40%",i.style.height="40%",i.style.animation="spin1 0.75s infinite linear",i.style.webkitAnimation="spin1 0.75s infinite linear",i.style.transformOrigin="50% 50%",i.style.webkitTransformOrigin="50% 50%",!r){var o={w:16,h:18.5},s={w:30,h:30};n.style.width=o.w+"vh",n.style.height=o.h+"vh",n.style.left="calc(50% - "+o.w/2+"vh)",n.style.top="calc(50% - "+o.h/2+"vh)",i.style.width=s.w+"vh",i.style.height=s.h+"vh",i.style.left="calc(50% - "+s.w/2+"vh)",i.style.top="calc(50% - "+s.h/2+"vh)"}this._loadingDiv.appendChild(n),this._loadingDiv.appendChild(i),this._resizeLoadingUI(),window.addEventListener("resize",this._resizeLoadingUI),this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor,document.body.appendChild(this._loadingDiv),this._loadingDiv.style.opacity="1"}},e.prototype.hideLoadingUI=function(){var e=this;this._loadingDiv&&(this._loadingDiv.style.opacity="0",this._loadingDiv.addEventListener("transitionend",(function(){e._loadingDiv&&(e._loadingDiv.parentElement&&e._loadingDiv.parentElement.removeChild(e._loadingDiv),window.removeEventListener("resize",e._resizeLoadingUI),e._loadingDiv=null)})))},Object.defineProperty(e.prototype,"loadingUIText",{get:function(){return this._loadingText},set:function(e){this._loadingText=e,this._loadingTextDiv&&(this._loadingTextDiv.innerHTML=this._loadingText)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loadingUIBackgroundColor",{get:function(){return this._loadingDivBackgroundColor},set:function(e){this._loadingDivBackgroundColor=e,this._loadingDiv&&(this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor)},enumerable:!1,configurable:!0}),e.DefaultLogoUrl="",e.DefaultSpinnerUrl="",e}();n.Engine.DefaultLoadingScreenFactory=function(e){return new i(e)}},"./Loading/sceneLoader.ts":
- /*!********************************!*\
- !*** ./Loading/sceneLoader.ts ***!
- \********************************/
- /*! exports provided: SceneLoaderAnimationGroupLoadingMode, SceneLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneLoaderAnimationGroupLoadingMode",(function(){return n})),r.d(t,"SceneLoader",(function(){return f}));var n,i=r(/*! ../Misc/tools */"./Misc/tools.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Misc/filesInputStore */"./Misc/filesInputStore.ts"),a=r(/*! ../scene */"./scene.ts"),l=r(/*! ../Engines/engine */"./Engines/engine.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Misc/logger */"./Misc/logger.ts"),d=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=r(/*! ./sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts");!function(e){e[e.Clean=0]="Clean",e[e.Stop=1]="Stop",e[e.Sync=2]="Sync",e[e.NoSync=3]="NoSync"}(n||(n={}));var f=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return h.SceneLoaderFlags.ForceFullSceneLoadingForIncremental},set:function(e){h.SceneLoaderFlags.ForceFullSceneLoadingForIncremental=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return h.SceneLoaderFlags.ShowLoadingScreen},set:function(e){h.SceneLoaderFlags.ShowLoadingScreen=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return h.SceneLoaderFlags.loggingLevel},set:function(e){h.SceneLoaderFlags.loggingLevel=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return h.SceneLoaderFlags.CleanBoneMatrixWeights},set:function(e){h.SceneLoaderFlags.CleanBoneMatrixWeights=e},enumerable:!1,configurable:!0}),e.GetDefaultPlugin=function(){return e._registeredPlugins[".babylon"]},e._GetPluginForExtension=function(t){var r=e._registeredPlugins[t];return r||(u.Logger.Warn("Unable to find a plugin to load "+t+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/how_to/load_from_any_file_type"),e.GetDefaultPlugin())},e._GetPluginForDirectLoad=function(t){for(var r in e._registeredPlugins){var n=e._registeredPlugins[r].plugin;if(n.canDirectLoad&&n.canDirectLoad(t))return e._registeredPlugins[r]}return e.GetDefaultPlugin()},e._GetPluginForFilename=function(t){var r=t.indexOf("?");-1!==r&&(t=t.substring(0,r));var n=t.lastIndexOf("."),i=t.substring(n,t.length).toLowerCase();return e._GetPluginForExtension(i)},e._GetDirectLoad=function(e){return"data:"===e.substr(0,5)?e.substr(5):null},e._LoadData=function(t,r,n,i,o,a,c){var u,d=e._GetDirectLoad(t.name),h=c?e._GetPluginForExtension(c):d?e._GetPluginForDirectLoad(t.name):e._GetPluginForFilename(t.name);if(!(u=void 0!==h.plugin.createPlugin?h.plugin.createPlugin():h.plugin))throw"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";if(e.OnPluginActivatedObservable.notifyObservers(u),d){if(u.directLoad){var f=u.directLoad(r,d);f.then?f.then((function(e){n(u,e)})).catch((function(e){o("Error in directLoad of _loadData: "+e,e)})):n(u,f)}else n(u,d);return u}var p=h.isBinary,m=function(e,t){r.isDisposed?o("Scene has been disposed"):n(u,e,t)},g=null,_=!1,v=u.onDisposeObservable;v&&v.add((function(){_=!0,g&&(g.abort(),g=null),a()}));var y=function(){if(!_){var e=function(e,t){m(e,t?t.responseURL:void 0)},n=function(e){o(e.message,e)};g=u.requestFile?u.requestFile(r,t.url,e,i,p,n):r._requestFile(t.url,e,i,!0,p,n)}},b=t.file||s.FilesInputStore.FilesToLoad[t.name.toLowerCase()];if(-1===t.rootUrl.indexOf("file:")||-1!==t.rootUrl.indexOf("file:")&&!b){var A=r.getEngine(),T=A.enableOfflineSupport;if(T){for(var M=!1,P=0,S=r.disableOfflineSupportExceptionRules;P<S.length;P++)if(S[P].test(t.url)){M=!0;break}T=!M}T&&l.Engine.OfflineProviderFactory?r.offlineProvider=l.Engine.OfflineProviderFactory(t.url,y,A.disableManifestCheck):y()}else if(b){var E=function(e){o(e.message,e)};g=u.readFile?u.readFile(r,b,m,i,p,E):r._readFile(b,m,i,p,E)}else o("Unable to find file named "+t.name);return u},e._GetFileInfo=function(e,t){var r,n,o=null;if(t)if(t.name){var s=t;r=e+s.name,n=s.name,o=s}else{var a=t;if("/"===a.substr(0,1))return i.Tools.Error("Wrong sceneFilename parameter"),null;r=e+a,n=a}else r=e,n=i.Tools.GetFilename(e),e=i.Tools.GetFolderPath(e);return{url:r,rootUrl:e,name:n,file:o}},e.GetPluginForExtension=function(t){return e._GetPluginForExtension(t).plugin},e.IsPluginForExtensionAvailable=function(t){return!!e._registeredPlugins[t]},e.RegisterPlugin=function(t){if("string"==typeof t.extensions){var r=t.extensions;e._registeredPlugins[r.toLowerCase()]={plugin:t,isBinary:!1}}else{var n=t.extensions;Object.keys(n).forEach((function(r){e._registeredPlugins[r.toLowerCase()]={plugin:t,isBinary:n[r].isBinary}}))}},e.ImportMesh=function(t,r,n,i,o,s,a,l){if(void 0===n&&(n=""),void 0===i&&(i=c.EngineStore.LastCreatedScene),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===l&&(l=null),!i)return u.Logger.Error("No scene available to import mesh to"),null;var d=e._GetFileInfo(r,n);if(!d)return null;var h={};i._addPendingData(h);var f=function(){i._removePendingData(h)},p=function(e,t){var r="Unable to import meshes from "+d.url+": "+e;a?a(i,r,t):u.Logger.Error(r),f()},m=s?function(e){try{s(e)}catch(e){p("Error in onProgress callback: "+e,e)}}:void 0,g=function(e,t,r,n){if(i.importedMeshesFiles.push(d.url),o)try{o(e,t,r,n)}catch(e){p("Error in onSuccess callback: "+e,e)}i._removePendingData(h)};return e._LoadData(d,i,(function(e,r,n){if(e.rewriteRootURL&&(d.rootUrl=e.rewriteRootURL(d.rootUrl,n)),e.importMesh){var o=e,s=new Array,a=new Array,l=new Array;if(!o.importMesh(t,i,r,d.rootUrl,s,a,l,p))return;i.loadingPluginName=e.name,g(s,a,l,[])}else e.importMeshAsync(t,i,r,d.rootUrl,m,d.name).then((function(t){i.loadingPluginName=e.name,g(t.meshes,t.particleSystems,t.skeletons,t.animationGroups)})).catch((function(e){p(e.message,e)}))}),m,p,f,l)},e.ImportMeshAsync=function(t,r,n,i,o,s){return void 0===n&&(n=""),void 0===i&&(i=c.EngineStore.LastCreatedScene),void 0===o&&(o=null),void 0===s&&(s=null),new Promise((function(a,l){e.ImportMesh(t,r,n,i,(function(e,t,r,n){a({meshes:e,particleSystems:t,skeletons:r,animationGroups:n})}),o,(function(e,t,r){l(r||new Error(t))}),s)}))},e.Load=function(t,r,n,o,s,l,u){return void 0===r&&(r=""),void 0===n&&(n=c.EngineStore.LastCreatedEngine),void 0===o&&(o=null),void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=null),n?e.Append(t,r,new a.Scene(n),o,s,l,u):(i.Tools.Error("No engine available"),null)},e.LoadAsync=function(t,r,n,i,o){return void 0===r&&(r=""),void 0===n&&(n=c.EngineStore.LastCreatedEngine),void 0===i&&(i=null),void 0===o&&(o=null),new Promise((function(s,a){e.Load(t,r,n,(function(e){s(e)}),i,(function(e,t,r){a(r||new Error(t))}),o)}))},e.Append=function(t,r,n,i,o,s,a){var l=this;if(void 0===r&&(r=""),void 0===n&&(n=c.EngineStore.LastCreatedScene),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),!n)return u.Logger.Error("No scene available to append to"),null;var d=e._GetFileInfo(t,r);if(!d)return null;e.ShowLoadingScreen&&!this._showingLoadingScreen&&(this._showingLoadingScreen=!0,n.getEngine().displayLoadingUI(),n.executeWhenReady((function(){n.getEngine().hideLoadingUI(),l._showingLoadingScreen=!1})));var h={};n._addPendingData(h);var f=function(){n._removePendingData(h)},p=function(e,t){var r="Unable to load from "+d.url+(e?": "+e:"");s?s(n,r,t):u.Logger.Error(r),f()},m=o?function(e){try{o(e)}catch(e){p("Error in onProgress callback",e)}}:void 0,g=function(){if(i)try{i(n)}catch(e){p("Error in onSuccess callback",e)}n._removePendingData(h)};return e._LoadData(d,n,(function(e,t){if(e.load){if(!e.load(n,t,d.rootUrl,p))return;n.loadingPluginName=e.name,g()}else e.loadAsync(n,t,d.rootUrl,m,d.name).then((function(){n.loadingPluginName=e.name,g()})).catch((function(e){p(e.message,e)}))}),m,p,f,a)},e.AppendAsync=function(t,r,n,i,o){return void 0===r&&(r=""),void 0===n&&(n=c.EngineStore.LastCreatedScene),void 0===i&&(i=null),void 0===o&&(o=null),new Promise((function(s,a){e.Append(t,r,n,(function(e){s(e)}),i,(function(e,t,r){a(r||new Error(t))}),o)}))},e.LoadAssetContainer=function(t,r,n,i,o,s,a){if(void 0===r&&(r=""),void 0===n&&(n=c.EngineStore.LastCreatedScene),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),!n)return u.Logger.Error("No scene available to load asset container to"),null;var l=e._GetFileInfo(t,r);if(!l)return null;var d={};n._addPendingData(d);var h=function(){n._removePendingData(d)},f=function(e,t){var r="Unable to load assets from "+l.url+(e?": "+e:"");t&&t.message&&(r+=" ("+t.message+")"),s?s(n,r,t):u.Logger.Error(r),h()},p=o?function(e){try{o(e)}catch(e){f("Error in onProgress callback",e)}}:void 0,m=function(e){if(i)try{i(e)}catch(e){f("Error in onSuccess callback",e)}n._removePendingData(d)};return e._LoadData(l,n,(function(e,t){if(e.loadAssetContainer){var r=e.loadAssetContainer(n,t,l.rootUrl,f);if(!r)return;n.loadingPluginName=e.name,m(r)}else e.loadAssetContainerAsync?e.loadAssetContainerAsync(n,t,l.rootUrl,p,l.name).then((function(t){n.loadingPluginName=e.name,m(t)})).catch((function(e){f(e.message,e)})):f("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.")}),p,f,h,a)},e.LoadAssetContainerAsync=function(t,r,n,i,o){return void 0===r&&(r=""),void 0===n&&(n=c.EngineStore.LastCreatedScene),void 0===i&&(i=null),void 0===o&&(o=null),new Promise((function(s,a){e.LoadAssetContainer(t,r,n,(function(e){s(e)}),i,(function(e,t,r){a(r||new Error(t))}),o)}))},e.ImportAnimations=function(e,t,r,i,o,s,a,l,d,h){if(void 0===t&&(t=""),void 0===r&&(r=c.EngineStore.LastCreatedScene),void 0===i&&(i=!0),void 0===o&&(o=n.Clean),void 0===s&&(s=null),void 0===a&&(a=null),void 0===l&&(l=null),void 0===d&&(d=null),void 0===h&&(h=null),r){if(i){for(var f=0,p=r.animatables;f<p.length;f++)p[f].reset();r.stopAllAnimations(),r.animationGroups.slice().forEach((function(e){e.dispose()})),r.getNodes().forEach((function(e){e.animations&&(e.animations=[])}))}else switch(o){case n.Clean:r.animationGroups.slice().forEach((function(e){e.dispose()}));break;case n.Stop:r.animationGroups.forEach((function(e){e.stop()}));break;case n.Sync:r.animationGroups.forEach((function(e){e.reset(),e.restart()}));break;case n.NoSync:break;default:return void u.Logger.Error("Unknown animation group loading mode value '"+o+"'")}var m=r.animatables.length;this.LoadAssetContainer(e,t,r,(function(e){e.mergeAnimationsTo(r,r.animatables.slice(m),s),e.dispose(),r.onAnimationFileImportedObservable.notifyObservers(r),a&&a(r)}),l,d,h)}else u.Logger.Error("No scene available to load animations to")},e.ImportAnimationsAsync=function(t,r,i,o,s,a,l,u,d,h){return void 0===r&&(r=""),void 0===i&&(i=c.EngineStore.LastCreatedScene),void 0===o&&(o=!0),void 0===s&&(s=n.Clean),void 0===a&&(a=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===h&&(h=null),new Promise((function(n,l){e.ImportAnimations(t,r,i,o,s,a,(function(e){n(e)}),u,(function(e,t,r){l(r||new Error(t))}),h)}))},e.NO_LOGGING=d.Constants.SCENELOADER_NO_LOGGING,e.MINIMAL_LOGGING=d.Constants.SCENELOADER_MINIMAL_LOGGING,e.SUMMARY_LOGGING=d.Constants.SCENELOADER_SUMMARY_LOGGING,e.DETAILED_LOGGING=d.Constants.SCENELOADER_DETAILED_LOGGING,e.OnPluginActivatedObservable=new o.Observable,e._registeredPlugins={},e._showingLoadingScreen=!1,e}()},"./Loading/sceneLoaderFlags.ts":
- /*!*************************************!*\
- !*** ./Loading/sceneLoaderFlags.ts ***!
- \*************************************/
- /*! exports provided: SceneLoaderFlags */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneLoaderFlags",(function(){return i}));var n=r(/*! ../Engines/constants */"./Engines/constants.ts"),i=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return e._ForceFullSceneLoadingForIncremental},set:function(t){e._ForceFullSceneLoadingForIncremental=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return e._ShowLoadingScreen},set:function(t){e._ShowLoadingScreen=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return e._loggingLevel},set:function(t){e._loggingLevel=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return e._CleanBoneMatrixWeights},set:function(t){e._CleanBoneMatrixWeights=t},enumerable:!1,configurable:!0}),e._ForceFullSceneLoadingForIncremental=!1,e._ShowLoadingScreen=!0,e._CleanBoneMatrixWeights=!1,e._loggingLevel=n.Constants.SCENELOADER_NO_LOGGING,e}()},"./Materials/Background/backgroundMaterial.ts":
- /*!****************************************************!*\
- !*** ./Materials/Background/backgroundMaterial.ts ***!
- \****************************************************/
- /*! exports provided: BackgroundMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"BackgroundMaterial",(function(){return b}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/smartArray */"./Misc/smartArray.ts"),s=r(/*! ../../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),u=r(/*! ../../Materials/materialDefines */"./Materials/materialDefines.ts"),d=r(/*! ../../Materials/pushMaterial */"./Materials/pushMaterial.ts"),h=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),f=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),p=r(/*! ../../Engines/constants */"./Engines/constants.ts"),m=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),g=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),_=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),v=(r(/*! ../../Shaders/background.fragment */"./Shaders/background.fragment.ts"),r(/*! ../../Shaders/background.vertex */"./Shaders/background.vertex.ts"),r(/*! ../effectFallbacks */"./Materials/effectFallbacks.ts")),y=function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.DIFFUSEDIRECTUV=0,t.GAMMADIFFUSE=!1,t.DIFFUSEHASALPHA=!1,t.OPACITYFRESNEL=!1,t.REFLECTIONBLUR=!1,t.REFLECTIONFRESNEL=!1,t.REFLECTIONFALLOFF=!1,t.TEXTURELODSUPPORT=!1,t.PREMULTIPLYALPHA=!1,t.USERGBCOLOR=!1,t.USEHIGHLIGHTANDSHADOWCOLORS=!1,t.BACKMAT_SHADOWONLY=!1,t.NOISE=!1,t.REFLECTIONBGR=!1,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.MULTIVIEW=!1,t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.EQUIRECTANGULAR_RELFECTION_FOV=!1,t.MAINUV1=!1,t.MAINUV2=!1,t.UV1=!1,t.UV2=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.NORMAL=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.SHADOWFLOAT=!1,t.rebuild(),t}return Object(n.__extends)(t,e),t}(u.MaterialDefines),b=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.primaryColor=_.Color3.White(),n._primaryColorShadowLevel=0,n._primaryColorHighlightLevel=0,n.reflectionTexture=null,n.reflectionBlur=0,n.diffuseTexture=null,n._shadowLights=null,n.shadowLights=null,n.shadowLevel=0,n.sceneCenter=a.Vector3.Zero(),n.opacityFresnel=!0,n.reflectionFresnel=!1,n.reflectionFalloffDistance=0,n.reflectionAmount=1,n.reflectionReflectance0=.05,n.reflectionReflectance90=.5,n.useRGBColor=!0,n.enableNoise=!1,n._fovMultiplier=1,n.useEquirectangularFOV=!1,n._maxSimultaneousLights=4,n.maxSimultaneousLights=4,n._shadowOnly=!1,n.shadowOnly=!1,n._imageProcessingObserver=null,n.switchToBGR=!1,n._renderTargets=new o.SmartArray(16),n._reflectionControls=a.Vector4.Zero(),n._white=_.Color3.White(),n._primaryShadowColor=_.Color3.Black(),n._primaryHighlightColor=_.Color3.Black(),n._attachImageProcessingConfiguration(null),n.getRenderTargetTextures=function(){return n._renderTargets.reset(),n._diffuseTexture&&n._diffuseTexture.isRenderTarget&&n._renderTargets.push(n._diffuseTexture),n._reflectionTexture&&n._reflectionTexture.isRenderTarget&&n._renderTargets.push(n._reflectionTexture),n._renderTargets},n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"_perceptualColor",{get:function(){return this.__perceptualColor},set:function(e){this.__perceptualColor=e,this._computePrimaryColorFromPerceptualColor(),this._markAllSubMeshesAsLightsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"primaryColorShadowLevel",{get:function(){return this._primaryColorShadowLevel},set:function(e){this._primaryColorShadowLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"primaryColorHighlightLevel",{get:function(){return this._primaryColorHighlightLevel},set:function(e){this._primaryColorHighlightLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionStandardFresnelWeight",{set:function(e){var r=e;r<.5?(r*=2,this.reflectionReflectance0=t.StandardReflectance0*r,this.reflectionReflectance90=t.StandardReflectance90*r):(r=2*r-1,this.reflectionReflectance0=t.StandardReflectance0+(1-t.StandardReflectance0)*r,this.reflectionReflectance90=t.StandardReflectance90+(1-t.StandardReflectance90)*r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._fovMultiplier},set:function(e){isNaN(e)&&(e=1),this._fovMultiplier=Math.max(0,Math.min(2,e))},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add((function(){t._computePrimaryColorFromPerceptualColor(),t._markAllSubMeshesAsImageProcessingDirty()}))))},Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this.imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this.imageProcessingConfiguration.colorCurves},set:function(e){this.imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!(!this._diffuseTexture||!this._diffuseTexture.isRenderTarget)||!(!this._reflectionTexture||!this._reflectionTexture.isRenderTarget)},enumerable:!1,configurable:!0}),t.prototype.needAlphaTesting=function(){return!0},t.prototype.needAlphaBlending=function(){return this.alpha<1||null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha||this._shadowOnly},t.prototype.isReadyForSubMesh=function(e,t,r){var n=this;if(void 0===r&&(r=!1),t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new y);var i=this.getScene(),o=t._materialDefines;if(this._isReadyForSubMesh(t))return!0;var a=i.getEngine();if(c.MaterialHelper.PrepareDefinesForLights(i,e,o,!1,this._maxSimultaneousLights),o._needNormals=!0,c.MaterialHelper.PrepareDefinesForMultiview(i,o),o._areTexturesDirty){if(o._needUVs=!1,i.texturesEnabled){if(i.getEngine().getCaps().textureLOD&&(o.TEXTURELODSUPPORT=!0),this._diffuseTexture&&g.MaterialFlags.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;c.MaterialHelper.PrepareDefinesForMergedUV(this._diffuseTexture,o,"DIFFUSE"),o.DIFFUSEHASALPHA=this._diffuseTexture.hasAlpha,o.GAMMADIFFUSE=this._diffuseTexture.gammaSpace,o.OPACITYFRESNEL=this._opacityFresnel}else o.DIFFUSE=!1,o.DIFFUSEHASALPHA=!1,o.GAMMADIFFUSE=!1,o.OPACITYFRESNEL=!1;var u=this._reflectionTexture;if(u&&g.MaterialFlags.ReflectionTextureEnabled){if(!u.isReadyOrNotBlocking())return!1;switch(o.REFLECTION=!0,o.GAMMAREFLECTION=u.gammaSpace,o.RGBDREFLECTION=u.isRGBD,o.REFLECTIONBLUR=this._reflectionBlur>0,o.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!u.invertZ:u.invertZ,o.LODINREFLECTIONALPHA=u.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,u.coordinatesMode===f.Texture.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=u.isCube,u.coordinatesMode){case f.Texture.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case f.Texture.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case f.Texture.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case f.Texture.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0;break;case f.Texture.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case f.Texture.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case f.Texture.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case f.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case f.Texture.CUBIC_MODE:case f.Texture.INVCUBIC_MODE:default:o.REFLECTIONMAP_CUBIC=!0}this.reflectionFresnel?(o.REFLECTIONFRESNEL=!0,o.REFLECTIONFALLOFF=this.reflectionFalloffDistance>0,this._reflectionControls.x=this.reflectionAmount,this._reflectionControls.y=this.reflectionReflectance0,this._reflectionControls.z=this.reflectionReflectance90,this._reflectionControls.w=1/this.reflectionFalloffDistance):(o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1)}else o.REFLECTION=!1,o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1,o.REFLECTIONBLUR=!1,o.REFLECTIONMAP_3D=!1,o.REFLECTIONMAP_SPHERICAL=!1,o.REFLECTIONMAP_PLANAR=!1,o.REFLECTIONMAP_CUBIC=!1,o.REFLECTIONMAP_PROJECTION=!1,o.REFLECTIONMAP_SKYBOX=!1,o.REFLECTIONMAP_EXPLICIT=!1,o.REFLECTIONMAP_EQUIRECTANGULAR=!1,o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,o.INVERTCUBICMAP=!1,o.REFLECTIONMAP_OPPOSITEZ=!1,o.LODINREFLECTIONALPHA=!1,o.GAMMAREFLECTION=!1,o.RGBDREFLECTION=!1}o.PREMULTIPLYALPHA=this.alphaMode===p.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===p.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,o.USERGBCOLOR=this._useRGBColor,o.NOISE=this._enableNoise}if(o._areLightsDirty&&(o.USEHIGHLIGHTANDSHADOWCOLORS=!this._useRGBColor&&(0!==this._primaryColorShadowLevel||0!==this._primaryColorHighlightLevel),o.BACKMAT_SHADOWONLY=this._shadowOnly),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o)}if(c.MaterialHelper.PrepareDefinesForMisc(e,i,!1,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),c.MaterialHelper.PrepareDefinesForFrameBoundValues(i,a,o,r,null,t.getRenderingMesh().hasThinInstances),c.MaterialHelper.PrepareDefinesForAttributes(e,o,!1,!0,!1)&&e&&(i.getEngine().getCaps().standardDerivatives||e.isVerticesDataPresent(l.VertexBuffer.NormalKind)||(e.createNormals(!0),s.Logger.Warn("BackgroundMaterial: Normals have been created for the mesh: "+e.name))),o.isDirty){o.markAsProcessed(),i.resetCachedMaterial();var d=new v.EffectFallbacks;o.FOG&&d.addFallback(0,"FOG"),o.POINTSIZE&&d.addFallback(1,"POINTSIZE"),o.MULTIVIEW&&d.addFallback(0,"MULTIVIEW"),c.MaterialHelper.HandleFallbacksForShadows(o,d,this._maxSimultaneousLights);var m=[l.VertexBuffer.PositionKind];o.NORMAL&&m.push(l.VertexBuffer.NormalKind),o.UV1&&m.push(l.VertexBuffer.UVKind),o.UV2&&m.push(l.VertexBuffer.UV2Kind),c.MaterialHelper.PrepareAttributesForBones(m,e,o,d),c.MaterialHelper.PrepareAttributesForInstances(m,o);var _=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix"],b=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],A=["Material","Scene"];h.ImageProcessingConfiguration&&(h.ImageProcessingConfiguration.PrepareUniforms(_,o),h.ImageProcessingConfiguration.PrepareSamplers(b,o)),c.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:_,uniformBuffersNames:A,samplers:b,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var T=o.toString();t.setEffect(i.getEngine().createEffect("background",{attributes:m,uniformsNames:_,uniformBuffersNames:A,samplers:b,defines:T,fallbacks:d,onCompiled:function(e){n.onCompiled&&n.onCompiled(e),n.bindSceneUniformBuffer(e,i.getSceneUniformBuffer())},onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},a),o),this.buildUniformLayout()}return!(!t.effect||!t.effect.isReady()||(o._renderId=i.getRenderId(),t.effect._wasPreviouslyReady=!0,0))},t.prototype._computePrimaryColorFromPerceptualColor=function(){this.__perceptualColor&&(this._primaryColor.copyFrom(this.__perceptualColor),this._primaryColor.toLinearSpaceToRef(this._primaryColor),this._imageProcessingConfiguration&&this._primaryColor.scaleToRef(1/this._imageProcessingConfiguration.exposure,this._primaryColor),this._computePrimaryColors())},t.prototype._computePrimaryColors=function(){0===this._primaryColorShadowLevel&&0===this._primaryColorHighlightLevel||(this._primaryColor.scaleToRef(this._primaryColorShadowLevel,this._primaryShadowColor),this._primaryColor.subtractToRef(this._primaryShadowColor,this._primaryShadowColor),this._white.subtractToRef(this._primaryColor,this._primaryHighlightColor),this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel,this._primaryHighlightColor),this._primaryColor.addToRef(this._primaryHighlightColor,this._primaryHighlightColor))},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vPrimaryColor",4),this._uniformBuffer.addUniform("vPrimaryColorShadow",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("fFovMultiplier",1),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("shadowLevel",1),this._uniformBuffer.addUniform("alpha",1),this._uniformBuffer.addUniform("vBackgroundCenter",3),this._uniformBuffer.addUniform("vReflectionControl",4),this._uniformBuffer.create()},t.prototype.unbind=function(){this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._uniformBuffer.setTexture("diffuseSampler",null),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindForSubMesh=function(e,t,r){var n=this.getScene(),i=r._materialDefines;if(i){var o=r.effect;if(o){this._activeEffect=o,this.bindOnlyWorldMatrix(e),c.MaterialHelper.BindBonesParameters(t,this._activeEffect);var s=this._mustRebind(n,o,t.visibility);if(s){this._uniformBuffer.bindToEffect(o,"Material"),this.bindViewProjection(o);var a=this._reflectionTexture;this._uniformBuffer.useUbo&&this.isFrozen&&this._uniformBuffer.isSync||(n.texturesEnabled&&(this._diffuseTexture&&g.MaterialFlags.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),c.MaterialHelper.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse")),a&&g.MaterialFlags.ReflectionTextureEnabled&&(this._uniformBuffer.updateMatrix("reflectionMatrix",a.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",a.level,this._reflectionBlur),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",a.getSize().width,a.lodGenerationScale,a.lodGenerationOffset))),this.shadowLevel>0&&this._uniformBuffer.updateFloat("shadowLevel",this.shadowLevel),this._uniformBuffer.updateFloat("alpha",this.alpha),this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),i.USEHIGHLIGHTANDSHADOWCOLORS?(this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryHighlightColor,1),this._uniformBuffer.updateColor4("vPrimaryColorShadow",this._primaryShadowColor,1)):this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryColor,1)),this._uniformBuffer.updateFloat("fFovMultiplier",this._fovMultiplier),n.texturesEnabled&&(this._diffuseTexture&&g.MaterialFlags.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),a&&g.MaterialFlags.ReflectionTextureEnabled&&(i.REFLECTIONBLUR&&i.TEXTURELODSUPPORT?this._uniformBuffer.setTexture("reflectionSampler",a):i.REFLECTIONBLUR?(this._uniformBuffer.setTexture("reflectionSampler",a._lodTextureMid||a),this._uniformBuffer.setTexture("reflectionSamplerLow",a._lodTextureLow||a),this._uniformBuffer.setTexture("reflectionSamplerHigh",a._lodTextureHigh||a)):this._uniformBuffer.setTexture("reflectionSampler",a),i.REFLECTIONFRESNEL&&(this._uniformBuffer.updateFloat3("vBackgroundCenter",this.sceneCenter.x,this.sceneCenter.y,this.sceneCenter.z),this._uniformBuffer.updateFloat4("vReflectionControl",this._reflectionControls.x,this._reflectionControls.y,this._reflectionControls.z,this._reflectionControls.w)))),c.MaterialHelper.BindClipPlane(this._activeEffect,n),c.MaterialHelper.BindEyePosition(o,n)}!s&&this.isFrozen||(n.lightsEnabled&&c.MaterialHelper.BindLights(n,t,this._activeEffect,i,this._maxSimultaneousLights,!1),this.bindView(o),c.MaterialHelper.BindFogParameters(n,t,this._activeEffect,!0),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._reflectionTexture===t||this._diffuseTexture===t},t.prototype.dispose=function(t,r){void 0===t&&(t=!1),void 0===r&&(r=!1),r&&(this.diffuseTexture&&this.diffuseTexture.dispose(),this.reflectionTexture&&this.reflectionTexture.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var r=this;return i.SerializationHelper.Clone((function(){return new t(e,r.getScene())}),this)},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.BackgroundMaterial",e},t.prototype.getClassName=function(){return"BackgroundMaterial"},t.Parse=function(e,r,n){return i.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n)},t.StandardReflectance0=.05,t.StandardReflectance90=.5,Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"_primaryColor",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"__perceptualColor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_primaryColorShadowLevel",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_primaryColorHighlightLevel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColorHighlightLevel",null),Object(n.__decorate)([Object(i.serializeAsTexture)()],t.prototype,"_reflectionTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionBlur",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionBlur",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)()],t.prototype,"_diffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLights",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_shadowLevel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLevel",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"_sceneCenter",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"sceneCenter",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_opacityFresnel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityFresnel",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionFresnel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFresnel",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionFalloffDistance",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFalloffDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionAmount",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionAmount",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionReflectance0",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance0",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionReflectance90",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance90",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_useRGBColor",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRGBColor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_enableNoise",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableNoise",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_shadowOnly",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"shadowOnly",void 0),Object(n.__decorate)([Object(i.serializeAsImageProcessingConfiguration)()],t.prototype,"_imageProcessingConfiguration",void 0),t}(d.PushMaterial);m._TypeStore.RegisteredTypes["BABYLON.BackgroundMaterial"]=b},"./Materials/Background/index.ts":
- /*!***************************************!*\
- !*** ./Materials/Background/index.ts ***!
- \***************************************/
- /*! exports provided: BackgroundMaterial */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./backgroundMaterial */"./Materials/Background/backgroundMaterial.ts");r.d(t,"BackgroundMaterial",(function(){return n.BackgroundMaterial}))},"./Materials/Node/Blocks/Dual/currentScreenBlock.ts":
- /*!**********************************************************!*\
- !*** ./Materials/Node/Blocks/Dual/currentScreenBlock.ts ***!
- \**********************************************************/
- /*! exports provided: CurrentScreenBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"CurrentScreenBlock",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../../../Textures/texture */"./Materials/Textures/texture.ts"),c=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.VertexAndFragment)||this;return r._samplerName="textureSampler",r.convertToGammaSpace=!1,r.convertToLinearSpace=!1,r._isUnique=!0,r.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2,!1,s.NodeMaterialBlockTargets.VertexAndFragment),r.registerOutput("rgba",o.NodeMaterialBlockConnectionPointTypes.Color4,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("rgb",o.NodeMaterialBlockConnectionPointTypes.Color3,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("r",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("g",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("b",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("a",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[0]._prioritizeVertex=!0,r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"CurrentScreenBlock"},Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("textureSampler")},Object.defineProperty(t.prototype,"target",{get:function(){if(!this.uv.isConnected)return s.NodeMaterialBlockTargets.VertexAndFragment;if(this.uv.sourceBlock.isInput)return s.NodeMaterialBlockTargets.VertexAndFragment;for(var e=this.uv.connectedPoint;e;){if(e.target===s.NodeMaterialBlockTargets.Fragment)return s.NodeMaterialBlockTargets.Fragment;if(e.target===s.NodeMaterialBlockTargets.Vertex)return s.NodeMaterialBlockTargets.VertexAndFragment;if(e.target===s.NodeMaterialBlockTargets.Neutral||e.target===s.NodeMaterialBlockTargets.VertexAndFragment){var t=e.ownerBlock;e=null;for(var r=0,n=t.inputs;r<n.length;r++){var i=n[r];if(i.connectedPoint){e=i.connectedPoint;break}}}}return s.NodeMaterialBlockTargets.VertexAndFragment},enumerable:!1,configurable:!0}),t.prototype.prepareDefines=function(e,t,r){r.setValue(this._linearDefineName,this.convertToGammaSpace,!0),r.setValue(this._gammaDefineName,this.convertToLinearSpace,!0)},t.prototype.isReady=function(){return!(this.texture&&!this.texture.isReadyOrNotBlocking())},t.prototype._injectVertexCode=function(e){var t=this.uv;if(t.connectedPoint.ownerBlock.isInput&&(t.connectedPoint.ownerBlock.isAttribute||e._emitUniformFromString(t.associatedVariableName,"vec2")),this._mainUVName="vMain"+t.associatedVariableName,e._emitVaryingFromString(this._mainUVName,"vec2"),e.compilationString+=this._mainUVName+" = "+t.associatedVariableName+".xy;\r\n",this._outputs.some((function(e){return e.isConnectedInVertexShader}))){this._writeTextureRead(e,!0);for(var r=0,n=this._outputs;r<n.length;r++){var i=n[r];i.hasEndpoints&&this._writeOutput(e,i,i.name,!0)}}},t.prototype._writeTextureRead=function(e,t){void 0===t&&(t=!1);var r=this.uv;if(t){if(e.target===s.NodeMaterialBlockTargets.Fragment)return;e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+r.associatedVariableName+");\r\n"}else this.uv.ownerBlock.target!==s.NodeMaterialBlockTargets.Fragment?e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this._mainUVName+");\r\n":e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+r.associatedVariableName+");\r\n"},t.prototype._writeOutput=function(e,t,r,n){if(void 0===n&&(n=!1),n){if(e.target===s.NodeMaterialBlockTargets.Fragment)return;e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+";\r\n"}else this.uv.ownerBlock.target!==s.NodeMaterialBlockTargets.Fragment?(e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+";\r\n",e.compilationString+="#ifdef "+this._linearDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toGammaSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef "+this._gammaDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toLinearSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n"):e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+";\r\n"},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===s.NodeMaterialBlockTargets.Vertex&&(this._tempTextureRead=t._getFreeVariableName("tempTextureRead"),t._emit2DSampler(this._samplerName),t.sharedData.blockingBlocks.push(this),t.sharedData.textureBlocks.push(this),t.sharedData.blocksWithDefines.push(this)),t.target===s.NodeMaterialBlockTargets.Fragment){if(this._outputs.some((function(e){return e.isConnectedInFragmentShader}))){t._emit2DSampler(this._samplerName),this._linearDefineName=t._getFreeDefineName("ISLINEAR"),this._gammaDefineName=t._getFreeDefineName("ISGAMMA");var r="//"+this.name;t._emitFunctionFromInclude("helperFunctions",r),this._writeTextureRead(t);for(var n=0,i=this._outputs;n<i.length;n++){var o=i[n];o.hasEndpoints&&this._writeOutput(t,o,o.name)}return this}}else this._injectVertexCode(t)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.convertToGammaSpace=t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,this.texture=l.Texture.Parse(t.texture,r,n))},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.CurrentScreenBlock"]=c},"./Materials/Node/Blocks/Dual/fogBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/Dual/fogBlock.ts ***!
- \************************************************/
- /*! exports provided: FogBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"FogBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),c=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),d=(r(/*! ../../../../Shaders/ShadersInclude/fogFragmentDeclaration */"./Shaders/ShadersInclude/fogFragmentDeclaration.ts"),function(e){function t(t){var r=e.call(this,t,a.NodeMaterialBlockTargets.VertexAndFragment,!0)||this;return r.registerInput("worldPosition",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1,a.NodeMaterialBlockTargets.Vertex),r.registerInput("view",o.NodeMaterialBlockConnectionPointTypes.Matrix,!1,a.NodeMaterialBlockTargets.Vertex),r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.Color3,!1,a.NodeMaterialBlockTargets.Fragment),r.registerInput("fogColor",o.NodeMaterialBlockConnectionPointTypes.Color3,!1,a.NodeMaterialBlockTargets.Fragment),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Color3,a.NodeMaterialBlockTargets.Fragment),r.input.acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r.fogColor.acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FogBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fogColor",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.view.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.systemValue===s.NodeMaterialSystemValues.View}));t||(t=new c.InputBlock("view")).setAsSystemValue(s.NodeMaterialSystemValues.View),t.output.connectTo(this.view)}if(!this.fogColor.isConnected){var r=e.getInputBlockByPredicate((function(e){return e.systemValue===s.NodeMaterialSystemValues.FogColor}));r||(r=new c.InputBlock("fogColor",void 0,o.NodeMaterialBlockConnectionPointTypes.Color3)).setAsSystemValue(s.NodeMaterialSystemValues.FogColor),r.output.connectTo(this.fogColor)}},t.prototype.prepareDefines=function(e,t,r){var n=e.getScene();r.setValue("FOG",t.fogEnabled&&l.MaterialHelper.GetFogState(e,n))},t.prototype.bind=function(e,t,r){if(r){var n=r.getScene();e.setFloat4(this._fogParameters,n.fogMode,n.fogStart,n.fogEnd,n.fogDensity)}},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===a.NodeMaterialBlockTargets.Fragment){t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),t._emitFunctionFromInclude("fogFragmentDeclaration","//"+this.name,{removeUniforms:!0,removeVaryings:!0,removeIfDef:!1,replaceStrings:[{search:/float CalcFogFactor\(\)/,replace:"float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)"}]});var r=t._getFreeVariableName("fog"),n=this.input,i=this.fogColor;this._fogParameters=t._getFreeVariableName("fogParameters");var o=this._outputs[0];t._emitUniformFromString(this._fogParameters,"vec4"),t.compilationString+="#ifdef FOG\r\n",t.compilationString+="float "+r+" = CalcFogFactor("+this._fogDistanceName+", "+this._fogParameters+");\r\n",t.compilationString+=this._declareOutput(o,t)+" = "+r+" * "+n.associatedVariableName+".rgb + (1.0 - "+r+") * "+i.associatedVariableName+".rgb;\r\n",t.compilationString+="#else\r\n"+this._declareOutput(o,t)+" = "+n.associatedVariableName+".rgb;\r\n",t.compilationString+="#endif\r\n"}else{var s=this.worldPosition,l=this.view;this._fogDistanceName=t._getFreeVariableName("vFogDistance"),t._emitVaryingFromString(this._fogDistanceName,"vec3"),t.compilationString+=this._fogDistanceName+" = ("+l.associatedVariableName+" * "+s.associatedVariableName+").xyz;\r\n"}return this},t}(i.NodeMaterialBlock));u._TypeStore.RegisteredTypes["BABYLON.FogBlock"]=d},"./Materials/Node/Blocks/Dual/index.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/Blocks/Dual/index.ts ***!
- \*********************************************/
- /*! exports provided: FogBlock, LightBlock, TextureBlock, ReflectionTextureBlock, CurrentScreenBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./fogBlock */"./Materials/Node/Blocks/Dual/fogBlock.ts");r.d(t,"FogBlock",(function(){return n.FogBlock}));var i=r(/*! ./lightBlock */"./Materials/Node/Blocks/Dual/lightBlock.ts");r.d(t,"LightBlock",(function(){return i.LightBlock}));var o=r(/*! ./textureBlock */"./Materials/Node/Blocks/Dual/textureBlock.ts");r.d(t,"TextureBlock",(function(){return o.TextureBlock}));var s=r(/*! ./reflectionTextureBlock */"./Materials/Node/Blocks/Dual/reflectionTextureBlock.ts");r.d(t,"ReflectionTextureBlock",(function(){return s.ReflectionTextureBlock}));var a=r(/*! ./currentScreenBlock */"./Materials/Node/Blocks/Dual/currentScreenBlock.ts");r.d(t,"CurrentScreenBlock",(function(){return a.CurrentScreenBlock}))},"./Materials/Node/Blocks/Dual/lightBlock.ts":
- /*!**************************************************!*\
- !*** ./Materials/Node/Blocks/Dual/lightBlock.ts ***!
- \**************************************************/
- /*! exports provided: LightBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"LightBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),a=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),c=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),d=(r(/*! ../../../../Shaders/ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/lightFragment */"./Shaders/ShadersInclude/lightFragment.ts"),r(/*! ../../../../Shaders/ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/lightsFragmentFunctions */"./Shaders/ShadersInclude/lightsFragmentFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/shadowsFragmentFunctions */"./Shaders/ShadersInclude/shadowsFragmentFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/shadowsVertex */"./Shaders/ShadersInclude/shadowsVertex.ts"),function(e){function t(t){var r=e.call(this,t,o.NodeMaterialBlockTargets.VertexAndFragment)||this;return r._isUnique=!0,r.registerInput("worldPosition",s.NodeMaterialBlockConnectionPointTypes.Vector4,!1,o.NodeMaterialBlockTargets.Vertex),r.registerInput("worldNormal",s.NodeMaterialBlockConnectionPointTypes.Vector4,!1,o.NodeMaterialBlockTargets.Fragment),r.registerInput("cameraPosition",s.NodeMaterialBlockConnectionPointTypes.Vector3,!1,o.NodeMaterialBlockTargets.Fragment),r.registerInput("glossiness",s.NodeMaterialBlockConnectionPointTypes.Float,!0,o.NodeMaterialBlockTargets.Fragment),r.registerInput("glossPower",s.NodeMaterialBlockConnectionPointTypes.Float,!0,o.NodeMaterialBlockTargets.Fragment),r.registerInput("diffuseColor",s.NodeMaterialBlockConnectionPointTypes.Color3,!0,o.NodeMaterialBlockTargets.Fragment),r.registerInput("specularColor",s.NodeMaterialBlockConnectionPointTypes.Color3,!0,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("diffuseOutput",s.NodeMaterialBlockConnectionPointTypes.Color3,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("specularOutput",s.NodeMaterialBlockConnectionPointTypes.Color3,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("shadow",s.NodeMaterialBlockConnectionPointTypes.Float,o.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"LightBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossiness",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossPower",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseColor",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularColor",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseOutput",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularOutput",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.systemValue===l.NodeMaterialSystemValues.CameraPosition}));t||(t=new c.InputBlock("cameraPosition")).setAsSystemValue(l.NodeMaterialSystemValues.CameraPosition),t.output.connectTo(this.cameraPosition)}},t.prototype.prepareDefines=function(e,t,r){if(r._areLightsDirty){var n=e.getScene();if(this.light){var i={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};a.MaterialHelper.PrepareDefinesForLight(n,e,this.light,this._lightId,r,!0,i),i.needRebuild&&r.rebuild()}else a.MaterialHelper.PrepareDefinesForLights(n,e,r,!0,t.maxSimultaneousLights)}},t.prototype.updateUniformsAndSamples=function(e,t,r,n){for(var i=0;i<t.maxSimultaneousLights&&r["LIGHT"+i];i++)a.MaterialHelper.PrepareUniformsAndSamplersForLight(i,e.uniforms,e.samplers,r["PROJECTEDLIGHTTEXTURE"+i],n)},t.prototype.bind=function(e,t,r){if(r){var n=r.getScene();this.light?a.MaterialHelper.BindLight(this.light,this._lightId,n,e,!0):a.MaterialHelper.BindLights(n,r,e,!0,t.maxSimultaneousLights)}},t.prototype._injectVertexCode=function(e){var t=this.worldPosition,r="//"+this.name;this.light?(this._lightId=(void 0!==e.counters.lightCounter?e.counters.lightCounter:-1)+1,e.counters.lightCounter=this._lightId,e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",r,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString())):(e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",r,{repeatKey:"maxSimultaneousLights"}),this._lightId=0,e.sharedData.dynamicUniformBlocks.push(this));var n="v_"+t.associatedVariableName;e._emitVaryingFromString(n,"vec4")&&(e.compilationString+=n+" = "+t.associatedVariableName+";\r\n"),this.light?e.compilationString+=e._emitCodeFromInclude("shadowsVertex",r,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:/worldPos/g,replace:t.associatedVariableName}]}):(e.compilationString+="vec4 worldPos = "+t.associatedVariableName+";\r\n",e.compilationString+=e._emitCodeFromInclude("shadowsVertex",r,{repeatKey:"maxSimultaneousLights"}))},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===o.NodeMaterialBlockTargets.Fragment){t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this);var r="//"+this.name,n=this.worldPosition;t._emitFunctionFromInclude("helperFunctions",r),t._emitFunctionFromInclude("lightsFragmentFunctions",r,{replaceStrings:[{search:/vPositionW/g,replace:"v_"+n.associatedVariableName+".xyz"}]}),t._emitFunctionFromInclude("shadowsFragmentFunctions",r,{replaceStrings:[{search:/vPositionW/g,replace:"v_"+n.associatedVariableName+".xyz"}]}),this.light?t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",r,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString()):t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",r,{repeatKey:"maxSimultaneousLights"}),0===this._lightId&&(t._registerTempVariable("viewDirectionW")&&(t.compilationString+="vec3 viewDirectionW = normalize("+this.cameraPosition.associatedVariableName+" - v_"+n.associatedVariableName+".xyz);\r\n"),t.compilationString+="lightingInfo info;\r\n",t.compilationString+="float shadow = 1.;\r\n",t.compilationString+="float glossiness = "+(this.glossiness.isConnected?this.glossiness.associatedVariableName:"1.0")+" * "+(this.glossPower.isConnected?this.glossPower.associatedVariableName:"1024.0")+";\r\n",t.compilationString+="vec3 diffuseBase = vec3(0., 0., 0.);\r\n",t.compilationString+="vec3 specularBase = vec3(0., 0., 0.);\r\n",t.compilationString+="vec3 normalW = "+this.worldNormal.associatedVariableName+".xyz;\r\n"),this.light?t.compilationString+=t._emitCodeFromInclude("lightFragment",r,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]}):t.compilationString+=t._emitCodeFromInclude("lightFragment",r,{repeatKey:"maxSimultaneousLights"});var i=this.diffuseOutput,s=this.specularOutput;return t.compilationString+=this._declareOutput(i,t)+" = diffuseBase"+(this.diffuseColor.isConnected?" * "+this.diffuseColor.associatedVariableName:"")+";\r\n",s.hasEndpoints&&(t.compilationString+=this._declareOutput(s,t)+" = specularBase"+(this.specularColor.isConnected?" * "+this.specularColor.associatedVariableName:"")+";\r\n"),this.shadow.hasEndpoints&&(t.compilationString+=this._declareOutput(this.shadow,t)+" = shadow;\r\n"),this}this._injectVertexCode(t)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.light&&(t.lightId=this.light.id),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),t.lightId&&(this.light=r.getLightByID(t.lightId))},t}(i.NodeMaterialBlock));u._TypeStore.RegisteredTypes["BABYLON.LightBlock"]=d},"./Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.ts":
- /*!******************************************************************!*\
- !*** ./Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.ts ***!
- \******************************************************************/
- /*! exports provided: ReflectionTextureBaseBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReflectionTextureBaseBlock",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),a=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),l=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),c=r(/*! ../../../../Engines/constants */"./Engines/constants.ts"),u=(r(/*! ../../../../Shaders/ShadersInclude/reflectionFunction */"./Shaders/ShadersInclude/reflectionFunction.ts"),r(/*! ../../../Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts")),d=r(/*! ../../../Textures/texture */"./Materials/Textures/texture.ts"),h=function(e){function t(t){return e.call(this,t,o.NodeMaterialBlockTargets.VertexAndFragment)||this}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ReflectionTextureBaseBlock"},t.prototype._getTexture=function(){return this.texture},t.prototype.autoConfigure=function(e){if(!this.position.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"position"===e.name}));t||(t=new a.InputBlock("position")).setAsAttribute(),t.output.connectTo(this.position)}if(!this.world.isConnected){var r=e.getInputBlockByPredicate((function(e){return e.systemValue===l.NodeMaterialSystemValues.World}));r||(r=new a.InputBlock("world")).setAsSystemValue(l.NodeMaterialSystemValues.World),r.output.connectTo(this.world)}if(!this.view.isConnected){var n=e.getInputBlockByPredicate((function(e){return e.systemValue===l.NodeMaterialSystemValues.View}));n||(n=new a.InputBlock("view")).setAsSystemValue(l.NodeMaterialSystemValues.View),n.output.connectTo(this.view)}},t.prototype.prepareDefines=function(e,t,r){if(r._areTexturesDirty){var n=this._getTexture();n&&n.getTextureMatrix&&(r.setValue(this._define3DName,n.isCube,!0),r.setValue(this._defineLocalCubicName,!!n.boundingBoxSize,!0),r.setValue(this._defineExplicitName,n.coordinatesMode===c.Constants.TEXTURE_EXPLICIT_MODE,!0),r.setValue(this._defineSkyboxName,n.coordinatesMode===c.Constants.TEXTURE_SKYBOX_MODE,!0),r.setValue(this._defineCubicName,n.coordinatesMode===c.Constants.TEXTURE_CUBIC_MODE,!0),r.setValue(this._defineSphericalName,n.coordinatesMode===c.Constants.TEXTURE_SPHERICAL_MODE,!0),r.setValue(this._definePlanarName,n.coordinatesMode===c.Constants.TEXTURE_PLANAR_MODE,!0),r.setValue(this._defineProjectionName,n.coordinatesMode===c.Constants.TEXTURE_PROJECTION_MODE,!0),r.setValue(this._defineEquirectangularName,n.coordinatesMode===c.Constants.TEXTURE_EQUIRECTANGULAR_MODE,!0),r.setValue(this._defineEquirectangularFixedName,n.coordinatesMode===c.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,!0),r.setValue(this._defineMirroredEquirectangularFixedName,n.coordinatesMode===c.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,!0))}},t.prototype.isReady=function(){var e=this._getTexture();return!(e&&!e.isReadyOrNotBlocking())},t.prototype.bind=function(e,t,r){var n=this._getTexture();r&&n&&(e.setMatrix(this._reflectionMatrixName,n.getReflectionTextureMatrix()),n.isCube?e.setTexture(this._cubeSamplerName,n):e.setTexture(this._2DSamplerName,n))},t.prototype.handleVertexSide=function(e){this._define3DName=e._getFreeDefineName("REFLECTIONMAP_3D"),this._defineCubicName=e._getFreeDefineName("REFLECTIONMAP_CUBIC"),this._defineSphericalName=e._getFreeDefineName("REFLECTIONMAP_SPHERICAL"),this._definePlanarName=e._getFreeDefineName("REFLECTIONMAP_PLANAR"),this._defineProjectionName=e._getFreeDefineName("REFLECTIONMAP_PROJECTION"),this._defineExplicitName=e._getFreeDefineName("REFLECTIONMAP_EXPLICIT"),this._defineEquirectangularName=e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR"),this._defineLocalCubicName=e._getFreeDefineName("USE_LOCAL_REFLECTIONMAP_CUBIC"),this._defineMirroredEquirectangularFixedName=e._getFreeDefineName("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"),this._defineEquirectangularFixedName=e._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR_FIXED"),this._defineSkyboxName=e._getFreeDefineName("REFLECTIONMAP_SKYBOX"),this._defineOppositeZ=e._getFreeDefineName("REFLECTIONMAP_OPPOSITEZ"),this._reflectionMatrixName=e._getFreeVariableName("reflectionMatrix"),e._emitUniformFromString(this._reflectionMatrixName,"mat4");var t="",r="v_"+this.worldPosition.associatedVariableName;return e._emitVaryingFromString(r,"vec4")&&(t+=r+" = "+this.worldPosition.associatedVariableName+";\r\n"),this._positionUVWName=e._getFreeVariableName("positionUVW"),this._directionWName=e._getFreeVariableName("directionW"),e._emitVaryingFromString(this._positionUVWName,"vec3",this._defineSkyboxName)&&(t+="#ifdef "+this._defineSkyboxName+"\r\n",t+=this._positionUVWName+" = "+this.position.associatedVariableName+".xyz;\r\n",t+="#endif\r\n"),e._emitVaryingFromString(this._directionWName,"vec3","defined("+this._defineEquirectangularFixedName+") || defined("+this._defineMirroredEquirectangularFixedName+")")&&(t+="#if defined("+this._defineEquirectangularFixedName+") || defined("+this._defineMirroredEquirectangularFixedName+")\r\n",t+=this._directionWName+" = normalize(vec3("+this.world.associatedVariableName+" * vec4("+this.position.associatedVariableName+".xyz, 0.0)));\r\n",t+="#endif\r\n"),t},t.prototype.handleFragmentSideInits=function(e){e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),this._cubeSamplerName=e._getFreeVariableName(this.name+"CubeSampler"),e.samplers.push(this._cubeSamplerName),this._2DSamplerName=e._getFreeVariableName(this.name+"2DSampler"),e.samplers.push(this._2DSamplerName),e._samplerDeclaration+="#ifdef "+this._define3DName+"\r\n",e._samplerDeclaration+="uniform samplerCube "+this._cubeSamplerName+";\r\n",e._samplerDeclaration+="#else\r\n",e._samplerDeclaration+="uniform sampler2D "+this._2DSamplerName+";\r\n",e._samplerDeclaration+="#endif\r\n",e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this);var t="//"+this.name;e._emitFunction("ReciprocalPI","#define RECIPROCAL_PI2 0.15915494",""),e._emitFunctionFromInclude("reflectionFunction",t,{replaceStrings:[{search:/vec3 computeReflectionCoords/g,replace:"void DUMMYFUNC"}]}),this._reflectionColorName=e._getFreeVariableName("reflectionColor"),this._reflectionVectorName=e._getFreeVariableName("reflectionUVW"),this._reflectionCoordsName=e._getFreeVariableName("reflectionCoords")},t.prototype.handleFragmentSideCodeReflectionCoords=function(e,t,r){void 0===r&&(r=!1),t||(t="v_"+this.worldPosition.associatedVariableName);var n=this._reflectionMatrixName,i="normalize("+this._directionWName+")",o=""+this._positionUVWName,s=""+this.cameraPosition.associatedVariableName,a=""+this.view.associatedVariableName;e+=".xyz";var l="\n #ifdef "+this._defineMirroredEquirectangularFixedName+"\n vec3 "+this._reflectionVectorName+" = computeMirroredFixedEquirectangularCoords("+t+", "+e+", "+i+");\n #endif\n\n #ifdef "+this._defineEquirectangularFixedName+"\n vec3 "+this._reflectionVectorName+" = computeFixedEquirectangularCoords("+t+", "+e+", "+i+");\n #endif\n\n #ifdef "+this._defineEquirectangularName+"\n vec3 "+this._reflectionVectorName+" = computeEquirectangularCoords("+t+", "+e+", "+s+".xyz, "+n+");\n #endif\n\n #ifdef "+this._defineSphericalName+"\n vec3 "+this._reflectionVectorName+" = computeSphericalCoords("+t+", "+e+", "+a+", "+n+");\n #endif\n\n #ifdef "+this._definePlanarName+"\n vec3 "+this._reflectionVectorName+" = computePlanarCoords("+t+", "+e+", "+s+".xyz, "+n+");\n #endif\n\n #ifdef "+this._defineCubicName+"\n #ifdef "+this._defineLocalCubicName+"\n vec3 "+this._reflectionVectorName+" = computeCubicLocalCoords("+t+", "+e+", "+s+".xyz, "+n+", vReflectionSize, vReflectionPosition);\n #else\n vec3 "+this._reflectionVectorName+" = computeCubicCoords("+t+", "+e+", "+s+".xyz, "+n+");\n #endif\n #endif\n\n #ifdef "+this._defineProjectionName+"\n vec3 "+this._reflectionVectorName+" = computeProjectionCoords("+t+", "+a+", "+n+");\n #endif\n\n #ifdef "+this._defineSkyboxName+"\n vec3 "+this._reflectionVectorName+" = computeSkyBoxCoords("+o+", "+n+");\n #endif\n\n #ifdef "+this._defineExplicitName+"\n vec3 "+this._reflectionVectorName+" = vec3(0, 0, 0);\n #endif\n\n #ifdef "+this._defineOppositeZ+"\n "+this._reflectionVectorName+".z *= -1.0;\n #endif\r\n";return r||(l+="\n #ifdef "+this._define3DName+"\n vec3 "+this._reflectionCoordsName+" = "+this._reflectionVectorName+";\n #else\n vec2 "+this._reflectionCoordsName+" = "+this._reflectionVectorName+".xy;\n #ifdef "+this._defineProjectionName+"\n "+this._reflectionCoordsName+" /= "+this._reflectionVectorName+".z;\n #endif\n "+this._reflectionCoordsName+".y = 1.0 - "+this._reflectionCoordsName+".y;\n #endif\r\n"),l},t.prototype.handleFragmentSideCodeReflectionColor=function(e,t){void 0===t&&(t=".rgb");var r="vec"+(0===t.length?"4":t.length-1)+" "+this._reflectionColorName+";\n #ifdef "+this._define3DName+"\r\n";return r+=e?this._reflectionColorName+" = textureCubeLodEXT("+this._cubeSamplerName+", "+this._reflectionVectorName+", "+e+")"+t+";\r\n":this._reflectionColorName+" = textureCube("+this._cubeSamplerName+", "+this._reflectionVectorName+")"+t+";\r\n",r+="\n #else\r\n",r+=e?this._reflectionColorName+" = texture2DLodEXT("+this._2DSamplerName+", "+this._reflectionCoordsName+", "+e+")"+t+";\r\n":this._reflectionColorName+" = texture2D("+this._2DSamplerName+", "+this._reflectionCoordsName+")"+t+";\r\n",r+="#endif\r\n"},t.prototype.writeOutputs=function(e,t){var r="";if(e.target===o.NodeMaterialBlockTargets.Fragment)for(var n=0,i=this._outputs;n<i.length;n++){var s=i[n];s.hasEndpoints&&(r+=this._declareOutput(s,e)+" = "+t+"."+s.name+";\r\n")}return r},t.prototype._buildBlock=function(t){return e.prototype._buildBlock.call(this,t),this},t.prototype._dumpPropertiesCode=function(){return this.texture?(e=this.texture.isCube?this._codeVariableName+'.texture = new BABYLON.CubeTexture("'+this.texture.name+'");\r\n':this._codeVariableName+'.texture = new BABYLON.Texture("'+this.texture.name+'");\r\n',e+=this._codeVariableName+".texture.coordinatesMode = "+this.texture.coordinatesMode+";\r\n"):"";var e},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,t.texture.isCube?this.texture=u.CubeTexture.Parse(t.texture,r,n):this.texture=d.Texture.Parse(t.texture,r,n))},t}(i.NodeMaterialBlock);s._TypeStore.RegisteredTypes["BABYLON.ReflectionTextureBaseBlock"]=h},"./Materials/Node/Blocks/Dual/reflectionTextureBlock.ts":
- /*!**************************************************************!*\
- !*** ./Materials/Node/Blocks/Dual/reflectionTextureBlock.ts ***!
- \**************************************************************/
- /*! exports provided: ReflectionTextureBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReflectionTextureBlock",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),o=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),a=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),l=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),c=function(e){function t(t){var r=e.call(this,t)||this;return r.registerInput("position",i.NodeMaterialBlockConnectionPointTypes.Vector3,!1,o.NodeMaterialBlockTargets.Vertex),r.registerInput("worldPosition",i.NodeMaterialBlockConnectionPointTypes.Vector4,!1,o.NodeMaterialBlockTargets.Vertex),r.registerInput("worldNormal",i.NodeMaterialBlockConnectionPointTypes.Vector4,!1,o.NodeMaterialBlockTargets.Fragment),r.registerInput("world",i.NodeMaterialBlockConnectionPointTypes.Matrix,!1,o.NodeMaterialBlockTargets.Vertex),r.registerInput("cameraPosition",i.NodeMaterialBlockConnectionPointTypes.Vector3,!1,o.NodeMaterialBlockTargets.Fragment),r.registerInput("view",i.NodeMaterialBlockConnectionPointTypes.Matrix,!1,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("rgb",i.NodeMaterialBlockConnectionPointTypes.Color3,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("rgba",i.NodeMaterialBlockConnectionPointTypes.Color4,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("r",i.NodeMaterialBlockConnectionPointTypes.Float,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("g",i.NodeMaterialBlockConnectionPointTypes.Float,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("b",i.NodeMaterialBlockConnectionPointTypes.Float,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("a",i.NodeMaterialBlockConnectionPointTypes.Float,o.NodeMaterialBlockTargets.Fragment),r._inputs[0].acceptedConnectionPointTypes.push(i.NodeMaterialBlockConnectionPointTypes.Vector4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ReflectionTextureBlock"},Object.defineProperty(t.prototype,"position",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(t){if(e.prototype.autoConfigure.call(this,t),!this.cameraPosition.isConnected){var r=t.getInputBlockByPredicate((function(e){return e.systemValue===l.NodeMaterialSystemValues.CameraPosition}));r||(r=new a.InputBlock("cameraPosition")).setAsSystemValue(l.NodeMaterialSystemValues.CameraPosition),r.output.connectTo(this.cameraPosition)}},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),!this.texture)return t.compilationString+=this.writeOutputs(t,"vec3(0.)"),this;if(t.target!==o.NodeMaterialBlockTargets.Fragment)return t.compilationString+=this.handleVertexSide(t),this;this.handleFragmentSideInits(t);var r=t._getFreeVariableName("normalWUnit");return t.compilationString+="vec4 "+r+" = normalize("+this.worldNormal.associatedVariableName+");\r\n",t.compilationString+=this.handleFragmentSideCodeReflectionCoords(r),t.compilationString+=this.handleFragmentSideCodeReflectionColor(void 0,""),t.compilationString+=this.writeOutputs(t,this._reflectionColorName),this},t}(r(/*! ./reflectionTextureBaseBlock */"./Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.ts").ReflectionTextureBaseBlock);s._TypeStore.RegisteredTypes["BABYLON.ReflectionTextureBlock"]=c},"./Materials/Node/Blocks/Dual/textureBlock.ts":
- /*!****************************************************!*\
- !*** ./Materials/Node/Blocks/Dual/textureBlock.ts ***!
- \****************************************************/
- /*! exports provided: TextureBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"TextureBlock",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../nodeMaterial */"./Materials/Node/nodeMaterial.ts"),l=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),c=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),u=r(/*! ../../../Textures/texture */"./Materials/Textures/texture.ts"),d=r(/*! ../../Enums/nodeMaterialModes */"./Materials/Node/Enums/nodeMaterialModes.ts"),h=(r(/*! ../../../../Shaders/ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),function(e){function t(t,r){void 0===r&&(r=!1);var n=e.call(this,t,r?s.NodeMaterialBlockTargets.Fragment:s.NodeMaterialBlockTargets.VertexAndFragment)||this;return n.convertToGammaSpace=!1,n.convertToLinearSpace=!1,n._fragmentOnly=r,n.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2,!1,s.NodeMaterialBlockTargets.VertexAndFragment),n.registerOutput("rgba",o.NodeMaterialBlockConnectionPointTypes.Color4,s.NodeMaterialBlockTargets.Neutral),n.registerOutput("rgb",o.NodeMaterialBlockConnectionPointTypes.Color3,s.NodeMaterialBlockTargets.Neutral),n.registerOutput("r",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),n.registerOutput("g",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),n.registerOutput("b",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),n.registerOutput("a",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),n._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector3),n._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),n._inputs[0]._prioritizeVertex=!r,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"TextureBlock"},Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){if(this._fragmentOnly)return s.NodeMaterialBlockTargets.Fragment;if(!this.uv.isConnected)return s.NodeMaterialBlockTargets.VertexAndFragment;if(this.uv.sourceBlock.isInput)return s.NodeMaterialBlockTargets.VertexAndFragment;for(var e=this.uv.connectedPoint;e;){if(e.target===s.NodeMaterialBlockTargets.Fragment)return s.NodeMaterialBlockTargets.Fragment;if(e.target===s.NodeMaterialBlockTargets.Vertex)return s.NodeMaterialBlockTargets.VertexAndFragment;if(e.target===s.NodeMaterialBlockTargets.Neutral||e.target===s.NodeMaterialBlockTargets.VertexAndFragment){var t=e.ownerBlock;e=null;for(var r=0,n=t.inputs;r<n.length;r++){var i=n[r];if(i.connectedPoint){e=i.connectedPoint;break}}}}return s.NodeMaterialBlockTargets.VertexAndFragment},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.uv.isConnected)if(e.mode===d.NodeMaterialModes.PostProcess)(t=e.getBlockByPredicate((function(e){return"uv"===e.name})))&&t.connectTo(this);else{var t,r=e.mode===d.NodeMaterialModes.Particle?"particle_uv":"uv";(t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&e.name===r})))||(t=new l.InputBlock("uv")).setAsAttribute(r),t.output.connectTo(this.uv)}},t.prototype.initializeDefines=function(e,t,r,n){void 0===n&&(n=!1),r._areTexturesDirty&&r.setValue(this._mainUVDefineName,!1)},t.prototype.prepareDefines=function(e,t,r){if(r._areTexturesDirty){if(!this.texture||!this.texture.getTextureMatrix)return r.setValue(this._defineName,!1),void r.setValue(this._mainUVDefineName,!0);r.setValue(this._linearDefineName,this.convertToGammaSpace),r.setValue(this._gammaDefineName,this.convertToLinearSpace),this._isMixed&&(this.texture.getTextureMatrix().isIdentityAs3x2()?(r.setValue(this._defineName,!1),r.setValue(this._mainUVDefineName,!0)):r.setValue(this._defineName,!0))}},t.prototype.isReady=function(){return!(this.texture&&!this.texture.isReadyOrNotBlocking())},t.prototype.bind=function(e,t,r){this.texture&&(this._isMixed&&(e.setFloat(this._textureInfoName,this.texture.level),e.setMatrix(this._textureTransformName,this.texture.getTextureMatrix())),e.setTexture(this._samplerName,this.texture))},Object.defineProperty(t.prototype,"_isMixed",{get:function(){return this.target!==s.NodeMaterialBlockTargets.Fragment},enumerable:!1,configurable:!0}),t.prototype._injectVertexCode=function(e){var t=this.uv;if(this._defineName=e._getFreeDefineName("UVTRANSFORM"),this._mainUVDefineName="VMAIN"+t.associatedVariableName.toUpperCase(),t.connectedPoint.ownerBlock.isInput&&(t.connectedPoint.ownerBlock.isAttribute||e._emitUniformFromString(t.associatedVariableName,"vec2")),this._mainUVName="vMain"+t.associatedVariableName,this._transformedUVName=e._getFreeVariableName("transformedUV"),this._textureTransformName=e._getFreeVariableName("textureTransform"),this._textureInfoName=e._getFreeVariableName("textureInfoName"),e._emitVaryingFromString(this._transformedUVName,"vec2",this._defineName),e._emitVaryingFromString(this._mainUVName,"vec2",this._mainUVDefineName),e._emitUniformFromString(this._textureTransformName,"mat4",this._defineName),e.compilationString+="#ifdef "+this._defineName+"\r\n",e.compilationString+=this._transformedUVName+" = vec2("+this._textureTransformName+" * vec4("+t.associatedVariableName+".xy, 1.0, 0.0));\r\n",e.compilationString+="#elif defined("+this._mainUVDefineName+")\r\n",e.compilationString+=this._mainUVName+" = "+t.associatedVariableName+".xy;\r\n",e.compilationString+="#endif\r\n",this._outputs.some((function(e){return e.isConnectedInVertexShader}))){this._writeTextureRead(e,!0);for(var r=0,n=this._outputs;r<n.length;r++){var i=n[r];i.hasEndpoints&&this._writeOutput(e,i,i.name,!0)}}},t.prototype._writeTextureRead=function(e,t){void 0===t&&(t=!1);var r=this.uv;if(t){if(e.target===s.NodeMaterialBlockTargets.Fragment)return;e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+r.associatedVariableName+");\r\n"}else this.uv.ownerBlock.target!==s.NodeMaterialBlockTargets.Fragment?(e.compilationString+="#ifdef "+this._defineName+"\r\n",e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this._transformedUVName+");\r\n",e.compilationString+="#elif defined("+this._mainUVDefineName+")\r\n",e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this._mainUVName+");\r\n",e.compilationString+="#endif\r\n"):e.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+r.associatedVariableName+");\r\n"},t.prototype._writeOutput=function(e,t,r,n){if(void 0===n&&(n=!1),n){if(e.target===s.NodeMaterialBlockTargets.Fragment)return;e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+";\r\n"}else if(this.uv.ownerBlock.target!==s.NodeMaterialBlockTargets.Fragment){var i=" * "+this._textureInfoName;e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+i+";\r\n","a"!==r&&(e.compilationString+="#ifdef "+this._linearDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toGammaSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef "+this._gammaDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toLinearSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n")}else e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+";\r\n"},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),(t.target===s.NodeMaterialBlockTargets.Vertex||this._fragmentOnly)&&(this._tempTextureRead=t._getFreeVariableName("tempTextureRead")),(!this._isMixed&&t.target===s.NodeMaterialBlockTargets.Fragment||this._isMixed&&t.target===s.NodeMaterialBlockTargets.Vertex)&&(this._samplerName=t._getFreeVariableName(this.name+"Sampler"),t._emit2DSampler(this._samplerName),t.sharedData.blockingBlocks.push(this),t.sharedData.textureBlocks.push(this),t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this)),t.target===s.NodeMaterialBlockTargets.Fragment){if(this._outputs.some((function(e){return e.isConnectedInFragmentShader}))){this._isMixed&&t._emit2DSampler(this._samplerName),this._linearDefineName=t._getFreeDefineName("ISLINEAR"),this._gammaDefineName=t._getFreeDefineName("ISGAMMA");var r="//"+this.name;t._emitFunctionFromInclude("helperFunctions",r),this._isMixed&&t._emitUniformFromString(this._textureInfoName,"float"),this._writeTextureRead(t);for(var n=0,i=this._outputs;n<i.length;n++){var o=i[n];o.hasEndpoints&&this._writeOutput(t,o,o.name)}return this}}else this._injectVertexCode(t)},t.prototype._dumpPropertiesCode=function(){if(!this.texture)return"";var e=this._codeVariableName+'.texture = new BABYLON.Texture("'+this.texture.name+'", null);\r\n';return e+=this._codeVariableName+".texture.wrapU = "+this.texture.wrapU+";\r\n",e+=this._codeVariableName+".texture.wrapV = "+this.texture.wrapV+";\r\n",e+=this._codeVariableName+".texture.uAng = "+this.texture.uAng+";\r\n",e+=this._codeVariableName+".texture.vAng = "+this.texture.vAng+";\r\n",e+=this._codeVariableName+".texture.wAng = "+this.texture.wAng+";\r\n",e+=this._codeVariableName+".texture.uOffset = "+this.texture.uOffset+";\r\n",e+=this._codeVariableName+".texture.vOffset = "+this.texture.vOffset+";\r\n",e+=this._codeVariableName+".texture.uScale = "+this.texture.uScale+";\r\n",e+=this._codeVariableName+".texture.vScale = "+this.texture.vScale+";\r\n",e+=this._codeVariableName+".convertToGammaSpace = "+this.convertToGammaSpace+";\r\n",e+=this._codeVariableName+".convertToLinearSpace = "+this.convertToLinearSpace+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,t.fragmentOnly=this._fragmentOnly,this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.convertToGammaSpace=t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,this._fragmentOnly=!!t.fragmentOnly,t.texture&&!a.NodeMaterial.IgnoreTexturesAtLoadTime&&(n=0===t.texture.url.indexOf("data:")?"":n,this.texture=u.Texture.Parse(t.texture,r,n))},t}(i.NodeMaterialBlock));c._TypeStore.RegisteredTypes["BABYLON.TextureBlock"]=h},"./Materials/Node/Blocks/Fragment/derivativeBlock.ts":
- /*!***********************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/derivativeBlock.ts ***!
- \***********************************************************/
- /*! exports provided: DerivativeBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"DerivativeBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.AutoDetect,!1),r.registerOutput("dx",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r.registerOutput("dy",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._outputs[1]._typeConnectionSource=r._inputs[0],r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DerivativeBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dx",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dy",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n=this._outputs[1];return t._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable"),r.hasEndpoints&&(t.compilationString+=this._declareOutput(r,t)+" = dFdx("+this.input.associatedVariableName+");\r\n"),n.hasEndpoints&&(t.compilationString+=this._declareOutput(n,t)+" = dFdy("+this.input.associatedVariableName+");\r\n"),this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.DerivativeBlock"]=l},"./Materials/Node/Blocks/Fragment/discardBlock.ts":
- /*!********************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/discardBlock.ts ***!
- \********************************************************/
- /*! exports provided: DiscardBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"DiscardBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment,!0)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("cutoff",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DiscardBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cutoff",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){return e.prototype._buildBlock.call(this,t),t.sharedData.hints.needAlphaTesting=!0,t.compilationString+="if ("+this.value.associatedVariableName+" < "+this.cutoff.associatedVariableName+") discard;\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.DiscardBlock"]=l},"./Materials/Node/Blocks/Fragment/fragCoordBlock.ts":
- /*!**********************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/fragCoordBlock.ts ***!
- \**********************************************************/
- /*! exports provided: FragCoordBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"FragCoordBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r.registerOutput("xy",o.NodeMaterialBlockConnectionPointTypes.Vector2,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("xyz",o.NodeMaterialBlockConnectionPointTypes.Vector3,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("xyzw",o.NodeMaterialBlockConnectionPointTypes.Vector4,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("x",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("y",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("z",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("w",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FragCoordBlock"},Object.defineProperty(t.prototype,"xy",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyz",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzw",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[6]},enumerable:!1,configurable:!0}),t.prototype.writeOutputs=function(e){for(var t="",r=0,n=this._outputs;r<n.length;r++){var i=n[r];i.hasEndpoints&&(t+=this._declareOutput(i,e)+" = gl_FragCoord."+i.name+";\r\n")}return t},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===s.NodeMaterialBlockTargets.Vertex)throw"FragCoordBlock must only be used in a fragment shader";return t.compilationString+=this.writeOutputs(t),this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.FragCoordBlock"]=l},"./Materials/Node/Blocks/Fragment/fragmentOutputBlock.ts":
- /*!***************************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/fragmentOutputBlock.ts ***!
- \***************************************************************/
- /*! exports provided: FragmentOutputBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"FragmentOutputBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment,!0)||this;return r.registerInput("rgba",o.NodeMaterialBlockConnectionPointTypes.Color4,!0),r.registerInput("rgb",o.NodeMaterialBlockConnectionPointTypes.Color3,!0),r.registerInput("a",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.rgb.acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FragmentOutputBlock"},Object.defineProperty(t.prototype,"rgba",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.rgba,n=this.rgb,i=this.a;if(t.sharedData.hints.needAlphaBlending=r.isConnected||i.isConnected,r.connectedPoint)i.isConnected?t.compilationString+="gl_FragColor = vec4("+r.associatedVariableName+".rgb, "+i.associatedVariableName+");\r\n":t.compilationString+="gl_FragColor = "+r.associatedVariableName+";\r\n";else if(n.connectedPoint){var s="1.0";i.connectedPoint&&(s=i.associatedVariableName),n.connectedPoint.type===o.NodeMaterialBlockConnectionPointTypes.Float?t.compilationString+="gl_FragColor = vec4("+n.associatedVariableName+", "+n.associatedVariableName+", "+n.associatedVariableName+", "+s+");\r\n":t.compilationString+="gl_FragColor = vec4("+n.associatedVariableName+", "+s+");\r\n"}else t.sharedData.checks.notConnectedNonOptionalInputs.push(r);return this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.FragmentOutputBlock"]=l},"./Materials/Node/Blocks/Fragment/frontFacingBlock.ts":
- /*!************************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/frontFacingBlock.ts ***!
- \************************************************************/
- /*! exports provided: FrontFacingBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"FrontFacingBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FrontFacingBlock"},Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===s.NodeMaterialBlockTargets.Vertex)throw"FrontFacingBlock must only be used in a fragment shader";var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = gl_FrontFacing ? 1.0 : 0.0;\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.FrontFacingBlock"]=l},"./Materials/Node/Blocks/Fragment/imageProcessingBlock.ts":
- /*!****************************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/imageProcessingBlock.ts ***!
- \****************************************************************/
- /*! exports provided: ImageProcessingBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ImageProcessingBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=(r(/*! ../../../../Shaders/ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r.registerInput("color",o.NodeMaterialBlockConnectionPointTypes.Color4),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Color4),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ImageProcessingBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("exposureLinear"),e._excludeVariableName("contrast"),e._excludeVariableName("vInverseScreenSize"),e._excludeVariableName("vignetteSettings1"),e._excludeVariableName("vignetteSettings2"),e._excludeVariableName("vCameraColorCurveNegative"),e._excludeVariableName("vCameraColorCurveNeutral"),e._excludeVariableName("vCameraColorCurvePositive"),e._excludeVariableName("txColorTransform"),e._excludeVariableName("colorTransformSettings")},t.prototype.isReady=function(e,t,r){return!(r._areImageProcessingDirty&&t.imageProcessingConfiguration&&!t.imageProcessingConfiguration.isReady())},t.prototype.prepareDefines=function(e,t,r){r._areImageProcessingDirty&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.prepareDefines(r)},t.prototype.bind=function(e,t,r){r&&t.imageProcessingConfiguration&&t.imageProcessingConfiguration.bind(e)},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithDefines.push(this),t.sharedData.blockingBlocks.push(this),t.sharedData.bindableBlocks.push(this),t.uniforms.push("exposureLinear"),t.uniforms.push("contrast"),t.uniforms.push("vInverseScreenSize"),t.uniforms.push("vignetteSettings1"),t.uniforms.push("vignetteSettings2"),t.uniforms.push("vCameraColorCurveNegative"),t.uniforms.push("vCameraColorCurveNeutral"),t.uniforms.push("vCameraColorCurvePositive"),t.uniforms.push("txColorTransform"),t.uniforms.push("colorTransformSettings");var r=this.color,n=this._outputs[0],i="//"+this.name;return t._emitFunctionFromInclude("helperFunctions",i),t._emitFunctionFromInclude("imageProcessingDeclaration",i),t._emitFunctionFromInclude("imageProcessingFunctions",i),r.connectedPoint.type===o.NodeMaterialBlockConnectionPointTypes.Color4||r.connectedPoint.type===o.NodeMaterialBlockConnectionPointTypes.Vector4?t.compilationString+=this._declareOutput(n,t)+" = "+r.associatedVariableName+";\r\n":t.compilationString+=this._declareOutput(n,t)+" = vec4("+r.associatedVariableName+", 1.0);\r\n",t.compilationString+="#ifdef IMAGEPROCESSINGPOSTPROCESS\r\n",t.compilationString+=n.associatedVariableName+".rgb = toLinearSpace("+r.associatedVariableName+".rgb);\r\n",t.compilationString+="#else\r\n",t.compilationString+="#ifdef IMAGEPROCESSING\r\n",t.compilationString+=n.associatedVariableName+".rgb = toLinearSpace("+r.associatedVariableName+".rgb);\r\n",t.compilationString+=n.associatedVariableName+" = applyImageProcessing("+n.associatedVariableName+");\r\n",t.compilationString+="#endif\r\n",t.compilationString+="#endif\r\n",this},t}(i.NodeMaterialBlock));a._TypeStore.RegisteredTypes["BABYLON.ImageProcessingBlock"]=l},"./Materials/Node/Blocks/Fragment/index.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/index.ts ***!
- \*************************************************/
- /*! exports provided: FragmentOutputBlock, ImageProcessingBlock, PerturbNormalBlock, DiscardBlock, FrontFacingBlock, DerivativeBlock, FragCoordBlock, ScreenSizeBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./fragmentOutputBlock */"./Materials/Node/Blocks/Fragment/fragmentOutputBlock.ts");r.d(t,"FragmentOutputBlock",(function(){return n.FragmentOutputBlock}));var i=r(/*! ./imageProcessingBlock */"./Materials/Node/Blocks/Fragment/imageProcessingBlock.ts");r.d(t,"ImageProcessingBlock",(function(){return i.ImageProcessingBlock}));var o=r(/*! ./perturbNormalBlock */"./Materials/Node/Blocks/Fragment/perturbNormalBlock.ts");r.d(t,"PerturbNormalBlock",(function(){return o.PerturbNormalBlock}));var s=r(/*! ./discardBlock */"./Materials/Node/Blocks/Fragment/discardBlock.ts");r.d(t,"DiscardBlock",(function(){return s.DiscardBlock}));var a=r(/*! ./frontFacingBlock */"./Materials/Node/Blocks/Fragment/frontFacingBlock.ts");r.d(t,"FrontFacingBlock",(function(){return a.FrontFacingBlock}));var l=r(/*! ./derivativeBlock */"./Materials/Node/Blocks/Fragment/derivativeBlock.ts");r.d(t,"DerivativeBlock",(function(){return l.DerivativeBlock}));var c=r(/*! ./fragCoordBlock */"./Materials/Node/Blocks/Fragment/fragCoordBlock.ts");r.d(t,"FragCoordBlock",(function(){return c.FragCoordBlock}));var u=r(/*! ./screenSizeBlock */"./Materials/Node/Blocks/Fragment/screenSizeBlock.ts");r.d(t,"ScreenSizeBlock",(function(){return u.ScreenSizeBlock}))},"./Materials/Node/Blocks/Fragment/perturbNormalBlock.ts":
- /*!**************************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/perturbNormalBlock.ts ***!
- \**************************************************************/
- /*! exports provided: PerturbNormalBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"PerturbNormalBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),c=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),u=(r(/*! ../../../../Shaders/ShadersInclude/bumpFragmentMainFunctions */"./Shaders/ShadersInclude/bumpFragmentMainFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/bumpFragmentFunctions */"./Shaders/ShadersInclude/bumpFragmentFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/bumpFragment */"./Shaders/ShadersInclude/bumpFragment.ts"),function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r._tangentSpaceParameterName="",r.invertX=!1,r.invertY=!1,r.registerInput("worldPosition",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1),r.registerInput("worldNormal",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1),r.registerInput("worldTangent",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0),r.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2,!1),r.registerInput("normalMapColor",o.NodeMaterialBlockConnectionPointTypes.Color3,!1),r.registerInput("strength",o.NodeMaterialBlockConnectionPointTypes.Float,!1),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PerturbNormalBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTangent",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalMapColor",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.prepareDefines=function(e,t,r){r.setValue("BUMP",!0)},t.prototype.bind=function(e,t,r){t.getScene()._mirroredCameraPosition?e.setFloat2(this._tangentSpaceParameterName,this.invertX?1:-1,this.invertY?1:-1):e.setFloat2(this._tangentSpaceParameterName,this.invertX?-1:1,this.invertY?-1:1)},t.prototype.autoConfigure=function(e){if(!this.uv.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"uv"===e.name}));t||(t=new l.InputBlock("uv")).setAsAttribute(),t.output.connectTo(this.uv)}if(!this.strength.isConnected){var r=new l.InputBlock("strength");r.value=1,r.output.connectTo(this.strength)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r="//"+this.name,n=this.uv,i=this.worldPosition,o=this.worldNormal,s=this.worldTangent;t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),this._tangentSpaceParameterName=t._getFreeDefineName("tangentSpaceParameter"),t._emitUniformFromString(this._tangentSpaceParameterName,"vec2");var a=this.strength.isConnectedToInputBlock&&this.strength.connectInputBlock.isConstant?""+t._emitFloat(1/this.strength.connectInputBlock.value):"1.0 / "+this.strength.associatedVariableName;t._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");var l={search:/defined\(TANGENT\)/g,replace:s.isConnected?"defined(TANGENT)":"defined(IGNORE)"};return s.isConnected&&(t.compilationString+="vec3 tbnNormal = normalize("+o.associatedVariableName+".xyz);\r\n",t.compilationString+="vec3 tbnTangent = normalize("+s.associatedVariableName+".xyz);\r\n",t.compilationString+="vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n",t.compilationString+="mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n"),t._emitFunctionFromInclude("bumpFragmentMainFunctions",r,{replaceStrings:[l]}),t._emitFunctionFromInclude("bumpFragmentFunctions",r,{replaceStrings:[{search:/vBumpInfos.y/g,replace:a},{search:/vTangentSpaceParams/g,replace:this._tangentSpaceParameterName},{search:/vPositionW/g,replace:i.associatedVariableName+".xyz"}]}),t.compilationString+=this._declareOutput(this.output,t)+" = vec4(0.);\r\n",t.compilationString+=t._emitCodeFromInclude("bumpFragment",r,{replaceStrings:[{search:/perturbNormal\(TBN,vBumpUV\+uvOffset\)/g,replace:"perturbNormal(TBN, "+this.normalMapColor.associatedVariableName+")"},{search:/vBumpInfos.y/g,replace:a},{search:/vBumpUV/g,replace:n.associatedVariableName},{search:/vPositionW/g,replace:i.associatedVariableName+".xyz"},{search:/normalW=/g,replace:this.output.associatedVariableName+".xyz = "},{search:/mat3\(normalMatrix\)\*normalW/g,replace:"mat3(normalMatrix) * "+this.output.associatedVariableName+".xyz"},{search:/normalW/g,replace:o.associatedVariableName+".xyz"},l]}),this},t.prototype._dumpPropertiesCode=function(){var e=this._codeVariableName+".invertX = "+this.invertX+";\r\n";return e+=this._codeVariableName+".invertY = "+this.invertY+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.invertX=this.invertX,t.invertY=this.invertY,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.invertX=t.invertX,this.invertY=t.invertY},Object(n.__decorate)([Object(c.editableInPropertyPage)("Invert X axis",c.PropertyTypeForEdition.Boolean,"PROPERTIES",{notifiers:{update:!1}})],t.prototype,"invertX",void 0),Object(n.__decorate)([Object(c.editableInPropertyPage)("Invert Y axis",c.PropertyTypeForEdition.Boolean,"PROPERTIES",{notifiers:{update:!1}})],t.prototype,"invertY",void 0),t}(i.NodeMaterialBlock));a._TypeStore.RegisteredTypes["BABYLON.PerturbNormalBlock"]=u},"./Materials/Node/Blocks/Fragment/screenSizeBlock.ts":
- /*!***********************************************************!*\
- !*** ./Materials/Node/Blocks/Fragment/screenSizeBlock.ts ***!
- \***********************************************************/
- /*! exports provided: ScreenSizeBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ScreenSizeBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r.registerOutput("xy",o.NodeMaterialBlockConnectionPointTypes.Vector2,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("x",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("y",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ScreenSizeBlock"},Object.defineProperty(t.prototype,"xy",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),t.prototype.bind=function(e,t,r){var n=this._scene.getEngine();e.setFloat2(this._varName,n.getRenderWidth(),n.getRenderWidth())},t.prototype.writeOutputs=function(e,t){for(var r="",n=0,i=this._outputs;n<i.length;n++){var o=i[n];o.hasEndpoints&&(r+=this._declareOutput(o,e)+" = "+t+"."+o.name+";\r\n")}return r},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this._scene=t.sharedData.scene,t.target===s.NodeMaterialBlockTargets.Vertex)throw"ScreenSizeBlock must only be used in a fragment shader";return t.sharedData.bindableBlocks.push(this),this._varName=t._getFreeVariableName("screenSize"),t._emitUniformFromString(this._varName,"vec2"),t.compilationString+=this.writeOutputs(t,this._varName),this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ScreenSizeBlock"]=l},"./Materials/Node/Blocks/Input/animatedInputBlockTypes.ts":
- /*!****************************************************************!*\
- !*** ./Materials/Node/Blocks/Input/animatedInputBlockTypes.ts ***!
- \****************************************************************/
- /*! exports provided: AnimatedInputBlockTypes */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"AnimatedInputBlockTypes",(function(){return n})),function(e){e[e.None=0]="None",e[e.Time=1]="Time"}(n||(n={}))},"./Materials/Node/Blocks/Input/index.ts":
- /*!**********************************************!*\
- !*** ./Materials/Node/Blocks/Input/index.ts ***!
- \**********************************************/
- /*! exports provided: InputBlock, AnimatedInputBlockTypes */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts");r.d(t,"InputBlock",(function(){return n.InputBlock}));var i=r(/*! ./animatedInputBlockTypes */"./Materials/Node/Blocks/Input/animatedInputBlockTypes.ts");r.d(t,"AnimatedInputBlockTypes",(function(){return i.AnimatedInputBlockTypes}))},"./Materials/Node/Blocks/Input/inputBlock.ts":
- /*!***************************************************!*\
- !*** ./Materials/Node/Blocks/Input/inputBlock.ts ***!
- \***************************************************/
- /*! exports provided: InputBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"InputBlock",(function(){return v}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockConnectionPointMode */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.ts"),a=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),l=r(/*! ../../../../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),d=r(/*! ../../../../Maths/math */"./Maths/math.ts"),h=r(/*! ./animatedInputBlockTypes */"./Materials/Node/Blocks/Input/animatedInputBlockTypes.ts"),f=r(/*! ../../../../Misc/observable */"./Misc/observable.ts"),p=r(/*! ../../../../Materials/materialHelper */"./Materials/materialHelper.ts"),m={position2d:"position",particle_uv:"vUV",particle_color:"vColor",particle_texturemask:"textureMask",particle_positionw:"vPositionW"},g={particle_uv:!0,particle_color:!0,particle_texturemask:!0,particle_positionw:!0},_={particle_texturemask:!0},v=function(e){function t(t,r,n){void 0===r&&(r=c.NodeMaterialBlockTargets.Vertex),void 0===n&&(n=o.NodeMaterialBlockConnectionPointTypes.AutoDetect);var i=e.call(this,t,r,!1,!0)||this;return i._mode=s.NodeMaterialBlockConnectionPointMode.Undefined,i._animationType=h.AnimatedInputBlockTypes.None,i.min=0,i.max=0,i.isBoolean=!1,i.matrixMode=0,i._systemValue=null,i.visibleInInspector=!1,i.isConstant=!1,i.groupInInspector="",i.onValueChangedObservable=new f.Observable,i._type=n,i.setDefaultValue(),i.registerOutput("output",n),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"type",{get:function(){if(this._type===o.NodeMaterialBlockConnectionPointTypes.AutoDetect){if(this.isUniform&&null!=this.value){if(!isNaN(this.value))return this._type=o.NodeMaterialBlockConnectionPointTypes.Float,this._type;switch(this.value.getClassName()){case"Vector2":return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector2,this._type;case"Vector3":return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector3,this._type;case"Vector4":return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector4,this._type;case"Color3":return this._type=o.NodeMaterialBlockConnectionPointTypes.Color3,this._type;case"Color4":return this._type=o.NodeMaterialBlockConnectionPointTypes.Color4,this._type;case"Matrix":return this._type=o.NodeMaterialBlockConnectionPointTypes.Matrix,this._type}}if(this.isAttribute)switch(this.name){case"position":case"normal":case"tangent":case"particle_positionw":return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector3,this._type;case"uv":case"uv2":case"position2d":case"particle_uv":return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector2,this._type;case"matricesIndices":case"matricesWeights":case"world0":case"world1":case"world2":case"world3":return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector4,this._type;case"color":case"particle_color":case"particle_texturemask":return this._type=o.NodeMaterialBlockConnectionPointTypes.Color4,this._type}if(this.isSystemValue)switch(this._systemValue){case a.NodeMaterialSystemValues.World:case a.NodeMaterialSystemValues.WorldView:case a.NodeMaterialSystemValues.WorldViewProjection:case a.NodeMaterialSystemValues.View:case a.NodeMaterialSystemValues.ViewProjection:case a.NodeMaterialSystemValues.Projection:return this._type=o.NodeMaterialBlockConnectionPointTypes.Matrix,this._type;case a.NodeMaterialSystemValues.CameraPosition:return this._type=o.NodeMaterialBlockConnectionPointTypes.Vector3,this._type;case a.NodeMaterialSystemValues.FogColor:return this._type=o.NodeMaterialBlockConnectionPointTypes.Color3,this._type;case a.NodeMaterialSystemValues.DeltaTime:return this._type=o.NodeMaterialBlockConnectionPointTypes.Float,this._type}}return this._type},enumerable:!1,configurable:!0}),t.prototype.validateBlockName=function(t){return!!this.isAttribute||e.prototype.validateBlockName.call(this,t)},Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.setAsAttribute=function(e){return this._mode=s.NodeMaterialBlockConnectionPointMode.Attribute,e&&(this.name=e),this},t.prototype.setAsSystemValue=function(e){return this.systemValue=e,this},Object.defineProperty(t.prototype,"value",{get:function(){return this._storedValue},set:function(e){this.type===o.NodeMaterialBlockConnectionPointTypes.Float&&(this.isBoolean?e=e?1:0:this.min!==this.max&&(e=Math.max(this.min,e),e=Math.min(this.max,e))),this._storedValue=e,this._mode=s.NodeMaterialBlockConnectionPointMode.Uniform,this.onValueChangedObservable.notifyObservers(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueCallback",{get:function(){return this._valueCallback},set:function(e){this._valueCallback=e,this._mode=s.NodeMaterialBlockConnectionPointMode.Uniform},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"associatedVariableName",{get:function(){return this._associatedVariableName},set:function(e){this._associatedVariableName=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationType",{get:function(){return this._animationType},set:function(e){this._animationType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndefined",{get:function(){return this._mode===s.NodeMaterialBlockConnectionPointMode.Undefined},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUniform",{get:function(){return this._mode===s.NodeMaterialBlockConnectionPointMode.Uniform},set:function(e){this._mode=e?s.NodeMaterialBlockConnectionPointMode.Uniform:s.NodeMaterialBlockConnectionPointMode.Undefined,this.associatedVariableName=""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAttribute",{get:function(){return this._mode===s.NodeMaterialBlockConnectionPointMode.Attribute},set:function(e){this._mode=e?s.NodeMaterialBlockConnectionPointMode.Attribute:s.NodeMaterialBlockConnectionPointMode.Undefined,this.associatedVariableName=""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVarying",{get:function(){return this._mode===s.NodeMaterialBlockConnectionPointMode.Varying},set:function(e){this._mode=e?s.NodeMaterialBlockConnectionPointMode.Varying:s.NodeMaterialBlockConnectionPointMode.Undefined,this.associatedVariableName=""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSystemValue",{get:function(){return null!=this._systemValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"systemValue",{get:function(){return this._systemValue},set:function(e){this._mode=s.NodeMaterialBlockConnectionPointMode.Uniform,this.associatedVariableName="",this._systemValue=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"InputBlock"},t.prototype.animate=function(e){switch(this._animationType){case h.AnimatedInputBlockTypes.Time:this.type===o.NodeMaterialBlockConnectionPointTypes.Float&&(this.value+=.01*e.getAnimationRatio())}},t.prototype._emitDefine=function(e){return"!"===e[0]?"#ifndef "+e.substring(1)+"\r\n":"#ifdef "+e+"\r\n"},t.prototype.initialize=function(e){this.associatedVariableName=""},t.prototype.setDefaultValue=function(){switch(this.type){case o.NodeMaterialBlockConnectionPointTypes.Float:this.value=0;break;case o.NodeMaterialBlockConnectionPointTypes.Vector2:this.value=l.Vector2.Zero();break;case o.NodeMaterialBlockConnectionPointTypes.Vector3:this.value=l.Vector3.Zero();break;case o.NodeMaterialBlockConnectionPointTypes.Vector4:this.value=l.Vector4.Zero();break;case o.NodeMaterialBlockConnectionPointTypes.Color3:this.value=d.Color3.White();break;case o.NodeMaterialBlockConnectionPointTypes.Color4:this.value=new d.Color4(1,1,1,1);break;case o.NodeMaterialBlockConnectionPointTypes.Matrix:this.value=l.Matrix.Identity()}},t.prototype._emitConstant=function(e){switch(this.type){case o.NodeMaterialBlockConnectionPointTypes.Float:return""+e._emitFloat(this.value);case o.NodeMaterialBlockConnectionPointTypes.Vector2:return"vec2("+this.value.x+", "+this.value.y+")";case o.NodeMaterialBlockConnectionPointTypes.Vector3:return"vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")";case o.NodeMaterialBlockConnectionPointTypes.Vector4:return"vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")";case o.NodeMaterialBlockConnectionPointTypes.Color3:return"vec3("+this.value.r+", "+this.value.g+", "+this.value.b+")";case o.NodeMaterialBlockConnectionPointTypes.Color4:return"vec4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")"}return""},Object.defineProperty(t.prototype,"_noContextSwitch",{get:function(){return g[this.name]},enumerable:!1,configurable:!0}),t.prototype._emit=function(e,t){var r;if(this.isUniform){if(this.associatedVariableName||(this.associatedVariableName=e._getFreeVariableName("u_"+this.name)),this.isConstant){if(-1!==e.constants.indexOf(this.associatedVariableName))return;return e.constants.push(this.associatedVariableName),void(e._constantDeclaration+=this._declareOutput(this.output,e)+" = "+this._emitConstant(e)+";\r\n")}if(-1!==e.uniforms.indexOf(this.associatedVariableName))return;e.uniforms.push(this.associatedVariableName),t&&(e._uniformDeclaration+=this._emitDefine(t)),e._uniformDeclaration+="uniform "+e._getGLType(this.type)+" "+this.associatedVariableName+";\r\n",t&&(e._uniformDeclaration+="#endif\r\n");var n=e.sharedData.hints;if(null!==this._systemValue&&void 0!==this._systemValue)switch(this._systemValue){case a.NodeMaterialSystemValues.WorldView:n.needWorldViewMatrix=!0;break;case a.NodeMaterialSystemValues.WorldViewProjection:n.needWorldViewProjectionMatrix=!0}else this._animationType!==h.AnimatedInputBlockTypes.None&&e.sharedData.animatedInputs.push(this)}else if(this.isAttribute){if(this.associatedVariableName=null!==(r=m[this.name])&&void 0!==r?r:this.name,this.target===c.NodeMaterialBlockTargets.Vertex&&e._vertexState)return void(g[this.name]?_[this.name]?e._emitUniformFromString(this.associatedVariableName,e._getGLType(this.type),t):e._emitVaryingFromString(this.associatedVariableName,e._getGLType(this.type),t):this._emit(e._vertexState,t));if(-1!==e.attributes.indexOf(this.associatedVariableName))return;e.attributes.push(this.associatedVariableName),g[this.name]?_[this.name]?e._emitUniformFromString(this.associatedVariableName,e._getGLType(this.type),t):e._emitVaryingFromString(this.associatedVariableName,e._getGLType(this.type),t):(t&&(e._attributeDeclaration+=this._emitDefine(t)),e._attributeDeclaration+="attribute "+e._getGLType(this.type)+" "+this.associatedVariableName+";\r\n",t&&(e._attributeDeclaration+="#endif\r\n"))}},t.prototype._transmitWorld=function(e,t,r,n){if(this._systemValue){var i=this.associatedVariableName;switch(this._systemValue){case a.NodeMaterialSystemValues.World:e.setMatrix(i,t);break;case a.NodeMaterialSystemValues.WorldView:e.setMatrix(i,r);break;case a.NodeMaterialSystemValues.WorldViewProjection:e.setMatrix(i,n)}}},t.prototype._transmit=function(e,t){if(!this.isAttribute){var r=this.associatedVariableName;if(this._systemValue)switch(this._systemValue){case a.NodeMaterialSystemValues.World:case a.NodeMaterialSystemValues.WorldView:case a.NodeMaterialSystemValues.WorldViewProjection:return;case a.NodeMaterialSystemValues.View:e.setMatrix(r,t.getViewMatrix());break;case a.NodeMaterialSystemValues.Projection:e.setMatrix(r,t.getProjectionMatrix());break;case a.NodeMaterialSystemValues.ViewProjection:e.setMatrix(r,t.getTransformMatrix());break;case a.NodeMaterialSystemValues.CameraPosition:p.MaterialHelper.BindEyePosition(e,t,r);break;case a.NodeMaterialSystemValues.FogColor:e.setColor3(r,t.fogColor);break;case a.NodeMaterialSystemValues.DeltaTime:e.setFloat(r,t.deltaTime/1e3)}else{var n=this._valueCallback?this._valueCallback():this._storedValue;if(null!==n)switch(this.type){case o.NodeMaterialBlockConnectionPointTypes.Float:e.setFloat(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Int:e.setInt(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Color3:e.setColor3(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Color4:e.setDirectColor4(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Vector2:e.setVector2(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Vector3:e.setVector3(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Vector4:e.setVector4(r,n);break;case o.NodeMaterialBlockConnectionPointTypes.Matrix:e.setMatrix(r,n)}}}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),(this.isUniform||this.isSystemValue)&&t.sharedData.inputBlocks.push(this),this._emit(t)},t.prototype._dumpPropertiesCode=function(){var e=this._codeVariableName;if(this.isAttribute)return e+'.setAsAttribute("'+this.name+'");\r\n';if(this.isSystemValue)return e+".setAsSystemValue(BABYLON.NodeMaterialSystemValues."+a.NodeMaterialSystemValues[this._systemValue]+");\r\n";if(this.isUniform){var t=[],r="";switch(this.type){case o.NodeMaterialBlockConnectionPointTypes.Float:r=""+this.value;break;case o.NodeMaterialBlockConnectionPointTypes.Vector2:r="new BABYLON.Vector2("+this.value.x+", "+this.value.y+")";break;case o.NodeMaterialBlockConnectionPointTypes.Vector3:r="new BABYLON.Vector3("+this.value.x+", "+this.value.y+", "+this.value.z+")";break;case o.NodeMaterialBlockConnectionPointTypes.Vector4:r="new BABYLON.Vector4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")";break;case o.NodeMaterialBlockConnectionPointTypes.Color3:r="new BABYLON.Color3("+this.value.r+", "+this.value.g+", "+this.value.b+")";break;case o.NodeMaterialBlockConnectionPointTypes.Color4:r="new BABYLON.Color4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")";break;case o.NodeMaterialBlockConnectionPointTypes.Matrix:r="BABYLON.Matrix.FromArray(["+this.value.m+"])"}return t.push(e+".value = "+r),this.type===o.NodeMaterialBlockConnectionPointTypes.Float&&t.push(e+".min = "+this.min,e+".max = "+this.max,e+".isBoolean = "+this.isBoolean,e+".matrixMode = "+this.matrixMode,e+".animationType = BABYLON.AnimatedInputBlockTypes."+h.AnimatedInputBlockTypes[this.animationType]),t.push(e+".isConstant = "+this.isConstant,e+".visibleInInspector = "+this.visibleInInspector),t.push(""),t.join(";\r\n")}return""},t.prototype.dispose=function(){this.onValueChangedObservable.clear(),e.prototype.dispose.call(this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.type=this.type,t.mode=this._mode,t.systemValue=this._systemValue,t.animationType=this._animationType,t.visibleInInspector=this.visibleInInspector,t.min=this.min,t.max=this.max,t.isBoolean=this.isBoolean,t.matrixMode=this.matrixMode,t.isConstant=this.isConstant,t.groupInInspector=this.groupInInspector,null!=this._storedValue&&this._mode===s.NodeMaterialBlockConnectionPointMode.Uniform&&(this._storedValue.asArray?(t.valueType="BABYLON."+this._storedValue.getClassName(),t.value=this._storedValue.asArray()):(t.valueType="number",t.value=this._storedValue)),t},t.prototype._deserialize=function(t,r,n){if(this._mode=t.mode,e.prototype._deserialize.call(this,t,r,n),this._type=t.type,this._systemValue=t.systemValue||t.wellKnownValue,this._animationType=t.animationType,this.visibleInInspector=t.visibleInInspector,this.min=t.min||0,this.max=t.max||0,this.isBoolean=!!t.isBoolean,this.matrixMode=t.matrixMode||0,this.isConstant=!!t.isConstant,this.groupInInspector=t.groupInInspector||"",t.valueType)if("number"===t.valueType)this._storedValue=t.value;else{var i=u._TypeStore.GetClass(t.valueType);i&&(this._storedValue=i.FromArray(t.value))}},t}(i.NodeMaterialBlock);u._TypeStore.RegisteredTypes["BABYLON.InputBlock"]=v},"./Materials/Node/Blocks/PBR/ambientOcclusionBlock.ts":
- /*!************************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/ambientOcclusionBlock.ts ***!
- \************************************************************/
- /*! exports provided: AmbientOcclusionBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"AmbientOcclusionBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),c=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),u=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),d=function(e){function t(r){var n=e.call(this,r,a.NodeMaterialBlockTargets.Fragment)||this;return n.useAmbientInGrayScale=!1,n._isUnique=!0,n.registerInput("texture",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("intensity",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("directLightIntensity",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerOutput("ambientOcclusion",o.NodeMaterialBlockConnectionPointTypes.Object,a.NodeMaterialBlockTargets.Fragment,new u.NodeMaterialConnectionPointCustomObject("ambientOcclusion",n,s.NodeMaterialConnectionPointDirection.Output,t,"AOBlock")),n}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("aoOut")},t.prototype.getClassName=function(){return"AmbientOcclusionBlock"},Object.defineProperty(t.prototype,"texture",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"directLightIntensity",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambientOcclusion",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.GetCode=function(e){var t="ambientOcclusionOutParams aoOut;\r\n";return t+="ambientOcclusionBlock(\n #ifdef AMBIENT\n "+((null==e?void 0:e.texture.isConnected)?e.texture.associatedVariableName:"vec3(0.)")+",\n vec4(0., 1.0, "+((null==e?void 0:e.intensity.isConnected)?e.intensity.associatedVariableName:"1.")+", 0.),\n #endif\n aoOut\n );\r\n"},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n),n.setValue("AMBIENT",this.texture.isConnected,!0),n.setValue("AMBIENTINGRAYSCALE",this.useAmbientInGrayScale,!0)},t.prototype._buildBlock=function(e){return e.target===a.NodeMaterialBlockTargets.Fragment&&e.sharedData.blocksWithDefines.push(this),this},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".useAmbientInGrayScale = "+this.useAmbientInGrayScale+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.useAmbientInGrayScale=this.useAmbientInGrayScale,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.useAmbientInGrayScale=t.useAmbientInGrayScale},Object(n.__decorate)([Object(l.editableInPropertyPage)("Ambient in gray scale",l.PropertyTypeForEdition.Boolean,"AMBIENT",{notifiers:{update:!0}})],t.prototype,"useAmbientInGrayScale",void 0),t}(i.NodeMaterialBlock);c._TypeStore.RegisteredTypes["BABYLON.AmbientOcclusionBlock"]=d},"./Materials/Node/Blocks/PBR/anisotropyBlock.ts":
- /*!******************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/anisotropyBlock.ts ***!
- \******************************************************/
- /*! exports provided: AnisotropyBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"AnisotropyBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),c=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),u=function(e){function t(r){var n=e.call(this,r,a.NodeMaterialBlockTargets.Fragment)||this;return n._isUnique=!0,n.registerInput("intensity",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("direction",o.NodeMaterialBlockConnectionPointTypes.Vector2,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("texture",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2,!0),n.registerInput("worldTangent",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0),n.registerOutput("anisotropy",o.NodeMaterialBlockConnectionPointTypes.Object,a.NodeMaterialBlockTargets.Fragment,new c.NodeMaterialConnectionPointCustomObject("anisotropy",n,s.NodeMaterialConnectionPointDirection.Output,t,"AnisotropyBlock")),n}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("anisotropicOut"),e._excludeVariableName("TBN")},t.prototype.getClassName=function(){return"AnisotropyBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTangent",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anisotropy",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._generateTBNSpace=function(e){var t="",r="//"+this.name,n=this.uv,i=this.worldPositionConnectionPoint,o=this.worldNormalConnectionPoint,s=this.worldTangent;n.isConnected||console.error("You must connect the 'uv' input of the Anisotropy block!"),e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");var a={search:/defined\(TANGENT\)/g,replace:s.isConnected?"defined(TANGENT)":"defined(IGNORE)"};return s.isConnected&&(t+="vec3 tbnNormal = normalize("+o.associatedVariableName+".xyz);\r\n",t+="vec3 tbnTangent = normalize("+s.associatedVariableName+".xyz);\r\n",t+="vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n",t+="mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n"),t+="\n #if defined("+(s.isConnected?"TANGENT":"IGNORE")+") && defined(NORMAL)\n mat3 TBN = vTBN;\n #else\n mat3 TBN = cotangent_frame("+o.associatedVariableName+".xyz, v_"+i.associatedVariableName+".xyz, "+(n.isConnected?n.associatedVariableName:"vec2(0.)")+", vec2(1., 1.));\n #endif\r\n",e._emitFunctionFromInclude("bumpFragmentMainFunctions",r,{replaceStrings:[a]}),t},t.prototype.getCode=function(e,t){void 0===t&&(t=!1);var r="";t&&(r+=this._generateTBNSpace(e));var n=this.intensity.isConnected?this.intensity.associatedVariableName:"1.0";return r+="anisotropicOutParams anisotropicOut;\n anisotropicBlock(\n vec3("+(this.direction.isConnected?this.direction.associatedVariableName:"vec2(1., 0.)")+", "+n+"),\n #ifdef ANISOTROPIC_TEXTURE\n "+(this.texture.isConnected?this.texture.associatedVariableName:"vec3(0.)")+",\n #endif\n TBN,\n normalW,\n viewDirectionW,\n anisotropicOut\n );\r\n"},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n),n.setValue("ANISOTROPIC",!0),n.setValue("ANISOTROPIC_TEXTURE",this.texture.isConnected,!0)},t.prototype._buildBlock=function(e){return e.target===a.NodeMaterialBlockTargets.Fragment&&e.sharedData.blocksWithDefines.push(this),this},t}(i.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.AnisotropyBlock"]=u},"./Materials/Node/Blocks/PBR/clearCoatBlock.ts":
- /*!*****************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/clearCoatBlock.ts ***!
- \*****************************************************/
- /*! exports provided: ClearCoatBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ClearCoatBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),c=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),d=function(e){function t(r){var n=e.call(this,r,a.NodeMaterialBlockTargets.Fragment)||this;return n._isUnique=!0,n.registerInput("intensity",o.NodeMaterialBlockConnectionPointTypes.Float,!1,a.NodeMaterialBlockTargets.Fragment),n.registerInput("roughness",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("ior",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("texture",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("bumpTexture",o.NodeMaterialBlockConnectionPointTypes.Color4,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("tintColor",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("tintAtDistance",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("tintThickness",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("worldTangent",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0),n.registerOutput("clearcoat",o.NodeMaterialBlockConnectionPointTypes.Object,a.NodeMaterialBlockTargets.Fragment,new u.NodeMaterialConnectionPointCustomObject("clearcoat",n,s.NodeMaterialConnectionPointDirection.Output,t,"ClearCoatBlock")),n}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("clearcoatOut"),e._excludeVariableName("vClearCoatParams"),e._excludeVariableName("vClearCoatTintParams"),e._excludeVariableName("vClearCoatRefractionParams"),e._excludeVariableName("vClearCoatTangentSpaceParams")},t.prototype.getClassName=function(){return"ClearCoatBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roughness",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ior",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bumpTexture",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintColor",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintAtDistance",{get:function(){return this._inputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintThickness",{get:function(){return this._inputs[8]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTangent",{get:function(){return this._inputs[9]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoat",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.intensity.isConnected){var t=new c.InputBlock("ClearCoat intensity",a.NodeMaterialBlockTargets.Fragment,o.NodeMaterialBlockConnectionPointTypes.Float);t.value=1,t.output.connectTo(this.intensity)}},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n),n.setValue("CLEARCOAT",!0),n.setValue("CLEARCOAT_TEXTURE",this.texture.isConnected,!0),n.setValue("CLEARCOAT_TINT",this.tintColor.isConnected||this.tintThickness.isConnected||this.tintAtDistance.isConnected,!0),n.setValue("CLEARCOAT_BUMP",this.bumpTexture.isConnected,!0),n.setValue("CLEARCOAT_DEFAULTIOR",!!this.ior.isConnected&&1.5===this.ior.connectInputBlock.value,!0)},t.prototype.bind=function(t,r,n,i){var o,s;e.prototype.bind.call(this,t,r,n);var a=null!==(s=null===(o=this.ior.connectInputBlock)||void 0===o?void 0:o.value)&&void 0!==s?s:1.5,l=1-a,c=1+a,u=Math.pow(-l/c,2),d=1/a;t.setFloat4("vClearCoatRefractionParams",u,d,l,c);var h=this.clearcoat.hasEndpoints?this.clearcoat.endpoints[0].ownerBlock:null,f=(null==h?void 0:h.perturbedNormal.isConnected)?h.perturbedNormal.connectedPoint.ownerBlock:null;this._scene._mirroredCameraPosition?t.setFloat2("vClearCoatTangentSpaceParams",(null==f?void 0:f.invertX)?1:-1,(null==f?void 0:f.invertY)?1:-1):t.setFloat2("vClearCoatTangentSpaceParams",(null==f?void 0:f.invertX)?-1:1,(null==f?void 0:f.invertY)?-1:1)},t.prototype._generateTBNSpace=function(e,t,r){var n="",i="//"+this.name,o=this.worldTangent;e._emitExtension("derivatives","#extension GL_OES_standard_derivatives : enable");var s={search:/defined\(TANGENT\)/g,replace:o.isConnected?"defined(TANGENT)":"defined(IGNORE)"};return o.isConnected&&(n+="vec3 tbnNormal = normalize("+r+".xyz);\r\n",n+="vec3 tbnTangent = normalize("+o.associatedVariableName+".xyz);\r\n",n+="vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\r\n",n+="mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n"),e._emitFunctionFromInclude("bumpFragmentMainFunctions",i,{replaceStrings:[s]}),n},t.GetCode=function(e,t,r,n,i,o,s){var a="",l=(null==t?void 0:t.intensity.isConnected)?t.intensity.associatedVariableName:"1.",c=(null==t?void 0:t.roughness.isConnected)?t.roughness.associatedVariableName:"0.",u=(null==t?void 0:t.texture.isConnected)?t.texture.associatedVariableName:"vec2(0.)",d=(null==t?void 0:t.bumpTexture.isConnected)?t.bumpTexture.associatedVariableName:"vec4(0.)",h=(null==t?void 0:t.uv.isConnected)?t.uv.associatedVariableName:"vec2(0.)",f=(null==t?void 0:t.tintColor.isConnected)?t.tintColor.associatedVariableName:"vec3(1.)",p=(null==t?void 0:t.tintThickness.isConnected)?t.tintThickness.associatedVariableName:"1.",m=(null==t?void 0:t.tintAtDistance.isConnected)?t.tintAtDistance.associatedVariableName:"1.";return t&&(e._emitUniformFromString("vClearCoatRefractionParams","vec4"),e._emitUniformFromString("vClearCoatTangentSpaceParams","vec2")),i&&t&&(a+=t._generateTBNSpace(e,n,s),o=t.worldTangent.isConnected),a+="clearcoatOutParams clearcoatOut;\n\n #ifdef CLEARCOAT\n vec2 vClearCoatParams = vec2("+l+", "+c+");\n vec4 vClearCoatTintParams = vec4("+f+", "+p+");\n\n clearcoatBlock(\n "+n+".xyz,\n geometricNormalW,\n viewDirectionW,\n vClearCoatParams,\n specularEnvironmentR0,\n #ifdef CLEARCOAT_TEXTURE\n "+u+".rg,\n #endif\n #ifdef CLEARCOAT_TINT\n vClearCoatTintParams,\n "+m+",\n vClearCoatRefractionParams,\n #ifdef CLEARCOAT_TINT_TEXTURE\n vec4(0.),\n #endif\n #endif\n #ifdef CLEARCOAT_BUMP\n vec2(0., 1.),\n "+d+",\n "+h+",\n #if defined("+(o?"TANGENT":"IGNORE")+") && defined(NORMAL)\n vTBN,\n #else\n vClearCoatTangentSpaceParams,\n #endif\n #ifdef OBJECTSPACE_NORMALMAP\n normalMatrix,\n #endif\n #endif\n #if defined(FORCENORMALFORWARD) && defined(NORMAL)\n faceNormal,\n #endif\n #ifdef REFLECTION\n "+(null==r?void 0:r._vReflectionMicrosurfaceInfosName)+",\n "+(null==r?void 0:r._vReflectionInfosName)+",\n "+(null==r?void 0:r.reflectionColor)+",\n vLightingIntensity,\n #ifdef "+(null==r?void 0:r._define3DName)+"\n "+(null==r?void 0:r._cubeSamplerName)+",\n #else\n "+(null==r?void 0:r._2DSamplerName)+",\n #endif\n #ifndef LODBASEDMICROSFURACE\n #ifdef "+(null==r?void 0:r._define3DName)+"\n "+(null==r?void 0:r._cubeSamplerName)+",\n "+(null==r?void 0:r._cubeSamplerName)+",\n #else\n "+(null==r?void 0:r._2DSamplerName)+",\n "+(null==r?void 0:r._2DSamplerName)+",\n #endif\n #endif\n #endif\n #if defined(ENVIRONMENTBRDF) && !defined("+(null==r?void 0:r._defineSkyboxName)+")\n #ifdef RADIANCEOCCLUSION\n ambientMonochrome,\n #endif\n #endif\n clearcoatOut\n );\n #else\n clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;\n #endif\r\n"},t.prototype._buildBlock=function(e){return this._scene=e.sharedData.scene,e.target===a.NodeMaterialBlockTargets.Fragment&&(e.sharedData.bindableBlocks.push(this),e.sharedData.blocksWithDefines.push(this)),this},t}(i.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.ClearCoatBlock"]=d},"./Materials/Node/Blocks/PBR/index.ts":
- /*!********************************************!*\
- !*** ./Materials/Node/Blocks/PBR/index.ts ***!
- \********************************************/
- /*! exports provided: PBRMetallicRoughnessBlock, SheenBlock, AmbientOcclusionBlock, ReflectivityBlock, AnisotropyBlock, ReflectionBlock, ClearCoatBlock, RefractionBlock, SubSurfaceBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./pbrMetallicRoughnessBlock */"./Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts");r.d(t,"PBRMetallicRoughnessBlock",(function(){return n.PBRMetallicRoughnessBlock}));var i=r(/*! ./sheenBlock */"./Materials/Node/Blocks/PBR/sheenBlock.ts");r.d(t,"SheenBlock",(function(){return i.SheenBlock}));var o=r(/*! ./ambientOcclusionBlock */"./Materials/Node/Blocks/PBR/ambientOcclusionBlock.ts");r.d(t,"AmbientOcclusionBlock",(function(){return o.AmbientOcclusionBlock}));var s=r(/*! ./reflectivityBlock */"./Materials/Node/Blocks/PBR/reflectivityBlock.ts");r.d(t,"ReflectivityBlock",(function(){return s.ReflectivityBlock}));var a=r(/*! ./anisotropyBlock */"./Materials/Node/Blocks/PBR/anisotropyBlock.ts");r.d(t,"AnisotropyBlock",(function(){return a.AnisotropyBlock}));var l=r(/*! ./reflectionBlock */"./Materials/Node/Blocks/PBR/reflectionBlock.ts");r.d(t,"ReflectionBlock",(function(){return l.ReflectionBlock}));var c=r(/*! ./clearCoatBlock */"./Materials/Node/Blocks/PBR/clearCoatBlock.ts");r.d(t,"ClearCoatBlock",(function(){return c.ClearCoatBlock}));var u=r(/*! ./refractionBlock */"./Materials/Node/Blocks/PBR/refractionBlock.ts");r.d(t,"RefractionBlock",(function(){return u.RefractionBlock}));var d=r(/*! ./subSurfaceBlock */"./Materials/Node/Blocks/PBR/subSurfaceBlock.ts");r.d(t,"SubSurfaceBlock",(function(){return d.SubSurfaceBlock}))},"./Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts":
- /*!****************************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts ***!
- \****************************************************************/
- /*! exports provided: PBRMetallicRoughnessBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRMetallicRoughnessBlock",(function(){return E}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),a=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),c=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),u=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),d=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),h=r(/*! ../../../PBR/pbrBaseMaterial */"./Materials/PBR/pbrBaseMaterial.ts"),f=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),p=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),m=r(/*! ./ambientOcclusionBlock */"./Materials/Node/Blocks/PBR/ambientOcclusionBlock.ts"),g=r(/*! ./sheenBlock */"./Materials/Node/Blocks/PBR/sheenBlock.ts"),_=r(/*! ./reflectivityBlock */"./Materials/Node/Blocks/PBR/reflectivityBlock.ts"),v=r(/*! ../../../../Misc/brdfTextureTools */"./Misc/brdfTextureTools.ts"),y=r(/*! ../../../materialFlags */"./Materials/materialFlags.ts"),b=r(/*! ./anisotropyBlock */"./Materials/Node/Blocks/PBR/anisotropyBlock.ts"),A=r(/*! ./reflectionBlock */"./Materials/Node/Blocks/PBR/reflectionBlock.ts"),T=r(/*! ./clearCoatBlock */"./Materials/Node/Blocks/PBR/clearCoatBlock.ts"),M=r(/*! ./subSurfaceBlock */"./Materials/Node/Blocks/PBR/subSurfaceBlock.ts"),P=r(/*! ../../../../Engines/constants */"./Engines/constants.ts"),S={ambient:["finalAmbient",""],diffuse:["finalDiffuse",""],specular:["finalSpecularScaled","!defined(UNLIT) && defined(SPECULARTERM)"],sheenDir:["finalSheenScaled","!defined(UNLIT) && defined(SHEEN)"],clearcoatDir:["finalClearCoatScaled","!defined(UNLIT) && defined(CLEARCOAT)"],diffuseInd:["finalIrradiance","!defined(UNLIT) && defined(REFLECTION)"],specularInd:["finalRadianceScaled","!defined(UNLIT) && defined(REFLECTION)"],sheenInd:["sheenOut.finalSheenRadianceScaled","!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"],clearcoatInd:["clearcoatOut.finalClearCoatRadianceScaled","!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"],refraction:["subSurfaceOut.finalRefraction","!defined(UNLIT) && defined(SS_REFRACTION)"],lighting:["finalColor.rgb",""],shadow:["shadow",""],alpha:["alpha",""]},E=function(e){function t(t){var r=e.call(this,t,l.NodeMaterialBlockTargets.VertexAndFragment)||this;return r._environmentBRDFTexture=null,r.directIntensity=1,r.environmentIntensity=1,r.specularIntensity=1,r.lightFalloff=0,r.useAlphaFromAlbedoTexture=!1,r.useAlphaTest=!1,r.alphaTestCutoff=.5,r.useAlphaBlending=!1,r.opacityRGB=!1,r.useRadianceOverAlpha=!0,r.useSpecularOverAlpha=!0,r.enableSpecularAntiAliasing=!1,r.realTimeFiltering=!1,r.realTimeFilteringQuality=P.Constants.TEXTURE_FILTERING_QUALITY_LOW,r.useEnergyConservation=!0,r.useRadianceOcclusion=!0,r.useHorizonOcclusion=!0,r.unlit=!1,r.forceNormalForward=!1,r.debugMode=0,r.debugLimit=0,r.debugFactor=1,r._isUnique=!0,r.registerInput("worldPosition",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1,l.NodeMaterialBlockTargets.Vertex),r.registerInput("worldNormal",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1,l.NodeMaterialBlockTargets.Fragment),r.registerInput("perturbedNormal",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0,l.NodeMaterialBlockTargets.Fragment),r.registerInput("cameraPosition",o.NodeMaterialBlockConnectionPointTypes.Vector3,!1,l.NodeMaterialBlockTargets.Fragment),r.registerInput("baseColor",o.NodeMaterialBlockConnectionPointTypes.Color4,!0,l.NodeMaterialBlockTargets.Fragment),r.registerInput("opacityTexture",o.NodeMaterialBlockConnectionPointTypes.Color4,!0,l.NodeMaterialBlockTargets.Fragment),r.registerInput("ambientColor",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,l.NodeMaterialBlockTargets.Fragment),r.registerInput("reflectivity",o.NodeMaterialBlockConnectionPointTypes.Object,!1,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("reflectivity",r,s.NodeMaterialConnectionPointDirection.Input,_.ReflectivityBlock,"ReflectivityBlock")),r.registerInput("ambientOcclusion",o.NodeMaterialBlockConnectionPointTypes.Object,!0,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("ambientOcclusion",r,s.NodeMaterialConnectionPointDirection.Input,m.AmbientOcclusionBlock,"AOBlock")),r.registerInput("reflection",o.NodeMaterialBlockConnectionPointTypes.Object,!0,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("reflection",r,s.NodeMaterialConnectionPointDirection.Input,A.ReflectionBlock,"ReflectionBlock")),r.registerInput("sheen",o.NodeMaterialBlockConnectionPointTypes.Object,!0,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("sheen",r,s.NodeMaterialConnectionPointDirection.Input,g.SheenBlock,"SheenBlock")),r.registerInput("clearcoat",o.NodeMaterialBlockConnectionPointTypes.Object,!0,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("clearcoat",r,s.NodeMaterialConnectionPointDirection.Input,T.ClearCoatBlock,"ClearCoatBlock")),r.registerInput("subsurface",o.NodeMaterialBlockConnectionPointTypes.Object,!0,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("subsurface",r,s.NodeMaterialConnectionPointDirection.Input,M.SubSurfaceBlock,"SubSurfaceBlock")),r.registerInput("anisotropy",o.NodeMaterialBlockConnectionPointTypes.Object,!0,l.NodeMaterialBlockTargets.Fragment,new p.NodeMaterialConnectionPointCustomObject("anisotropy",r,s.NodeMaterialConnectionPointDirection.Input,b.AnisotropyBlock,"AnisotropyBlock")),r.registerOutput("ambient",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("diffuse",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("specular",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("sheenDir",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("clearcoatDir",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("diffuseInd",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("specularInd",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("sheenInd",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("clearcoatInd",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("refraction",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("lighting",o.NodeMaterialBlockConnectionPointTypes.Color3,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("shadow",o.NodeMaterialBlockConnectionPointTypes.Float,l.NodeMaterialBlockTargets.Fragment),r.registerOutput("alpha",o.NodeMaterialBlockConnectionPointTypes.Float,l.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("vLightingIntensity"),e._excludeVariableName("geometricNormalW"),e._excludeVariableName("normalW"),e._excludeVariableName("faceNormal"),e._excludeVariableName("albedoOpacityOut"),e._excludeVariableName("surfaceAlbedo"),e._excludeVariableName("alpha"),e._excludeVariableName("NdotVUnclamped"),e._excludeVariableName("NdotV"),e._excludeVariableName("alphaG"),e._excludeVariableName("AARoughnessFactors"),e._excludeVariableName("environmentBrdf"),e._excludeVariableName("ambientMonochrome"),e._excludeVariableName("seo"),e._excludeVariableName("eho"),e._excludeVariableName("environmentRadiance"),e._excludeVariableName("irradianceVector"),e._excludeVariableName("environmentIrradiance"),e._excludeVariableName("diffuseBase"),e._excludeVariableName("specularBase"),e._excludeVariableName("preInfo"),e._excludeVariableName("info"),e._excludeVariableName("shadow"),e._excludeVariableName("finalDiffuse"),e._excludeVariableName("finalAmbient"),e._excludeVariableName("ambientOcclusionForDirectDiffuse"),e._excludeVariableName("finalColor"),e._excludeVariableName("vClipSpacePosition"),e._excludeVariableName("vDebugMode")},t.prototype.getClassName=function(){return"PBRMetallicRoughnessBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perturbedNormal",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseColor",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"opacityTexture",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambientColor",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectivity",{get:function(){return this._inputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambientOcclusion",{get:function(){return this._inputs[8]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflection",{get:function(){return this._inputs[9]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheen",{get:function(){return this._inputs[10]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoat",{get:function(){return this._inputs[11]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subsurface",{get:function(){return this._inputs[12]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anisotropy",{get:function(){return this._inputs[13]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ambient",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuse",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specular",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheenDir",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoatDir",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diffuseIndirect",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"specularIndirect",{get:function(){return this._outputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheenIndirect",{get:function(){return this._outputs[7]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearcoatIndirect",{get:function(){return this._outputs[8]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refraction",{get:function(){return this._outputs[9]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lighting",{get:function(){return this._outputs[10]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this._outputs[11]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._outputs[12]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.systemValue===c.NodeMaterialSystemValues.CameraPosition}));t||(t=new u.InputBlock("cameraPosition")).setAsSystemValue(c.NodeMaterialSystemValues.CameraPosition),t.output.connectTo(this.cameraPosition)}},t.prototype.prepareDefines=function(e,t,r){if(r.setValue("PBR",!0),r.setValue("METALLICWORKFLOW",!0),r.setValue("DEBUGMODE",this.debugMode,!0),r.setValue("NORMALXYSCALE",!0),r.setValue("BUMP",this.perturbedNormal.isConnected,!0),r.setValue("LODBASEDMICROSFURACE",this._scene.getEngine().getCaps().textureLOD),r.setValue("OPACITY",this.opacityTexture.isConnected,!0),this.lightFalloff===h.PBRBaseMaterial.LIGHTFALLOFF_STANDARD?(r.setValue("USEPHYSICALLIGHTFALLOFF",!1),r.setValue("USEGLTFLIGHTFALLOFF",!1)):this.lightFalloff===h.PBRBaseMaterial.LIGHTFALLOFF_GLTF?(r.setValue("USEPHYSICALLIGHTFALLOFF",!1),r.setValue("USEGLTFLIGHTFALLOFF",!0)):(r.setValue("USEPHYSICALLIGHTFALLOFF",!0),r.setValue("USEGLTFLIGHTFALLOFF",!1)),r.setValue("ALPHABLEND",this.useAlphaBlending,!0),r.setValue("ALPHAFROMALBEDO",this.useAlphaFromAlbedoTexture,!0),r.setValue("ALPHATEST",this.useAlphaTest,!0),r.setValue("ALPHATESTVALUE",this.alphaTestCutoff,!0),r.setValue("OPACITYRGB",this.opacityRGB,!0),r.setValue("RADIANCEOVERALPHA",this.useRadianceOverAlpha,!0),r.setValue("SPECULAROVERALPHA",this.useSpecularOverAlpha,!0),r.setValue("SPECULARAA",this._scene.getEngine().getCaps().standardDerivatives&&this.enableSpecularAntiAliasing,!0),r.setValue("REALTIME_FILTERING",this.realTimeFiltering,!0),r.setValue("NUM_SAMPLES",""+this.realTimeFilteringQuality,!0),this._scene.getEngine().webGLVersion>1&&r.setValue("NUM_SAMPLES",this.realTimeFilteringQuality+"u",!0),r.setValue("BRDF_V_HEIGHT_CORRELATED",!0),r.setValue("MS_BRDF_ENERGY_CONSERVATION",this.useEnergyConservation,!0),r.setValue("RADIANCEOCCLUSION",this.useRadianceOcclusion,!0),r.setValue("HORIZONOCCLUSION",this.useHorizonOcclusion,!0),r.setValue("UNLIT",this.unlit,!0),r.setValue("FORCENORMALFORWARD",this.forceNormalForward,!0),this._environmentBRDFTexture&&y.MaterialFlags.ReflectionTextureEnabled?(r.setValue("ENVIRONMENTBRDF",!0),r.setValue("ENVIRONMENTBRDF_RGBD",this._environmentBRDFTexture.isRGBD,!0)):(r.setValue("ENVIRONMENTBRDF",!1),r.setValue("ENVIRONMENTBRDF_RGBD",!1)),r._areLightsDirty){var n=e.getScene();if(this.light){var i={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};a.MaterialHelper.PrepareDefinesForLight(n,e,this.light,this._lightId,r,!0,i),i.needRebuild&&r.rebuild()}else a.MaterialHelper.PrepareDefinesForLights(n,e,r,!0,t.maxSimultaneousLights),r._needNormals=!0,a.MaterialHelper.PrepareDefinesForMultiview(n,r)}},t.prototype.updateUniformsAndSamples=function(e,t,r,n){a.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:e.uniforms,uniformBuffersNames:n,samplers:e.samplers,defines:r,maxSimultaneousLights:t.maxSimultaneousLights})},t.prototype.bind=function(e,t,r){if(r){var n=r.getScene();this.light?a.MaterialHelper.BindLight(this.light,this._lightId,n,e,!0):a.MaterialHelper.BindLights(n,r,e,!0,t.maxSimultaneousLights),e.setTexture(this._environmentBrdfSamplerName,this._environmentBRDFTexture),e.setFloat2("vDebugMode",this.debugLimit,this.debugFactor);var i=this._scene.ambientColor;i&&e.setColor3("ambientFromScene",i);var o=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);e.setFloat(this._invertNormalName,o?-1:1),e.setFloat4("vLightingIntensity",this.directIntensity,1,this.environmentIntensity*this._scene.environmentIntensity,this.specularIntensity)}},t.prototype._injectVertexCode=function(e){var t,r,n=this.worldPosition,i="//"+this.name;this.light?(this._lightId=(void 0!==e.counters.lightCounter?e.counters.lightCounter:-1)+1,e.counters.lightCounter=this._lightId,e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString())):(e._emitFunctionFromInclude(e.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",i,{repeatKey:"maxSimultaneousLights"}),this._lightId=0,e.sharedData.dynamicUniformBlocks.push(this));var o="v_"+n.associatedVariableName;e._emitVaryingFromString(o,"vec4")&&(e.compilationString+=o+" = "+n.associatedVariableName+";\r\n");var s=this.reflection.isConnected?null===(t=this.reflection.connectedPoint)||void 0===t?void 0:t.ownerBlock:null;e.compilationString+=null!==(r=null==s?void 0:s.handleVertexSide(e))&&void 0!==r?r:"",e._emitUniformFromString("vDebugMode","vec2","defined(IGNORE) || DEBUGMODE > 0"),e._emitUniformFromString("ambientFromScene","vec3"),e._emitVaryingFromString("vClipSpacePosition","vec4","defined(IGNORE) || DEBUGMODE > 0")&&(e._injectAtEnd+="#if DEBUGMODE > 0\r\n",e._injectAtEnd+="vClipSpacePosition = gl_Position;\r\n",e._injectAtEnd+="#endif\r\n"),this.light?e.compilationString+=e._emitCodeFromInclude("shadowsVertex",i,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()},{search:/worldPos/g,replace:n.associatedVariableName}]}):(e.compilationString+="vec4 worldPos = "+n.associatedVariableName+";\r\n",e.compilationString+=e._emitCodeFromInclude("shadowsVertex",i,{repeatKey:"maxSimultaneousLights"}))},t.prototype.getAlbedoOpacityCode=function(){var e="albedoOpacityOutParams albedoOpacityOut;\r\n";return e+="albedoOpacityBlock(\n "+(this.baseColor.isConnected?this.baseColor.associatedVariableName:"vec4(1., 1., 1., 1.)")+",\n #ifdef ALBEDO\n vec4(1.),\n vec2(1., 1.),\n #endif\n #ifdef OPACITY\n "+(this.opacityTexture.isConnected?this.opacityTexture.associatedVariableName:"")+",\n vec2(1., 1.),\n #endif\n albedoOpacityOut\n );\n\n vec3 surfaceAlbedo = albedoOpacityOut.surfaceAlbedo;\n float alpha = albedoOpacityOut.alpha;\r\n"},t.prototype._buildBlock=function(t){var r,n,i,o,s,a,c,u,d,f,p,g,_,y,b,A,P,E,C,x,R,O,I,D,B,N,L,w,F,V,k,U,z,G,j,H,W,X,Y,Q,K,q,Z,J;e.prototype._buildBlock.call(this,t),this._scene=t.sharedData.scene,this._environmentBRDFTexture||(this._environmentBRDFTexture=v.BRDFTextureTools.GetEnvironmentBRDFTexture(this._scene));var $=this.reflection.isConnected?null===(r=this.reflection.connectedPoint)||void 0===r?void 0:r.ownerBlock:null;if($&&($.worldPositionConnectionPoint=this.worldPosition,$.cameraPositionConnectionPoint=this.cameraPosition,$.worldNormalConnectionPoint=this.worldNormal),t.target!==l.NodeMaterialBlockTargets.Fragment)return this._injectVertexCode(t),this;t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this);var ee="//"+this.name,te="v_"+this.worldPosition.associatedVariableName,re=this.perturbedNormal;this._environmentBrdfSamplerName=t._getFreeVariableName("environmentBrdfSampler"),t._emit2DSampler(this._environmentBrdfSamplerName),t.sharedData.hints.needAlphaBlending=t.sharedData.hints.needAlphaBlending||this.useAlphaBlending,t.sharedData.hints.needAlphaTesting=t.sharedData.hints.needAlphaTesting||this.useAlphaTest,t._emitExtension("lod","#extension GL_EXT_shader_texture_lod : enable","defined(LODBASEDMICROSFURACE)"),this.light?t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",ee,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]},this._lightId.toString()):t._emitFunctionFromInclude(t.supportUniformBuffers?"lightUboDeclaration":"lightFragmentDeclaration",ee,{repeatKey:"maxSimultaneousLights"}),t._emitFunctionFromInclude("helperFunctions",ee),t._emitFunctionFromInclude("importanceSampling",ee),t._emitFunctionFromInclude("pbrHelperFunctions",ee),t._emitFunctionFromInclude("imageProcessingFunctions",ee),t._emitFunctionFromInclude("shadowsFragmentFunctions",ee,{replaceStrings:[{search:/vPositionW/g,replace:te+".xyz"}]}),t._emitFunctionFromInclude("pbrDirectLightingSetupFunctions",ee,{replaceStrings:[{search:/vPositionW/g,replace:te+".xyz"}]}),t._emitFunctionFromInclude("pbrDirectLightingFalloffFunctions",ee),t._emitFunctionFromInclude("pbrBRDFFunctions",ee),t._emitFunctionFromInclude("hdrFilteringFunctions",ee),t._emitFunctionFromInclude("pbrDirectLightingFunctions",ee,{replaceStrings:[{search:/vPositionW/g,replace:te+".xyz"}]}),t._emitFunctionFromInclude("pbrIBLFunctions",ee),t._emitFunctionFromInclude("pbrBlockAlbedoOpacity",ee),t._emitFunctionFromInclude("pbrBlockReflectivity",ee),t._emitFunctionFromInclude("pbrBlockAmbientOcclusion",ee),t._emitFunctionFromInclude("pbrBlockAlphaFresnel",ee),t._emitFunctionFromInclude("pbrBlockAnisotropic",ee),t._emitUniformFromString("vLightingIntensity","vec4"),this._vNormalWName=t._getFreeVariableName("vNormalW"),t.compilationString+="vec4 "+this._vNormalWName+" = normalize("+this.worldNormal.associatedVariableName+");\r\n",t._registerTempVariable("viewDirectionW")&&(t.compilationString+="vec3 viewDirectionW = normalize("+this.cameraPosition.associatedVariableName+" - "+te+".xyz);\r\n"),t.compilationString+="vec3 geometricNormalW = "+this._vNormalWName+".xyz;\r\n",t.compilationString+="vec3 normalW = "+(re.isConnected?"normalize("+re.associatedVariableName+".xyz)":"geometricNormalW")+";\r\n",this._invertNormalName=t._getFreeVariableName("invertNormal"),t._emitUniformFromString(this._invertNormalName,"float"),t.compilationString+=t._emitCodeFromInclude("pbrBlockNormalFinal",ee,{replaceStrings:[{search:/vPositionW/g,replace:te+".xyz"},{search:/vEyePosition.w/g,replace:this._invertNormalName}]}),t.compilationString+=this.getAlbedoOpacityCode(),t.compilationString+=t._emitCodeFromInclude("depthPrePass",ee);var ne=null===(n=this.ambientOcclusion.connectedPoint)||void 0===n?void 0:n.ownerBlock;t.compilationString+=m.AmbientOcclusionBlock.GetCode(ne),t.compilationString+=t._emitCodeFromInclude("pbrBlockLightmapInit",ee),t.compilationString+="#ifdef UNLIT\n vec3 diffuseBase = vec3(1., 1., 1.);\n #else\r\n";var ie=this.subsurface.isConnected?null===(i=this.subsurface.connectedPoint)||void 0===i?void 0:i.ownerBlock:null,oe=this.subsurface.isConnected?null===(s=(null===(o=this.subsurface.connectedPoint)||void 0===o?void 0:o.ownerBlock).refraction.connectedPoint)||void 0===s?void 0:s.ownerBlock:null,se=null!==(c=null===(a=this.reflectivity.connectedPoint)||void 0===a?void 0:a.ownerBlock)&&void 0!==c?c:null;se&&(se.indexOfRefractionConnectionPoint=null!==(u=null==oe?void 0:oe.indexOfRefraction)&&void 0!==u?u:null);var ae=(null==ne?void 0:ne.intensity.isConnected)?ne.intensity.associatedVariableName:"1.";t.compilationString+=null!==(d=null==se?void 0:se.getCode(t,ae))&&void 0!==d?d:"",t.compilationString+=t._emitCodeFromInclude("pbrBlockGeometryInfo",ee,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(f=null==$?void 0:$._defineSkyboxName)&&void 0!==f?f:"REFLECTIONMAP_SKYBOX"},{search:/REFLECTIONMAP_3D/g,replace:null!==(p=null==$?void 0:$._define3DName)&&void 0!==p?p:"REFLECTIONMAP_3D"}]});var le=this.anisotropy.isConnected?null===(g=this.anisotropy.connectedPoint)||void 0===g?void 0:g.ownerBlock:null;le&&(le.worldPositionConnectionPoint=this.worldPosition,le.worldNormalConnectionPoint=this.worldNormal,t.compilationString+=le.getCode(t,!this.perturbedNormal.isConnected)),$&&$.hasTexture&&(t.compilationString+=$.getCode(t,le?"anisotropicOut.anisotropicNormal":"normalW")),t._emitFunctionFromInclude("pbrBlockReflection",ee,{replaceStrings:[{search:/computeReflectionCoords/g,replace:"computeReflectionCoordsPBR"},{search:/REFLECTIONMAP_3D/g,replace:null!==(_=null==$?void 0:$._define3DName)&&void 0!==_?_:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:null!==(y=null==$?void 0:$._defineOppositeZ)&&void 0!==y?y:"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:null!==(b=null==$?void 0:$._defineProjectionName)&&void 0!==b?b:"REFLECTIONMAP_PROJECTION"},{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(A=null==$?void 0:$._defineSkyboxName)&&void 0!==A?A:"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:null!==(P=null==$?void 0:$._defineLODReflectionAlpha)&&void 0!==P?P:"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:null!==(E=null==$?void 0:$._defineLinearSpecularReflection)&&void 0!==E?E:"LINEARSPECULARREFLECTION"},{search:/vReflectionFilteringInfo/g,replace:null!==(C=null==$?void 0:$._vReflectionFilteringInfoName)&&void 0!==C?C:"vReflectionFilteringInfo"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockReflectance0",ee,{replaceStrings:[{search:/metallicReflectanceFactors/g,replace:null!==(x=null==se?void 0:se._vMetallicReflectanceFactorsName)&&void 0!==x?x:"metallicReflectanceFactors"}]});var ce=this.sheen.isConnected?null===(R=this.sheen.connectedPoint)||void 0===R?void 0:R.ownerBlock:null;ce&&(t.compilationString+=ce.getCode($)),t._emitFunctionFromInclude("pbrBlockSheen",ee,{replaceStrings:[{search:/REFLECTIONMAP_3D/g,replace:null!==(O=null==$?void 0:$._define3DName)&&void 0!==O?O:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(I=null==$?void 0:$._defineSkyboxName)&&void 0!==I?I:"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:null!==(D=null==$?void 0:$._defineLODReflectionAlpha)&&void 0!==D?D:"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:null!==(B=null==$?void 0:$._defineLinearSpecularReflection)&&void 0!==B?B:"LINEARSPECULARREFLECTION"}]});var ue=this.clearcoat.isConnected?null===(N=this.clearcoat.connectedPoint)||void 0===N?void 0:N.ownerBlock:null,de=!this.perturbedNormal.isConnected&&!this.anisotropy.isConnected,he=this.perturbedNormal.isConnected&&(null===(L=this.perturbedNormal.connectedPoint)||void 0===L?void 0:L.ownerBlock).worldTangent.isConnected,fe=this.anisotropy.isConnected&&(null===(w=this.anisotropy.connectedPoint)||void 0===w?void 0:w.ownerBlock).worldTangent.isConnected,pe=he||!this.perturbedNormal.isConnected&&fe;t.compilationString+=T.ClearCoatBlock.GetCode(t,ue,$,te,de,pe,this.worldNormal.associatedVariableName),de&&(pe=null!==(F=null==ue?void 0:ue.worldTangent.isConnected)&&void 0!==F&&F),t._emitFunctionFromInclude("pbrBlockClearcoat",ee,{replaceStrings:[{search:/computeReflectionCoords/g,replace:"computeReflectionCoordsPBR"},{search:/REFLECTIONMAP_3D/g,replace:null!==(V=null==$?void 0:$._define3DName)&&void 0!==V?V:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:null!==(k=null==$?void 0:$._defineOppositeZ)&&void 0!==k?k:"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:null!==(U=null==$?void 0:$._defineProjectionName)&&void 0!==U?U:"REFLECTIONMAP_PROJECTION"},{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(z=null==$?void 0:$._defineSkyboxName)&&void 0!==z?z:"REFLECTIONMAP_SKYBOX"},{search:/LODINREFLECTIONALPHA/g,replace:null!==(G=null==$?void 0:$._defineLODReflectionAlpha)&&void 0!==G?G:"LODINREFLECTIONALPHA"},{search:/LINEARSPECULARREFLECTION/g,replace:null!==(j=null==$?void 0:$._defineLinearSpecularReflection)&&void 0!==j?j:"LINEARSPECULARREFLECTION"},{search:/defined\(TANGENT\)/g,replace:pe?"defined(TANGENT)":"defined(IGNORE)"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockReflectance",ee,{replaceStrings:[{search:/REFLECTIONMAP_SKYBOX/g,replace:null!==(H=null==$?void 0:$._defineSkyboxName)&&void 0!==H?H:"REFLECTIONMAP_SKYBOX"},{search:/REFLECTIONMAP_3D/g,replace:null!==(W=null==$?void 0:$._define3DName)&&void 0!==W?W:"REFLECTIONMAP_3D"}]}),t.compilationString+=M.SubSurfaceBlock.GetCode(t,ie,$,te),t._emitFunctionFromInclude("pbrBlockSubSurface",ee,{replaceStrings:[{search:/REFLECTIONMAP_3D/g,replace:null!==(X=null==$?void 0:$._define3DName)&&void 0!==X?X:"REFLECTIONMAP_3D"},{search:/REFLECTIONMAP_OPPOSITEZ/g,replace:null!==(Y=null==$?void 0:$._defineOppositeZ)&&void 0!==Y?Y:"REFLECTIONMAP_OPPOSITEZ"},{search:/REFLECTIONMAP_PROJECTION/g,replace:null!==(Q=null==$?void 0:$._defineProjectionName)&&void 0!==Q?Q:"REFLECTIONMAP_PROJECTION"},{search:/SS_REFRACTIONMAP_3D/g,replace:null!==(K=null==oe?void 0:oe._define3DName)&&void 0!==K?K:"SS_REFRACTIONMAP_3D"},{search:/SS_LODINREFRACTIONALPHA/g,replace:null!==(q=null==oe?void 0:oe._defineLODRefractionAlpha)&&void 0!==q?q:"SS_LODINREFRACTIONALPHA"},{search:/SS_LINEARSPECULARREFRACTION/g,replace:null!==(Z=null==oe?void 0:oe._defineLinearSpecularRefraction)&&void 0!==Z?Z:"SS_LINEARSPECULARREFRACTION"},{search:/SS_REFRACTIONMAP_OPPOSITEZ/g,replace:null!==(J=null==oe?void 0:oe._defineOppositeZ)&&void 0!==J?J:"SS_REFRACTIONMAP_OPPOSITEZ"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockDirectLighting",ee),this.light?t.compilationString+=t._emitCodeFromInclude("lightFragment",ee,{replaceStrings:[{search:/{X}/g,replace:this._lightId.toString()}]}):t.compilationString+=t._emitCodeFromInclude("lightFragment",ee,{repeatKey:"maxSimultaneousLights"}),t.compilationString+=t._emitCodeFromInclude("pbrBlockFinalLitComponents",ee),t.compilationString+="#endif\r\n";var me=this.ambientColor.isConnected?this.ambientColor.associatedVariableName:"vec3(0., 0., 0.)",ge=(null==ne?void 0:ne.directLightIntensity.isConnected)?ne.directLightIntensity.associatedVariableName:h.PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();(null==ne?void 0:ne.directLightIntensity.isConnected)||-1!==ge.indexOf(".")||(ge+="."),t.compilationString+=t._emitCodeFromInclude("pbrBlockFinalUnlitComponents",ee,{replaceStrings:[{search:/vec3 finalEmissive[\s\S]*?finalEmissive\*=vLightingIntensity\.y;/g,replace:""},{search:/vAmbientColor/g,replace:me+" * ambientFromScene"},{search:/vAmbientInfos\.w/g,replace:ge}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockFinalColorComposition",ee,{replaceStrings:[{search:/finalEmissive/g,replace:"vec3(0.)"}]}),t.compilationString+=t._emitCodeFromInclude("pbrBlockImageProcessing",ee,{replaceStrings:[{search:/visibility/g,replace:"1."}]}),t.compilationString+=t._emitCodeFromInclude("pbrDebug",ee,{replaceStrings:[{search:/vNormalW/g,replace:this._vNormalWName},{search:/vPositionW/g,replace:te},{search:/albedoTexture\.rgb;/g,replace:"vec3(1.);\r\ngl_FragColor.rgb = toGammaSpace(gl_FragColor.rgb);\r\n"},{search:/opacityMap/g,replace:this.opacityTexture.associatedVariableName}]});for(var _e=0,ve=this._outputs;_e<ve.length;_e++){var ye=ve[_e];if(ye.hasEndpoints){var be=S[ye.name];if(be){var Ae=be[0],Te=be[1];Te&&(t.compilationString+="#if "+Te+"\r\n"),t.compilationString+=this._declareOutput(ye,t)+" = "+Ae+";\r\n",Te&&(t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(ye,t)+" = vec3(0.);\r\n",t.compilationString+="#endif\r\n")}else console.error("There's no remapping for the "+ye.name+" end point! No code generated")}}return this},t.prototype._dumpPropertiesCode=function(){var e="";return e+=this._codeVariableName+".lightFalloff = "+this.lightFalloff+";\r\n",e+=this._codeVariableName+".useAlphaFromAlbedoTexture = "+this.useAlphaFromAlbedoTexture+";\r\n",e+=this._codeVariableName+".useAlphaTest = "+this.useAlphaTest+";\r\n",e+=this._codeVariableName+".alphaTestCutoff = "+this.alphaTestCutoff+";\r\n",e+=this._codeVariableName+".useAlphaBlending = "+this.useAlphaBlending+";\r\n",e+=this._codeVariableName+".opacityRGB = "+this.opacityRGB+";\r\n",e+=this._codeVariableName+".useRadianceOverAlpha = "+this.useRadianceOverAlpha+";\r\n",e+=this._codeVariableName+".useSpecularOverAlpha = "+this.useSpecularOverAlpha+";\r\n",e+=this._codeVariableName+".enableSpecularAntiAliasing = "+this.enableSpecularAntiAliasing+";\r\n",e+=this._codeVariableName+".realTimeFiltering = "+this.realTimeFiltering+";\r\n",e+=this._codeVariableName+".realTimeFilteringQuality = "+this.realTimeFilteringQuality+";\r\n",e+=this._codeVariableName+".useEnergyConservation = "+this.useEnergyConservation+";\r\n",e+=this._codeVariableName+".useRadianceOcclusion = "+this.useRadianceOcclusion+";\r\n",e+=this._codeVariableName+".useHorizonOcclusion = "+this.useHorizonOcclusion+";\r\n",e+=this._codeVariableName+".unlit = "+this.unlit+";\r\n",e+=this._codeVariableName+".forceNormalForward = "+this.forceNormalForward+";\r\n",e+=this._codeVariableName+".debugMode = "+this.debugMode+";\r\n",e+=this._codeVariableName+".debugLimit = "+this.debugLimit+";\r\n",e+=this._codeVariableName+".debugFactor = "+this.debugFactor+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.light&&(t.lightId=this.light.id),t.lightFalloff=this.lightFalloff,t.useAlphaFromAlbedoTexture=this.useAlphaFromAlbedoTexture,t.useAlphaTest=this.useAlphaTest,t.alphaTestCutoff=this.alphaTestCutoff,t.useAlphaBlending=this.useAlphaBlending,t.opacityRGB=this.opacityRGB,t.useRadianceOverAlpha=this.useRadianceOverAlpha,t.useSpecularOverAlpha=this.useSpecularOverAlpha,t.enableSpecularAntiAliasing=this.enableSpecularAntiAliasing,t.realTimeFiltering=this.realTimeFiltering,t.realTimeFilteringQuality=this.realTimeFilteringQuality,t.useEnergyConservation=this.useEnergyConservation,t.useRadianceOcclusion=this.useRadianceOcclusion,t.useHorizonOcclusion=this.useHorizonOcclusion,t.unlit=this.unlit,t.forceNormalForward=this.forceNormalForward,t.debugMode=this.debugMode,t.debugLimit=this.debugLimit,t.debugFactor=this.debugFactor,t},t.prototype._deserialize=function(t,r,n){var i,o;e.prototype._deserialize.call(this,t,r,n),t.lightId&&(this.light=r.getLightByID(t.lightId)),this.lightFalloff=null!==(i=t.lightFalloff)&&void 0!==i?i:0,this.useAlphaFromAlbedoTexture=t.useAlphaFromAlbedoTexture,this.useAlphaTest=t.useAlphaTest,this.alphaTestCutoff=t.alphaTestCutoff,this.useAlphaBlending=t.useAlphaBlending,this.opacityRGB=t.opacityRGB,this.useRadianceOverAlpha=t.useRadianceOverAlpha,this.useSpecularOverAlpha=t.useSpecularOverAlpha,this.enableSpecularAntiAliasing=t.enableSpecularAntiAliasing,this.realTimeFiltering=!!t.realTimeFiltering,this.realTimeFilteringQuality=null!==(o=t.realTimeFilteringQuality)&&void 0!==o?o:P.Constants.TEXTURE_FILTERING_QUALITY_LOW,this.useEnergyConservation=t.useEnergyConservation,this.useRadianceOcclusion=t.useRadianceOcclusion,this.useHorizonOcclusion=t.useHorizonOcclusion,this.unlit=t.unlit,this.forceNormalForward=!!t.forceNormalForward,this.debugMode=t.debugMode,this.debugLimit=t.debugLimit,this.debugFactor=t.debugFactor},Object(n.__decorate)([Object(f.editableInPropertyPage)("Direct lights",f.PropertyTypeForEdition.Float,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"directIntensity",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Environment lights",f.PropertyTypeForEdition.Float,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"environmentIntensity",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Specular highlights",f.PropertyTypeForEdition.Float,"INTENSITY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"specularIntensity",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Light falloff",f.PropertyTypeForEdition.List,"LIGHTING & COLORS",{notifiers:{update:!0},options:[{label:"Physical",value:h.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL},{label:"GLTF",value:h.PBRBaseMaterial.LIGHTFALLOFF_GLTF},{label:"Standard",value:h.PBRBaseMaterial.LIGHTFALLOFF_STANDARD}]})],t.prototype,"lightFalloff",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Alpha from albedo",f.PropertyTypeForEdition.Boolean,"TRANSPARENCY",{notifiers:{update:!0}})],t.prototype,"useAlphaFromAlbedoTexture",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Alpha Testing",f.PropertyTypeForEdition.Boolean,"TRANSPARENCY")],t.prototype,"useAlphaTest",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Alpha CutOff",f.PropertyTypeForEdition.Float,"TRANSPARENCY",{min:0,max:1,notifiers:{update:!0}})],t.prototype,"alphaTestCutoff",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Alpha blending",f.PropertyTypeForEdition.Boolean,"TRANSPARENCY")],t.prototype,"useAlphaBlending",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Get alpha from opacity texture RGB",f.PropertyTypeForEdition.Boolean,"TRANSPARENCY",{notifiers:{update:!0}})],t.prototype,"opacityRGB",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Radiance over alpha",f.PropertyTypeForEdition.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"useRadianceOverAlpha",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Specular over alpha",f.PropertyTypeForEdition.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Specular anti-aliasing",f.PropertyTypeForEdition.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"enableSpecularAntiAliasing",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Realtime filtering",f.PropertyTypeForEdition.Boolean,"RENDERING",{notifiers:{update:!0}})],t.prototype,"realTimeFiltering",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Realtime filtering quality",f.PropertyTypeForEdition.List,"RENDERING",{notifiers:{update:!0},options:[{label:"Low",value:P.Constants.TEXTURE_FILTERING_QUALITY_LOW},{label:"Medium",value:P.Constants.TEXTURE_FILTERING_QUALITY_MEDIUM},{label:"High",value:P.Constants.TEXTURE_FILTERING_QUALITY_HIGH}]})],t.prototype,"realTimeFilteringQuality",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Energy Conservation",f.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useEnergyConservation",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Radiance occlusion",f.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useRadianceOcclusion",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Horizon occlusion",f.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useHorizonOcclusion",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Unlit",f.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"unlit",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Force normal forward",f.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"forceNormalForward",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Debug mode",f.PropertyTypeForEdition.List,"DEBUG",{notifiers:{update:!0},options:[{label:"None",value:0},{label:"Normalized position",value:1},{label:"Normals",value:2},{label:"Tangents",value:3},{label:"Bitangents",value:4},{label:"Bump Normals",value:5},{label:"ClearCoat Normals",value:8},{label:"ClearCoat Tangents",value:9},{label:"ClearCoat Bitangents",value:10},{label:"Anisotropic Normals",value:11},{label:"Anisotropic Tangents",value:12},{label:"Anisotropic Bitangents",value:13},{label:"Albedo Map",value:20},{label:"Ambient Map",value:21},{label:"Opacity Map",value:22},{label:"Metallic Map",value:25},{label:"Reflectivity Map",value:26},{label:"ClearCoat Map",value:27},{label:"ClearCoat Tint Map",value:28},{label:"Sheen Map",value:29},{label:"Anisotropic Map",value:30},{label:"Thickness Map",value:31},{label:"Env Refraction",value:40},{label:"Env Reflection",value:41},{label:"Env Clear Coat",value:42},{label:"Direct Diffuse",value:50},{label:"Direct Specular",value:51},{label:"Direct Clear Coat",value:52},{label:"Direct Sheen",value:53},{label:"Env Irradiance",value:54},{label:"Surface Albedo",value:60},{label:"Reflectance 0",value:61},{label:"Metallic",value:62},{label:"Metallic F0",value:71},{label:"Roughness",value:63},{label:"AlphaG",value:64},{label:"NdotV",value:65},{label:"ClearCoat Color",value:66},{label:"ClearCoat Roughness",value:67},{label:"ClearCoat NdotV",value:68},{label:"Transmittance",value:69},{label:"Refraction Transmittance",value:70},{label:"SEO",value:80},{label:"EHO",value:81},{label:"Energy Factor",value:82},{label:"Specular Reflectance",value:83},{label:"Clear Coat Reflectance",value:84},{label:"Sheen Reflectance",value:85},{label:"Luminance Over Alpha",value:86},{label:"Alpha",value:87}]})],t.prototype,"debugMode",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Split position",f.PropertyTypeForEdition.Float,"DEBUG",{min:-1,max:1,notifiers:{update:!0}})],t.prototype,"debugLimit",void 0),Object(n.__decorate)([Object(f.editableInPropertyPage)("Output factor",f.PropertyTypeForEdition.Float,"DEBUG",{min:0,max:5,notifiers:{update:!0}})],t.prototype,"debugFactor",void 0),t}(i.NodeMaterialBlock);d._TypeStore.RegisteredTypes["BABYLON.PBRMetallicRoughnessBlock"]=E},"./Materials/Node/Blocks/PBR/reflectionBlock.ts":
- /*!******************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/reflectionBlock.ts ***!
- \******************************************************/
- /*! exports provided: ReflectionBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReflectionBlock",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),o=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),c=r(/*! ../Dual/reflectionTextureBaseBlock */"./Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.ts"),u=r(/*! ../../../Textures/texture */"./Materials/Textures/texture.ts"),d=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),h=r(/*! ../../../../Maths/math.scalar */"./Maths/math.scalar.ts"),f=function(e){function t(r){var n=e.call(this,r)||this;return n.useSphericalHarmonics=!0,n.forceIrradianceInFragment=!1,n._isUnique=!0,n.registerInput("position",i.NodeMaterialBlockConnectionPointTypes.Vector3,!1,s.NodeMaterialBlockTargets.Vertex),n.registerInput("world",i.NodeMaterialBlockConnectionPointTypes.Matrix,!1,s.NodeMaterialBlockTargets.Vertex),n.registerInput("view",i.NodeMaterialBlockConnectionPointTypes.Matrix,!1,s.NodeMaterialBlockTargets.Fragment),n.registerInput("color",i.NodeMaterialBlockConnectionPointTypes.Color3,!0,s.NodeMaterialBlockTargets.Fragment),n.registerOutput("reflection",i.NodeMaterialBlockConnectionPointTypes.Object,s.NodeMaterialBlockTargets.Fragment,new l.NodeMaterialConnectionPointCustomObject("reflection",n,o.NodeMaterialConnectionPointDirection.Output,t,"ReflectionBlock")),n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ReflectionBlock"},Object.defineProperty(t.prototype,"position",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this.worldPositionConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this.worldNormalConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this.cameraPositionConnectionPoint},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflection",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTexture",{get:function(){return!!this._getTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionColor",{get:function(){return this.color.isConnected?this.color.associatedVariableName:"vec3(1., 1., 1.)"},enumerable:!1,configurable:!0}),t.prototype._getTexture=function(){return this.texture?this.texture:this._scene.environmentTexture},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n);var i=this._getTexture(),o=i&&i.getTextureMatrix;n.setValue("REFLECTION",o,!0),o&&(n.setValue(this._defineLODReflectionAlpha,i.lodLevelInAlpha,!0),n.setValue(this._defineLinearSpecularReflection,i.linearSpecularLOD,!0),n.setValue(this._defineOppositeZ,this._scene.useRightHandedSystem?!i.invertZ:i.invertZ,!0),n.setValue("SPHERICAL_HARMONICS",this.useSphericalHarmonics,!0),n.setValue("GAMMAREFLECTION",i.gammaSpace,!0),n.setValue("RGBDREFLECTION",i.isRGBD,!0),i&&i.coordinatesMode!==u.Texture.SKYBOX_MODE&&i.isCube&&(n.setValue("USESPHERICALFROMREFLECTIONMAP",!0),n.setValue("USEIRRADIANCEMAP",!1),this.forceIrradianceInFragment||this._scene.getEngine().getCaps().maxVaryingVectors<=8?n.setValue("USESPHERICALINVERTEX",!1):n.setValue("USESPHERICALINVERTEX",!0)))},t.prototype.bind=function(t,r,n,i){e.prototype.bind.call(this,t,r,n);var o=this._getTexture();if(o&&i){o.isCube?t.setTexture(this._cubeSamplerName,o):t.setTexture(this._2DSamplerName,o);var s=o.getSize().width;t.setFloat3(this._vReflectionMicrosurfaceInfosName,s,o.lodGenerationScale,o.lodGenerationOffset),t.setFloat2(this._vReflectionFilteringInfoName,s,h.Scalar.Log2(s));var a=i._materialDefines,l=o.sphericalPolynomial;if(a.USESPHERICALFROMREFLECTIONMAP&&l)if(a.SPHERICAL_HARMONICS){var c=l.preScaledHarmonics;t.setVector3("vSphericalL00",c.l00),t.setVector3("vSphericalL1_1",c.l1_1),t.setVector3("vSphericalL10",c.l10),t.setVector3("vSphericalL11",c.l11),t.setVector3("vSphericalL2_2",c.l2_2),t.setVector3("vSphericalL2_1",c.l2_1),t.setVector3("vSphericalL20",c.l20),t.setVector3("vSphericalL21",c.l21),t.setVector3("vSphericalL22",c.l22)}else t.setFloat3("vSphericalX",l.x.x,l.x.y,l.x.z),t.setFloat3("vSphericalY",l.y.x,l.y.y,l.y.z),t.setFloat3("vSphericalZ",l.z.x,l.z.y,l.z.z),t.setFloat3("vSphericalXX_ZZ",l.xx.x-l.zz.x,l.xx.y-l.zz.y,l.xx.z-l.zz.z),t.setFloat3("vSphericalYY_ZZ",l.yy.x-l.zz.x,l.yy.y-l.zz.y,l.yy.z-l.zz.z),t.setFloat3("vSphericalZZ",l.zz.x,l.zz.y,l.zz.z),t.setFloat3("vSphericalXY",l.xy.x,l.xy.y,l.xy.z),t.setFloat3("vSphericalYZ",l.yz.x,l.yz.y,l.yz.z),t.setFloat3("vSphericalZX",l.zx.x,l.zx.y,l.zx.z)}},t.prototype.handleVertexSide=function(t){var r=e.prototype.handleVertexSide.call(this,t);t._emitFunctionFromInclude("harmonicsFunctions","//"+this.name,{replaceStrings:[{search:/uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g,replace:""},{search:/uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g,replace:""}]});var n=t._getFreeVariableName("reflectionVector");return this._vEnvironmentIrradianceName=t._getFreeVariableName("vEnvironmentIrradiance"),t._emitVaryingFromString(this._vEnvironmentIrradianceName,"vec3","defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)"),t._emitUniformFromString("vSphericalL00","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL1_1","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL10","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL11","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL2_2","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL2_1","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL20","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL21","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalL22","vec3","SPHERICAL_HARMONICS"),t._emitUniformFromString("vSphericalX","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalY","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalXX_ZZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalYY_ZZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalZZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalXY","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalYZ","vec3","SPHERICAL_HARMONICS",!0),t._emitUniformFromString("vSphericalZX","vec3","SPHERICAL_HARMONICS",!0),r+="#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n vec3 "+n+" = vec3("+this._reflectionMatrixName+" * vec4(normalize("+this.worldNormal.associatedVariableName+").xyz, 0)).xyz;\n #ifdef "+this._defineOppositeZ+"\n "+n+".z *= -1.0;\n #endif\n "+this._vEnvironmentIrradianceName+" = computeEnvironmentIrradiance("+n+");\n #endif\r\n"},t.prototype.getCode=function(e,t){var r="";this.handleFragmentSideInits(e),e._emitFunctionFromInclude("harmonicsFunctions","//"+this.name,{replaceStrings:[{search:/uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g,replace:""},{search:/uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g,replace:""}]}),e._emitFunction("sampleReflection","\n #ifdef "+this._define3DName+"\n #define sampleReflection(s, c) textureCube(s, c)\n #else\n #define sampleReflection(s, c) texture2D(s, c)\n #endif\r\n","//"+this.name),e._emitFunction("sampleReflectionLod","\n #ifdef "+this._define3DName+"\n #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)\n #else\n #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)\n #endif\r\n","//"+this.name);var n="\n vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {\n "+this.handleFragmentSideCodeReflectionCoords("worldNormal","worldPos",!0)+"\n return "+this._reflectionVectorName+";\n }\r\n";return e._emitFunction("computeReflectionCoordsPBR",n,"//"+this.name),this._vReflectionMicrosurfaceInfosName=e._getFreeVariableName("vReflectionMicrosurfaceInfos"),e._emitUniformFromString(this._vReflectionMicrosurfaceInfosName,"vec3"),this._vReflectionInfosName=e._getFreeVariableName("vReflectionInfos"),this._vReflectionFilteringInfoName=e._getFreeVariableName("vReflectionFilteringInfo"),e._emitUniformFromString(this._vReflectionFilteringInfoName,"vec2"),r+="#ifdef REFLECTION\n vec2 "+this._vReflectionInfosName+" = vec2(1., 0.);\n\n reflectionOutParams reflectionOut;\n\n reflectionBlock(\n v_"+this.worldPosition.associatedVariableName+".xyz,\n "+t+",\n alphaG,\n "+this._vReflectionMicrosurfaceInfosName+",\n "+this._vReflectionInfosName+",\n "+this.reflectionColor+",\n #ifdef ANISOTROPIC\n anisotropicOut,\n #endif\n #if defined("+this._defineLODReflectionAlpha+") && !defined("+this._defineSkyboxName+")\n NdotVUnclamped,\n #endif\n #ifdef "+this._defineLinearSpecularReflection+"\n roughness,\n #endif\n #ifdef "+this._define3DName+"\n "+this._cubeSamplerName+",\n #else\n "+this._2DSamplerName+",\n #endif\n #if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n "+this._vEnvironmentIrradianceName+",\n #endif\n #ifdef USESPHERICALFROMREFLECTIONMAP\n #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n "+this._reflectionMatrixName+",\n #endif\n #endif\n #ifdef USEIRRADIANCEMAP\n irradianceSampler, // ** not handled **\n #endif\n #ifndef LODBASEDMICROSFURACE\n #ifdef "+this._define3DName+"\n "+this._cubeSamplerName+",\n "+this._cubeSamplerName+",\n #else\n "+this._2DSamplerName+",\n "+this._2DSamplerName+",\n #endif\n #endif\n reflectionOut\n );\n #endif\r\n"},t.prototype._buildBlock=function(e){return this._scene=e.sharedData.scene,e.target!==s.NodeMaterialBlockTargets.Fragment&&(this._defineLODReflectionAlpha=e._getFreeDefineName("LODINREFLECTIONALPHA"),this._defineLinearSpecularReflection=e._getFreeDefineName("LINEARSPECULARREFLECTION")),this},t.prototype._dumpPropertiesCode=function(){var t=e.prototype._dumpPropertiesCode.call(this);return t+=this._codeVariableName+".useSphericalHarmonics = "+this.useSphericalHarmonics+";\r\n",t+=this._codeVariableName+".forceIrradianceInFragment = "+this.forceIrradianceInFragment+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.useSphericalHarmonics=this.useSphericalHarmonics,t.forceIrradianceInFragment=this.forceIrradianceInFragment,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.useSphericalHarmonics=t.useSphericalHarmonics,this.forceIrradianceInFragment=t.forceIrradianceInFragment},Object(n.__decorate)([Object(d.editableInPropertyPage)("Spherical Harmonics",d.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"useSphericalHarmonics",void 0),Object(n.__decorate)([Object(d.editableInPropertyPage)("Force irradiance in fragment",d.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"forceIrradianceInFragment",void 0),t}(c.ReflectionTextureBaseBlock);a._TypeStore.RegisteredTypes["BABYLON.ReflectionBlock"]=f},"./Materials/Node/Blocks/PBR/reflectivityBlock.ts":
- /*!********************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/reflectivityBlock.ts ***!
- \********************************************************/
- /*! exports provided: ReflectivityBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReflectivityBlock",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),s=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),a=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),l=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),c=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),u=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),d=r(/*! ../../../../Maths/math.color */"./Maths/math.color.ts"),h=function(e){function t(r){var n=e.call(this,r,l.NodeMaterialBlockTargets.Fragment)||this;return n._metallicReflectanceColor=d.Color3.White(),n._metallicF0Factor=1,n.useAmbientOcclusionFromMetallicTextureRed=!1,n.useMetallnessFromMetallicTextureBlue=!0,n.useRoughnessFromMetallicTextureAlpha=!1,n.useRoughnessFromMetallicTextureGreen=!0,n._isUnique=!0,n.registerInput("metallic",a.NodeMaterialBlockConnectionPointTypes.Float,!1,l.NodeMaterialBlockTargets.Fragment),n.registerInput("roughness",a.NodeMaterialBlockConnectionPointTypes.Float,!1,l.NodeMaterialBlockTargets.Fragment),n.registerInput("texture",a.NodeMaterialBlockConnectionPointTypes.Color4,!0,l.NodeMaterialBlockTargets.Fragment),n.registerOutput("reflectivity",a.NodeMaterialBlockConnectionPointTypes.Object,l.NodeMaterialBlockTargets.Fragment,new c.NodeMaterialConnectionPointCustomObject("reflectivity",n,u.NodeMaterialConnectionPointDirection.Output,t,"ReflectivityBlock")),n}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("baseColor"),e._excludeVariableName("reflectivityOut"),e._excludeVariableName("microSurface"),e._excludeVariableName("roughness")},t.prototype.getClassName=function(){return"ReflectivityBlock"},Object.defineProperty(t.prototype,"metallic",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roughness",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectivity",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,r,n,i){var o,s,a;e.prototype.bind.call(this,t,r,n);var l=null!==(a=null===(s=null===(o=this.indexOfRefractionConnectionPoint)||void 0===o?void 0:o.connectInputBlock)||void 0===s?void 0:s.value)&&void 0!==a?a:1.5,c=Math.pow((l-1)/(l+1),2);this._metallicReflectanceColor.scaleToRef(c*this._metallicF0Factor,d.TmpColors.Color3[0]);var u=this._metallicF0Factor;t.setColor4(this._vMetallicReflectanceFactorsName,d.TmpColors.Color3[0],u)},t.prototype.getCode=function(e,t){var r,n=this.texture.isConnected?null===(r=this.texture.connectedPoint)||void 0===r?void 0:r.associatedVariableName:null;return this._vMetallicReflectanceFactorsName=e._getFreeVariableName("vMetallicReflectanceFactors"),e._emitUniformFromString(this._vMetallicReflectanceFactorsName,"vec4"),"vec3 baseColor = surfaceAlbedo;\n reflectivityOutParams reflectivityOut;\n\n reflectivityBlock(\n vec4("+this.metallic.associatedVariableName+", "+this.roughness.associatedVariableName+", 0., 0.),\n #ifdef METALLICWORKFLOW\n surfaceAlbedo,\n "+this._vMetallicReflectanceFactorsName+",\n #endif\n #ifdef REFLECTIVITY\n vec3(0., 0., "+t+"),\n "+n+",\n #endif\n #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n aoOut.ambientOcclusionColor,\n #endif\n #ifdef MICROSURFACEMAP\n microSurfaceTexel, <== not handled!\n #endif\n reflectivityOut\n );\n\n float microSurface = reflectivityOut.microSurface;\n float roughness = reflectivityOut.roughness;\n\n #ifdef METALLICWORKFLOW\n surfaceAlbedo = reflectivityOut.surfaceAlbedo;\n #endif\n #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;\n #endif\r\n"},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n),n.setValue("REFLECTIVITY",this.texture.isConnected,!0),n.setValue("AOSTOREINMETALMAPRED",this.useAmbientOcclusionFromMetallicTextureRed,!0),n.setValue("METALLNESSSTOREINMETALMAPBLUE",this.useMetallnessFromMetallicTextureBlue,!0),n.setValue("ROUGHNESSSTOREINMETALMAPALPHA",this.useRoughnessFromMetallicTextureAlpha,!0),n.setValue("ROUGHNESSSTOREINMETALMAPGREEN",!this.useRoughnessFromMetallicTextureAlpha&&this.useRoughnessFromMetallicTextureGreen,!0)},t.prototype._buildBlock=function(e){return e.target===l.NodeMaterialBlockTargets.Fragment&&(e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this)),this},t.prototype._dumpPropertiesCode=function(){var e="";return e+=this._codeVariableName+".useAmbientOcclusionFromMetallicTextureRed = "+this.useAmbientOcclusionFromMetallicTextureRed+";\r\n",e+=this._codeVariableName+".useMetallnessFromMetallicTextureBlue = "+this.useMetallnessFromMetallicTextureBlue+";\r\n",e+=this._codeVariableName+".useRoughnessFromMetallicTextureAlpha = "+this.useRoughnessFromMetallicTextureAlpha+";\r\n",e+=this._codeVariableName+".useRoughnessFromMetallicTextureGreen = "+this.useRoughnessFromMetallicTextureGreen+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.useAmbientOcclusionFromMetallicTextureRed=this.useAmbientOcclusionFromMetallicTextureRed,t.useMetallnessFromMetallicTextureBlue=this.useMetallnessFromMetallicTextureBlue,t.useRoughnessFromMetallicTextureAlpha=this.useRoughnessFromMetallicTextureAlpha,t.useRoughnessFromMetallicTextureGreen=this.useRoughnessFromMetallicTextureGreen,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.useAmbientOcclusionFromMetallicTextureRed=t.useAmbientOcclusionFromMetallicTextureRed,this.useMetallnessFromMetallicTextureBlue=t.useMetallnessFromMetallicTextureBlue,this.useRoughnessFromMetallicTextureAlpha=t.useRoughnessFromMetallicTextureAlpha,this.useRoughnessFromMetallicTextureGreen=t.useRoughnessFromMetallicTextureGreen},Object(n.__decorate)([Object(s.editableInPropertyPage)("AO from red channel",s.PropertyTypeForEdition.Boolean,"METALLIC WORKFLOW",{notifiers:{update:!0}})],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),Object(n.__decorate)([Object(s.editableInPropertyPage)("Metallness from blue channel",s.PropertyTypeForEdition.Boolean,"METALLIC WORKFLOW",{notifiers:{update:!0}})],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),Object(n.__decorate)([Object(s.editableInPropertyPage)("Roughness from alpha channel",s.PropertyTypeForEdition.Boolean,"METALLIC WORKFLOW",{notifiers:{update:!0}})],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),Object(n.__decorate)([Object(s.editableInPropertyPage)("Roughness from green channel",s.PropertyTypeForEdition.Boolean,"METALLIC WORKFLOW",{notifiers:{update:!0}})],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),t}(i.NodeMaterialBlock);o._TypeStore.RegisteredTypes["BABYLON.ReflectivityBlock"]=h},"./Materials/Node/Blocks/PBR/refractionBlock.ts":
- /*!******************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/refractionBlock.ts ***!
- \******************************************************/
- /*! exports provided: RefractionBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"RefractionBlock",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),o=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),c=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),u=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),d=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),h=r(/*! ../../../Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),f=r(/*! ../../../Textures/texture */"./Materials/Textures/texture.ts"),p=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),m=function(e){function t(r){var n=e.call(this,r,s.NodeMaterialBlockTargets.Fragment)||this;return n.linkRefractionWithTransparency=!1,n.invertRefractionY=!1,n._isUnique=!0,n.registerInput("intensity",i.NodeMaterialBlockConnectionPointTypes.Float,!1,s.NodeMaterialBlockTargets.Fragment),n.registerInput("indexOfRefraction",i.NodeMaterialBlockConnectionPointTypes.Float,!0,s.NodeMaterialBlockTargets.Fragment),n.registerInput("tintAtDistance",i.NodeMaterialBlockConnectionPointTypes.Float,!0,s.NodeMaterialBlockTargets.Fragment),n.registerInput("view",i.NodeMaterialBlockConnectionPointTypes.Matrix,!1,s.NodeMaterialBlockTargets.Fragment),n.registerOutput("refraction",i.NodeMaterialBlockConnectionPointTypes.Object,s.NodeMaterialBlockTargets.Fragment,new c.NodeMaterialConnectionPointCustomObject("refraction",n,o.NodeMaterialConnectionPointDirection.Output,t,"RefractionBlock")),n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"RefractionBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexOfRefraction",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintAtDistance",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refraction",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTexture",{get:function(){return!!this._getTexture()},enumerable:!1,configurable:!0}),t.prototype._getTexture=function(){return this.texture?this.texture:this._scene.environmentTexture},t.prototype.autoConfigure=function(e){if(!this.intensity.isConnected){var t=new l.InputBlock("Refraction intensity",s.NodeMaterialBlockTargets.Fragment,i.NodeMaterialBlockConnectionPointTypes.Float);t.value=1,t.output.connectTo(this.intensity)}if(!this.view.isConnected){var r=e.getInputBlockByPredicate((function(e){return e.systemValue===p.NodeMaterialSystemValues.View}));r||(r=new l.InputBlock("view")).setAsSystemValue(p.NodeMaterialSystemValues.View),r.output.connectTo(this.view)}},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n);var i=this._getTexture(),o=i&&i.getTextureMatrix;n.setValue("SS_REFRACTION",o,!0),o&&(n.setValue(this._define3DName,i.isCube,!0),n.setValue(this._defineLODRefractionAlpha,i.lodLevelInAlpha,!0),n.setValue(this._defineLinearSpecularRefraction,i.linearSpecularLOD,!0),n.setValue(this._defineOppositeZ,this._scene.useRightHandedSystem?!i.invertZ:i.invertZ,!0),n.setValue("SS_LINKREFRACTIONTOTRANSPARENCY",this.linkRefractionWithTransparency,!0),n.setValue("SS_GAMMAREFRACTION",i.gammaSpace,!0),n.setValue("SS_RGBDREFRACTION",i.isRGBD,!0))},t.prototype.isReady=function(){var e=this._getTexture();return!(e&&!e.isReadyOrNotBlocking())},t.prototype.bind=function(t,r,n,i){var o,s;e.prototype.bind.call(this,t,r,n);var a=this._getTexture();if(a){a.isCube?t.setTexture(this._cubeSamplerName,a):t.setTexture(this._2DSamplerName,a),t.setMatrix(this._refractionMatrixName,a.getReflectionTextureMatrix());var l=1;a.isCube||a.depth&&(l=a.depth);var c=null!==(s=null===(o=this.indexOfRefraction.connectInputBlock)||void 0===o?void 0:o.value)&&void 0!==s?s:1.5;t.setFloat4(this._vRefractionInfosName,a.level,1/c,l,this.invertRefractionY?-1:1),t.setFloat3(this._vRefractionMicrosurfaceInfosName,a.getSize().width,a.lodGenerationScale,a.lodGenerationOffset)}},t.prototype.getCode=function(e){return e.sharedData.blockingBlocks.push(this),e.sharedData.textureBlocks.push(this),this._cubeSamplerName=e._getFreeVariableName(this.name+"CubeSampler"),e.samplers.push(this._cubeSamplerName),this._2DSamplerName=e._getFreeVariableName(this.name+"2DSampler"),e.samplers.push(this._2DSamplerName),this._define3DName=e._getFreeDefineName("SS_REFRACTIONMAP_3D"),e._samplerDeclaration+="#ifdef "+this._define3DName+"\r\n",e._samplerDeclaration+="uniform samplerCube "+this._cubeSamplerName+";\r\n",e._samplerDeclaration+="#else\r\n",e._samplerDeclaration+="uniform sampler2D "+this._2DSamplerName+";\r\n",e._samplerDeclaration+="#endif\r\n",e.sharedData.blocksWithDefines.push(this),e.sharedData.bindableBlocks.push(this),this._defineLODRefractionAlpha=e._getFreeDefineName("SS_LODINREFRACTIONALPHA"),this._defineLinearSpecularRefraction=e._getFreeDefineName("SS_LINEARSPECULARREFRACTION"),this._defineOppositeZ=e._getFreeDefineName("SS_REFRACTIONMAP_OPPOSITEZ"),this._refractionMatrixName=e._getFreeVariableName("refractionMatrix"),e._emitUniformFromString(this._refractionMatrixName,"mat4"),e._emitFunction("sampleRefraction","\n #ifdef "+this._define3DName+"\n #define sampleRefraction(s, c) textureCube(s, c)\n #else\n #define sampleRefraction(s, c) texture2D(s, c)\n #endif\r\n","//"+this.name),e._emitFunction("sampleRefractionLod","\n #ifdef "+this._define3DName+"\n #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\n #else\n #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\n #endif\r\n","//"+this.name),this._vRefractionMicrosurfaceInfosName=e._getFreeVariableName("vRefractionMicrosurfaceInfos"),e._emitUniformFromString(this._vRefractionMicrosurfaceInfosName,"vec3"),this._vRefractionInfosName=e._getFreeVariableName("vRefractionInfos"),e._emitUniformFromString(this._vRefractionInfosName,"vec4"),""},t.prototype._buildBlock=function(e){return this._scene=e.sharedData.scene,this},t.prototype._dumpPropertiesCode=function(){var t=e.prototype._dumpPropertiesCode.call(this);return this.texture&&(t=this.texture.isCube?this._codeVariableName+'.texture = new BABYLON.CubeTexture("'+this.texture.name+'");\r\n':this._codeVariableName+'.texture = new BABYLON.Texture("'+this.texture.name+'");\r\n',t+=this._codeVariableName+".texture.coordinatesMode = "+this.texture.coordinatesMode+";\r\n"),t+=this._codeVariableName+".linkRefractionWithTransparency = "+this.linkRefractionWithTransparency+";\r\n",t+=this._codeVariableName+".invertRefractionY = "+this.invertRefractionY+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.texture&&(t.texture=this.texture.serialize()),t.linkRefractionWithTransparency=this.linkRefractionWithTransparency,t.invertRefractionY=this.invertRefractionY,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,t.texture.isCube?this.texture=h.CubeTexture.Parse(t.texture,r,n):this.texture=f.Texture.Parse(t.texture,r,n)),this.linkRefractionWithTransparency=t.linkRefractionWithTransparency,this.invertRefractionY=t.invertRefractionY},Object(n.__decorate)([Object(u.editableInPropertyPage)("Link refraction to transparency",u.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"linkRefractionWithTransparency",void 0),Object(n.__decorate)([Object(u.editableInPropertyPage)("Invert refraction Y",u.PropertyTypeForEdition.Boolean,"ADVANCED",{notifiers:{update:!0}})],t.prototype,"invertRefractionY",void 0),t}(d.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.RefractionBlock"]=m},"./Materials/Node/Blocks/PBR/sheenBlock.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/sheenBlock.ts ***!
- \*************************************************/
- /*! exports provided: SheenBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"SheenBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),c=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),u=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),d=function(e){function t(r){var n=e.call(this,r,a.NodeMaterialBlockTargets.Fragment)||this;return n.albedoScaling=!1,n.linkSheenWithAlbedo=!1,n._isUnique=!0,n.registerInput("intensity",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("color",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("roughness",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerOutput("sheen",o.NodeMaterialBlockConnectionPointTypes.Object,a.NodeMaterialBlockTargets.Fragment,new u.NodeMaterialConnectionPointCustomObject("sheen",n,s.NodeMaterialConnectionPointDirection.Output,t,"SheenBlock")),n}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("sheenOut"),e._excludeVariableName("sheenMapData"),e._excludeVariableName("vSheenColor"),e._excludeVariableName("vSheenRoughness")},t.prototype.getClassName=function(){return"SheenBlock"},Object.defineProperty(t.prototype,"intensity",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roughness",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sheen",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n),n.setValue("SHEEN",!0),n.setValue("SHEEN_LINKWITHALBEDO",this.linkSheenWithAlbedo,!0),n.setValue("SHEEN_ROUGHNESS",this.roughness.isConnected,!0),n.setValue("SHEEN_ALBEDOSCALING",this.albedoScaling,!0)},t.prototype.getCode=function(e){return"#ifdef SHEEN\n sheenOutParams sheenOut;\n\n vec4 vSheenColor = vec4("+(this.color.isConnected?this.color.associatedVariableName:"vec3(1.)")+", "+(this.intensity.isConnected?this.intensity.associatedVariableName:"1.")+");\n\n sheenBlock(\n vSheenColor,\n #ifdef SHEEN_ROUGHNESS\n "+(this.roughness.isConnected?this.roughness.associatedVariableName:"0.")+",\n #endif\n roughness,\n #ifdef SHEEN_TEXTURE\n vec4(0.),\n #endif\n reflectance,\n #ifdef SHEEN_LINKWITHALBEDO\n baseColor,\n surfaceAlbedo,\n #endif\n #ifdef ENVIRONMENTBRDF\n NdotV,\n environmentBrdf,\n #endif\n #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n AARoughnessFactors,\n "+(null==e?void 0:e._vReflectionMicrosurfaceInfosName)+",\n "+(null==e?void 0:e._vReflectionInfosName)+",\n "+(null==e?void 0:e.reflectionColor)+",\n vLightingIntensity,\n #ifdef "+(null==e?void 0:e._define3DName)+"\n "+(null==e?void 0:e._cubeSamplerName)+",\n #else\n "+(null==e?void 0:e._2DSamplerName)+",\n #endif\n reflectionOut.reflectionCoords,\n NdotVUnclamped,\n #ifndef LODBASEDMICROSFURACE\n #ifdef "+(null==e?void 0:e._define3DName)+"\n "+(null==e?void 0:e._cubeSamplerName)+",\n "+(null==e?void 0:e._cubeSamplerName)+",\n #else\n "+(null==e?void 0:e._2DSamplerName)+",\n "+(null==e?void 0:e._2DSamplerName)+",\n #endif\n #endif\n #if !defined("+(null==e?void 0:e._defineSkyboxName)+") && defined(RADIANCEOCCLUSION)\n seo,\n #endif\n #if !defined("+(null==e?void 0:e._defineSkyboxName)+") && defined(HORIZONOCCLUSION) && defined(BUMP) && defined("+(null==e?void 0:e._define3DName)+")\n eho,\n #endif\n #endif\n sheenOut\n );\n\n #ifdef SHEEN_LINKWITHALBEDO\n surfaceAlbedo = sheenOut.surfaceAlbedo;\n #endif\n #endif\r\n"},t.prototype._buildBlock=function(e){return e.target===a.NodeMaterialBlockTargets.Fragment&&e.sharedData.blocksWithDefines.push(this),this},t.prototype._dumpPropertiesCode=function(){var t=e.prototype._dumpPropertiesCode.call(this);return t+=this._codeVariableName+".albedoScaling = "+this.albedoScaling+";\r\n",t+=this._codeVariableName+".linkSheenWithAlbedo = "+this.linkSheenWithAlbedo+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.albedoScaling=this.albedoScaling,t.linkSheenWithAlbedo=this.linkSheenWithAlbedo,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.albedoScaling=t.albedoScaling,this.linkSheenWithAlbedo=t.linkSheenWithAlbedo},Object(n.__decorate)([Object(c.editableInPropertyPage)("Albedo scaling",c.PropertyTypeForEdition.Boolean,"PROPERTIES",{notifiers:{update:!0}})],t.prototype,"albedoScaling",void 0),Object(n.__decorate)([Object(c.editableInPropertyPage)("Link sheen with albedo",c.PropertyTypeForEdition.Boolean,"PROPERTIES",{notifiers:{update:!0}})],t.prototype,"linkSheenWithAlbedo",void 0),t}(i.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.SheenBlock"]=d},"./Materials/Node/Blocks/PBR/subSurfaceBlock.ts":
- /*!******************************************************!*\
- !*** ./Materials/Node/Blocks/PBR/subSurfaceBlock.ts ***!
- \******************************************************/
- /*! exports provided: SubSurfaceBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"SubSurfaceBlock",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),c=r(/*! ../../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),u=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),d=r(/*! ../../nodeMaterialConnectionPointCustomObject */"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts"),h=r(/*! ./refractionBlock */"./Materials/Node/Blocks/PBR/refractionBlock.ts"),f=function(e){function t(r){var n=e.call(this,r,a.NodeMaterialBlockTargets.Fragment)||this;return n.useMaskFromThicknessTexture=!1,n._isUnique=!0,n.registerInput("minThickness",o.NodeMaterialBlockConnectionPointTypes.Float,!1,a.NodeMaterialBlockTargets.Fragment),n.registerInput("maxThickness",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("thicknessTexture",o.NodeMaterialBlockConnectionPointTypes.Color4,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("tintColor",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("translucencyIntensity",o.NodeMaterialBlockConnectionPointTypes.Float,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("translucencyDiffusionDistance",o.NodeMaterialBlockConnectionPointTypes.Color3,!0,a.NodeMaterialBlockTargets.Fragment),n.registerInput("refraction",o.NodeMaterialBlockConnectionPointTypes.Object,!0,a.NodeMaterialBlockTargets.Fragment,new d.NodeMaterialConnectionPointCustomObject("refraction",n,s.NodeMaterialConnectionPointDirection.Input,h.RefractionBlock,"RefractionBlock")),n.registerOutput("subsurface",o.NodeMaterialBlockConnectionPointTypes.Object,a.NodeMaterialBlockTargets.Fragment,new d.NodeMaterialConnectionPointCustomObject("subsurface",n,s.NodeMaterialConnectionPointDirection.Output,t,"SubSurfaceBlock")),n}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("subSurfaceOut"),e._excludeVariableName("vThicknessParam"),e._excludeVariableName("vTintColor"),e._excludeVariableName("vSubSurfaceIntensity")},t.prototype.getClassName=function(){return"SubSurfaceBlock"},Object.defineProperty(t.prototype,"minThickness",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxThickness",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thicknessTexture",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tintColor",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translucencyIntensity",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translucencyDiffusionDistance",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refraction",{get:function(){return this._inputs[6]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subsurface",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.minThickness.isConnected){var t=new u.InputBlock("SubSurface min thickness",a.NodeMaterialBlockTargets.Fragment,o.NodeMaterialBlockConnectionPointTypes.Float);t.value=0,t.output.connectTo(this.minThickness)}},t.prototype.prepareDefines=function(t,r,n){e.prototype.prepareDefines.call(this,t,r,n);var i=this.translucencyDiffusionDistance.isConnected||this.translucencyIntensity.isConnected;n.setValue("SUBSURFACE",i||this.refraction.isConnected,!0),n.setValue("SS_TRANSLUCENCY",i,!0),n.setValue("SS_THICKNESSANDMASK_TEXTURE",this.thicknessTexture.isConnected,!0),n.setValue("SS_MASK_FROM_THICKNESS_TEXTURE",this.useMaskFromThicknessTexture,!0)},t.GetCode=function(e,t,r,n){var i,o,s,a,l,c,u,d,h,f,p,m,g,_,v,y="",b=(null==t?void 0:t.minThickness.isConnected)?t.minThickness.associatedVariableName:"0.",A=(null==t?void 0:t.maxThickness.isConnected)?t.maxThickness.associatedVariableName:"1.",T=(null==t?void 0:t.thicknessTexture.isConnected)?t.thicknessTexture.associatedVariableName:"vec4(0.)",M=(null==t?void 0:t.tintColor.isConnected)?t.tintColor.associatedVariableName:"vec3(1.)",P=(null==t?void 0:t.translucencyIntensity.isConnected)?null==t?void 0:t.translucencyIntensity.associatedVariableName:"1.",S=(null==t?void 0:t.translucencyDiffusionDistance.isConnected)?null==t?void 0:t.translucencyDiffusionDistance.associatedVariableName:"vec3(1.)",E=(null==t?void 0:t.refraction.isConnected)?null===(i=null==t?void 0:t.refraction.connectedPoint)||void 0===i?void 0:i.ownerBlock:null,C=(null==E?void 0:E.tintAtDistance.isConnected)?E.tintAtDistance.associatedVariableName:"1.",x=(null==E?void 0:E.intensity.isConnected)?E.intensity.associatedVariableName:"1.",R=(null==E?void 0:E.view.isConnected)?E.view.associatedVariableName:"";return y+=null!==(o=null==E?void 0:E.getCode(e))&&void 0!==o?o:"",y+="subSurfaceOutParams subSurfaceOut;\n\n #ifdef SUBSURFACE\n vec2 vThicknessParam = vec2("+b+", "+A+" - "+b+");\n vec4 vTintColor = vec4("+M+", "+C+");\n vec3 vSubSurfaceIntensity = vec3("+x+", "+P+", 0.);\n\n subSurfaceBlock(\n vSubSurfaceIntensity,\n vThicknessParam,\n vTintColor,\n normalW,\n specularEnvironmentReflectance,\n #ifdef SS_THICKNESSANDMASK_TEXTURE\n "+T+",\n #endif\n #ifdef REFLECTION\n #ifdef SS_TRANSLUCENCY\n "+(null==r?void 0:r._reflectionMatrixName)+",\n #ifdef USESPHERICALFROMREFLECTIONMAP\n #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n reflectionOut.irradianceVector,\n #endif\n #endif\n #ifdef USEIRRADIANCEMAP\n irradianceSampler,\n #endif\n #endif\n #endif\n #ifdef SS_REFRACTION\n "+n+".xyz,\n viewDirectionW,\n "+R+",\n surfaceAlbedo,\n "+(null!==(s=null==E?void 0:E._vRefractionInfosName)&&void 0!==s?s:"")+",\n "+(null!==(a=null==E?void 0:E._refractionMatrixName)&&void 0!==a?a:"")+",\n "+(null!==(l=null==E?void 0:E._vRefractionMicrosurfaceInfosName)&&void 0!==l?l:"")+",\n vLightingIntensity,\n #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n alpha,\n #endif\n #ifdef "+(null!==(c=null==E?void 0:E._defineLODRefractionAlpha)&&void 0!==c?c:"IGNORE")+"\n NdotVUnclamped,\n #endif\n #ifdef "+(null!==(u=null==E?void 0:E._defineLinearSpecularRefraction)&&void 0!==u?u:"IGNORE")+"\n roughness,\n #else\n alphaG,\n #endif\n #ifdef "+(null!==(d=null==E?void 0:E._define3DName)&&void 0!==d?d:"IGNORE")+"\n "+(null!==(h=null==E?void 0:E._cubeSamplerName)&&void 0!==h?h:"")+",\n #else\n "+(null!==(f=null==E?void 0:E._2DSamplerName)&&void 0!==f?f:"")+",\n #endif\n #ifndef LODBASEDMICROSFURACE\n #ifdef "+(null!==(p=null==E?void 0:E._define3DName)&&void 0!==p?p:"IGNORE")+"\n "+(null!==(m=null==E?void 0:E._cubeSamplerName)&&void 0!==m?m:"")+",\n "+(null!==(g=null==E?void 0:E._cubeSamplerName)&&void 0!==g?g:"")+",\n #else\n "+(null!==(_=null==E?void 0:E._2DSamplerName)&&void 0!==_?_:"")+",\n "+(null!==(v=null==E?void 0:E._2DSamplerName)&&void 0!==v?v:"")+",\n #endif\n #endif\n #ifdef ANISOTROPIC\n anisotropicOut,\n #endif\n #endif\n #ifdef SS_TRANSLUCENCY\n "+S+",\n #endif\n subSurfaceOut\n );\n\n #ifdef SS_REFRACTION\n surfaceAlbedo = subSurfaceOut.surfaceAlbedo;\n #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n alpha = subSurfaceOut.alpha;\n #endif\n #endif\n #else\n subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;\n #endif\r\n"},t.prototype._buildBlock=function(e){return e.target===a.NodeMaterialBlockTargets.Fragment&&e.sharedData.blocksWithDefines.push(this),this},Object(n.__decorate)([Object(c.editableInPropertyPage)("Mask from thickness texture",c.PropertyTypeForEdition.Boolean,"PROPERTIES",{notifiers:{update:!0}})],t.prototype,"useMaskFromThicknessTexture",void 0),t}(i.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.SubSurfaceBlock"]=f},"./Materials/Node/Blocks/Particle/index.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/Blocks/Particle/index.ts ***!
- \*************************************************/
- /*! exports provided: ParticleTextureBlock, ParticleRampGradientBlock, ParticleBlendMultiplyBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./particleTextureBlock */"./Materials/Node/Blocks/Particle/particleTextureBlock.ts");r.d(t,"ParticleTextureBlock",(function(){return n.ParticleTextureBlock}));var i=r(/*! ./particleRampGradientBlock */"./Materials/Node/Blocks/Particle/particleRampGradientBlock.ts");r.d(t,"ParticleRampGradientBlock",(function(){return i.ParticleRampGradientBlock}));var o=r(/*! ./particleBlendMultiplyBlock */"./Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.ts");r.d(t,"ParticleBlendMultiplyBlock",(function(){return o.ParticleBlendMultiplyBlock}))},"./Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.ts":
- /*!**********************************************************************!*\
- !*** ./Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.ts ***!
- \**********************************************************************/
- /*! exports provided: ParticleBlendMultiplyBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleBlendMultiplyBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r._isUnique=!0,r.registerInput("color",o.NodeMaterialBlockConnectionPointTypes.Color4,!1,s.NodeMaterialBlockTargets.Fragment),r.registerInput("alphaTexture",o.NodeMaterialBlockConnectionPointTypes.Float,!1,s.NodeMaterialBlockTargets.Fragment),r.registerInput("alphaColor",o.NodeMaterialBlockConnectionPointTypes.Float,!1,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("blendColor",o.NodeMaterialBlockConnectionPointTypes.Color4,s.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ParticleBlendMultiplyBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alphaTexture",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alphaColor",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendColor",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("sourceAlpha")},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target!==s.NodeMaterialBlockTargets.Vertex)return t.compilationString+="\n #ifdef BLENDMULTIPLYMODE\n "+this._declareOutput(this.blendColor,t)+";\n float sourceAlpha = "+this.alphaColor.associatedVariableName+" * "+this.alphaTexture.associatedVariableName+";\n "+this.blendColor.associatedVariableName+".rgb = "+this.color.associatedVariableName+".rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha);\n "+this.blendColor.associatedVariableName+".a = "+this.color.associatedVariableName+".a;\n #else\n "+this._declareOutput(this.blendColor,t)+" = "+this.color.associatedVariableName+";\n #endif\n ",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ParticleBlendMultiplyBlock"]=l},"./Materials/Node/Blocks/Particle/particleRampGradientBlock.ts":
- /*!*********************************************************************!*\
- !*** ./Materials/Node/Blocks/Particle/particleRampGradientBlock.ts ***!
- \*********************************************************************/
- /*! exports provided: ParticleRampGradientBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleRampGradientBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r._isUnique=!0,r.registerInput("color",o.NodeMaterialBlockConnectionPointTypes.Color4,!1,s.NodeMaterialBlockTargets.Fragment),r.registerOutput("rampColor",o.NodeMaterialBlockConnectionPointTypes.Color4,s.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ParticleRampGradientBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rampColor",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("remapRanges"),e._excludeVariableName("rampSampler"),e._excludeVariableName("baseColor"),e._excludeVariableName("alpha"),e._excludeVariableName("remappedColorIndex"),e._excludeVariableName("rampColor"),e._excludeVariableName("finalAlpha")},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target!==s.NodeMaterialBlockTargets.Vertex)return t._emit2DSampler("rampSampler"),t._emitVaryingFromString("remapRanges","vec4","RAMPGRADIENT"),t.compilationString+="\n #ifdef RAMPGRADIENT\n vec4 baseColor = "+this.color.associatedVariableName+";\n float alpha = "+this.color.associatedVariableName+".a;\n\n float remappedColorIndex = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);\n\n vec4 rampColor = texture2D(rampSampler, vec2(1.0 - remappedColorIndex, 0.));\n baseColor.rgb *= rampColor.rgb;\n\n // Remapped alpha\n float finalAlpha = baseColor.a;\n baseColor.a = clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0);\n\n "+this._declareOutput(this.rampColor,t)+" = baseColor;\n #else\n "+this._declareOutput(this.rampColor,t)+" = "+this.color.associatedVariableName+";\n #endif\n ",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ParticleRampGradientBlock"]=l},"./Materials/Node/Blocks/Particle/particleTextureBlock.ts":
- /*!****************************************************************!*\
- !*** ./Materials/Node/Blocks/Particle/particleTextureBlock.ts ***!
- \****************************************************************/
- /*! exports provided: ParticleTextureBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleTextureBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),l=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),c=r(/*! ../../../Textures/texture */"./Materials/Textures/texture.ts"),u=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Fragment)||this;return r._samplerName="diffuseSampler",r.convertToGammaSpace=!1,r.convertToLinearSpace=!1,r._isUnique=!0,r.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2,!1,s.NodeMaterialBlockTargets.VertexAndFragment),r.registerOutput("rgba",o.NodeMaterialBlockConnectionPointTypes.Color4,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("rgb",o.NodeMaterialBlockConnectionPointTypes.Color3,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("r",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("g",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("b",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r.registerOutput("a",o.NodeMaterialBlockConnectionPointTypes.Float,s.NodeMaterialBlockTargets.Neutral),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ParticleTextureBlock"},Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("diffuseSampler")},t.prototype.autoConfigure=function(e){if(!this.uv.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"particle_uv"===e.name}));t||(t=new a.InputBlock("uv")).setAsAttribute("particle_uv"),t.output.connectTo(this.uv)}},t.prototype.prepareDefines=function(e,t,r){r.setValue(this._linearDefineName,this.convertToGammaSpace,!0),r.setValue(this._gammaDefineName,this.convertToLinearSpace,!0)},t.prototype.isReady=function(){return!(this.texture&&!this.texture.isReadyOrNotBlocking())},t.prototype._writeOutput=function(e,t,r){e.compilationString+=this._declareOutput(t,e)+" = "+this._tempTextureRead+"."+r+";\r\n",e.compilationString+="#ifdef "+this._linearDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toGammaSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n",e.compilationString+="#ifdef "+this._gammaDefineName+"\r\n",e.compilationString+=t.associatedVariableName+" = toLinearSpace("+t.associatedVariableName+");\r\n",e.compilationString+="#endif\r\n"},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target!==s.NodeMaterialBlockTargets.Vertex){this._tempTextureRead=t._getFreeVariableName("tempTextureRead"),t._emit2DSampler(this._samplerName),t.sharedData.blockingBlocks.push(this),t.sharedData.textureBlocks.push(this),t.sharedData.blocksWithDefines.push(this),this._linearDefineName=t._getFreeDefineName("ISLINEAR"),this._gammaDefineName=t._getFreeDefineName("ISGAMMA");var r="//"+this.name;t._emitFunctionFromInclude("helperFunctions",r),t.compilationString+="vec4 "+this._tempTextureRead+" = texture2D("+this._samplerName+", "+this.uv.associatedVariableName+");\r\n";for(var n=0,i=this._outputs;n<i.length;n++){var o=i[n];o.hasEndpoints&&this._writeOutput(t,o,o.name)}return this}},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.convertToGammaSpace=this.convertToGammaSpace,t.convertToLinearSpace=this.convertToLinearSpace,this.texture&&(t.texture=this.texture.serialize()),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.convertToGammaSpace=t.convertToGammaSpace,this.convertToLinearSpace=!!t.convertToLinearSpace,t.texture&&(n=0===t.texture.url.indexOf("data:")?"":n,this.texture=c.Texture.Parse(t.texture,r,n))},t}(i.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.ParticleTextureBlock"]=u},"./Materials/Node/Blocks/Vertex/bonesBlock.ts":
- /*!****************************************************!*\
- !*** ./Materials/Node/Blocks/Vertex/bonesBlock.ts ***!
- \****************************************************/
- /*! exports provided: BonesBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"BonesBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),c=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),d=(r(/*! ../../../../Shaders/ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),function(e){function t(t){var r=e.call(this,t,a.NodeMaterialBlockTargets.Vertex)||this;return r.registerInput("matricesIndices",o.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("matricesWeights",o.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("matricesIndicesExtra",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0),r.registerInput("matricesWeightsExtra",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0),r.registerInput("world",o.NodeMaterialBlockConnectionPointTypes.Matrix),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.initialize=function(e){e._excludeVariableName("boneSampler"),e._excludeVariableName("boneTextureWidth"),e._excludeVariableName("mBones"),e._excludeVariableName("BonesPerMesh")},t.prototype.getClassName=function(){return"BonesBlock"},Object.defineProperty(t.prototype,"matricesIndices",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matricesWeights",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matricesIndicesExtra",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matricesWeightsExtra",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.matricesIndices.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"matricesIndices"===e.name}));t||(t=new c.InputBlock("matricesIndices")).setAsAttribute("matricesIndices"),t.output.connectTo(this.matricesIndices)}if(!this.matricesWeights.isConnected){var r=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"matricesWeights"===e.name}));r||(r=new c.InputBlock("matricesWeights")).setAsAttribute("matricesWeights"),r.output.connectTo(this.matricesWeights)}if(!this.world.isConnected){var n=e.getInputBlockByPredicate((function(e){return e.systemValue===s.NodeMaterialSystemValues.World}));n||(n=new c.InputBlock("world")).setAsSystemValue(s.NodeMaterialSystemValues.World),n.output.connectTo(this.world)}},t.prototype.provideFallbacks=function(e,t){e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton&&t.addCPUSkinningFallback(0,e)},t.prototype.bind=function(e,t,r){l.MaterialHelper.BindBonesParameters(r,e)},t.prototype.prepareDefines=function(e,t,r){r._areAttributesDirty&&l.MaterialHelper.PrepareDefinesForBones(e,r)},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithFallbacks.push(this),t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this),t.uniforms.push("boneTextureWidth"),t.uniforms.push("mBones"),t.samplers.push("boneSampler");var r="//"+this.name;t._emitFunctionFromInclude("bonesDeclaration",r,{removeAttributes:!0,removeUniforms:!1,removeVaryings:!0,removeIfDef:!1});var n=t._getFreeVariableName("influence");t.compilationString+=t._emitCodeFromInclude("bonesVertex",r,{replaceStrings:[{search:/finalWorld=finalWorld\*influence;/,replace:""},{search:/influence/gm,replace:n}]});var i=this._outputs[0],o=this.world;return t.compilationString+="#if NUM_BONE_INFLUENCERS>0\r\n",t.compilationString+=this._declareOutput(i,t)+" = "+o.associatedVariableName+" * "+n+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(i,t)+" = "+o.associatedVariableName+";\r\n",t.compilationString+="#endif\r\n",this},t}(i.NodeMaterialBlock));u._TypeStore.RegisteredTypes["BABYLON.BonesBlock"]=d},"./Materials/Node/Blocks/Vertex/index.ts":
- /*!***********************************************!*\
- !*** ./Materials/Node/Blocks/Vertex/index.ts ***!
- \***********************************************/
- /*! exports provided: VertexOutputBlock, BonesBlock, InstancesBlock, MorphTargetsBlock, LightInformationBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./vertexOutputBlock */"./Materials/Node/Blocks/Vertex/vertexOutputBlock.ts");r.d(t,"VertexOutputBlock",(function(){return n.VertexOutputBlock}));var i=r(/*! ./bonesBlock */"./Materials/Node/Blocks/Vertex/bonesBlock.ts");r.d(t,"BonesBlock",(function(){return i.BonesBlock}));var o=r(/*! ./instancesBlock */"./Materials/Node/Blocks/Vertex/instancesBlock.ts");r.d(t,"InstancesBlock",(function(){return o.InstancesBlock}));var s=r(/*! ./morphTargetsBlock */"./Materials/Node/Blocks/Vertex/morphTargetsBlock.ts");r.d(t,"MorphTargetsBlock",(function(){return s.MorphTargetsBlock}));var a=r(/*! ./lightInformationBlock */"./Materials/Node/Blocks/Vertex/lightInformationBlock.ts");r.d(t,"LightInformationBlock",(function(){return a.LightInformationBlock}))},"./Materials/Node/Blocks/Vertex/instancesBlock.ts":
- /*!********************************************************!*\
- !*** ./Materials/Node/Blocks/Vertex/instancesBlock.ts ***!
- \********************************************************/
- /*! exports provided: InstancesBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"InstancesBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),a=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),l=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),c=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),u=function(e){function t(t){var r=e.call(this,t,o.NodeMaterialBlockTargets.Vertex)||this;return r.registerInput("world0",s.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("world1",s.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("world2",s.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("world3",s.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("world",s.NodeMaterialBlockConnectionPointTypes.Matrix,!0),r.registerOutput("output",s.NodeMaterialBlockConnectionPointTypes.Matrix),r.registerOutput("instanceID",s.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"InstancesBlock"},Object.defineProperty(t.prototype,"world0",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world1",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world2",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world3",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"world",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceID",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.world0.connectedPoint){var t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"world0"===e.name}));t||(t=new l.InputBlock("world0")).setAsAttribute("world0"),t.output.connectTo(this.world0)}if(!this.world1.connectedPoint){var r=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"world1"===e.name}));r||(r=new l.InputBlock("world1")).setAsAttribute("world1"),r.output.connectTo(this.world1)}if(!this.world2.connectedPoint){var n=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"world2"===e.name}));n||(n=new l.InputBlock("world2")).setAsAttribute("world2"),n.output.connectTo(this.world2)}if(!this.world3.connectedPoint){var i=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"world3"===e.name}));i||(i=new l.InputBlock("world3")).setAsAttribute("world3"),i.output.connectTo(this.world3)}if(!this.world.connectedPoint){var o=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"world"===e.name}));o||(o=new l.InputBlock("world")).setAsSystemValue(a.NodeMaterialSystemValues.World),o.output.connectTo(this.world)}this.world.define="!INSTANCES || THIN_INSTANCES"},t.prototype.prepareDefines=function(e,t,r,n,i){void 0===n&&(n=!1);var o=!1;r.INSTANCES!==n&&(r.setValue("INSTANCES",n),o=!0),i&&r.THIN_INSTANCES!==!!(null==i?void 0:i.getRenderingMesh().hasThinInstances)&&(r.setValue("THIN_INSTANCES",!!(null==i?void 0:i.getRenderingMesh().hasThinInstances)),o=!0),o&&r.markAsUnprocessed()},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithDefines.push(this);var r=this._outputs[0],n=this._outputs[1],i=this.world0,o=this.world1,s=this.world2,a=this.world3;return t.compilationString+="#ifdef INSTANCES\r\n",t.compilationString+=this._declareOutput(r,t)+" = mat4("+i.associatedVariableName+", "+o.associatedVariableName+", "+s.associatedVariableName+", "+a.associatedVariableName+");\r\n",t.compilationString+="#ifdef THIN_INSTANCES\r\n",t.compilationString+=r.associatedVariableName+" = "+this.world.associatedVariableName+" * "+r.associatedVariableName+";\r\n",t.compilationString+="#endif\r\n",t.compilationString+=this._declareOutput(n,t)+" = float(gl_InstanceID);\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(r,t)+" = "+this.world.associatedVariableName+";\r\n",t.compilationString+=this._declareOutput(n,t)+" = 0.0;\r\n",t.compilationString+="#endif\r\n",this},t}(i.NodeMaterialBlock);c._TypeStore.RegisteredTypes["BABYLON.InstancesBlock"]=u},"./Materials/Node/Blocks/Vertex/lightInformationBlock.ts":
- /*!***************************************************************!*\
- !*** ./Materials/Node/Blocks/Vertex/lightInformationBlock.ts ***!
- \***************************************************************/
- /*! exports provided: LightInformationBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"LightInformationBlock",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../../../../Lights/pointLight */"./Lights/pointLight.ts"),c=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Vertex)||this;return r.registerInput("worldPosition",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1,s.NodeMaterialBlockTargets.Vertex),r.registerOutput("direction",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("color",o.NodeMaterialBlockConnectionPointTypes.Color3),r.registerOutput("intensity",o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"LightInformationBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"intensity",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),t.prototype.bind=function(e,t,r){if(r){this.light&&this.light.isDisposed&&(this.light=null);var n=this.light,i=t.getScene();if(!n&&i.lights.length&&(n=i.lights[0]),!n||!n.isEnabled)return e.setFloat3(this._lightDataUniformName,0,0,0),void e.setFloat4(this._lightColorUniformName,0,0,0,0);n.transferToNodeMaterialEffect(e,this._lightDataUniformName),e.setColor4(this._lightColorUniformName,n.diffuse,n.intensity)}},t.prototype.prepareDefines=function(e,t,r){if(r._areLightsDirty){var n=this.light;r.setValue(this._lightTypeDefineName,!!(n&&n instanceof l.PointLight))}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.bindableBlocks.push(this),t.sharedData.blocksWithDefines.push(this);var r=this.direction,n=this.color,i=this.intensity;return this._lightDataUniformName=t._getFreeVariableName("lightData"),this._lightColorUniformName=t._getFreeVariableName("lightColor"),this._lightTypeDefineName=t._getFreeDefineName("LIGHTPOINTTYPE"),t._emitUniformFromString(this._lightDataUniformName,"vec3"),t._emitUniformFromString(this._lightColorUniformName,"vec4"),t.compilationString+="#ifdef "+this._lightTypeDefineName+"\r\n",t.compilationString+=this._declareOutput(r,t)+" = normalize("+this.worldPosition.associatedVariableName+".xyz - "+this._lightDataUniformName+");\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(r,t)+" = "+this._lightDataUniformName+";\r\n",t.compilationString+="#endif\r\n",t.compilationString+=this._declareOutput(n,t)+" = "+this._lightColorUniformName+".rgb;\r\n",t.compilationString+=this._declareOutput(i,t)+" = "+this._lightColorUniformName+".a;\r\n",this},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return this.light&&(t.lightId=this.light.id),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),t.lightId&&(this.light=r.getLightByID(t.lightId))},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.LightInformationBlock"]=c},"./Materials/Node/Blocks/Vertex/morphTargetsBlock.ts":
- /*!***********************************************************!*\
- !*** ./Materials/Node/Blocks/Vertex/morphTargetsBlock.ts ***!
- \***********************************************************/
- /*! exports provided: MorphTargetsBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"MorphTargetsBlock",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../../../../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),d=(r(/*! ../../../../Shaders/ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Vertex)||this;return r.registerInput("position",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("normal",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("tangent",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("uv",o.NodeMaterialBlockConnectionPointTypes.Vector2),r.registerOutput("positionOutput",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("normalOutput",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("tangentOutput",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("uvOutput",o.NodeMaterialBlockConnectionPointTypes.Vector2),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"MorphTargetsBlock"},Object.defineProperty(t.prototype,"position",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tangent",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uv",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"positionOutput",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalOutput",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tangentOutput",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uvOutput",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){e._excludeVariableName("morphTargetInfluences")},t.prototype.autoConfigure=function(e){if(!this.position.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"position"===e.name}));t||(t=new c.InputBlock("position")).setAsAttribute(),t.output.connectTo(this.position)}if(!this.normal.isConnected){var r=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"normal"===e.name}));r||(r=new c.InputBlock("normal")).setAsAttribute("normal"),r.output.connectTo(this.normal)}if(!this.tangent.isConnected){var n=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"tangent"===e.name}));n||(n=new c.InputBlock("tangent")).setAsAttribute("tangent"),n.output.connectTo(this.tangent)}if(!this.uv.isConnected){var i=e.getInputBlockByPredicate((function(e){return e.isAttribute&&"uv"===e.name}));i||(i=new c.InputBlock("uv")).setAsAttribute("uv"),i.output.connectTo(this.uv)}},t.prototype.prepareDefines=function(e,t,r){r._areAttributesDirty&&a.MaterialHelper.PrepareDefinesForMorphTargets(e,r)},t.prototype.bind=function(e,t,r){r&&r.morphTargetManager&&r.morphTargetManager.numInfluencers>0&&a.MaterialHelper.BindMorphTargetParameters(r,e)},t.prototype.replaceRepeatableContent=function(e,t,r,n){for(var i=this.position,o=this.normal,s=this.tangent,a=this.uv,c=this.positionOutput,u=this.normalOutput,d=this.tangentOutput,h=this.uvOutput,f=e,p=n.NUM_MORPH_INFLUENCERS,m=r.morphTargetManager,g=m&&m.supportsNormals&&n.NORMAL,_=m&&m.supportsTangents&&n.TANGENT,v=m&&m.supportsUVs&&n.UV1,y="",b=0;b<p;b++)y+="#ifdef MORPHTARGETS\r\n",y+=c.associatedVariableName+" += (position"+b+" - "+i.associatedVariableName+") * morphTargetInfluences["+b+"];\r\n",g&&(y+="#ifdef MORPHTARGETS_NORMAL\r\n",y+=u.associatedVariableName+" += (normal"+b+" - "+o.associatedVariableName+") * morphTargetInfluences["+b+"];\r\n",y+="#endif\r\n"),_&&(y+="#ifdef MORPHTARGETS_TANGENT\r\n",y+=d.associatedVariableName+".xyz += (tangent"+b+" - "+s.associatedVariableName+".xyz) * morphTargetInfluences["+b+"];\r\n",y+="#endif\r\n"),v&&(y+="#ifdef MORPHTARGETS_UV\r\n",y+=h.associatedVariableName+".xy += (uv_"+b+" - "+a.associatedVariableName+".xy) * morphTargetInfluences["+b+"];\r\n",y+="#endif\r\n"),y+="#endif\r\n";if(f.compilationString=f.compilationString.replace(this._repeatableContentAnchor,y),p>0)for(b=0;b<p;b++)f.attributes.push(l.VertexBuffer.PositionKind+b),g&&f.attributes.push(l.VertexBuffer.NormalKind+b),_&&f.attributes.push(l.VertexBuffer.TangentKind+b),v&&f.attributes.push(l.VertexBuffer.UVKind+"_"+b)},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t),t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),t.sharedData.repeatableContentBlocks.push(this);var r=this.position,n=this.normal,i=this.tangent,o=this.uv,s=this.positionOutput,a=this.normalOutput,l=this.tangentOutput,c=this.uvOutput,u="//"+this.name;return t.uniforms.push("morphTargetInfluences"),t._emitFunctionFromInclude("morphTargetsVertexGlobalDeclaration",u),t._emitFunctionFromInclude("morphTargetsVertexDeclaration",u,{repeatKey:"maxSimultaneousMorphTargets"}),t.compilationString+=this._declareOutput(s,t)+" = "+r.associatedVariableName+";\r\n",t.compilationString+="#ifdef NORMAL\r\n",t.compilationString+=this._declareOutput(a,t)+" = "+n.associatedVariableName+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(a,t)+" = vec3(0., 0., 0.);\r\n",t.compilationString+="#endif\r\n",t.compilationString+="#ifdef TANGENT\r\n",t.compilationString+=this._declareOutput(l,t)+" = "+i.associatedVariableName+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(l,t)+" = vec3(0., 0., 0.);\r\n",t.compilationString+="#endif\r\n",t.compilationString+="#ifdef UV1\r\n",t.compilationString+=this._declareOutput(c,t)+" = "+o.associatedVariableName+";\r\n",t.compilationString+="#else\r\n",t.compilationString+=this._declareOutput(c,t)+" = vec2(0., 0.);\r\n",t.compilationString+="#endif\r\n",this._repeatableContentAnchor=t._repeatableContentAnchor,t.compilationString+=this._repeatableContentAnchor,this},t}(i.NodeMaterialBlock));u._TypeStore.RegisteredTypes["BABYLON.MorphTargetsBlock"]=d},"./Materials/Node/Blocks/Vertex/vertexOutputBlock.ts":
- /*!***********************************************************!*\
- !*** ./Materials/Node/Blocks/Vertex/vertexOutputBlock.ts ***!
- \***********************************************************/
- /*! exports provided: VertexOutputBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"VertexOutputBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Vertex,!0)||this;return r.registerInput("vector",o.NodeMaterialBlockConnectionPointTypes.Vector4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VertexOutputBlock"},Object.defineProperty(t.prototype,"vector",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.vector;return t.compilationString+="gl_Position = "+r.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.VertexOutputBlock"]=l},"./Materials/Node/Blocks/addBlock.ts":
- /*!*******************************************!*\
- !*** ./Materials/Node/Blocks/addBlock.ts ***!
- \*******************************************/
- /*! exports provided: AddBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"AddBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AddBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = "+this.left.associatedVariableName+" + "+this.right.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.AddBlock"]=l},"./Materials/Node/Blocks/arcTan2Block.ts":
- /*!***********************************************!*\
- !*** ./Materials/Node/Blocks/arcTan2Block.ts ***!
- \***********************************************/
- /*! exports provided: ArcTan2Block */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcTan2Block",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("x",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("y",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ArcTan2Block"},Object.defineProperty(t.prototype,"x",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = atan("+this.x.associatedVariableName+", "+this.y.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ArcTan2Block"]=l},"./Materials/Node/Blocks/clampBlock.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/Blocks/clampBlock.ts ***!
- \*********************************************/
- /*! exports provided: ClampBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ClampBlock",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),c=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.minimum=0,r.maximum=1,r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ClampBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = clamp("+this.value.associatedVariableName+", "+this._writeFloat(this.minimum)+", "+this._writeFloat(this.maximum)+");\r\n",this},t.prototype._dumpPropertiesCode=function(){var e=this._codeVariableName+".minimum = "+this.minimum+";\r\n";return e+=this._codeVariableName+".maximum = "+this.maximum+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.minimum=this.minimum,t.maximum=this.maximum,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.minimum=t.minimum,this.maximum=t.maximum},Object(n.__decorate)([Object(l.editableInPropertyPage)("Minimum",l.PropertyTypeForEdition.Float)],t.prototype,"minimum",void 0),Object(n.__decorate)([Object(l.editableInPropertyPage)("Maximum",l.PropertyTypeForEdition.Float)],t.prototype,"maximum",void 0),t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ClampBlock"]=c},"./Materials/Node/Blocks/colorMergerBlock.ts":
- /*!***************************************************!*\
- !*** ./Materials/Node/Blocks/colorMergerBlock.ts ***!
- \***************************************************/
- /*! exports provided: ColorMergerBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorMergerBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("rgb ",o.NodeMaterialBlockConnectionPointTypes.Color3,!0),r.registerInput("r",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("g",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("b",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("a",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerOutput("rgba",o.NodeMaterialBlockConnectionPointTypes.Color4),r.registerOutput("rgb",o.NodeMaterialBlockConnectionPointTypes.Color3),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ColorMergerBlock"},Object.defineProperty(t.prototype,"rgbIn",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgbOut",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this.rgbOut},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.r,n=this.g,i=this.b,o=this.a,s=this.rgbIn,a=this._outputs[0],l=this._outputs[1];return s.isConnected?a.hasEndpoints?t.compilationString+=this._declareOutput(a,t)+" = vec4("+s.associatedVariableName+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":l.hasEndpoints&&(t.compilationString+=this._declareOutput(l,t)+" = "+s.associatedVariableName+";\r\n"):a.hasEndpoints?t.compilationString+=this._declareOutput(a,t)+" = vec4("+(r.isConnected?this._writeVariable(r):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(i.isConnected?this._writeVariable(i):"0.0")+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":l.hasEndpoints&&(t.compilationString+=this._declareOutput(l,t)+" = vec3("+(r.isConnected?this._writeVariable(r):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(i.isConnected?this._writeVariable(i):"0.0")+");\r\n"),this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ColorMergerBlock"]=l},"./Materials/Node/Blocks/colorSplitterBlock.ts":
- /*!*****************************************************!*\
- !*** ./Materials/Node/Blocks/colorSplitterBlock.ts ***!
- \*****************************************************/
- /*! exports provided: ColorSplitterBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorSplitterBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("rgba",o.NodeMaterialBlockConnectionPointTypes.Color4,!0),r.registerInput("rgb ",o.NodeMaterialBlockConnectionPointTypes.Color3,!0),r.registerOutput("rgb",o.NodeMaterialBlockConnectionPointTypes.Color3),r.registerOutput("r",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("g",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("b",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("a",o.NodeMaterialBlockConnectionPointTypes.Float),r.inputsAreExclusive=!0,r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ColorSplitterBlock"},Object.defineProperty(t.prototype,"rgba",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgbIn",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgbOut",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"r",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),t.prototype._inputRename=function(e){return"rgb "===e?"rgbIn":e},t.prototype._outputRename=function(e){return"rgb"===e?"rgbOut":e},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.rgba.isConnected?this.rgba:this.rgbIn;if(r.isConnected){var n=this._outputs[0],i=this._outputs[1],o=this._outputs[2],s=this._outputs[3],a=this._outputs[4];return n.hasEndpoints&&(t.compilationString+=this._declareOutput(n,t)+" = "+r.associatedVariableName+".rgb;\r\n"),i.hasEndpoints&&(t.compilationString+=this._declareOutput(i,t)+" = "+r.associatedVariableName+".r;\r\n"),o.hasEndpoints&&(t.compilationString+=this._declareOutput(o,t)+" = "+r.associatedVariableName+".g;\r\n"),s.hasEndpoints&&(t.compilationString+=this._declareOutput(s,t)+" = "+r.associatedVariableName+".b;\r\n"),a.hasEndpoints&&(t.compilationString+=this._declareOutput(a,t)+" = "+r.associatedVariableName+".a;\r\n"),this}},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ColorSplitterBlock"]=l},"./Materials/Node/Blocks/crossBlock.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/Blocks/crossBlock.ts ***!
- \*********************************************/
- /*! exports provided: CrossBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"CrossBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector3),r._linkConnectionTypes(0,1),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector2),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector2),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"CrossBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = cross("+this.left.associatedVariableName+".xyz, "+this.right.associatedVariableName+".xyz);\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.CrossBlock"]=l},"./Materials/Node/Blocks/desaturateBlock.ts":
- /*!**************************************************!*\
- !*** ./Materials/Node/Blocks/desaturateBlock.ts ***!
- \**************************************************/
- /*! exports provided: DesaturateBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"DesaturateBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("color",o.NodeMaterialBlockConnectionPointTypes.Color3),r.registerInput("level",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Color3),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DesaturateBlock"},Object.defineProperty(t.prototype,"color",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n=this.color.associatedVariableName,i=t._getFreeVariableName("colorMin"),o=t._getFreeVariableName("colorMax"),s=t._getFreeVariableName("colorMerge");return t.compilationString+="float "+i+" = min(min("+n+".x, "+n+".y), "+n+".z);\r\n",t.compilationString+="float "+o+" = max(max("+n+".x, "+n+".y), "+n+".z);\r\n",t.compilationString+="float "+s+" = 0.5 * ("+i+" + "+o+");\r\n",t.compilationString+=this._declareOutput(r,t)+" = mix("+n+", vec3("+s+", "+s+", "+s+"), "+this.level.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.DesaturateBlock"]=l},"./Materials/Node/Blocks/distanceBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/distanceBlock.ts ***!
- \************************************************/
- /*! exports provided: DistanceBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"DistanceBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r._linkConnectionTypes(0,1),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DistanceBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = length("+this.left.associatedVariableName+" - "+this.right.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.DistanceBlock"]=l},"./Materials/Node/Blocks/divideBlock.ts":
- /*!**********************************************!*\
- !*** ./Materials/Node/Blocks/divideBlock.ts ***!
- \**********************************************/
- /*! exports provided: DivideBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"DivideBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DivideBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = "+this.left.associatedVariableName+" / "+this.right.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.DivideBlock"]=l},"./Materials/Node/Blocks/dotBlock.ts":
- /*!*******************************************!*\
- !*** ./Materials/Node/Blocks/dotBlock.ts ***!
- \*******************************************/
- /*! exports provided: DotBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"DotBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r._linkConnectionTypes(0,1),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DotBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = dot("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.DotBlock"]=l},"./Materials/Node/Blocks/fresnelBlock.ts":
- /*!***********************************************!*\
- !*** ./Materials/Node/Blocks/fresnelBlock.ts ***!
- \***********************************************/
- /*! exports provided: FresnelBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"FresnelBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ./Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),c=(r(/*! ../../../Shaders/ShadersInclude/fresnelFunction */"./Shaders/ShadersInclude/fresnelFunction.ts"),r(/*! ./viewDirectionBlock */"./Materials/Node/Blocks/viewDirectionBlock.ts")),u=function(e){function t(t){var r=e.call(this,t,o.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("worldNormal",s.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("viewDirection",s.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("bias",s.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("power",s.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("fresnel",s.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FresnelBlock"},Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewDirection",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bias",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"power",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fresnel",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.viewDirection.isConnected){var t=new c.ViewDirectionBlock("View direction");t.output.connectTo(this.viewDirection),t.autoConfigure(e)}if(!this.bias.isConnected){var r=new l.InputBlock("bias");r.value=0,r.output.connectTo(this.bias)}if(!this.power.isConnected){var n=new l.InputBlock("power");n.value=1,n.output.connectTo(this.power)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r="//"+this.name;return t._emitFunctionFromInclude("fresnelFunction",r,{removeIfDef:!0}),t.compilationString+=this._declareOutput(this.fresnel,t)+" = computeFresnelTerm("+this.viewDirection.associatedVariableName+".xyz, "+this.worldNormal.associatedVariableName+".xyz, "+this.bias.associatedVariableName+", "+this.power.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.FresnelBlock"]=u},"./Materials/Node/Blocks/gradientBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/gradientBlock.ts ***!
- \************************************************/
- /*! exports provided: GradientBlockColorStep, GradientBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"GradientBlockColorStep",(function(){return c})),r.d(t,"GradientBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../../../Maths/math.color */"./Maths/math.color.ts"),c=function(e,t){this.step=e,this.color=t},u=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.colorSteps=[new c(0,l.Color3.Black()),new c(1,l.Color3.White())],r.registerInput("gradient",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector2),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"GradientBlock"},Object.defineProperty(t.prototype,"gradient",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._writeColorConstant=function(e){var t=this.colorSteps[e];return"vec3("+t.color.r+", "+t.color.g+", "+t.color.b+")"},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];if(this.colorSteps.length&&this.gradient.connectedPoint){var n=t._getFreeVariableName("gradientTempColor"),i=t._getFreeVariableName("gradientTempPosition");t.compilationString+="vec3 "+n+" = "+this._writeColorConstant(0)+";\r\n",t.compilationString+="float "+i+";\r\n";var s=this.gradient.associatedVariableName;this.gradient.connectedPoint.type!==o.NodeMaterialBlockConnectionPointTypes.Float&&(s+=".x");for(var a=1;a<this.colorSteps.length;a++){var l=this.colorSteps[a],c=this.colorSteps[a-1];t.compilationString+=i+" = clamp(("+s+" - "+t._emitFloat(c.step)+") / ("+t._emitFloat(l.step)+" - "+t._emitFloat(c.step)+"), 0.0, 1.0) * step("+t._emitFloat(a)+", "+t._emitFloat(this.colorSteps.length-1)+");\r\n",t.compilationString+=n+" = mix("+n+", "+this._writeColorConstant(a)+", "+i+");\r\n"}return t.compilationString+=this._declareOutput(r,t)+" = "+n+";\r\n",this}t.compilationString+=this._declareOutput(r,t)+" = vec3(0., 0., 0.);\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.colorSteps=this.colorSteps,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.colorSteps=[];for(var i=0,o=t.colorSteps;i<o.length;i++){var s=o[i];this.colorSteps.push(new c(s.step,new l.Color3(s.color.r,s.color.g,s.color.b)))}},t.prototype._dumpPropertiesCode=function(){for(var e="",t=0,r=this.colorSteps;t<r.length;t++){var n=r[t];e+=this._codeVariableName+".colorSteps.push(new BABYLON.GradientBlockColorStep("+n.step+", new BABYLON.Color3("+n.color.r+", "+n.color.g+", "+n.color.b+")));\r\n"}return e},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.GradientBlock"]=u},"./Materials/Node/Blocks/index.ts":
- /*!****************************************!*\
- !*** ./Materials/Node/Blocks/index.ts ***!
- \****************************************/
- /*! exports provided: VertexOutputBlock, BonesBlock, InstancesBlock, MorphTargetsBlock, LightInformationBlock, FragmentOutputBlock, ImageProcessingBlock, PerturbNormalBlock, DiscardBlock, FrontFacingBlock, DerivativeBlock, FragCoordBlock, ScreenSizeBlock, FogBlock, LightBlock, TextureBlock, ReflectionTextureBlock, CurrentScreenBlock, InputBlock, AnimatedInputBlockTypes, MultiplyBlock, AddBlock, ScaleBlock, ClampBlock, CrossBlock, DotBlock, TransformBlock, RemapBlock, NormalizeBlock, TrigonometryBlockOperations, TrigonometryBlock, ColorMergerBlock, VectorMergerBlock, ColorSplitterBlock, VectorSplitterBlock, LerpBlock, DivideBlock, SubtractBlock, StepBlock, OneMinusBlock, ViewDirectionBlock, FresnelBlock, MaxBlock, MinBlock, DistanceBlock, LengthBlock, NegateBlock, PowBlock, RandomNumberBlock, ArcTan2Block, SmoothStepBlock, ReciprocalBlock, ReplaceColorBlock, PosterizeBlock, WaveBlockKind, WaveBlock, GradientBlockColorStep, GradientBlock, NLerpBlock, WorleyNoise3DBlock, SimplexPerlin3DBlock, NormalBlendBlock, Rotate2dBlock, ReflectBlock, RefractBlock, DesaturateBlock, PBRMetallicRoughnessBlock, SheenBlock, AmbientOcclusionBlock, ReflectivityBlock, AnisotropyBlock, ReflectionBlock, ClearCoatBlock, RefractionBlock, SubSurfaceBlock, ParticleTextureBlock, ParticleRampGradientBlock, ParticleBlendMultiplyBlock, ModBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Vertex/index */"./Materials/Node/Blocks/Vertex/index.ts");r.d(t,"VertexOutputBlock",(function(){return n.VertexOutputBlock})),r.d(t,"BonesBlock",(function(){return n.BonesBlock})),r.d(t,"InstancesBlock",(function(){return n.InstancesBlock})),r.d(t,"MorphTargetsBlock",(function(){return n.MorphTargetsBlock})),r.d(t,"LightInformationBlock",(function(){return n.LightInformationBlock}));var i=r(/*! ./Fragment/index */"./Materials/Node/Blocks/Fragment/index.ts");r.d(t,"FragmentOutputBlock",(function(){return i.FragmentOutputBlock})),r.d(t,"ImageProcessingBlock",(function(){return i.ImageProcessingBlock})),r.d(t,"PerturbNormalBlock",(function(){return i.PerturbNormalBlock})),r.d(t,"DiscardBlock",(function(){return i.DiscardBlock})),r.d(t,"FrontFacingBlock",(function(){return i.FrontFacingBlock})),r.d(t,"DerivativeBlock",(function(){return i.DerivativeBlock})),r.d(t,"FragCoordBlock",(function(){return i.FragCoordBlock})),r.d(t,"ScreenSizeBlock",(function(){return i.ScreenSizeBlock}));var o=r(/*! ./Dual/index */"./Materials/Node/Blocks/Dual/index.ts");r.d(t,"FogBlock",(function(){return o.FogBlock})),r.d(t,"LightBlock",(function(){return o.LightBlock})),r.d(t,"TextureBlock",(function(){return o.TextureBlock})),r.d(t,"ReflectionTextureBlock",(function(){return o.ReflectionTextureBlock})),r.d(t,"CurrentScreenBlock",(function(){return o.CurrentScreenBlock}));var s=r(/*! ./Input/index */"./Materials/Node/Blocks/Input/index.ts");r.d(t,"InputBlock",(function(){return s.InputBlock})),r.d(t,"AnimatedInputBlockTypes",(function(){return s.AnimatedInputBlockTypes}));var a=r(/*! ./multiplyBlock */"./Materials/Node/Blocks/multiplyBlock.ts");r.d(t,"MultiplyBlock",(function(){return a.MultiplyBlock}));var l=r(/*! ./addBlock */"./Materials/Node/Blocks/addBlock.ts");r.d(t,"AddBlock",(function(){return l.AddBlock}));var c=r(/*! ./scaleBlock */"./Materials/Node/Blocks/scaleBlock.ts");r.d(t,"ScaleBlock",(function(){return c.ScaleBlock}));var u=r(/*! ./clampBlock */"./Materials/Node/Blocks/clampBlock.ts");r.d(t,"ClampBlock",(function(){return u.ClampBlock}));var d=r(/*! ./crossBlock */"./Materials/Node/Blocks/crossBlock.ts");r.d(t,"CrossBlock",(function(){return d.CrossBlock}));var h=r(/*! ./dotBlock */"./Materials/Node/Blocks/dotBlock.ts");r.d(t,"DotBlock",(function(){return h.DotBlock}));var f=r(/*! ./transformBlock */"./Materials/Node/Blocks/transformBlock.ts");r.d(t,"TransformBlock",(function(){return f.TransformBlock}));var p=r(/*! ./remapBlock */"./Materials/Node/Blocks/remapBlock.ts");r.d(t,"RemapBlock",(function(){return p.RemapBlock}));var m=r(/*! ./normalizeBlock */"./Materials/Node/Blocks/normalizeBlock.ts");r.d(t,"NormalizeBlock",(function(){return m.NormalizeBlock}));var g=r(/*! ./trigonometryBlock */"./Materials/Node/Blocks/trigonometryBlock.ts");r.d(t,"TrigonometryBlockOperations",(function(){return g.TrigonometryBlockOperations})),r.d(t,"TrigonometryBlock",(function(){return g.TrigonometryBlock}));var _=r(/*! ./colorMergerBlock */"./Materials/Node/Blocks/colorMergerBlock.ts");r.d(t,"ColorMergerBlock",(function(){return _.ColorMergerBlock}));var v=r(/*! ./vectorMergerBlock */"./Materials/Node/Blocks/vectorMergerBlock.ts");r.d(t,"VectorMergerBlock",(function(){return v.VectorMergerBlock}));var y=r(/*! ./colorSplitterBlock */"./Materials/Node/Blocks/colorSplitterBlock.ts");r.d(t,"ColorSplitterBlock",(function(){return y.ColorSplitterBlock}));var b=r(/*! ./vectorSplitterBlock */"./Materials/Node/Blocks/vectorSplitterBlock.ts");r.d(t,"VectorSplitterBlock",(function(){return b.VectorSplitterBlock}));var A=r(/*! ./lerpBlock */"./Materials/Node/Blocks/lerpBlock.ts");r.d(t,"LerpBlock",(function(){return A.LerpBlock}));var T=r(/*! ./divideBlock */"./Materials/Node/Blocks/divideBlock.ts");r.d(t,"DivideBlock",(function(){return T.DivideBlock}));var M=r(/*! ./subtractBlock */"./Materials/Node/Blocks/subtractBlock.ts");r.d(t,"SubtractBlock",(function(){return M.SubtractBlock}));var P=r(/*! ./stepBlock */"./Materials/Node/Blocks/stepBlock.ts");r.d(t,"StepBlock",(function(){return P.StepBlock}));var S=r(/*! ./oneMinusBlock */"./Materials/Node/Blocks/oneMinusBlock.ts");r.d(t,"OneMinusBlock",(function(){return S.OneMinusBlock}));var E=r(/*! ./viewDirectionBlock */"./Materials/Node/Blocks/viewDirectionBlock.ts");r.d(t,"ViewDirectionBlock",(function(){return E.ViewDirectionBlock}));var C=r(/*! ./fresnelBlock */"./Materials/Node/Blocks/fresnelBlock.ts");r.d(t,"FresnelBlock",(function(){return C.FresnelBlock}));var x=r(/*! ./maxBlock */"./Materials/Node/Blocks/maxBlock.ts");r.d(t,"MaxBlock",(function(){return x.MaxBlock}));var R=r(/*! ./minBlock */"./Materials/Node/Blocks/minBlock.ts");r.d(t,"MinBlock",(function(){return R.MinBlock}));var O=r(/*! ./distanceBlock */"./Materials/Node/Blocks/distanceBlock.ts");r.d(t,"DistanceBlock",(function(){return O.DistanceBlock}));var I=r(/*! ./lengthBlock */"./Materials/Node/Blocks/lengthBlock.ts");r.d(t,"LengthBlock",(function(){return I.LengthBlock}));var D=r(/*! ./negateBlock */"./Materials/Node/Blocks/negateBlock.ts");r.d(t,"NegateBlock",(function(){return D.NegateBlock}));var B=r(/*! ./powBlock */"./Materials/Node/Blocks/powBlock.ts");r.d(t,"PowBlock",(function(){return B.PowBlock}));var N=r(/*! ./randomNumberBlock */"./Materials/Node/Blocks/randomNumberBlock.ts");r.d(t,"RandomNumberBlock",(function(){return N.RandomNumberBlock}));var L=r(/*! ./arcTan2Block */"./Materials/Node/Blocks/arcTan2Block.ts");r.d(t,"ArcTan2Block",(function(){return L.ArcTan2Block}));var w=r(/*! ./smoothStepBlock */"./Materials/Node/Blocks/smoothStepBlock.ts");r.d(t,"SmoothStepBlock",(function(){return w.SmoothStepBlock}));var F=r(/*! ./reciprocalBlock */"./Materials/Node/Blocks/reciprocalBlock.ts");r.d(t,"ReciprocalBlock",(function(){return F.ReciprocalBlock}));var V=r(/*! ./replaceColorBlock */"./Materials/Node/Blocks/replaceColorBlock.ts");r.d(t,"ReplaceColorBlock",(function(){return V.ReplaceColorBlock}));var k=r(/*! ./posterizeBlock */"./Materials/Node/Blocks/posterizeBlock.ts");r.d(t,"PosterizeBlock",(function(){return k.PosterizeBlock}));var U=r(/*! ./waveBlock */"./Materials/Node/Blocks/waveBlock.ts");r.d(t,"WaveBlockKind",(function(){return U.WaveBlockKind})),r.d(t,"WaveBlock",(function(){return U.WaveBlock}));var z=r(/*! ./gradientBlock */"./Materials/Node/Blocks/gradientBlock.ts");r.d(t,"GradientBlockColorStep",(function(){return z.GradientBlockColorStep})),r.d(t,"GradientBlock",(function(){return z.GradientBlock}));var G=r(/*! ./nLerpBlock */"./Materials/Node/Blocks/nLerpBlock.ts");r.d(t,"NLerpBlock",(function(){return G.NLerpBlock}));var j=r(/*! ./worleyNoise3DBlock */"./Materials/Node/Blocks/worleyNoise3DBlock.ts");r.d(t,"WorleyNoise3DBlock",(function(){return j.WorleyNoise3DBlock}));var H=r(/*! ./simplexPerlin3DBlock */"./Materials/Node/Blocks/simplexPerlin3DBlock.ts");r.d(t,"SimplexPerlin3DBlock",(function(){return H.SimplexPerlin3DBlock}));var W=r(/*! ./normalBlendBlock */"./Materials/Node/Blocks/normalBlendBlock.ts");r.d(t,"NormalBlendBlock",(function(){return W.NormalBlendBlock}));var X=r(/*! ./rotate2dBlock */"./Materials/Node/Blocks/rotate2dBlock.ts");r.d(t,"Rotate2dBlock",(function(){return X.Rotate2dBlock}));var Y=r(/*! ./reflectBlock */"./Materials/Node/Blocks/reflectBlock.ts");r.d(t,"ReflectBlock",(function(){return Y.ReflectBlock}));var Q=r(/*! ./refractBlock */"./Materials/Node/Blocks/refractBlock.ts");r.d(t,"RefractBlock",(function(){return Q.RefractBlock}));var K=r(/*! ./desaturateBlock */"./Materials/Node/Blocks/desaturateBlock.ts");r.d(t,"DesaturateBlock",(function(){return K.DesaturateBlock}));var q=r(/*! ./PBR/index */"./Materials/Node/Blocks/PBR/index.ts");r.d(t,"PBRMetallicRoughnessBlock",(function(){return q.PBRMetallicRoughnessBlock})),r.d(t,"SheenBlock",(function(){return q.SheenBlock})),r.d(t,"AmbientOcclusionBlock",(function(){return q.AmbientOcclusionBlock})),r.d(t,"ReflectivityBlock",(function(){return q.ReflectivityBlock})),r.d(t,"AnisotropyBlock",(function(){return q.AnisotropyBlock})),r.d(t,"ReflectionBlock",(function(){return q.ReflectionBlock})),r.d(t,"ClearCoatBlock",(function(){return q.ClearCoatBlock})),r.d(t,"RefractionBlock",(function(){return q.RefractionBlock})),r.d(t,"SubSurfaceBlock",(function(){return q.SubSurfaceBlock}));var Z=r(/*! ./Particle/index */"./Materials/Node/Blocks/Particle/index.ts");r.d(t,"ParticleTextureBlock",(function(){return Z.ParticleTextureBlock})),r.d(t,"ParticleRampGradientBlock",(function(){return Z.ParticleRampGradientBlock})),r.d(t,"ParticleBlendMultiplyBlock",(function(){return Z.ParticleBlendMultiplyBlock}));var J=r(/*! ./modBlock */"./Materials/Node/Blocks/modBlock.ts");r.d(t,"ModBlock",(function(){return J.ModBlock}))},"./Materials/Node/Blocks/lengthBlock.ts":
- /*!**********************************************!*\
- !*** ./Materials/Node/Blocks/lengthBlock.ts ***!
- \**********************************************/
- /*! exports provided: LengthBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"LengthBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"LengthBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = length("+this.value.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.LengthBlock"]=l},"./Materials/Node/Blocks/lerpBlock.ts":
- /*!********************************************!*\
- !*** ./Materials/Node/Blocks/lerpBlock.ts ***!
- \********************************************/
- /*! exports provided: LerpBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"LerpBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("gradient",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r._linkConnectionTypes(1,2),r._inputs[2].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"LerpBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradient",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = mix("+this.left.associatedVariableName+" , "+this.right.associatedVariableName+", "+this.gradient.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.LerpBlock"]=l},"./Materials/Node/Blocks/maxBlock.ts":
- /*!*******************************************!*\
- !*** ./Materials/Node/Blocks/maxBlock.ts ***!
- \*******************************************/
- /*! exports provided: MaxBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"MaxBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"MaxBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = max("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.MaxBlock"]=l},"./Materials/Node/Blocks/minBlock.ts":
- /*!*******************************************!*\
- !*** ./Materials/Node/Blocks/minBlock.ts ***!
- \*******************************************/
- /*! exports provided: MinBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"MinBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"MinBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = min("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.MinBlock"]=l},"./Materials/Node/Blocks/modBlock.ts":
- /*!*******************************************!*\
- !*** ./Materials/Node/Blocks/modBlock.ts ***!
- \*******************************************/
- /*! exports provided: ModBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ModBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ModBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = mod("+this.left.associatedVariableName+", "+this.right.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ModBlock"]=l},"./Materials/Node/Blocks/multiplyBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/multiplyBlock.ts ***!
- \************************************************/
- /*! exports provided: MultiplyBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiplyBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"MultiplyBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = "+this.left.associatedVariableName+" * "+this.right.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.MultiplyBlock"]=l},"./Materials/Node/Blocks/nLerpBlock.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/Blocks/nLerpBlock.ts ***!
- \*********************************************/
- /*! exports provided: NLerpBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"NLerpBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("gradient",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"NLerpBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradient",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = normalize(mix("+this.left.associatedVariableName+" , "+this.right.associatedVariableName+", "+this.gradient.associatedVariableName+"));\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.NLerpBlock"]=l},"./Materials/Node/Blocks/negateBlock.ts":
- /*!**********************************************!*\
- !*** ./Materials/Node/Blocks/negateBlock.ts ***!
- \**********************************************/
- /*! exports provided: NegateBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"NegateBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"NegateBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = -1.0 * "+this.value.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.NegateBlock"]=l},"./Materials/Node/Blocks/normalBlendBlock.ts":
- /*!***************************************************!*\
- !*** ./Materials/Node/Blocks/normalBlendBlock.ts ***!
- \***************************************************/
- /*! exports provided: NormalBlendBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"NormalBlendBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("normalMap0",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("normalMap1",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"NormalBlendBlock"},Object.defineProperty(t.prototype,"normalMap0",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normalMap1",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n=this._inputs[0],i=this._inputs[1],o=t._getFreeVariableName("stepR"),s=t._getFreeVariableName("stepG");return t.compilationString+="float "+o+" = step(0.5, "+n.associatedVariableName+".r);\r\n",t.compilationString+="float "+s+" = step(0.5, "+n.associatedVariableName+".g);\r\n",t.compilationString+=this._declareOutput(r,t)+";\r\n",t.compilationString+=r.associatedVariableName+".r = (1.0 - "+o+") * "+n.associatedVariableName+".r * "+i.associatedVariableName+".r * 2.0 + "+o+" * (1.0 - "+n.associatedVariableName+".r) * (1.0 - "+i.associatedVariableName+".r) * 2.0;\r\n",t.compilationString+=r.associatedVariableName+".g = (1.0 - "+s+") * "+n.associatedVariableName+".g * "+i.associatedVariableName+".g * 2.0 + "+s+" * (1.0 - "+n.associatedVariableName+".g) * (1.0 - "+i.associatedVariableName+".g) * 2.0;\r\n",t.compilationString+=r.associatedVariableName+".b = "+n.associatedVariableName+".b * "+i.associatedVariableName+".b;\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.NormalBlendBlock"]=l},"./Materials/Node/Blocks/normalizeBlock.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/Blocks/normalizeBlock.ts ***!
- \*************************************************/
- /*! exports provided: NormalizeBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"NormalizeBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"NormalizeBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n=this._inputs[0];return t.compilationString+=this._declareOutput(r,t)+" = normalize("+n.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.NormalizeBlock"]=l},"./Materials/Node/Blocks/oneMinusBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/oneMinusBlock.ts ***!
- \************************************************/
- /*! exports provided: OneMinusBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"OneMinusBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._outputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"OneMinusBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = 1. - "+this.input.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.OneMinusBlock"]=l,a._TypeStore.RegisteredTypes["BABYLON.OppositeBlock"]=l},"./Materials/Node/Blocks/posterizeBlock.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/Blocks/posterizeBlock.ts ***!
- \*************************************************/
- /*! exports provided: PosterizeBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"PosterizeBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("steps",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PosterizeBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"steps",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = floor("+this.value.associatedVariableName+" / (1.0 / "+this.steps.associatedVariableName+")) * (1.0 / "+this.steps.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.PosterizeBlock"]=l},"./Materials/Node/Blocks/powBlock.ts":
- /*!*******************************************!*\
- !*** ./Materials/Node/Blocks/powBlock.ts ***!
- \*******************************************/
- /*! exports provided: PowBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"PowBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("power",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PowBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"power",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = pow("+this.value.associatedVariableName+", "+this.power.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.PowBlock"]=l},"./Materials/Node/Blocks/randomNumberBlock.ts":
- /*!****************************************************!*\
- !*** ./Materials/Node/Blocks/randomNumberBlock.ts ***!
- \****************************************************/
- /*! exports provided: RandomNumberBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"RandomNumberBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=(r(/*! ../../../Shaders/ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("seed",o.NodeMaterialBlockConnectionPointTypes.Vector2),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"RandomNumberBlock"},Object.defineProperty(t.prototype,"seed",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n="//"+this.name;return t._emitFunctionFromInclude("helperFunctions",n),t.compilationString+=this._declareOutput(r,t)+" = getRand("+this.seed.associatedVariableName+".xy);\r\n",this},t}(i.NodeMaterialBlock));a._TypeStore.RegisteredTypes["BABYLON.RandomNumberBlock"]=l},"./Materials/Node/Blocks/reciprocalBlock.ts":
- /*!**************************************************!*\
- !*** ./Materials/Node/Blocks/reciprocalBlock.ts ***!
- \**************************************************/
- /*! exports provided: ReciprocalBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReciprocalBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._outputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ReciprocalBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = 1. / "+this.input.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ReciprocalBlock"]=l},"./Materials/Node/Blocks/reflectBlock.ts":
- /*!***********************************************!*\
- !*** ./Materials/Node/Blocks/reflectBlock.ts ***!
- \***********************************************/
- /*! exports provided: ReflectBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReflectBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("incident",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("normal",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ReflectBlock"},Object.defineProperty(t.prototype,"incident",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = reflect("+this.incident.associatedVariableName+".xyz, "+this.normal.associatedVariableName+".xyz);\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ReflectBlock"]=l},"./Materials/Node/Blocks/refractBlock.ts":
- /*!***********************************************!*\
- !*** ./Materials/Node/Blocks/refractBlock.ts ***!
- \***********************************************/
- /*! exports provided: RefractBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"RefractBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("incident",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("normal",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("ior",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[0].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Vector4),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color3),r._inputs[1].acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"RefractBlock"},Object.defineProperty(t.prototype,"incident",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ior",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = refract("+this.incident.associatedVariableName+".xyz, "+this.normal.associatedVariableName+".xyz, "+this.ior.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.RefractBlock"]=l},"./Materials/Node/Blocks/remapBlock.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/Blocks/remapBlock.ts ***!
- \*********************************************/
- /*! exports provided: RemapBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"RemapBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),u=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.sourceRange=new l.Vector2(-1,1),r.targetRange=new l.Vector2(0,1),r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("sourceMin",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("sourceMax",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("targetMin",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("targetMax",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"RemapBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceMin",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sourceMax",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetMin",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetMax",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n=this.sourceMin.isConnected?this.sourceMin.associatedVariableName:this._writeFloat(this.sourceRange.x),i=this.sourceMax.isConnected?this.sourceMax.associatedVariableName:this._writeFloat(this.sourceRange.y),o=this.targetMin.isConnected?this.targetMin.associatedVariableName:this._writeFloat(this.targetRange.x),s=this.targetMax.isConnected?this.targetMax.associatedVariableName:this._writeFloat(this.targetRange.y);return t.compilationString+=this._declareOutput(r,t)+" = "+o+" + ("+this._inputs[0].associatedVariableName+" - "+n+") * ("+s+" - "+o+") / ("+i+" - "+n+");\r\n",this},t.prototype._dumpPropertiesCode=function(){var e=this._codeVariableName+".sourceRange = new BABYLON.Vector2("+this.sourceRange.x+", "+this.sourceRange.y+");\r\n";return e+=this._codeVariableName+".targetRange = new BABYLON.Vector2("+this.targetRange.x+", "+this.targetRange.y+");\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.sourceRange=this.sourceRange.asArray(),t.targetRange=this.targetRange.asArray(),t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.sourceRange=l.Vector2.FromArray(t.sourceRange),this.targetRange=l.Vector2.FromArray(t.targetRange)},Object(n.__decorate)([Object(c.editableInPropertyPage)("From",c.PropertyTypeForEdition.Vector2)],t.prototype,"sourceRange",void 0),Object(n.__decorate)([Object(c.editableInPropertyPage)("To",c.PropertyTypeForEdition.Vector2)],t.prototype,"targetRange",void 0),t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.RemapBlock"]=u},"./Materials/Node/Blocks/replaceColorBlock.ts":
- /*!****************************************************!*\
- !*** ./Materials/Node/Blocks/replaceColorBlock.ts ***!
- \****************************************************/
- /*! exports provided: ReplaceColorBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ReplaceColorBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("reference",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("distance",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("replacement",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r._linkConnectionTypes(0,3),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[0].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[1].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r._inputs[3].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Float),r._inputs[3].excludedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ReplaceColorBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"distance",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"replacement",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+";\r\n",t.compilationString+="if (length("+this.value.associatedVariableName+" - "+this.reference.associatedVariableName+") < "+this.distance.associatedVariableName+") {\r\n",t.compilationString+=r.associatedVariableName+" = "+this.replacement.associatedVariableName+";\r\n",t.compilationString+="} else {\r\n",t.compilationString+=r.associatedVariableName+" = "+this.value.associatedVariableName+";\r\n",t.compilationString+="}\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ReplaceColorBlock"]=l},"./Materials/Node/Blocks/rotate2dBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/rotate2dBlock.ts ***!
- \************************************************/
- /*! exports provided: Rotate2dBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"Rotate2dBlock",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ./Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),c=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.Vector2),r.registerInput("angle",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector2),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"Rotate2dBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.angle.isConnected){var t=new l.InputBlock("angle");t.value=0,t.output.connectTo(this.angle)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],n=this.angle,i=this.input;return t.compilationString+=this._declareOutput(r,t)+" = vec2(cos("+n.associatedVariableName+") * "+i.associatedVariableName+".x - sin("+n.associatedVariableName+") * "+i.associatedVariableName+".y, sin("+n.associatedVariableName+") * "+i.associatedVariableName+".x + cos("+n.associatedVariableName+") * "+i.associatedVariableName+".y);\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.Rotate2dBlock"]=c},"./Materials/Node/Blocks/scaleBlock.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/Blocks/scaleBlock.ts ***!
- \*********************************************/
- /*! exports provided: ScaleBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ScaleBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("factor",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ScaleBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factor",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = "+this.input.associatedVariableName+" * "+this.factor.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ScaleBlock"]=l},"./Materials/Node/Blocks/simplexPerlin3DBlock.ts":
- /*!*******************************************************!*\
- !*** ./Materials/Node/Blocks/simplexPerlin3DBlock.ts ***!
- \*******************************************************/
- /*! exports provided: SimplexPerlin3DBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"SimplexPerlin3DBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("seed",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"SimplexPerlin3DBlock"},Object.defineProperty(t.prototype,"seed",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this.seed.isConnected&&this._outputs[0].hasEndpoints)return t._emitFunction("SimplexPerlin3D","const float SKEWFACTOR = 1.0/3.0;\r\nconst float UNSKEWFACTOR = 1.0/6.0;\r\nconst float SIMPLEX_CORNER_POS = 0.5;\r\nconst float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\r\nfloat SimplexPerlin3D( vec3 P ){\r\n P *= SIMPLEX_TETRAHADRON_HEIGHT;\r\n vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) ); vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\r\n vec3 g = step(x0.yzx, x0.xyz);\r\n vec3 l = 1.0 - g;\r\n vec3 Pi_1 = min( g.xyz, l.zxy );\r\n vec3 Pi_2 = max( g.xyz, l.zxy );\r\n vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\r\n vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\r\n vec3 x3 = x0 - SIMPLEX_CORNER_POS;\r\n vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\r\n vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\r\n vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\r\n Pi.xyz = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\r\n vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\r\n vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\r\n Pt *= Pt;\r\n vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\r\n Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\r\n const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\r\n const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\r\n vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\r\n vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\r\n Pi_1 = ( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods;\r\n Pi_2 = ( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods;\r\n vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\r\n vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\r\n vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\r\n vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\r\n const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\r\n vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\r\n kernel_weights = max(0.5 - kernel_weights, 0.0);\r\n kernel_weights = kernel_weights*kernel_weights*kernel_weights;\r\n return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\r\n}\r\n","// SimplexPerlin3D"),t.compilationString+=this._declareOutput(this._outputs[0],t)+" = SimplexPerlin3D("+this.seed.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.SimplexPerlin3DBlock"]=l},"./Materials/Node/Blocks/smoothStepBlock.ts":
- /*!**************************************************!*\
- !*** ./Materials/Node/Blocks/smoothStepBlock.ts ***!
- \**************************************************/
- /*! exports provided: SmoothStepBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"SmoothStepBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("edge0",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("edge1",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"SmoothStepBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge0",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge1",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = smoothstep("+this.edge0.associatedVariableName+", "+this.edge1.associatedVariableName+", "+this.value.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.SmoothStepBlock"]=l},"./Materials/Node/Blocks/stepBlock.ts":
- /*!********************************************!*\
- !*** ./Materials/Node/Blocks/stepBlock.ts ***!
- \********************************************/
- /*! exports provided: StepBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"StepBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("value",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerInput("edge",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Float),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StepBlock"},Object.defineProperty(t.prototype,"value",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = step("+this.edge.associatedVariableName+", "+this.value.associatedVariableName+");\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.StepBlock"]=l},"./Materials/Node/Blocks/subtractBlock.ts":
- /*!************************************************!*\
- !*** ./Materials/Node/Blocks/subtractBlock.ts ***!
- \************************************************/
- /*! exports provided: SubtractBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"SubtractBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("left",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("right",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._linkConnectionTypes(0,1),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"SubtractBlock"},Object.defineProperty(t.prototype,"left",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = "+this.left.associatedVariableName+" - "+this.right.associatedVariableName+";\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.SubtractBlock"]=l},"./Materials/Node/Blocks/transformBlock.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/Blocks/transformBlock.ts ***!
- \*************************************************/
- /*! exports provided: TransformBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"TransformBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Vertex)||this;return r.complementW=1,r.complementZ=0,r.registerInput("vector",o.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerInput("transform",o.NodeMaterialBlockConnectionPointTypes.Matrix),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerOutput("xyz",o.NodeMaterialBlockConnectionPointTypes.Vector3),r._inputs[0].onConnectionObservable.add((function(e){if(e.ownerBlock.isInput){var t=e.ownerBlock;"normal"!==t.name&&"tangent"!==t.name||(r.complementW=0)}})),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"TransformBlock"},Object.defineProperty(t.prototype,"vector",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyz",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.vector,n=this.transform;if(r.connectedPoint){if(0===this.complementW){var i="//"+this.name;t._emitFunctionFromInclude("helperFunctions",i),t.sharedData.blocksWithDefines.push(this);var s=t._getFreeVariableName(n.associatedVariableName+"_NUS");switch(t.compilationString+="mat3 "+s+" = mat3("+n.associatedVariableName+");\r\n",t.compilationString+="#ifdef NONUNIFORMSCALING\r\n",t.compilationString+=s+" = transposeMat3(inverseMat3("+s+"));\r\n",t.compilationString+="#endif\r\n",r.connectedPoint.type){case o.NodeMaterialBlockConnectionPointTypes.Vector2:t.compilationString+=this._declareOutput(this.output,t)+" = vec4("+s+" * vec3("+r.associatedVariableName+", "+this._writeFloat(this.complementZ)+"), "+this._writeFloat(this.complementW)+");\r\n";break;case o.NodeMaterialBlockConnectionPointTypes.Vector3:case o.NodeMaterialBlockConnectionPointTypes.Color3:t.compilationString+=this._declareOutput(this.output,t)+" = vec4("+s+" * "+r.associatedVariableName+", "+this._writeFloat(this.complementW)+");\r\n";break;default:t.compilationString+=this._declareOutput(this.output,t)+" = vec4("+s+" * "+r.associatedVariableName+".xyz, "+this._writeFloat(this.complementW)+");\r\n"}}else switch(s=n.associatedVariableName,r.connectedPoint.type){case o.NodeMaterialBlockConnectionPointTypes.Vector2:t.compilationString+=this._declareOutput(this.output,t)+" = "+s+" * vec4("+r.associatedVariableName+", "+this._writeFloat(this.complementZ)+", "+this._writeFloat(this.complementW)+");\r\n";break;case o.NodeMaterialBlockConnectionPointTypes.Vector3:case o.NodeMaterialBlockConnectionPointTypes.Color3:t.compilationString+=this._declareOutput(this.output,t)+" = "+s+" * vec4("+r.associatedVariableName+", "+this._writeFloat(this.complementW)+");\r\n";break;default:t.compilationString+=this._declareOutput(this.output,t)+" = "+s+" * "+r.associatedVariableName+";\r\n"}this.xyz.hasEndpoints&&(t.compilationString+=this._declareOutput(this.xyz,t)+" = "+this.output.associatedVariableName+".xyz;\r\n")}return this},t.prototype.prepareDefines=function(e,t,r,n,i){void 0===n&&(n=!1),e.nonUniformScaling&&r.setValue("NONUNIFORMSCALING",!0)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.complementZ=this.complementZ,t.complementW=this.complementW,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.complementZ=void 0!==t.complementZ?t.complementZ:0,this.complementW=void 0!==t.complementW?t.complementW:1},t.prototype._dumpPropertiesCode=function(){var e=this._codeVariableName+".complementZ = "+this.complementZ+";\r\n";return e+=this._codeVariableName+".complementW = "+this.complementW+";\r\n"},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.TransformBlock"]=l},"./Materials/Node/Blocks/trigonometryBlock.ts":
- /*!****************************************************!*\
- !*** ./Materials/Node/Blocks/trigonometryBlock.ts ***!
- \****************************************************/
- /*! exports provided: TrigonometryBlockOperations, TrigonometryBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"TrigonometryBlockOperations",(function(){return n})),r.d(t,"TrigonometryBlock",(function(){return c}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),s=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),a=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts");!function(e){e[e.Cos=0]="Cos",e[e.Sin=1]="Sin",e[e.Abs=2]="Abs",e[e.Exp=3]="Exp",e[e.Exp2=4]="Exp2",e[e.Round=5]="Round",e[e.Floor=6]="Floor",e[e.Ceiling=7]="Ceiling",e[e.Sqrt=8]="Sqrt",e[e.Log=9]="Log",e[e.Tan=10]="Tan",e[e.ArcTan=11]="ArcTan",e[e.ArcCos=12]="ArcCos",e[e.ArcSin=13]="ArcSin",e[e.Fract=14]="Fract",e[e.Sign=15]="Sign",e[e.Radians=16]="Radians",e[e.Degrees=17]="Degrees"}(n||(n={}));var c=function(e){function t(t){var r=e.call(this,t,a.NodeMaterialBlockTargets.Neutral)||this;return r.operation=n.Cos,r.registerInput("input",s.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",s.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r}return Object(i.__extends)(t,e),t.prototype.getClassName=function(){return"TrigonometryBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0],i="";switch(this.operation){case n.Cos:i="cos";break;case n.Sin:i="sin";break;case n.Abs:i="abs";break;case n.Exp:i="exp";break;case n.Exp2:i="exp2";break;case n.Round:i="round";break;case n.Floor:i="floor";break;case n.Ceiling:i="ceil";break;case n.Sqrt:i="sqrt";break;case n.Log:i="log";break;case n.Tan:i="tan";break;case n.ArcTan:i="atan";break;case n.ArcCos:i="acos";break;case n.ArcSin:i="asin";break;case n.Fract:i="fract";break;case n.Sign:i="sign";break;case n.Radians:i="radians";break;case n.Degrees:i="degrees"}return t.compilationString+=this._declareOutput(r,t)+" = "+i+"("+this.input.associatedVariableName+");\r\n",this},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.operation=this.operation,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.operation=t.operation},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".operation = BABYLON.TrigonometryBlockOperations."+n[this.operation]+";\r\n"},t}(o.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.TrigonometryBlock"]=c},"./Materials/Node/Blocks/vectorMergerBlock.ts":
- /*!****************************************************!*\
- !*** ./Materials/Node/Blocks/vectorMergerBlock.ts ***!
- \****************************************************/
- /*! exports provided: VectorMergerBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"VectorMergerBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("xyz ",o.NodeMaterialBlockConnectionPointTypes.Vector3,!0),r.registerInput("xy ",o.NodeMaterialBlockConnectionPointTypes.Vector2,!0),r.registerInput("x",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("y",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("z",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerInput("w",o.NodeMaterialBlockConnectionPointTypes.Float,!0),r.registerOutput("xyzw",o.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerOutput("xyz",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("xy",o.NodeMaterialBlockConnectionPointTypes.Vector2),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VectorMergerBlock"},Object.defineProperty(t.prototype,"xyzIn",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyIn",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._inputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._inputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this._inputs[5]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzw",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzOut",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyOut",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xy",{get:function(){return this.xyOut},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyz",{get:function(){return this.xyzOut},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.x,n=this.y,i=this.z,o=this.w,s=this.xyIn,a=this.xyzIn,l=this._outputs[0],c=this._outputs[1],u=this._outputs[2];return s.isConnected?l.hasEndpoints?t.compilationString+=this._declareOutput(l,t)+" = vec4("+s.associatedVariableName+", "+(i.isConnected?this._writeVariable(i):"0.0")+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":c.hasEndpoints?t.compilationString+=this._declareOutput(c,t)+" = vec3("+s.associatedVariableName+", "+(i.isConnected?this._writeVariable(i):"0.0")+");\r\n":u.hasEndpoints&&(t.compilationString+=this._declareOutput(u,t)+" = "+s.associatedVariableName+";\r\n"):a.isConnected?l.hasEndpoints?t.compilationString+=this._declareOutput(l,t)+" = vec4("+a.associatedVariableName+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":c.hasEndpoints?t.compilationString+=this._declareOutput(c,t)+" = "+a.associatedVariableName+";\r\n":u.hasEndpoints&&(t.compilationString+=this._declareOutput(u,t)+" = "+a.associatedVariableName+".xy;\r\n"):l.hasEndpoints?t.compilationString+=this._declareOutput(l,t)+" = vec4("+(r.isConnected?this._writeVariable(r):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(i.isConnected?this._writeVariable(i):"0.0")+", "+(o.isConnected?this._writeVariable(o):"0.0")+");\r\n":c.hasEndpoints?t.compilationString+=this._declareOutput(c,t)+" = vec3("+(r.isConnected?this._writeVariable(r):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+", "+(i.isConnected?this._writeVariable(i):"0.0")+");\r\n":u.hasEndpoints&&(t.compilationString+=this._declareOutput(u,t)+" = vec2("+(r.isConnected?this._writeVariable(r):"0.0")+", "+(n.isConnected?this._writeVariable(n):"0.0")+");\r\n"),this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.VectorMergerBlock"]=l},"./Materials/Node/Blocks/vectorSplitterBlock.ts":
- /*!******************************************************!*\
- !*** ./Materials/Node/Blocks/vectorSplitterBlock.ts ***!
- \******************************************************/
- /*! exports provided: VectorSplitterBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"VectorSplitterBlock",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("xyzw",o.NodeMaterialBlockConnectionPointTypes.Vector4,!0),r.registerInput("xyz ",o.NodeMaterialBlockConnectionPointTypes.Vector3,!0),r.registerInput("xy ",o.NodeMaterialBlockConnectionPointTypes.Vector2,!0),r.registerOutput("xyz",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("xy",o.NodeMaterialBlockConnectionPointTypes.Vector2),r.registerOutput("x",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("y",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("z",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("w",o.NodeMaterialBlockConnectionPointTypes.Float),r.inputsAreExclusive=!0,r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VectorSplitterBlock"},Object.defineProperty(t.prototype,"xyzw",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzIn",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyIn",{get:function(){return this._inputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyzOut",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xyOut",{get:function(){return this._outputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._outputs[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._outputs[3]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._outputs[4]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this._outputs[5]},enumerable:!1,configurable:!0}),t.prototype._inputRename=function(e){switch(e){case"xy ":return"xyIn";case"xyz ":return"xyzIn";default:return e}},t.prototype._outputRename=function(e){switch(e){case"xy":return"xyOut";case"xyz":return"xyzOut";default:return e}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this.xyzw.isConnected?this.xyzw:this.xyzIn.isConnected?this.xyzIn:this.xyIn,n=this._outputs[0],i=this._outputs[1],o=this._outputs[2],s=this._outputs[3],a=this._outputs[4],l=this._outputs[5];return n.hasEndpoints&&(r===this.xyIn?t.compilationString+=this._declareOutput(n,t)+" = vec3("+r.associatedVariableName+", 0.0);\r\n":t.compilationString+=this._declareOutput(n,t)+" = "+r.associatedVariableName+".xyz;\r\n"),i.hasEndpoints&&(t.compilationString+=this._declareOutput(i,t)+" = "+r.associatedVariableName+".xy;\r\n"),o.hasEndpoints&&(t.compilationString+=this._declareOutput(o,t)+" = "+r.associatedVariableName+".x;\r\n"),s.hasEndpoints&&(t.compilationString+=this._declareOutput(s,t)+" = "+r.associatedVariableName+".y;\r\n"),a.hasEndpoints&&(t.compilationString+=this._declareOutput(a,t)+" = "+r.associatedVariableName+".z;\r\n"),l.hasEndpoints&&(t.compilationString+=this._declareOutput(l,t)+" = "+r.associatedVariableName+".w;\r\n"),this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.VectorSplitterBlock"]=l},"./Materials/Node/Blocks/viewDirectionBlock.ts":
- /*!*****************************************************!*\
- !*** ./Materials/Node/Blocks/viewDirectionBlock.ts ***!
- \*****************************************************/
- /*! exports provided: ViewDirectionBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"ViewDirectionBlock",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),c=r(/*! ./Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.registerInput("worldPosition",o.NodeMaterialBlockConnectionPointTypes.Vector4),r.registerInput("cameraPosition",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector3),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ViewDirectionBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate((function(e){return e.systemValue===l.NodeMaterialSystemValues.CameraPosition}));t||(t=new c.InputBlock("cameraPosition")).setAsSystemValue(l.NodeMaterialSystemValues.CameraPosition),t.output.connectTo(this.cameraPosition)}},t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];return t.compilationString+=this._declareOutput(r,t)+" = normalize("+this.cameraPosition.associatedVariableName+" - "+this.worldPosition.associatedVariableName+".xyz);\r\n",this},t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.ViewDirectionBlock"]=u},"./Materials/Node/Blocks/waveBlock.ts":
- /*!********************************************!*\
- !*** ./Materials/Node/Blocks/waveBlock.ts ***!
- \********************************************/
- /*! exports provided: WaveBlockKind, WaveBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"WaveBlockKind",(function(){return n})),r.d(t,"WaveBlock",(function(){return c}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),s=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),a=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),l=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts");!function(e){e[e.SawTooth=0]="SawTooth",e[e.Square=1]="Square",e[e.Triangle=2]="Triangle"}(n||(n={}));var c=function(e){function t(t){var r=e.call(this,t,a.NodeMaterialBlockTargets.Neutral)||this;return r.kind=n.SawTooth,r.registerInput("input",s.NodeMaterialBlockConnectionPointTypes.AutoDetect),r.registerOutput("output",s.NodeMaterialBlockConnectionPointTypes.BasedOnInput),r._outputs[0]._typeConnectionSource=r._inputs[0],r._inputs[0].excludedConnectionPointTypes.push(s.NodeMaterialBlockConnectionPointTypes.Matrix),r}return Object(i.__extends)(t,e),t.prototype.getClassName=function(){return"WaveBlock"},Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){e.prototype._buildBlock.call(this,t);var r=this._outputs[0];switch(this.kind){case n.SawTooth:t.compilationString+=this._declareOutput(r,t)+" = "+this.input.associatedVariableName+" - floor(0.5 + "+this.input.associatedVariableName+");\r\n";break;case n.Square:t.compilationString+=this._declareOutput(r,t)+" = 1.0 - 2.0 * round(fract("+this.input.associatedVariableName+"));\r\n";break;case n.Triangle:t.compilationString+=this._declareOutput(r,t)+" = 2.0 * abs(2.0 * ("+this.input.associatedVariableName+" - floor(0.5 + "+this.input.associatedVariableName+"))) - 1.0;\r\n"}return this},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.kind=this.kind,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.kind=t.kind},t}(o.NodeMaterialBlock);l._TypeStore.RegisteredTypes["BABYLON.WaveBlock"]=c},"./Materials/Node/Blocks/worleyNoise3DBlock.ts":
- /*!*****************************************************!*\
- !*** ./Materials/Node/Blocks/worleyNoise3DBlock.ts ***!
- \*****************************************************/
- /*! exports provided: WorleyNoise3DBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"WorleyNoise3DBlock",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),l=r(/*! ../nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts"),c=function(e){function t(t){var r=e.call(this,t,s.NodeMaterialBlockTargets.Neutral)||this;return r.manhattanDistance=!1,r.registerInput("seed",o.NodeMaterialBlockConnectionPointTypes.Vector3),r.registerInput("jitter",o.NodeMaterialBlockConnectionPointTypes.Float),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Vector2),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"WorleyNoise3DBlock"},Object.defineProperty(t.prototype,"seed",{get:function(){return this._inputs[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jitter",{get:function(){return this._inputs[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!1,configurable:!0}),t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),this.seed.isConnected&&this._outputs[0].hasEndpoints)return t._emitFunction("worley3D","vec3 permute(vec3 x){\r\n return mod((34.0 * x + 1.0) * x, 289.0);\r\n}\r\n\r\nvec3 dist(vec3 x, vec3 y, vec3 z, bool manhattanDistance){\r\n return manhattanDistance ? abs(x) + abs(y) + abs(z) : (x * x + y * y + z * z);\r\n}\r\n\r\nvec2 worley(vec3 P, float jitter, bool manhattanDistance){\r\n float K = 0.142857142857; // 1/7\r\n float Ko = 0.428571428571; // 1/2-K/2\r\n float K2 = 0.020408163265306; // 1/(7*7)\r\n float Kz = 0.166666666667; // 1/6\r\n float Kzo = 0.416666666667; // 1/2-1/6*2\r\n\r\n vec3 Pi = mod(floor(P), 289.0);\r\n vec3 Pf = fract(P) - 0.5;\r\n\r\n vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\r\n vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\r\n vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\r\n\r\n vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\r\n vec3 p1 = permute(p + Pi.y - 1.0);\r\n vec3 p2 = permute(p + Pi.y);\r\n vec3 p3 = permute(p + Pi.y + 1.0);\r\n\r\n vec3 p11 = permute(p1 + Pi.z - 1.0);\r\n vec3 p12 = permute(p1 + Pi.z);\r\n vec3 p13 = permute(p1 + Pi.z + 1.0);\r\n\r\n vec3 p21 = permute(p2 + Pi.z - 1.0);\r\n vec3 p22 = permute(p2 + Pi.z);\r\n vec3 p23 = permute(p2 + Pi.z + 1.0);\r\n\r\n vec3 p31 = permute(p3 + Pi.z - 1.0);\r\n vec3 p32 = permute(p3 + Pi.z);\r\n vec3 p33 = permute(p3 + Pi.z + 1.0);\r\n\r\n vec3 ox11 = fract(p11*K) - Ko;\r\n vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\r\n vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\r\n\r\n vec3 ox12 = fract(p12*K) - Ko;\r\n vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\r\n vec3 oz12 = floor(p12*K2)*Kz - Kzo;\r\n\r\n vec3 ox13 = fract(p13*K) - Ko;\r\n vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\r\n vec3 oz13 = floor(p13*K2)*Kz - Kzo;\r\n\r\n vec3 ox21 = fract(p21*K) - Ko;\r\n vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\r\n vec3 oz21 = floor(p21*K2)*Kz - Kzo;\r\n\r\n vec3 ox22 = fract(p22*K) - Ko;\r\n vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\r\n vec3 oz22 = floor(p22*K2)*Kz - Kzo;\r\n\r\n vec3 ox23 = fract(p23*K) - Ko;\r\n vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\r\n vec3 oz23 = floor(p23*K2)*Kz - Kzo;\r\n\r\n vec3 ox31 = fract(p31*K) - Ko;\r\n vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\r\n vec3 oz31 = floor(p31*K2)*Kz - Kzo;\r\n\r\n vec3 ox32 = fract(p32*K) - Ko;\r\n vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\r\n vec3 oz32 = floor(p32*K2)*Kz - Kzo;\r\n\r\n vec3 ox33 = fract(p33*K) - Ko;\r\n vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\r\n vec3 oz33 = floor(p33*K2)*Kz - Kzo;\r\n\r\n vec3 dx11 = Pfx + jitter*ox11;\r\n vec3 dy11 = Pfy.x + jitter*oy11;\r\n vec3 dz11 = Pfz.x + jitter*oz11;\r\n\r\n vec3 dx12 = Pfx + jitter*ox12;\r\n vec3 dy12 = Pfy.x + jitter*oy12;\r\n vec3 dz12 = Pfz.y + jitter*oz12;\r\n\r\n vec3 dx13 = Pfx + jitter*ox13;\r\n vec3 dy13 = Pfy.x + jitter*oy13;\r\n vec3 dz13 = Pfz.z + jitter*oz13;\r\n\r\n vec3 dx21 = Pfx + jitter*ox21;\r\n vec3 dy21 = Pfy.y + jitter*oy21;\r\n vec3 dz21 = Pfz.x + jitter*oz21;\r\n\r\n vec3 dx22 = Pfx + jitter*ox22;\r\n vec3 dy22 = Pfy.y + jitter*oy22;\r\n vec3 dz22 = Pfz.y + jitter*oz22;\r\n\r\n vec3 dx23 = Pfx + jitter*ox23;\r\n vec3 dy23 = Pfy.y + jitter*oy23;\r\n vec3 dz23 = Pfz.z + jitter*oz23;\r\n\r\n vec3 dx31 = Pfx + jitter*ox31;\r\n vec3 dy31 = Pfy.z + jitter*oy31;\r\n vec3 dz31 = Pfz.x + jitter*oz31;\r\n\r\n vec3 dx32 = Pfx + jitter*ox32;\r\n vec3 dy32 = Pfy.z + jitter*oy32;\r\n vec3 dz32 = Pfz.y + jitter*oz32;\r\n\r\n vec3 dx33 = Pfx + jitter*ox33;\r\n vec3 dy33 = Pfy.z + jitter*oy33;\r\n vec3 dz33 = Pfz.z + jitter*oz33;\r\n\r\n vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\r\n vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);\r\n vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\r\n vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\r\n vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\r\n vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\r\n vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\r\n vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\r\n vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\r\n\r\n vec3 d1a = min(d11, d12);\r\n d12 = max(d11, d12);\r\n d11 = min(d1a, d13); // Smallest now not in d12 or d13\r\n d13 = max(d1a, d13);\r\n d12 = min(d12, d13); // 2nd smallest now not in d13\r\n vec3 d2a = min(d21, d22);\r\n d22 = max(d21, d22);\r\n d21 = min(d2a, d23); // Smallest now not in d22 or d23\r\n d23 = max(d2a, d23);\r\n d22 = min(d22, d23); // 2nd smallest now not in d23\r\n vec3 d3a = min(d31, d32);\r\n d32 = max(d31, d32);\r\n d31 = min(d3a, d33); // Smallest now not in d32 or d33\r\n d33 = max(d3a, d33);\r\n d32 = min(d32, d33); // 2nd smallest now not in d33\r\n vec3 da = min(d11, d21);\r\n d21 = max(d11, d21);\r\n d11 = min(da, d31); // Smallest now in d11\r\n d31 = max(da, d31); // 2nd smallest now not in d31\r\n d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;\r\n d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest\r\n d12 = min(d12, d21); // 2nd smallest now not in d21\r\n d12 = min(d12, d22); // nor in d22\r\n d12 = min(d12, d31); // nor in d31\r\n d12 = min(d12, d32); // nor in d32\r\n d11.yz = min(d11.yz,d12.xy); // nor in d12.yz\r\n d11.y = min(d11.y,d12.z); // Only two more to go\r\n d11.y = min(d11.y,d11.z); // Done! (Phew!)\r\n return sqrt(d11.xy); // F1, F2\r\n}\r\n\r\n","// Worley3D"),t.compilationString+=this._declareOutput(this._outputs[0],t)+" = worley("+this.seed.associatedVariableName+", "+this.jitter.associatedVariableName+", "+this.manhattanDistance+");\r\n",this},t.prototype._dumpPropertiesCode=function(){return this._codeVariableName+".manhattanDistance = "+this.manhattanDistance+";\r\n"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.manhattanDistance=this.manhattanDistance,t},t.prototype._deserialize=function(t,r,n){e.prototype._deserialize.call(this,t,r,n),this.manhattanDistance=t.manhattanDistance},Object(n.__decorate)([Object(l.editableInPropertyPage)("Use Manhattan Distance",l.PropertyTypeForEdition.Boolean,"PROPERTIES",{notifiers:{update:!1}})],t.prototype,"manhattanDistance",void 0),t}(i.NodeMaterialBlock);a._TypeStore.RegisteredTypes["BABYLON.WorleyNoise3DBlock"]=c},"./Materials/Node/Enums/index.ts":
- /*!***************************************!*\
- !*** ./Materials/Node/Enums/index.ts ***!
- \***************************************/
- /*! exports provided: NodeMaterialBlockTargets, NodeMaterialBlockConnectionPointTypes, NodeMaterialBlockConnectionPointMode, NodeMaterialSystemValues, NodeMaterialModes */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts");r.d(t,"NodeMaterialBlockTargets",(function(){return n.NodeMaterialBlockTargets}));var i=r(/*! ./nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts");r.d(t,"NodeMaterialBlockConnectionPointTypes",(function(){return i.NodeMaterialBlockConnectionPointTypes}));var o=r(/*! ./nodeMaterialBlockConnectionPointMode */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.ts");r.d(t,"NodeMaterialBlockConnectionPointMode",(function(){return o.NodeMaterialBlockConnectionPointMode}));var s=r(/*! ./nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts");r.d(t,"NodeMaterialSystemValues",(function(){return s.NodeMaterialSystemValues}));var a=r(/*! ./nodeMaterialModes */"./Materials/Node/Enums/nodeMaterialModes.ts");r.d(t,"NodeMaterialModes",(function(){return a.NodeMaterialModes}))},"./Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.ts":
- /*!**********************************************************************!*\
- !*** ./Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.ts ***!
- \**********************************************************************/
- /*! exports provided: NodeMaterialBlockConnectionPointMode */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"NodeMaterialBlockConnectionPointMode",(function(){return n})),function(e){e[e.Uniform=0]="Uniform",e[e.Attribute=1]="Attribute",e[e.Varying=2]="Varying",e[e.Undefined=3]="Undefined"}(n||(n={}))},"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts":
- /*!***********************************************************************!*\
- !*** ./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts ***!
- \***********************************************************************/
- /*! exports provided: NodeMaterialBlockConnectionPointTypes */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"NodeMaterialBlockConnectionPointTypes",(function(){return n})),function(e){e[e.Float=1]="Float",e[e.Int=2]="Int",e[e.Vector2=4]="Vector2",e[e.Vector3=8]="Vector3",e[e.Vector4=16]="Vector4",e[e.Color3=32]="Color3",e[e.Color4=64]="Color4",e[e.Matrix=128]="Matrix",e[e.Object=256]="Object",e[e.AutoDetect=1024]="AutoDetect",e[e.BasedOnInput=2048]="BasedOnInput"}(n||(n={}))},"./Materials/Node/Enums/nodeMaterialBlockTargets.ts":
- /*!**********************************************************!*\
- !*** ./Materials/Node/Enums/nodeMaterialBlockTargets.ts ***!
- \**********************************************************/
- /*! exports provided: NodeMaterialBlockTargets */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"NodeMaterialBlockTargets",(function(){return n})),function(e){e[e.Vertex=1]="Vertex",e[e.Fragment=2]="Fragment",e[e.Neutral=4]="Neutral",e[e.VertexAndFragment=3]="VertexAndFragment"}(n||(n={}))},"./Materials/Node/Enums/nodeMaterialModes.ts":
- /*!***************************************************!*\
- !*** ./Materials/Node/Enums/nodeMaterialModes.ts ***!
- \***************************************************/
- /*! exports provided: NodeMaterialModes */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"NodeMaterialModes",(function(){return n})),function(e){e[e.Material=0]="Material",e[e.PostProcess=1]="PostProcess",e[e.Particle=2]="Particle"}(n||(n={}))},"./Materials/Node/Enums/nodeMaterialSystemValues.ts":
- /*!**********************************************************!*\
- !*** ./Materials/Node/Enums/nodeMaterialSystemValues.ts ***!
- \**********************************************************/
- /*! exports provided: NodeMaterialSystemValues */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"NodeMaterialSystemValues",(function(){return n})),function(e){e[e.World=1]="World",e[e.View=2]="View",e[e.Projection=3]="Projection",e[e.ViewProjection=4]="ViewProjection",e[e.WorldView=5]="WorldView",e[e.WorldViewProjection=6]="WorldViewProjection",e[e.CameraPosition=7]="CameraPosition",e[e.FogColor=8]="FogColor",e[e.DeltaTime=9]="DeltaTime"}(n||(n={}))},"./Materials/Node/Optimizers/index.ts":
- /*!********************************************!*\
- !*** ./Materials/Node/Optimizers/index.ts ***!
- \********************************************/
- /*! exports provided: NodeMaterialOptimizer */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./nodeMaterialOptimizer */"./Materials/Node/Optimizers/nodeMaterialOptimizer.ts");r.d(t,"NodeMaterialOptimizer",(function(){return n.NodeMaterialOptimizer}))},"./Materials/Node/Optimizers/nodeMaterialOptimizer.ts":
- /*!************************************************************!*\
- !*** ./Materials/Node/Optimizers/nodeMaterialOptimizer.ts ***!
- \************************************************************/
- /*! exports provided: NodeMaterialOptimizer */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialOptimizer",(function(){return n}));var n=function(){function e(){}return e.prototype.optimize=function(e,t){},e}()},"./Materials/Node/index.ts":
- /*!*********************************!*\
- !*** ./Materials/Node/index.ts ***!
- \*********************************/
- /*! exports provided: NodeMaterialBlockTargets, NodeMaterialBlockConnectionPointTypes, NodeMaterialBlockConnectionPointMode, NodeMaterialSystemValues, NodeMaterialModes, NodeMaterialConnectionPointCompatibilityStates, NodeMaterialConnectionPointDirection, NodeMaterialConnectionPoint, NodeMaterialBlock, NodeMaterialDefines, NodeMaterial, VertexOutputBlock, BonesBlock, InstancesBlock, MorphTargetsBlock, LightInformationBlock, FragmentOutputBlock, ImageProcessingBlock, PerturbNormalBlock, DiscardBlock, FrontFacingBlock, DerivativeBlock, FragCoordBlock, ScreenSizeBlock, FogBlock, LightBlock, TextureBlock, ReflectionTextureBlock, CurrentScreenBlock, InputBlock, AnimatedInputBlockTypes, MultiplyBlock, AddBlock, ScaleBlock, ClampBlock, CrossBlock, DotBlock, TransformBlock, RemapBlock, NormalizeBlock, TrigonometryBlockOperations, TrigonometryBlock, ColorMergerBlock, VectorMergerBlock, ColorSplitterBlock, VectorSplitterBlock, LerpBlock, DivideBlock, SubtractBlock, StepBlock, OneMinusBlock, ViewDirectionBlock, FresnelBlock, MaxBlock, MinBlock, DistanceBlock, LengthBlock, NegateBlock, PowBlock, RandomNumberBlock, ArcTan2Block, SmoothStepBlock, ReciprocalBlock, ReplaceColorBlock, PosterizeBlock, WaveBlockKind, WaveBlock, GradientBlockColorStep, GradientBlock, NLerpBlock, WorleyNoise3DBlock, SimplexPerlin3DBlock, NormalBlendBlock, Rotate2dBlock, ReflectBlock, RefractBlock, DesaturateBlock, PBRMetallicRoughnessBlock, SheenBlock, AmbientOcclusionBlock, ReflectivityBlock, AnisotropyBlock, ReflectionBlock, ClearCoatBlock, RefractionBlock, SubSurfaceBlock, ParticleTextureBlock, ParticleRampGradientBlock, ParticleBlendMultiplyBlock, ModBlock, NodeMaterialOptimizer, PropertyTypeForEdition, editableInPropertyPage */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Enums/index */"./Materials/Node/Enums/index.ts");r.d(t,"NodeMaterialBlockTargets",(function(){return n.NodeMaterialBlockTargets})),r.d(t,"NodeMaterialBlockConnectionPointTypes",(function(){return n.NodeMaterialBlockConnectionPointTypes})),r.d(t,"NodeMaterialBlockConnectionPointMode",(function(){return n.NodeMaterialBlockConnectionPointMode})),r.d(t,"NodeMaterialSystemValues",(function(){return n.NodeMaterialSystemValues})),r.d(t,"NodeMaterialModes",(function(){return n.NodeMaterialModes}));var i=r(/*! ./nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts");r.d(t,"NodeMaterialConnectionPointCompatibilityStates",(function(){return i.NodeMaterialConnectionPointCompatibilityStates})),r.d(t,"NodeMaterialConnectionPointDirection",(function(){return i.NodeMaterialConnectionPointDirection})),r.d(t,"NodeMaterialConnectionPoint",(function(){return i.NodeMaterialConnectionPoint}));var o=r(/*! ./nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts");r.d(t,"NodeMaterialBlock",(function(){return o.NodeMaterialBlock}));var s=r(/*! ./nodeMaterial */"./Materials/Node/nodeMaterial.ts");r.d(t,"NodeMaterialDefines",(function(){return s.NodeMaterialDefines})),r.d(t,"NodeMaterial",(function(){return s.NodeMaterial}));var a=r(/*! ./Blocks/index */"./Materials/Node/Blocks/index.ts");r.d(t,"VertexOutputBlock",(function(){return a.VertexOutputBlock})),r.d(t,"BonesBlock",(function(){return a.BonesBlock})),r.d(t,"InstancesBlock",(function(){return a.InstancesBlock})),r.d(t,"MorphTargetsBlock",(function(){return a.MorphTargetsBlock})),r.d(t,"LightInformationBlock",(function(){return a.LightInformationBlock})),r.d(t,"FragmentOutputBlock",(function(){return a.FragmentOutputBlock})),r.d(t,"ImageProcessingBlock",(function(){return a.ImageProcessingBlock})),r.d(t,"PerturbNormalBlock",(function(){return a.PerturbNormalBlock})),r.d(t,"DiscardBlock",(function(){return a.DiscardBlock})),r.d(t,"FrontFacingBlock",(function(){return a.FrontFacingBlock})),r.d(t,"DerivativeBlock",(function(){return a.DerivativeBlock})),r.d(t,"FragCoordBlock",(function(){return a.FragCoordBlock})),r.d(t,"ScreenSizeBlock",(function(){return a.ScreenSizeBlock})),r.d(t,"FogBlock",(function(){return a.FogBlock})),r.d(t,"LightBlock",(function(){return a.LightBlock})),r.d(t,"TextureBlock",(function(){return a.TextureBlock})),r.d(t,"ReflectionTextureBlock",(function(){return a.ReflectionTextureBlock})),r.d(t,"CurrentScreenBlock",(function(){return a.CurrentScreenBlock})),r.d(t,"InputBlock",(function(){return a.InputBlock})),r.d(t,"AnimatedInputBlockTypes",(function(){return a.AnimatedInputBlockTypes})),r.d(t,"MultiplyBlock",(function(){return a.MultiplyBlock})),r.d(t,"AddBlock",(function(){return a.AddBlock})),r.d(t,"ScaleBlock",(function(){return a.ScaleBlock})),r.d(t,"ClampBlock",(function(){return a.ClampBlock})),r.d(t,"CrossBlock",(function(){return a.CrossBlock})),r.d(t,"DotBlock",(function(){return a.DotBlock})),r.d(t,"TransformBlock",(function(){return a.TransformBlock})),r.d(t,"RemapBlock",(function(){return a.RemapBlock})),r.d(t,"NormalizeBlock",(function(){return a.NormalizeBlock})),r.d(t,"TrigonometryBlockOperations",(function(){return a.TrigonometryBlockOperations})),r.d(t,"TrigonometryBlock",(function(){return a.TrigonometryBlock})),r.d(t,"ColorMergerBlock",(function(){return a.ColorMergerBlock})),r.d(t,"VectorMergerBlock",(function(){return a.VectorMergerBlock})),r.d(t,"ColorSplitterBlock",(function(){return a.ColorSplitterBlock})),r.d(t,"VectorSplitterBlock",(function(){return a.VectorSplitterBlock})),r.d(t,"LerpBlock",(function(){return a.LerpBlock})),r.d(t,"DivideBlock",(function(){return a.DivideBlock})),r.d(t,"SubtractBlock",(function(){return a.SubtractBlock})),r.d(t,"StepBlock",(function(){return a.StepBlock})),r.d(t,"OneMinusBlock",(function(){return a.OneMinusBlock})),r.d(t,"ViewDirectionBlock",(function(){return a.ViewDirectionBlock})),r.d(t,"FresnelBlock",(function(){return a.FresnelBlock})),r.d(t,"MaxBlock",(function(){return a.MaxBlock})),r.d(t,"MinBlock",(function(){return a.MinBlock})),r.d(t,"DistanceBlock",(function(){return a.DistanceBlock})),r.d(t,"LengthBlock",(function(){return a.LengthBlock})),r.d(t,"NegateBlock",(function(){return a.NegateBlock})),r.d(t,"PowBlock",(function(){return a.PowBlock})),r.d(t,"RandomNumberBlock",(function(){return a.RandomNumberBlock})),r.d(t,"ArcTan2Block",(function(){return a.ArcTan2Block})),r.d(t,"SmoothStepBlock",(function(){return a.SmoothStepBlock})),r.d(t,"ReciprocalBlock",(function(){return a.ReciprocalBlock})),r.d(t,"ReplaceColorBlock",(function(){return a.ReplaceColorBlock})),r.d(t,"PosterizeBlock",(function(){return a.PosterizeBlock})),r.d(t,"WaveBlockKind",(function(){return a.WaveBlockKind})),r.d(t,"WaveBlock",(function(){return a.WaveBlock})),r.d(t,"GradientBlockColorStep",(function(){return a.GradientBlockColorStep})),r.d(t,"GradientBlock",(function(){return a.GradientBlock})),r.d(t,"NLerpBlock",(function(){return a.NLerpBlock})),r.d(t,"WorleyNoise3DBlock",(function(){return a.WorleyNoise3DBlock})),r.d(t,"SimplexPerlin3DBlock",(function(){return a.SimplexPerlin3DBlock})),r.d(t,"NormalBlendBlock",(function(){return a.NormalBlendBlock})),r.d(t,"Rotate2dBlock",(function(){return a.Rotate2dBlock})),r.d(t,"ReflectBlock",(function(){return a.ReflectBlock})),r.d(t,"RefractBlock",(function(){return a.RefractBlock})),r.d(t,"DesaturateBlock",(function(){return a.DesaturateBlock})),r.d(t,"PBRMetallicRoughnessBlock",(function(){return a.PBRMetallicRoughnessBlock})),r.d(t,"SheenBlock",(function(){return a.SheenBlock})),r.d(t,"AmbientOcclusionBlock",(function(){return a.AmbientOcclusionBlock})),r.d(t,"ReflectivityBlock",(function(){return a.ReflectivityBlock})),r.d(t,"AnisotropyBlock",(function(){return a.AnisotropyBlock})),r.d(t,"ReflectionBlock",(function(){return a.ReflectionBlock})),r.d(t,"ClearCoatBlock",(function(){return a.ClearCoatBlock})),r.d(t,"RefractionBlock",(function(){return a.RefractionBlock})),r.d(t,"SubSurfaceBlock",(function(){return a.SubSurfaceBlock})),r.d(t,"ParticleTextureBlock",(function(){return a.ParticleTextureBlock})),r.d(t,"ParticleRampGradientBlock",(function(){return a.ParticleRampGradientBlock})),r.d(t,"ParticleBlendMultiplyBlock",(function(){return a.ParticleBlendMultiplyBlock})),r.d(t,"ModBlock",(function(){return a.ModBlock}));var l=r(/*! ./Optimizers/index */"./Materials/Node/Optimizers/index.ts");r.d(t,"NodeMaterialOptimizer",(function(){return l.NodeMaterialOptimizer}));var c=r(/*! ./nodeMaterialDecorator */"./Materials/Node/nodeMaterialDecorator.ts");r.d(t,"PropertyTypeForEdition",(function(){return c.PropertyTypeForEdition})),r.d(t,"editableInPropertyPage",(function(){return c.editableInPropertyPage}))},"./Materials/Node/nodeMaterial.ts":
- /*!****************************************!*\
- !*** ./Materials/Node/nodeMaterial.ts ***!
- \****************************************/
- /*! exports provided: NodeMaterialDefines, NodeMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialDefines",(function(){return U})),r.d(t,"NodeMaterial",(function(){return z}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../pushMaterial */"./Materials/pushMaterial.ts"),o=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../../Engines/engine */"./Engines/engine.ts"),c=r(/*! ./nodeMaterialBuildState */"./Materials/Node/nodeMaterialBuildState.ts"),u=r(/*! ../../Misc/observable */"./Misc/observable.ts"),d=r(/*! ./Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),h=r(/*! ./nodeMaterialBuildStateSharedData */"./Materials/Node/nodeMaterialBuildStateSharedData.ts"),f=r(/*! ../../Materials/materialDefines */"./Materials/materialDefines.ts"),p=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),m=r(/*! ../../Misc/tools */"./Misc/tools.ts"),g=r(/*! ./Blocks/transformBlock */"./Materials/Node/Blocks/transformBlock.ts"),_=r(/*! ./Blocks/Vertex/vertexOutputBlock */"./Materials/Node/Blocks/Vertex/vertexOutputBlock.ts"),v=r(/*! ./Blocks/Fragment/fragmentOutputBlock */"./Materials/Node/Blocks/Fragment/fragmentOutputBlock.ts"),y=r(/*! ./Blocks/Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),b=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),A=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),T=r(/*! ./Blocks/Dual/currentScreenBlock */"./Materials/Node/Blocks/Dual/currentScreenBlock.ts"),M=r(/*! ./Blocks/Particle/particleTextureBlock */"./Materials/Node/Blocks/Particle/particleTextureBlock.ts"),P=r(/*! ./Blocks/Particle/particleRampGradientBlock */"./Materials/Node/Blocks/Particle/particleRampGradientBlock.ts"),S=r(/*! ./Blocks/Particle/particleBlendMultiplyBlock */"./Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.ts"),E=r(/*! ../effectFallbacks */"./Materials/effectFallbacks.ts"),C=r(/*! ../../Misc/webRequest */"./Misc/webRequest.ts"),x=r(/*! ../effect */"./Materials/effect.ts"),R=r(/*! ../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),O=r(/*! ../../Engines/constants */"./Engines/constants.ts"),I=r(/*! ./Blocks/vectorMergerBlock */"./Materials/Node/Blocks/vectorMergerBlock.ts"),D=r(/*! ./Blocks/remapBlock */"./Materials/Node/Blocks/remapBlock.ts"),B=r(/*! ./Blocks/multiplyBlock */"./Materials/Node/Blocks/multiplyBlock.ts"),N=r(/*! ./Enums/nodeMaterialModes */"./Materials/Node/Enums/nodeMaterialModes.ts"),L=r(/*! ../Textures/texture */"./Materials/Textures/texture.ts"),w=r(/*! ../../Particles/baseParticleSystem */"./Particles/baseParticleSystem.ts"),F=r(/*! ./Blocks/colorSplitterBlock */"./Materials/Node/Blocks/colorSplitterBlock.ts"),V=r(/*! ../../Misc/timingTools */"./Misc/timingTools.ts"),k={effect:null,subMesh:null},U=function(e){function t(){var t=e.call(this)||this;return t.NORMAL=!1,t.TANGENT=!1,t.UV1=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.EXPOSURE=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.BUMPDIRECTUV=0,t.rebuild(),t}return Object(n.__extends)(t,e),t.prototype.setValue=function(e,t,r){void 0===r&&(r=!1),void 0===this[e]&&this._keys.push(e),r&&this[e]!==t&&this.markAsUnprocessed(),this[e]=t},t}(f.MaterialDefines),z=function(e){function t(r,i,o){void 0===o&&(o={});var a=e.call(this,r,i||l.Engine.LastCreatedScene)||this;return a._buildId=t._BuildIdGenerator++,a._buildWasSuccessful=!1,a._cachedWorldViewMatrix=new s.Matrix,a._cachedWorldViewProjectionMatrix=new s.Matrix,a._optimizers=new Array,a._animationFrame=-1,a.BJSNODEMATERIALEDITOR=a._getGlobalNodeMaterialEditor(),a.editorData=null,a.ignoreAlpha=!1,a.maxSimultaneousLights=4,a.onBuildObservable=new u.Observable,a._vertexOutputNodes=new Array,a._fragmentOutputNodes=new Array,a.attachedBlocks=new Array,a._mode=N.NodeMaterialModes.Material,a._options=Object(n.__assign)({emitComments:!1},o),a._attachImageProcessingConfiguration(null),a}return Object(n.__extends)(t,e),t.prototype._getGlobalNodeMaterialEditor=function(){return"undefined"!=typeof NODEEDITOR?NODEEDITOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.NodeEditor?BABYLON:void 0},Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"NodeMaterial"},t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add((function(){t._markAllSubMeshesAsImageProcessingDirty()}))))},t.prototype.getBlockByName=function(e){for(var t=null,r=0,n=this.attachedBlocks;r<n.length;r++){var i=n[r];if(i.name===e){if(t)return m.Tools.Warn("More than one block was found with the name `"+e+"`"),t;t=i}}return t},t.prototype.getBlockByPredicate=function(e){for(var t=0,r=this.attachedBlocks;t<r.length;t++){var n=r[t];if(e(n))return n}return null},t.prototype.getInputBlockByPredicate=function(e){for(var t=0,r=this.attachedBlocks;t<r.length;t++){var n=r[t];if(n.isInput&&e(n))return n}return null},t.prototype.getInputBlocks=function(){for(var e=[],t=0,r=this.attachedBlocks;t<r.length;t++){var n=r[t];n.isInput&&e.push(n)}return e},t.prototype.registerOptimizer=function(e){if(!(this._optimizers.indexOf(e)>-1))return this._optimizers.push(e),this},t.prototype.unregisterOptimizer=function(e){var t=this._optimizers.indexOf(e);if(-1!==t)return this._optimizers.splice(t,1),this},t.prototype.addOutputNode=function(e){if(null===e.target)throw"This node is not meant to be an output node. You may want to explicitly set its target value.";return 0!=(e.target&d.NodeMaterialBlockTargets.Vertex)&&this._addVertexOutputNode(e),0!=(e.target&d.NodeMaterialBlockTargets.Fragment)&&this._addFragmentOutputNode(e),this},t.prototype.removeOutputNode=function(e){return null===e.target||(0!=(e.target&d.NodeMaterialBlockTargets.Vertex)&&this._removeVertexOutputNode(e),0!=(e.target&d.NodeMaterialBlockTargets.Fragment)&&this._removeFragmentOutputNode(e)),this},t.prototype._addVertexOutputNode=function(e){if(-1===this._vertexOutputNodes.indexOf(e))return e.target=d.NodeMaterialBlockTargets.Vertex,this._vertexOutputNodes.push(e),this},t.prototype._removeVertexOutputNode=function(e){var t=this._vertexOutputNodes.indexOf(e);if(-1!==t)return this._vertexOutputNodes.splice(t,1),this},t.prototype._addFragmentOutputNode=function(e){if(-1===this._fragmentOutputNodes.indexOf(e))return e.target=d.NodeMaterialBlockTargets.Fragment,this._fragmentOutputNodes.push(e),this},t.prototype._removeFragmentOutputNode=function(e){var t=this._fragmentOutputNodes.indexOf(e);if(-1!==t)return this._fragmentOutputNodes.splice(t,1),this},t.prototype.needAlphaBlending=function(){return!this.ignoreAlpha&&(this.alpha<1||this._sharedData&&this._sharedData.hints.needAlphaBlending)},t.prototype.needAlphaTesting=function(){return this._sharedData&&this._sharedData.hints.needAlphaTesting},t.prototype._initializeBlock=function(e,t,r){if(e.initialize(t),e.autoConfigure(this),e._preparationId=this._buildId,-1===this.attachedBlocks.indexOf(e)){if(e.isUnique)for(var n=e.getClassName(),i=0,o=this.attachedBlocks;i<o.length;i++)if(o[i].getClassName()===n)throw"Cannot have multiple blocks of type "+n+" in the same NodeMaterial";this.attachedBlocks.push(e)}for(var s=0,a=e.inputs;s<a.length;s++){var l=a[s];l.associatedVariableName="";var c=l.connectedPoint;if(c){var u=c.ownerBlock;u!==e&&((u.target===d.NodeMaterialBlockTargets.VertexAndFragment||t.target===d.NodeMaterialBlockTargets.Fragment&&u.target===d.NodeMaterialBlockTargets.Vertex&&u._preparationId!==this._buildId)&&r.push(u),this._initializeBlock(u,t,r))}}for(var h=0,f=e.outputs;h<f.length;h++)f[h].associatedVariableName=""},t.prototype._resetDualBlocks=function(e,t){e.target===d.NodeMaterialBlockTargets.VertexAndFragment&&(e.buildId=t);for(var r=0,n=e.inputs;r<n.length;r++){var i=n[r].connectedPoint;if(i){var o=i.ownerBlock;o!==e&&this._resetDualBlocks(o,t)}}},t.prototype.removeBlock=function(e){var t=this.attachedBlocks.indexOf(e);t>-1&&this.attachedBlocks.splice(t,1),e.isFinalMerger&&this.removeOutputNode(e)},t.prototype.build=function(e){void 0===e&&(e=!1),this._buildWasSuccessful=!1;var r=this.getScene().getEngine(),n=this._mode===N.NodeMaterialModes.Particle;if(0===this._vertexOutputNodes.length&&!n)throw"You must define at least one vertexOutputNode";if(0===this._fragmentOutputNodes.length)throw"You must define at least one fragmentOutputNode";this._vertexCompilationState=new c.NodeMaterialBuildState,this._vertexCompilationState.supportUniformBuffers=r.supportsUniformBuffers,this._vertexCompilationState.target=d.NodeMaterialBlockTargets.Vertex,this._fragmentCompilationState=new c.NodeMaterialBuildState,this._fragmentCompilationState.supportUniformBuffers=r.supportsUniformBuffers,this._fragmentCompilationState.target=d.NodeMaterialBlockTargets.Fragment,this._sharedData=new h.NodeMaterialBuildStateSharedData,this._vertexCompilationState.sharedData=this._sharedData,this._fragmentCompilationState.sharedData=this._sharedData,this._sharedData.buildId=this._buildId,this._sharedData.emitComments=this._options.emitComments,this._sharedData.verbose=e,this._sharedData.scene=this.getScene(),this._sharedData.allowEmptyVertexProgram=n;for(var i=[],o=[],s=0,a=this._vertexOutputNodes;s<a.length;s++){var l=a[s];i.push(l),this._initializeBlock(l,this._vertexCompilationState,o)}for(var u=0,f=this._fragmentOutputNodes;u<f.length;u++){var p=f[u];o.push(p),this._initializeBlock(p,this._fragmentCompilationState,i)}this.optimize();for(var m=0,g=i;m<g.length;m++)(l=g[m]).build(this._vertexCompilationState,i);this._fragmentCompilationState.uniforms=this._vertexCompilationState.uniforms.slice(0),this._fragmentCompilationState._uniformDeclaration=this._vertexCompilationState._uniformDeclaration,this._fragmentCompilationState._constantDeclaration=this._vertexCompilationState._constantDeclaration,this._fragmentCompilationState._vertexState=this._vertexCompilationState;for(var _=0,v=o;_<v.length;_++)p=v[_],this._resetDualBlocks(p,this._buildId-1);for(var y=0,b=o;y<b.length;y++)(p=b[y]).build(this._fragmentCompilationState,o);this._vertexCompilationState.finalize(this._vertexCompilationState),this._fragmentCompilationState.finalize(this._fragmentCompilationState),this._buildId=t._BuildIdGenerator++,this._sharedData.emitErrors(),e&&(console.log("Vertex shader:"),console.log(this._vertexCompilationState.compilationString),console.log("Fragment shader:"),console.log(this._fragmentCompilationState.compilationString)),this._buildWasSuccessful=!0,this.onBuildObservable.notifyObservers(this);for(var A=0,T=this.getScene().meshes;A<T.length;A++){var M=T[A];if(M.subMeshes)for(var P=0,S=M.subMeshes;P<S.length;P++){var E=S[P];if(E.getMaterial()===this&&E._materialDefines){var C=E._materialDefines;C.markAllAsDirty(),C.reset()}}}},t.prototype.optimize=function(){for(var e=0,t=this._optimizers;e<t.length;e++)t[e].optimize(this._vertexOutputNodes,this._fragmentOutputNodes)},t.prototype._prepareDefinesForAttributes=function(e,t){var r=t.NORMAL,n=t.TANGENT,i=t.UV1;t.NORMAL=e.isVerticesDataPresent(p.VertexBuffer.NormalKind),t.TANGENT=e.isVerticesDataPresent(p.VertexBuffer.TangentKind),t.UV1=e.isVerticesDataPresent(p.VertexBuffer.UVKind),r===t.NORMAL&&n===t.TANGENT&&i===t.UV1||t.markAsAttributesDirty()},t.prototype.createPostProcess=function(e,t,r,n,i,o,s){return void 0===t&&(t=1),void 0===r&&(r=O.Constants.TEXTURE_NEAREST_SAMPLINGMODE),void 0===o&&(o=O.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===s&&(s=O.Constants.TEXTUREFORMAT_RGBA),this._createEffectOrPostProcess(null,e,t,r,n,i,o,s)},t.prototype.createEffectForPostProcess=function(e){this._createEffectOrPostProcess(e)},t.prototype._createEffectOrPostProcess=function(e,t,r,n,i,s,a,l){var c=this;void 0===r&&(r=1),void 0===n&&(n=O.Constants.TEXTURE_NEAREST_SAMPLINGMODE),void 0===a&&(a=O.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=O.Constants.TEXTUREFORMAT_RGBA);var u=this.name+this._buildId,d=new U,h=new o.AbstractMesh(u+"PostProcess",this.getScene()),f=this._buildId;return this._processDefines(h,d),x.Effect.RegisterShader(u,this._fragmentCompilationState._builtCompilationString,this._vertexCompilationState._builtCompilationString),e?e.updateEffect(d.toString(),this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,{maxSimultaneousLights:this.maxSimultaneousLights},void 0,void 0,u,u):e=new R.PostProcess(this.name+"PostProcess",u,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,r,t,n,i,s,d.toString(),a,u,{maxSimultaneousLights:this.maxSimultaneousLights},!1,l),e.nodeMaterialSource=this,e.onApplyObservable.add((function(t){if(f!==c._buildId&&(delete x.Effect.ShadersStore[u+"VertexShader"],delete x.Effect.ShadersStore[u+"PixelShader"],u=c.name+c._buildId,d.markAsUnprocessed(),f=c._buildId),c._processDefines(h,d)&&(x.Effect.RegisterShader(u,c._fragmentCompilationState._builtCompilationString,c._vertexCompilationState._builtCompilationString),V.TimingTools.SetImmediate((function(){return e.updateEffect(d.toString(),c._fragmentCompilationState.uniforms,c._fragmentCompilationState.samplers,{maxSimultaneousLights:c.maxSimultaneousLights},void 0,void 0,u,u)}))),c._sharedData.animatedInputs){var r=c.getScene(),n=r.getFrameId();if(c._animationFrame!==n){for(var i=0,o=c._sharedData.animatedInputs;i<o.length;i++)o[i].animate(r);c._animationFrame=n}}for(var s=0,a=c._sharedData.bindableBlocks;s<a.length;s++)a[s].bind(t,c);for(var l=0,p=c._sharedData.inputBlocks;l<p.length;l++)p[l]._transmit(t,c.getScene())})),e},t.prototype._createEffectForParticles=function(e,t,r,n,i,s,a,l){var c=this;void 0===l&&(l="");var u=this.name+this._buildId+"_"+t;s||(s=new U),a||(a=this.getScene().getMeshByName(this.name+"Particle"))||(a=new o.AbstractMesh(this.name+"Particle",this.getScene()));var d=this._buildId,h=[],f=l;if(!i){var p=this._processDefines(a,s);x.Effect.RegisterShader(u,this._fragmentCompilationState._builtCompilationString),e.fillDefines(h,t),f=h.join("\n"),i=this.getScene().getEngine().createEffectForParticles(u,this._fragmentCompilationState.uniforms,this._fragmentCompilationState.samplers,s.toString()+"\n"+f,null==p?void 0:p.fallbacks,r,n,e),e.setCustomEffect(i,t)}i.onBindObservable.add((function(i){d!==c._buildId&&(delete x.Effect.ShadersStore[u+"PixelShader"],u=c.name+c._buildId+"_"+t,s.markAsUnprocessed(),d=c._buildId),h.length=0,e.fillDefines(h,t);var o=h.join("\n");o!==f&&(s.markAsUnprocessed(),f=o);var l=c._processDefines(a,s);if(l)return x.Effect.RegisterShader(u,c._fragmentCompilationState._builtCompilationString),i=c.getScene().getEngine().createEffectForParticles(u,c._fragmentCompilationState.uniforms,c._fragmentCompilationState.samplers,s.toString()+"\n"+f,null==l?void 0:l.fallbacks,r,n,e),e.setCustomEffect(i,t),void c._createEffectForParticles(e,t,r,n,i,s,a,f);if(c._sharedData.animatedInputs){var p=c.getScene(),m=p.getFrameId();if(c._animationFrame!==m){for(var g=0,_=c._sharedData.animatedInputs;g<_.length;g++)_[g].animate(p);c._animationFrame=m}}for(var v=0,y=c._sharedData.bindableBlocks;v<y.length;v++)y[v].bind(i,c);for(var b=0,A=c._sharedData.inputBlocks;b<A.length;b++)A[b]._transmit(i,c.getScene())}))},t.prototype.createEffectForParticles=function(e,t,r){this._createEffectForParticles(e,w.BaseParticleSystem.BLENDMODE_ONEONE,t,r),this._createEffectForParticles(e,w.BaseParticleSystem.BLENDMODE_MULTIPLY,t,r)},t.prototype._processDefines=function(e,t,r,n){var i=this;void 0===r&&(r=!1);var o=null;if(this._sharedData.blocksWithDefines.forEach((function(n){n.initializeDefines(e,i,t,r)})),this._sharedData.blocksWithDefines.forEach((function(o){o.prepareDefines(e,i,t,r,n)})),t.isDirty){var s=t._areLightsDisposed;t.markAsProcessed(),this._vertexCompilationState.compilationString=this._vertexCompilationState._builtCompilationString,this._fragmentCompilationState.compilationString=this._fragmentCompilationState._builtCompilationString,this._sharedData.repeatableContentBlocks.forEach((function(r){r.replaceRepeatableContent(i._vertexCompilationState,i._fragmentCompilationState,e,t)}));var a=[];this._sharedData.dynamicUniformBlocks.forEach((function(e){e.updateUniformsAndSamples(i._vertexCompilationState,i,t,a)}));var l=this._vertexCompilationState.uniforms;this._fragmentCompilationState.uniforms.forEach((function(e){-1===l.indexOf(e)&&l.push(e)}));var c=this._vertexCompilationState.samplers;this._fragmentCompilationState.samplers.forEach((function(e){-1===c.indexOf(e)&&c.push(e)}));var u=new E.EffectFallbacks;this._sharedData.blocksWithFallbacks.forEach((function(t){t.provideFallbacks(e,u)})),o={lightDisposed:s,uniformBuffers:a,mergedUniforms:l,mergedSamplers:c,fallbacks:u}}return o},t.prototype.isReadyForSubMesh=function(e,t,r){var n=this;if(void 0===r&&(r=!1),!this._buildWasSuccessful)return!1;var i=this.getScene();if(this._sharedData.animatedInputs){var o=i.getFrameId();if(this._animationFrame!==o){for(var s=0,a=this._sharedData.animatedInputs;s<a.length;s++)a[s].animate(i);this._animationFrame=o}}if(t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new U);var l=t._materialDefines;if(this._isReadyForSubMesh(t))return!0;var c=i.getEngine();if(this._prepareDefinesForAttributes(e,l),this._sharedData.blockingBlocks.some((function(t){return!t.isReady(e,n,l,r)})))return!1;var u=this._processDefines(e,l,r,t);if(u){var d=t.effect,h=l.toString(),f=c.createEffect({vertex:"nodeMaterial"+this._buildId,fragment:"nodeMaterial"+this._buildId,vertexSource:this._vertexCompilationState.compilationString,fragmentSource:this._fragmentCompilationState.compilationString},{attributes:this._vertexCompilationState.attributes,uniformsNames:u.mergedUniforms,uniformBuffersNames:u.uniformBuffers,samplers:u.mergedSamplers,defines:h,fallbacks:u.fallbacks,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights,maxSimultaneousMorphTargets:l.NUM_MORPH_INFLUENCERS}},c);if(f)if(this._onEffectCreatedObservable&&(k.effect=f,k.subMesh=t,this._onEffectCreatedObservable.notifyObservers(k)),this.allowShaderHotSwapping&&d&&!f.isReady()){if(f=d,l.markAsUnprocessed(),u.lightDisposed)return l._areLightsDisposed=!0,!1}else i.resetCachedMaterial(),t.setEffect(f,l)}return!(!t.effect||!t.effect.isReady()||(l._renderId=i.getRenderId(),t.effect._wasPreviouslyReady=!0,0))},Object.defineProperty(t.prototype,"compiledShaders",{get:function(){return"// Vertex shader\r\n"+this._vertexCompilationState.compilationString+"\r\n\r\n// Fragment shader\r\n"+this._fragmentCompilationState.compilationString},enumerable:!1,configurable:!0}),t.prototype.bindOnlyWorldMatrix=function(e){var t=this.getScene();if(this._activeEffect){var r=this._sharedData.hints;r.needWorldViewMatrix&&e.multiplyToRef(t.getViewMatrix(),this._cachedWorldViewMatrix),r.needWorldViewProjectionMatrix&&e.multiplyToRef(t.getTransformMatrix(),this._cachedWorldViewProjectionMatrix);for(var n=0,i=this._sharedData.inputBlocks;n<i.length;n++)i[n]._transmitWorld(this._activeEffect,e,this._cachedWorldViewMatrix,this._cachedWorldViewProjectionMatrix)}},t.prototype.bindForSubMesh=function(e,t,r){var n=this.getScene(),i=r.effect;if(i){if(this._activeEffect=i,this.bindOnlyWorldMatrix(e),this._mustRebind(n,i,t.visibility)){var o=this._sharedData;if(i&&n.getCachedEffect()!==i){for(var s=0,a=o.bindableBlocks;s<a.length;s++)a[s].bind(i,this,t,r);for(var l=0,c=o.inputBlocks;l<c.length;l++)c[l]._transmit(i,n)}}this._afterBind(t,this._activeEffect)}},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._sharedData&&t.push.apply(t,this._sharedData.textureBlocks.filter((function(e){return e.texture})).map((function(e){return e.texture}))),t},t.prototype.getTextureBlocks=function(){return this._sharedData?this._sharedData.textureBlocks:[]},t.prototype.hasTexture=function(t){if(e.prototype.hasTexture.call(this,t))return!0;if(!this._sharedData)return!1;for(var r=0,n=this._sharedData.textureBlocks;r<n.length;r++)if(n[r].texture===t)return!0;return!1},t.prototype.dispose=function(t,r,n){if(r)for(var i=0,o=this._sharedData.textureBlocks.filter((function(e){return e.texture})).map((function(e){return e.texture}));i<o.length;i++)o[i].dispose();for(var s=0,a=this.attachedBlocks;s<a.length;s++)a[s].dispose();this.onBuildObservable.clear(),e.prototype.dispose.call(this,t,r,n)},t.prototype._createNodeEditor=function(){this.BJSNODEMATERIALEDITOR=this.BJSNODEMATERIALEDITOR||this._getGlobalNodeMaterialEditor(),this.BJSNODEMATERIALEDITOR.NodeEditor.Show({nodeMaterial:this})},t.prototype.edit=function(e){var r=this;return new Promise((function(n,i){if(void 0===r.BJSNODEMATERIALEDITOR){var o=e&&e.editorURL?e.editorURL:t.EditorURL;m.Tools.LoadScript(o,(function(){r._createNodeEditor(),n()}))}else r._createNodeEditor(),n()}))},t.prototype.clear=function(){this._vertexOutputNodes=[],this._fragmentOutputNodes=[],this.attachedBlocks=[]},t.prototype.setToDefault=function(){this.clear(),this.editorData=null;var e=new y.InputBlock("Position");e.setAsAttribute("position");var t=new y.InputBlock("World");t.setAsSystemValue(BABYLON.NodeMaterialSystemValues.World);var r=new g.TransformBlock("WorldPos");e.connectTo(r),t.connectTo(r);var n=new y.InputBlock("ViewProjection");n.setAsSystemValue(BABYLON.NodeMaterialSystemValues.ViewProjection);var i=new g.TransformBlock("WorldPos * ViewProjectionTransform");r.connectTo(i),n.connectTo(i);var o=new _.VertexOutputBlock("VertexOutput");i.connectTo(o);var s=new y.InputBlock("color");s.value=new a.Color4(.8,.8,.8,1);var l=new v.FragmentOutputBlock("FragmentOutput");s.connectTo(l),this.addOutputNode(o),this.addOutputNode(l),this._mode=N.NodeMaterialModes.Material},t.prototype.setToDefaultPostProcess=function(){this.clear(),this.editorData=null;var e=new y.InputBlock("Position");e.setAsAttribute("position2d");var t=new y.InputBlock("Constant1");t.isConstant=!0,t.value=1;var r=new I.VectorMergerBlock("Position3D");e.connectTo(r),t.connectTo(r,{input:"w"});var n=new _.VertexOutputBlock("VertexOutput");r.connectTo(n);var i=new y.InputBlock("scale");i.visibleInInspector=!0,i.value=new s.Vector2(1,1);var o=new D.RemapBlock("uv0");e.connectTo(o);var a=new B.MultiplyBlock("uv");o.connectTo(a),i.connectTo(a);var l=new T.CurrentScreenBlock("CurrentScreen");a.connectTo(l),l.texture=new L.Texture("https://assets.babylonjs.com/nme/currentScreenPostProcess.png",this.getScene());var c=new v.FragmentOutputBlock("FragmentOutput");l.connectTo(c,{output:"rgba"}),this.addOutputNode(n),this.addOutputNode(c),this._mode=N.NodeMaterialModes.PostProcess},t.prototype.setToDefaultParticle=function(){this.clear(),this.editorData=null;var e=new y.InputBlock("uv");e.setAsAttribute("particle_uv");var t=new M.ParticleTextureBlock("ParticleTexture");e.connectTo(t);var r=new y.InputBlock("Color");r.setAsAttribute("particle_color");var n=new B.MultiplyBlock("Texture * Color");t.connectTo(n),r.connectTo(n);var i=new P.ParticleRampGradientBlock("ParticleRampGradient");n.connectTo(i);var o=new F.ColorSplitterBlock("ColorSplitter");r.connectTo(o);var s=new S.ParticleBlendMultiplyBlock("ParticleBlendMultiply");i.connectTo(s),t.connectTo(s,{output:"a"}),o.connectTo(s,{output:"a"});var a=new v.FragmentOutputBlock("FragmentOutput");s.connectTo(a),this.addOutputNode(a),this._mode=N.NodeMaterialModes.Particle},t.prototype.loadAsync=function(e){var t=this;return this.getScene()._loadFileAsync(e).then((function(e){var r=JSON.parse(e);t.loadFromSerialization(r,"")}))},t.prototype._gatherBlocks=function(e,t){if(-1===t.indexOf(e)){t.push(e);for(var r=0,n=e.inputs;r<n.length;r++){var i=n[r].connectedPoint;if(i){var o=i.ownerBlock;o!==e&&this._gatherBlocks(o,t)}}}},t.prototype.generateCode=function(){for(var e=[],t=[],r=[],n=0,i=this._vertexOutputNodes;n<i.length;n++){var o=i[n];this._gatherBlocks(o,t)}for(var s=[],a=0,l=this._fragmentOutputNodes;a<l.length;a++)o=l[a],this._gatherBlocks(o,s);for(var c='var nodeMaterial = new BABYLON.NodeMaterial("'+(this.name||"node material")+'");\r\n',u=0,d=t;u<d.length;u++)(T=d[u]).isInput&&-1===e.indexOf(T)&&(c+=T._dumpCode(r,e));for(var h=0,f=s;h<f.length;h++)(T=f[h]).isInput&&-1===e.indexOf(T)&&(c+=T._dumpCode(r,e));e=[],c+="\r\n// Connections\r\n";for(var p=0,m=this._vertexOutputNodes;p<m.length;p++)c+=(T=m[p])._dumpCodeForOutputConnections(e);for(var g=0,_=this._fragmentOutputNodes;g<_.length;g++)c+=(T=_[g])._dumpCodeForOutputConnections(e);c+="\r\n// Output nodes\r\n";for(var v=0,y=this._vertexOutputNodes;v<y.length;v++)c+="nodeMaterial.addOutputNode("+(T=y[v])._codeVariableName+");\r\n";for(var b=0,A=this._fragmentOutputNodes;b<A.length;b++){var T;c+="nodeMaterial.addOutputNode("+(T=A[b])._codeVariableName+");\r\n"}return c+="nodeMaterial.build();\r\n"},t.prototype.serialize=function(e){var t=e?{}:A.SerializationHelper.Serialize(this);t.editorData=JSON.parse(JSON.stringify(this.editorData));var r=[];if(e)r=e;else{t.customType="BABYLON.NodeMaterial",t.outputNodes=[];for(var n=0,i=this._vertexOutputNodes;n<i.length;n++){var o=i[n];this._gatherBlocks(o,r),t.outputNodes.push(o.uniqueId)}for(var s=0,a=this._fragmentOutputNodes;s<a.length;s++)o=a[s],this._gatherBlocks(o,r),-1===t.outputNodes.indexOf(o.uniqueId)&&t.outputNodes.push(o.uniqueId)}t.blocks=[];for(var l=0,c=r;l<c.length;l++){var u=c[l];t.blocks.push(u.serialize())}if(!e)for(var d=0,h=this.attachedBlocks;d<h.length;d++)u=h[d],-1===r.indexOf(u)&&t.blocks.push(u.serialize());return t},t.prototype._restoreConnections=function(e,t,r){for(var n=0,i=e.outputs;n<i.length;n++)for(var o=i[n],s=0,a=t.blocks;s<a.length;s++)for(var l=a[s],c=r[l.id],u=0,d=l.inputs;u<d.length;u++){var h=d[u];if(r[h.targetBlockId]!==e||h.targetConnectionName!==o.name);else{var f=c.getInputByName(h.inputName);if(!f||f.isConnected)continue;o.connectTo(f,!0),this._restoreConnections(c,t,r)}}},t.prototype.loadFromSerialization=function(e,t,r){var n;void 0===t&&(t=""),void 0===r&&(r=!1),r||this.clear();for(var i={},o=0,s=e.blocks;o<s.length;o++){var a=s[o],l=b._TypeStore.GetClass(a.customType);l&&((u=new l)._deserialize(a,this.getScene(),t),i[a.id]=u,this.attachedBlocks.push(u))}if(!r){for(var c=0;c<e.blocks.length;c++){var u;(u=i[e.blocks[c].id]).inputs.length||this._restoreConnections(u,e,i)}for(var d=0,h=e.outputNodes;d<h.length;d++){var f=h[d];this.addOutputNode(i[f])}}if(e.locations||e.editorData&&e.editorData.locations){for(var p=e.locations||e.editorData.locations,m=0,g=p;m<g.length;m++){var _=g[m];i[_.blockId]&&(_.blockId=i[_.blockId].uniqueId)}e.locations?this.editorData={locations:p}:(this.editorData=e.editorData,this.editorData.locations=p);var v=[];for(var y in i)v[y]=i[y].uniqueId;this.editorData.map=v}r||(this._mode=null!==(n=e.mode)&&void 0!==n?n:N.NodeMaterialModes.Material)},t.prototype.clone=function(e){var r=this,n=this.serialize(),i=A.SerializationHelper.Clone((function(){return new t(e,r.getScene(),r.options)}),this);return i.id=e,i.name=e,i.loadFromSerialization(n),i.build(),i},t.Parse=function(e,r,n){void 0===n&&(n="");var i=A.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n);return i.loadFromSerialization(e,n),i.build(),i},t.ParseFromFileAsync=function(e,r,n){var i=new t(e,n);return new Promise((function(e,t){return i.loadAsync(r).then((function(){return e(i)})).catch(t)}))},t.ParseFromSnippetAsync=function(e,r,n,i){var o=this;return void 0===n&&(n=""),new Promise((function(s,a){var l=new C.WebRequest;l.addEventListener("readystatechange",(function(){if(4==l.readyState)if(200==l.status){var o=JSON.parse(JSON.parse(l.responseText).jsonPayload),c=JSON.parse(o.nodeMaterial);i||((i=A.SerializationHelper.Parse((function(){return new t(e,r)}),c,r,n)).uniqueId=r.getUniqueId()),i.loadFromSerialization(c),i.snippetId=e;try{i.build(),s(i)}catch(e){a(e)}}else a("Unable to load the snippet "+e)})),l.open("GET",o.SnippetUrl+"/"+e.replace(/#/g,"/")),l.send()}))},t.CreateDefault=function(e,r){var n=new t(e,r);return n.setToDefault(),n.build(),n},t._BuildIdGenerator=0,t.EditorURL="https://unpkg.com/babylonjs-node-editor@"+l.Engine.Version+"/babylon.nodeEditor.js",t.SnippetUrl="https://snippet.babylonjs.com",t.IgnoreTexturesAtLoadTime=!1,Object(n.__decorate)([Object(A.serialize)("mode")],t.prototype,"_mode",void 0),t}(i.PushMaterial);b._TypeStore.RegisteredTypes["BABYLON.NodeMaterial"]=z},"./Materials/Node/nodeMaterialBlock.ts":
- /*!*********************************************!*\
- !*** ./Materials/Node/nodeMaterialBlock.ts ***!
- \*********************************************/
- /*! exports provided: NodeMaterialBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialBlock",(function(){return l}));var n=r(/*! ./Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),i=r(/*! ./nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),o=r(/*! ./Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../../Misc/uniqueIdGenerator */"./Misc/uniqueIdGenerator.ts"),a=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),l=function(){function e(e,t,r,n){void 0===t&&(t=o.NodeMaterialBlockTargets.Vertex),void 0===r&&(r=!1),void 0===n&&(n=!1),this._isFinalMerger=!1,this._isInput=!1,this._name="",this._isUnique=!1,this.inputsAreExclusive=!1,this._codeVariableName="",this._inputs=new Array,this._outputs=new Array,this.comments="",this._target=t,this._isFinalMerger=r,this._isInput=n,this._name=e,this.uniqueId=s.UniqueIdGenerator.UniqueId}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this.validateBlockName(e)&&(this._name=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUnique",{get:function(){return this._isUnique},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFinalMerger",{get:function(){return this._isFinalMerger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInput",{get:function(){return this._isInput},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buildId",{get:function(){return this._buildId},set:function(e){this._buildId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(e){0==(this._target&e)&&(this._target=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this._inputs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs},enumerable:!1,configurable:!0}),e.prototype.getInputByName=function(e){var t=this._inputs.filter((function(t){return t.name===e}));return t.length?t[0]:null},e.prototype.getOutputByName=function(e){var t=this._outputs.filter((function(t){return t.name===e}));return t.length?t[0]:null},e.prototype.initialize=function(e){},e.prototype.bind=function(e,t,r,n){},e.prototype._declareOutput=function(e,t){return t._getGLType(e.type)+" "+e.associatedVariableName},e.prototype._writeVariable=function(e){return e.connectedPoint?""+e.associatedVariableName:"0."},e.prototype._writeFloat=function(e){var t=e.toString();return-1===t.indexOf(".")&&(t+=".0"),""+t},e.prototype.getClassName=function(){return"NodeMaterialBlock"},e.prototype.registerInput=function(e,t,r,n,o){return void 0===r&&(r=!1),(o=null!=o?o:new i.NodeMaterialConnectionPoint(e,this,i.NodeMaterialConnectionPointDirection.Input)).type=t,o.isOptional=r,n&&(o.target=n),this._inputs.push(o),this},e.prototype.registerOutput=function(e,t,r,n){return(n=null!=n?n:new i.NodeMaterialConnectionPoint(e,this,i.NodeMaterialConnectionPointDirection.Output)).type=t,r&&(n.target=r),this._outputs.push(n),this},e.prototype.getFirstAvailableInput=function(e){void 0===e&&(e=null);for(var t=0,r=this._inputs;t<r.length;t++){var i=r[t];if(!(i.connectedPoint||e&&e.type!==i.type&&i.type!==n.NodeMaterialBlockConnectionPointTypes.AutoDetect))return i}return null},e.prototype.getFirstAvailableOutput=function(e){void 0===e&&(e=null);for(var t=0,r=this._outputs;t<r.length;t++){var n=r[t];if(!e||!e.target||e.target===o.NodeMaterialBlockTargets.Neutral||0!=(e.target&n.target))return n}return null},e.prototype.getSiblingOutput=function(e){var t=this._outputs.indexOf(e);return-1===t||t>=this._outputs.length?null:this._outputs[t+1]},e.prototype.connectTo=function(e,t){if(0!==this._outputs.length){for(var r=t&&t.output?this.getOutputByName(t.output):this.getFirstAvailableOutput(e),n=!0;n;){var i=t&&t.input?e.getInputByName(t.input):e.getFirstAvailableInput(r);if(r&&i&&r.canConnectTo(i))r.connectTo(i),n=!1;else{if(!r)throw"Unable to find a compatible match";r=this.getSiblingOutput(r)}}return this}},e.prototype._buildBlock=function(e){},e.prototype.updateUniformsAndSamples=function(e,t,r,n){},e.prototype.provideFallbacks=function(e,t){},e.prototype.initializeDefines=function(e,t,r,n){void 0===n&&(n=!1)},e.prototype.prepareDefines=function(e,t,r,n,i){void 0===n&&(n=!1)},e.prototype.autoConfigure=function(e){},e.prototype.replaceRepeatableContent=function(e,t,r,n){},e.prototype.isReady=function(e,t,r,n){return void 0===n&&(n=!1),!0},e.prototype._linkConnectionTypes=function(e,t){this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[t]._linkedConnectionSource=this._inputs[e]},e.prototype._processBuild=function(e,t,r,n){e.build(t,n);var i=null!=t._vertexState,s=e._buildTarget===o.NodeMaterialBlockTargets.Vertex&&e.target!==o.NodeMaterialBlockTargets.VertexAndFragment;if(i&&(0==(e.target&e._buildTarget)||0==(e.target&r.target)||this.target!==o.NodeMaterialBlockTargets.VertexAndFragment&&s)&&(!e.isInput&&t.target!==e._buildTarget||e.isInput&&e.isAttribute&&!e._noContextSwitch)){var a=r.connectedPoint;t._vertexState._emitVaryingFromString("v_"+a.associatedVariableName,t._getGLType(a.type))&&(t._vertexState.compilationString+="v_"+a.associatedVariableName+" = "+a.associatedVariableName+";\r\n"),r.associatedVariableName="v_"+a.associatedVariableName,r._enforceAssociatedVariableName=!0}},e.prototype.validateBlockName=function(e){for(var t=0,r=["position","normal","tangent","particle_positionw","uv","uv2","position2d","particle_uv","matricesIndices","matricesWeights","world0","world1","world2","world3","particle_color","particle_texturemask"];t<r.length;t++)if(e===r[t])return!1;return!0},e.prototype.build=function(e,t){if(this._buildId===e.sharedData.buildId)return!0;if(!this.isInput)for(var r=0,n=this._outputs;r<n.length;r++)(u=n[r]).associatedVariableName||(u.associatedVariableName=e._getFreeVariableName(u.name));for(var i=0,s=this._inputs;i<s.length;i++){var a=s[i];if(a.connectedPoint){if(this.target!==o.NodeMaterialBlockTargets.Neutral){if(0==(a.target&this.target))continue;if(0==(a.target&e.target))continue}(f=a.connectedPoint.ownerBlock)&&f!==this&&this._processBuild(f,e,a,t)}else a.isOptional||e.sharedData.checks.notConnectedNonOptionalInputs.push(a)}if(this._buildId===e.sharedData.buildId)return!0;if(e.sharedData.verbose&&console.log((e.target===o.NodeMaterialBlockTargets.Vertex?"Vertex shader":"Fragment shader")+": Building "+this.name+" ["+this.getClassName()+"]"),this.isFinalMerger)switch(e.target){case o.NodeMaterialBlockTargets.Vertex:e.sharedData.checks.emitVertex=!0;break;case o.NodeMaterialBlockTargets.Fragment:e.sharedData.checks.emitFragment=!0}!this.isInput&&e.sharedData.emitComments&&(e.compilationString+="\r\n//"+this.name+"\r\n"),this._buildBlock(e),this._buildId=e.sharedData.buildId,this._buildTarget=e.target;for(var l=0,c=this._outputs;l<c.length;l++){var u;if(0!=((u=c[l]).target&e.target))for(var d=0,h=u.endpoints;d<h.length;d++){var f,p=h[d];(f=p.ownerBlock)&&0!=(f.target&e.target)&&-1!==t.indexOf(f)&&this._processBuild(f,e,p,t)}}return!1},e.prototype._inputRename=function(e){return e},e.prototype._outputRename=function(e){return e},e.prototype._dumpPropertiesCode=function(){return""},e.prototype._dumpCode=function(e,t){var r;t.push(this);var n=this.name.replace(/[^A-Za-z_]+/g,"");if(this._codeVariableName=n||this.getClassName()+"_"+this.uniqueId,-1!==e.indexOf(this._codeVariableName)){var i=0;do{i++,this._codeVariableName=n+i}while(-1!==e.indexOf(this._codeVariableName))}e.push(this._codeVariableName),r="\r\n// "+this.getClassName()+"\r\n",this.comments&&(r+="// "+this.comments+"\r\n"),r+="var "+this._codeVariableName+" = new BABYLON."+this.getClassName()+'("'+this.name+'");\r\n',r+=this._dumpPropertiesCode();for(var o=0,s=this.inputs;o<s.length;o++){var a=s[o];if(a.isConnected){var l=a.connectedPoint.ownerBlock;-1===t.indexOf(l)&&(r+=l._dumpCode(e,t))}}for(var c=0,u=this.outputs;c<u.length;c++){var d=u[c];if(d.hasEndpoints)for(var h=0,f=d.endpoints;h<f.length;h++)(l=f[h].ownerBlock)&&-1===t.indexOf(l)&&(r+=l._dumpCode(e,t))}return r},e.prototype._dumpCodeForOutputConnections=function(e){var t="";if(-1!==e.indexOf(this))return t;e.push(this);for(var r=0,n=this.inputs;r<n.length;r++){var i=n[r];if(i.isConnected){var o=i.connectedPoint,s=o.ownerBlock;t+=s._dumpCodeForOutputConnections(e),t+=s._codeVariableName+"."+s._outputRename(o.name)+".connectTo("+this._codeVariableName+"."+this._inputRename(i.name)+");\r\n"}}return t},e.prototype.clone=function(e,t){void 0===t&&(t="");var r=this.serialize(),n=a._TypeStore.GetClass(r.customType);if(n){var i=new n;return i._deserialize(r,e,t),i}return null},e.prototype.serialize=function(){var e={};e.customType="BABYLON."+this.getClassName(),e.id=this.uniqueId,e.name=this.name,e.comments=this.comments,e.inputs=[],e.outputs=[];for(var t=0,r=this.inputs;t<r.length;t++){var n=r[t];e.inputs.push(n.serialize())}for(var i=0,o=this.outputs;i<o.length;i++){var s=o[i];e.outputs.push(s.serialize(!1))}return e},e.prototype._deserialize=function(e,t,r){this.name=e.name,this.comments=e.comments,this._deserializePortDisplayNamesAndExposedOnFrame(e)},e.prototype._deserializePortDisplayNamesAndExposedOnFrame=function(e){var t=this,r=e.inputs,n=e.outputs;r&&r.forEach((function(e,r){e.displayName&&(t.inputs[r].displayName=e.displayName),e.isExposedOnFrame&&(t.inputs[r].isExposedOnFrame=e.isExposedOnFrame)})),n&&n.forEach((function(e,r){e.displayName&&(t.outputs[r].displayName=e.displayName),e.isExposedOnFrame&&(t.outputs[r].isExposedOnFrame=e.isExposedOnFrame)}))},e.prototype.dispose=function(){for(var e=0,t=this.inputs;e<t.length;e++)t[e].dispose();for(var r=0,n=this.outputs;r<n.length;r++)n[r].dispose()},e}()},"./Materials/Node/nodeMaterialBlockConnectionPoint.ts":
- /*!************************************************************!*\
- !*** ./Materials/Node/nodeMaterialBlockConnectionPoint.ts ***!
- \************************************************************/
- /*! exports provided: NodeMaterialConnectionPointCompatibilityStates, NodeMaterialConnectionPointDirection, NodeMaterialConnectionPoint */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialConnectionPointCompatibilityStates",(function(){return n})),r.d(t,"NodeMaterialConnectionPointDirection",(function(){return i})),r.d(t,"NodeMaterialConnectionPoint",(function(){return l}));var n,i,o=r(/*! ./Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ./Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),a=r(/*! ../../Misc/observable */"./Misc/observable.ts");!function(e){e[e.Compatible=0]="Compatible",e[e.TypeIncompatible=1]="TypeIncompatible",e[e.TargetIncompatible=2]="TargetIncompatible"}(n||(n={})),function(e){e[e.Input=0]="Input",e[e.Output=1]="Output"}(i||(i={}));var l=function(){function e(e,t,r){this._connectedPoint=null,this._endpoints=new Array,this._typeConnectionSource=null,this._linkedConnectionSource=null,this._type=o.NodeMaterialBlockConnectionPointTypes.Float,this._enforceAssociatedVariableName=!1,this.needDualDirectionValidation=!1,this.acceptedConnectionPointTypes=new Array,this.excludedConnectionPointTypes=new Array,this.onConnectionObservable=new a.Observable,this.isExposedOnFrame=!1,this._prioritizeVertex=!1,this._target=s.NodeMaterialBlockTargets.VertexAndFragment,this._ownerBlock=t,this.name=e,this._direction=r}return Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"associatedVariableName",{get:function(){return this._ownerBlock.isInput?this._ownerBlock.associatedVariableName:this._enforceAssociatedVariableName&&this._associatedVariableName||!this._connectedPoint?this._associatedVariableName:this._connectedPoint.associatedVariableName},set:function(e){this._associatedVariableName=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"innerType",{get:function(){return this._linkedConnectionSource&&this._linkedConnectionSource.isConnected?this.type:this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){if(this._type===o.NodeMaterialBlockConnectionPointTypes.AutoDetect){if(this._ownerBlock.isInput)return this._ownerBlock.type;if(this._connectedPoint)return this._connectedPoint.type;if(this._linkedConnectionSource&&this._linkedConnectionSource.isConnected)return this._linkedConnectionSource.type}return this._type===o.NodeMaterialBlockConnectionPointTypes.BasedOnInput&&this._typeConnectionSource?this._typeConnectionSource.type:this._type},set:function(e){this._type=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._prioritizeVertex&&this._ownerBlock?this._target!==s.NodeMaterialBlockTargets.VertexAndFragment?this._target:this._ownerBlock.target===s.NodeMaterialBlockTargets.Fragment?s.NodeMaterialBlockTargets.Fragment:s.NodeMaterialBlockTargets.Vertex:this._target},set:function(e){this._target=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnected",{get:function(){return null!==this.connectedPoint||this.hasEndpoints},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedToInputBlock",{get:function(){return null!==this.connectedPoint&&this.connectedPoint.ownerBlock.isInput},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectInputBlock",{get:function(){return this.isConnectedToInputBlock?this.connectedPoint.ownerBlock:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectedPoint",{get:function(){return this._connectedPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownerBlock",{get:function(){return this._ownerBlock},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceBlock",{get:function(){return this._connectedPoint?this._connectedPoint.ownerBlock:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectedBlocks",{get:function(){return 0===this._endpoints.length?[]:this._endpoints.map((function(e){return e.ownerBlock}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endpoints",{get:function(){return this._endpoints},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasEndpoints",{get:function(){return this._endpoints&&this._endpoints.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedInVertexShader",{get:function(){if(this.target===s.NodeMaterialBlockTargets.Vertex)return!0;if(!this.hasEndpoints)return!1;for(var e=0,t=this._endpoints;e<t.length;e++){var r=t[e];if(r.ownerBlock.target===s.NodeMaterialBlockTargets.Vertex)return!0;if(r.target===s.NodeMaterialBlockTargets.Vertex)return!0;if((r.ownerBlock.target===s.NodeMaterialBlockTargets.Neutral||r.ownerBlock.target===s.NodeMaterialBlockTargets.VertexAndFragment)&&r.ownerBlock.outputs.some((function(e){return e.isConnectedInVertexShader})))return!0}return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedInFragmentShader",{get:function(){if(this.target===s.NodeMaterialBlockTargets.Fragment)return!0;if(!this.hasEndpoints)return!1;for(var e=0,t=this._endpoints;e<t.length;e++){var r=t[e];if(r.ownerBlock.target===s.NodeMaterialBlockTargets.Fragment)return!0;if((r.ownerBlock.target===s.NodeMaterialBlockTargets.Neutral||r.ownerBlock.target===s.NodeMaterialBlockTargets.VertexAndFragment)&&r.ownerBlock.outputs.some((function(e){return e.isConnectedInFragmentShader})))return!0}return!1},enumerable:!1,configurable:!0}),e.prototype.createCustomInputBlock=function(){return null},e.prototype.getClassName=function(){return"NodeMaterialConnectionPoint"},e.prototype.canConnectTo=function(e){return this.checkCompatibilityState(e)===n.Compatible},e.prototype.checkCompatibilityState=function(e){if(this._ownerBlock.target===s.NodeMaterialBlockTargets.Fragment){var t=e.ownerBlock;if(t.target===s.NodeMaterialBlockTargets.Vertex)return n.TargetIncompatible;for(var r=0,i=t.outputs;r<i.length;r++)if(i[r].isConnectedInVertexShader)return n.TargetIncompatible}if(this.type!==e.type&&e.innerType!==o.NodeMaterialBlockConnectionPointTypes.AutoDetect){switch(this.type){case o.NodeMaterialBlockConnectionPointTypes.Vector3:if(e.type===o.NodeMaterialBlockConnectionPointTypes.Color3)return n.Compatible;break;case o.NodeMaterialBlockConnectionPointTypes.Vector4:if(e.type===o.NodeMaterialBlockConnectionPointTypes.Color4)return n.Compatible;break;case o.NodeMaterialBlockConnectionPointTypes.Color3:if(e.type===o.NodeMaterialBlockConnectionPointTypes.Vector3)return n.Compatible;break;case o.NodeMaterialBlockConnectionPointTypes.Color4:if(e.type===o.NodeMaterialBlockConnectionPointTypes.Vector4)return n.Compatible}return e.acceptedConnectionPointTypes&&-1!==e.acceptedConnectionPointTypes.indexOf(this.type)?n.Compatible:n.TypeIncompatible}return e.excludedConnectionPointTypes&&-1!==e.excludedConnectionPointTypes.indexOf(this.type)?1:n.Compatible},e.prototype.connectTo=function(e,t){if(void 0===t&&(t=!1),!t&&!this.canConnectTo(e))throw"Cannot connect these two connectors.";return this._endpoints.push(e),e._connectedPoint=this,this._enforceAssociatedVariableName=!1,this.onConnectionObservable.notifyObservers(e),e.onConnectionObservable.notifyObservers(this),this},e.prototype.disconnectFrom=function(e){var t=this._endpoints.indexOf(e);return-1===t||(this._endpoints.splice(t,1),e._connectedPoint=null,this._enforceAssociatedVariableName=!1,e._enforceAssociatedVariableName=!1),this},e.prototype.serialize=function(e){void 0===e&&(e=!0);var t={};return t.name=this.name,t.displayName=this.displayName,e&&this.connectedPoint&&(t.inputName=this.name,t.targetBlockId=this.connectedPoint.ownerBlock.uniqueId,t.targetConnectionName=this.connectedPoint.name),this.isExposedOnFrame&&(t.isExposedOnFrame=this.isExposedOnFrame),t},e.prototype.dispose=function(){this.onConnectionObservable.clear()},e}()},"./Materials/Node/nodeMaterialBuildState.ts":
- /*!**************************************************!*\
- !*** ./Materials/Node/nodeMaterialBuildState.ts ***!
- \**************************************************/
- /*! exports provided: NodeMaterialBuildState */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialBuildState",(function(){return a}));var n=r(/*! ./Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),i=r(/*! ./Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),o=r(/*! ../effect */"./Materials/effect.ts"),s=r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts"),a=function(){function e(){this.supportUniformBuffers=!1,this.attributes=new Array,this.uniforms=new Array,this.constants=new Array,this.samplers=new Array,this.functions={},this.extensions={},this.counters={},this._attributeDeclaration="",this._uniformDeclaration="",this._constantDeclaration="",this._samplerDeclaration="",this._varyingTransfer="",this._injectAtEnd="",this._repeatableContentAnchorIndex=0,this._builtCompilationString="",this.compilationString=""}return e.prototype.finalize=function(e){var t=e.sharedData.emitComments,r=this.target===i.NodeMaterialBlockTargets.Fragment;this.compilationString="\r\n"+(t?"//Entry point\r\n":"")+"void main(void) {\r\n"+this.compilationString,this._constantDeclaration&&(this.compilationString="\r\n"+(t?"//Constants\r\n":"")+this._constantDeclaration+"\r\n"+this.compilationString);var n="";for(var o in this.functions)n+=this.functions[o]+"\r\n";for(var s in this.compilationString="\r\n"+n+"\r\n"+this.compilationString,!r&&this._varyingTransfer&&(this.compilationString=this.compilationString+"\r\n"+this._varyingTransfer),this._injectAtEnd&&(this.compilationString=this.compilationString+"\r\n"+this._injectAtEnd),this.compilationString=this.compilationString+"\r\n}",this.sharedData.varyingDeclaration&&(this.compilationString="\r\n"+(t?"//Varyings\r\n":"")+this.sharedData.varyingDeclaration+"\r\n"+this.compilationString),this._samplerDeclaration&&(this.compilationString="\r\n"+(t?"//Samplers\r\n":"")+this._samplerDeclaration+"\r\n"+this.compilationString),this._uniformDeclaration&&(this.compilationString="\r\n"+(t?"//Uniforms\r\n":"")+this._uniformDeclaration+"\r\n"+this.compilationString),this._attributeDeclaration&&!r&&(this.compilationString="\r\n"+(t?"//Attributes\r\n":"")+this._attributeDeclaration+"\r\n"+this.compilationString),this.extensions){var a=this.extensions[s];this.compilationString="\r\n"+a+"\r\n"+this.compilationString}this._builtCompilationString=this.compilationString},Object.defineProperty(e.prototype,"_repeatableContentAnchor",{get:function(){return"###___ANCHOR"+this._repeatableContentAnchorIndex+++"___###"},enumerable:!1,configurable:!0}),e.prototype._getFreeVariableName=function(e){return e=e.replace(/[^a-zA-Z_]+/g,""),void 0===this.sharedData.variableNames[e]?(this.sharedData.variableNames[e]=0,"output"===e||"texture"===e?e+this.sharedData.variableNames[e]:e):(this.sharedData.variableNames[e]++,e+this.sharedData.variableNames[e])},e.prototype._getFreeDefineName=function(e){return void 0===this.sharedData.defineNames[e]?this.sharedData.defineNames[e]=0:this.sharedData.defineNames[e]++,e+this.sharedData.defineNames[e]},e.prototype._excludeVariableName=function(e){this.sharedData.variableNames[e]=0},e.prototype._emit2DSampler=function(e){this._samplerDeclaration+="uniform sampler2D "+e+";\r\n",this.samplers.push(e)},e.prototype._getGLType=function(e){switch(e){case n.NodeMaterialBlockConnectionPointTypes.Float:return"float";case n.NodeMaterialBlockConnectionPointTypes.Int:return"int";case n.NodeMaterialBlockConnectionPointTypes.Vector2:return"vec2";case n.NodeMaterialBlockConnectionPointTypes.Color3:case n.NodeMaterialBlockConnectionPointTypes.Vector3:return"vec3";case n.NodeMaterialBlockConnectionPointTypes.Color4:case n.NodeMaterialBlockConnectionPointTypes.Vector4:return"vec4";case n.NodeMaterialBlockConnectionPointTypes.Matrix:return"mat4"}return""},e.prototype._emitExtension=function(e,t,r){void 0===r&&(r=""),this.extensions[e]||(r&&(t="#if "+r+"\r\n"+t+"\r\n#endif"),this.extensions[e]=t)},e.prototype._emitFunction=function(e,t,r){this.functions[e]||(this.sharedData.emitComments&&(t=r+"\r\n"+t),this.functions[e]=t)},e.prototype._emitCodeFromInclude=function(e,t,r){if(r&&r.repeatKey)return"#include<"+e+">[0.."+r.repeatKey+"]\r\n";var n=o.Effect.IncludesShadersStore[e]+"\r\n";if(this.sharedData.emitComments&&(n=t+"\r\n"+n),!r)return n;if(r.replaceStrings)for(var i=0;i<r.replaceStrings.length;i++){var s=r.replaceStrings[i];n=n.replace(s.search,s.replace)}return n},e.prototype._emitFunctionFromInclude=function(e,t,r,n){void 0===n&&(n="");var i=e+n;if(!this.functions[i]){if(!r||!(r.removeAttributes||r.removeUniforms||r.removeVaryings||r.removeIfDef||r.replaceStrings))return r&&r.repeatKey?this.functions[i]="#include<"+e+">[0.."+r.repeatKey+"]\r\n":this.functions[i]="#include<"+e+">\r\n",void(this.sharedData.emitComments&&(this.functions[i]=t+"\r\n"+this.functions[i]));if(this.functions[i]=o.Effect.IncludesShadersStore[e],this.sharedData.emitComments&&(this.functions[i]=t+"\r\n"+this.functions[i]),r.removeIfDef&&(this.functions[i]=this.functions[i].replace(/^\s*?#ifdef.+$/gm,""),this.functions[i]=this.functions[i].replace(/^\s*?#endif.*$/gm,""),this.functions[i]=this.functions[i].replace(/^\s*?#else.*$/gm,""),this.functions[i]=this.functions[i].replace(/^\s*?#elif.*$/gm,"")),r.removeAttributes&&(this.functions[i]=this.functions[i].replace(/^\s*?attribute.+$/gm,"")),r.removeUniforms&&(this.functions[i]=this.functions[i].replace(/^\s*?uniform.+$/gm,"")),r.removeVaryings&&(this.functions[i]=this.functions[i].replace(/^\s*?varying.+$/gm,"")),r.replaceStrings)for(var s=0;s<r.replaceStrings.length;s++){var a=r.replaceStrings[s];this.functions[i]=this.functions[i].replace(a.search,a.replace)}}},e.prototype._registerTempVariable=function(e){return-1===this.sharedData.temps.indexOf(e)&&(this.sharedData.temps.push(e),!0)},e.prototype._emitVaryingFromString=function(e,t,r,n){return void 0===r&&(r=""),void 0===n&&(n=!1),-1===this.sharedData.varyings.indexOf(e)&&(this.sharedData.varyings.push(e),r&&(s.StringTools.StartsWith(r,"defined(")?this.sharedData.varyingDeclaration+="#if "+r+"\r\n":this.sharedData.varyingDeclaration+=(n?"#ifndef":"#ifdef")+" "+r+"\r\n"),this.sharedData.varyingDeclaration+="varying "+t+" "+e+";\r\n",r&&(this.sharedData.varyingDeclaration+="#endif\r\n"),!0)},e.prototype._emitUniformFromString=function(e,t,r,n){void 0===r&&(r=""),void 0===n&&(n=!1),-1===this.uniforms.indexOf(e)&&(this.uniforms.push(e),r&&(s.StringTools.StartsWith(r,"defined(")?this._uniformDeclaration+="#if "+r+"\r\n":this._uniformDeclaration+=(n?"#ifndef":"#ifdef")+" "+r+"\r\n"),this._uniformDeclaration+="uniform "+t+" "+e+";\r\n",r&&(this._uniformDeclaration+="#endif\r\n"))},e.prototype._emitFloat=function(e){return e.toString()===e.toFixed(0)?e+".0":e.toString()},e}()},"./Materials/Node/nodeMaterialBuildStateSharedData.ts":
- /*!************************************************************!*\
- !*** ./Materials/Node/nodeMaterialBuildStateSharedData.ts ***!
- \************************************************************/
- /*! exports provided: NodeMaterialBuildStateSharedData */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialBuildStateSharedData",(function(){return n}));var n=function(){function e(){this.temps=new Array,this.varyings=new Array,this.varyingDeclaration="",this.inputBlocks=new Array,this.textureBlocks=new Array,this.bindableBlocks=new Array,this.blocksWithFallbacks=new Array,this.blocksWithDefines=new Array,this.repeatableContentBlocks=new Array,this.dynamicUniformBlocks=new Array,this.blockingBlocks=new Array,this.animatedInputs=new Array,this.variableNames={},this.defineNames={},this.hints={needWorldViewMatrix:!1,needWorldViewProjectionMatrix:!1,needAlphaBlending:!1,needAlphaTesting:!1},this.checks={emitVertex:!1,emitFragment:!1,notConnectedNonOptionalInputs:new Array},this.allowEmptyVertexProgram=!1,this.variableNames.position=0,this.variableNames.normal=0,this.variableNames.tangent=0,this.variableNames.uv=0,this.variableNames.uv2=0,this.variableNames.uv3=0,this.variableNames.uv4=0,this.variableNames.uv4=0,this.variableNames.uv5=0,this.variableNames.uv6=0,this.variableNames.color=0,this.variableNames.matricesIndices=0,this.variableNames.matricesWeights=0,this.variableNames.matricesIndicesExtra=0,this.variableNames.matricesWeightsExtra=0,this.variableNames.diffuseBase=0,this.variableNames.specularBase=0,this.variableNames.worldPos=0,this.variableNames.shadow=0,this.variableNames.vTBN=0,this.defineNames.MAINUV0=0,this.defineNames.MAINUV1=0,this.defineNames.MAINUV2=0,this.defineNames.MAINUV3=0,this.defineNames.MAINUV4=0,this.defineNames.MAINUV5=0,this.defineNames.MAINUV6=0,this.defineNames.MAINUV7=0}return e.prototype.emitErrors=function(){var e="";this.checks.emitVertex||this.allowEmptyVertexProgram||(e+="NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\r\n"),this.checks.emitFragment||(e+="NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\r\n");for(var t=0,r=this.checks.notConnectedNonOptionalInputs;t<r.length;t++){var n=r[t];e+="input "+n.name+" from block "+n.ownerBlock.name+"["+n.ownerBlock.getClassName()+"] is not connected and is not optional.\r\n"}if(e)throw"Build of NodeMaterial failed:\r\n"+e},e}()},"./Materials/Node/nodeMaterialConnectionPointCustomObject.ts":
- /*!*******************************************************************!*\
- !*** ./Materials/Node/nodeMaterialConnectionPointCustomObject.ts ***!
- \*******************************************************************/
- /*! exports provided: NodeMaterialConnectionPointCustomObject */function(e,t,r){"use strict";r.r(t),r.d(t,"NodeMaterialConnectionPointCustomObject",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./nodeMaterialBlockConnectionPoint */"./Materials/Node/nodeMaterialBlockConnectionPoint.ts"),o=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t,r,n)||this;return a._blockType=i,a._blockName=o,a._nameForCheking=s,a._nameForCheking||(a._nameForCheking=t),a.needDualDirectionValidation=!0,a}return Object(n.__extends)(t,e),t.prototype.checkCompatibilityState=function(e){return e instanceof t&&e.name===this._nameForCheking?i.NodeMaterialConnectionPointCompatibilityStates.Compatible:i.NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible},t.prototype.createCustomInputBlock=function(){return[new this._blockType(this._blockName),this.name]},t}(i.NodeMaterialConnectionPoint)},"./Materials/Node/nodeMaterialDecorator.ts":
- /*!*************************************************!*\
- !*** ./Materials/Node/nodeMaterialDecorator.ts ***!
- \*************************************************/
- /*! exports provided: PropertyTypeForEdition, editableInPropertyPage */function(e,t,r){"use strict";var n;function i(e,t,r,i){return void 0===t&&(t=n.Boolean),void 0===r&&(r="PROPERTIES"),function(n,o){var s=n._propStore;s||(s=[],n._propStore=s),s.push({propertyName:o,displayName:e,type:t,groupName:r,options:null!=i?i:{}})}}r.r(t),r.d(t,"PropertyTypeForEdition",(function(){return n})),r.d(t,"editableInPropertyPage",(function(){return i})),function(e){e[e.Boolean=0]="Boolean",e[e.Float=1]="Float",e[e.Vector2=2]="Vector2",e[e.List=3]="List"}(n||(n={}))},"./Materials/PBR/index.ts":
- /*!********************************!*\
- !*** ./Materials/PBR/index.ts ***!
- \********************************/
- /*! exports provided: PBRMaterialDefines, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./pbrBaseMaterial */"./Materials/PBR/pbrBaseMaterial.ts");r.d(t,"PBRMaterialDefines",(function(){return n.PBRMaterialDefines})),r.d(t,"PBRBaseMaterial",(function(){return n.PBRBaseMaterial}));var i=r(/*! ./pbrBaseSimpleMaterial */"./Materials/PBR/pbrBaseSimpleMaterial.ts");r.d(t,"PBRBaseSimpleMaterial",(function(){return i.PBRBaseSimpleMaterial}));var o=r(/*! ./pbrMaterial */"./Materials/PBR/pbrMaterial.ts");r.d(t,"PBRMaterial",(function(){return o.PBRMaterial}));var s=r(/*! ./pbrMetallicRoughnessMaterial */"./Materials/PBR/pbrMetallicRoughnessMaterial.ts");r.d(t,"PBRMetallicRoughnessMaterial",(function(){return s.PBRMetallicRoughnessMaterial}));var a=r(/*! ./pbrSpecularGlossinessMaterial */"./Materials/PBR/pbrSpecularGlossinessMaterial.ts");r.d(t,"PBRSpecularGlossinessMaterial",(function(){return a.PBRSpecularGlossinessMaterial}))},"./Materials/PBR/pbrAnisotropicConfiguration.ts":
- /*!******************************************************!*\
- !*** ./Materials/PBR/pbrAnisotropicConfiguration.ts ***!
- \******************************************************/
- /*! exports provided: PBRAnisotropicConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRAnisotropicConfiguration",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/materialFlags */"./Materials/materialFlags.ts"),l=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),c=function(){function e(e){this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.direction=new s.Vector2(1,0),this._texture=null,this.texture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){return!(e._areTexturesDirty&&t.texturesEnabled&&this._texture&&a.MaterialFlags.AnisotropicTextureEnabled&&!this._texture.isReadyOrNotBlocking())},e.prototype.prepareDefines=function(e,t,r){this._isEnabled?(e.ANISOTROPIC=this._isEnabled,this._isEnabled&&!t.isVerticesDataPresent(o.VertexBuffer.TangentKind)&&(e._needUVs=!0,e.MAINUV1=!0),e._areTexturesDirty&&r.texturesEnabled&&(this._texture&&a.MaterialFlags.AnisotropicTextureEnabled?l.MaterialHelper.PrepareDefinesForMergedUV(this._texture,e,"ANISOTROPIC_TEXTURE"):e.ANISOTROPIC_TEXTURE=!1)):(e.ANISOTROPIC=!1,e.ANISOTROPIC_TEXTURE=!1)},e.prototype.bindForSubMesh=function(e,t,r){e.useUbo&&r&&e.isSync||(this._texture&&a.MaterialFlags.AnisotropicTextureEnabled&&(e.updateFloat2("vAnisotropyInfos",this._texture.coordinatesIndex,this._texture.level),l.MaterialHelper.BindTextureMatrix(this._texture,e,"anisotropy")),e.updateFloat3("vAnisotropy",this.direction.x,this.direction.y,this.intensity)),t.texturesEnabled&&this._texture&&a.MaterialFlags.AnisotropicTextureEnabled&&e.setTexture("anisotropySampler",this._texture)},e.prototype.hasTexture=function(e){return this._texture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)},e.prototype.dispose=function(e){e&&this._texture&&this._texture.dispose()},e.prototype.getClassName=function(){return"PBRAnisotropicConfiguration"},e.AddFallbacks=function(e,t,r){return e.ANISOTROPIC&&t.addFallback(r++,"ANISOTROPIC"),r},e.AddUniforms=function(e){e.push("vAnisotropy","vAnisotropyInfos","anisotropyMatrix")},e.PrepareUniformBuffer=function(e){e.addUniform("vAnisotropy",3),e.addUniform("vAnisotropyInfos",2),e.addUniform("anisotropyMatrix",16)},e.AddSamplers=function(e){e.push("anisotropySampler")},e.prototype.copyTo=function(e){i.SerializationHelper.Clone((function(){return e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse((function(){return n}),e,t,r)},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serializeAsVector2)()],e.prototype,"direction",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),e}()},"./Materials/PBR/pbrBRDFConfiguration.ts":
- /*!***********************************************!*\
- !*** ./Materials/PBR/pbrBRDFConfiguration.ts ***!
- \***********************************************/
- /*! exports provided: PBRBRDFConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRBRDFConfiguration",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=function(){function e(t){this._useEnergyConservation=e.DEFAULT_USE_ENERGY_CONSERVATION,this.useEnergyConservation=e.DEFAULT_USE_ENERGY_CONSERVATION,this._useSmithVisibilityHeightCorrelated=e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this.useSmithVisibilityHeightCorrelated=e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this._useSphericalHarmonics=e.DEFAULT_USE_SPHERICAL_HARMONICS,this.useSphericalHarmonics=e.DEFAULT_USE_SPHERICAL_HARMONICS,this._useSpecularGlossinessInputEnergyConservation=e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this.useSpecularGlossinessInputEnergyConservation=e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this._internalMarkAllSubMeshesAsMiscDirty=t}return e.prototype._markAllSubMeshesAsMiscDirty=function(){this._internalMarkAllSubMeshesAsMiscDirty()},e.prototype.prepareDefines=function(e){e.BRDF_V_HEIGHT_CORRELATED=this._useSmithVisibilityHeightCorrelated,e.MS_BRDF_ENERGY_CONSERVATION=this._useEnergyConservation&&this._useSmithVisibilityHeightCorrelated,e.SPHERICAL_HARMONICS=this._useSphericalHarmonics,e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=this._useSpecularGlossinessInputEnergyConservation},e.prototype.getClassName=function(){return"PBRBRDFConfiguration"},e.prototype.copyTo=function(e){i.SerializationHelper.Clone((function(){return e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse((function(){return n}),e,t,r)},e.DEFAULT_USE_ENERGY_CONSERVATION=!0,e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0,e.DEFAULT_USE_SPHERICAL_HARMONICS=!0,e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION=!0,Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useEnergyConservation",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSmithVisibilityHeightCorrelated",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSphericalHarmonics",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSpecularGlossinessInputEnergyConservation",void 0),e}()},"./Materials/PBR/pbrBaseMaterial.ts":
- /*!******************************************!*\
- !*** ./Materials/PBR/pbrBaseMaterial.ts ***!
- \******************************************/
- /*! exports provided: PBRMaterialDefines, PBRBaseMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRMaterialDefines",(function(){return R})),r.d(t,"PBRBaseMaterial",(function(){return O}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../../Misc/smartArray */"./Misc/smartArray.ts"),a=r(/*! ../../Misc/brdfTextureTools */"./Misc/brdfTextureTools.ts"),l=r(/*! ../../scene */"./scene.ts"),c=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),u=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),d=r(/*! ./pbrClearCoatConfiguration */"./Materials/PBR/pbrClearCoatConfiguration.ts"),h=r(/*! ./pbrAnisotropicConfiguration */"./Materials/PBR/pbrAnisotropicConfiguration.ts"),f=r(/*! ./pbrBRDFConfiguration */"./Materials/PBR/pbrBRDFConfiguration.ts"),p=r(/*! ./pbrSheenConfiguration */"./Materials/PBR/pbrSheenConfiguration.ts"),m=r(/*! ./pbrSubSurfaceConfiguration */"./Materials/PBR/pbrSubSurfaceConfiguration.ts"),g=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),_=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),v=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),y=r(/*! ../../Materials/material */"./Materials/material.ts"),b=r(/*! ../../Materials/materialDefines */"./Materials/materialDefines.ts"),A=r(/*! ../../Materials/pushMaterial */"./Materials/pushMaterial.ts"),T=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),M=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),P=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),S=r(/*! ../../Engines/constants */"./Engines/constants.ts"),E=(r(/*! ../../Materials/Textures/baseTexture.polynomial */"./Materials/Textures/baseTexture.polynomial.ts"),r(/*! ../../Shaders/pbr.fragment */"./Shaders/pbr.fragment.ts"),r(/*! ../../Shaders/pbr.vertex */"./Shaders/pbr.vertex.ts"),r(/*! ../effectFallbacks */"./Materials/effectFallbacks.ts")),C=r(/*! ../material.detailMapConfiguration */"./Materials/material.detailMapConfiguration.ts"),x={effect:null,subMesh:null},R=function(e){function t(){var t=e.call(this)||this;return t.PBR=!0,t.NUM_SAMPLES="0",t.REALTIME_FILTERING=!1,t.MAINUV1=!1,t.MAINUV2=!1,t.UV1=!1,t.UV2=!1,t.ALBEDO=!1,t.GAMMAALBEDO=!1,t.ALBEDODIRECTUV=0,t.VERTEXCOLOR=!1,t.DETAIL=!1,t.DETAILDIRECTUV=0,t.DETAIL_NORMALBLENDMETHOD=0,t.AMBIENT=!1,t.AMBIENTDIRECTUV=0,t.AMBIENTINGRAYSCALE=!1,t.OPACITY=!1,t.VERTEXALPHA=!1,t.OPACITYDIRECTUV=0,t.OPACITYRGB=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.ALPHABLEND=!1,t.ALPHAFROMALBEDO=!1,t.ALPHATESTVALUE="0.5",t.SPECULAROVERALPHA=!1,t.RADIANCEOVERALPHA=!1,t.ALPHAFRESNEL=!1,t.LINEARALPHAFRESNEL=!1,t.PREMULTIPLYALPHA=!1,t.EMISSIVE=!1,t.EMISSIVEDIRECTUV=0,t.REFLECTIVITY=!1,t.REFLECTIVITYDIRECTUV=0,t.SPECULARTERM=!1,t.MICROSURFACEFROMREFLECTIVITYMAP=!1,t.MICROSURFACEAUTOMATIC=!1,t.LODBASEDMICROSFURACE=!1,t.MICROSURFACEMAP=!1,t.MICROSURFACEMAPDIRECTUV=0,t.METALLICWORKFLOW=!1,t.ROUGHNESSSTOREINMETALMAPALPHA=!1,t.ROUGHNESSSTOREINMETALMAPGREEN=!1,t.METALLNESSSTOREINMETALMAPBLUE=!1,t.AOSTOREINMETALMAPRED=!1,t.METALLIC_REFLECTANCE=!1,t.METALLIC_REFLECTANCEDIRECTUV=0,t.ENVIRONMENTBRDF=!1,t.ENVIRONMENTBRDF_RGBD=!1,t.NORMAL=!1,t.TANGENT=!1,t.BUMP=!1,t.BUMPDIRECTUV=0,t.OBJECTSPACE_NORMALMAP=!1,t.PARALLAX=!1,t.PARALLAXOCCLUSION=!1,t.NORMALXYSCALE=!0,t.LIGHTMAP=!1,t.LIGHTMAPDIRECTUV=0,t.USELIGHTMAPASSHADOWMAP=!1,t.GAMMALIGHTMAP=!1,t.RGBDLIGHTMAP=!1,t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USEIRRADIANCEMAP=!1,t.SPHERICAL_HARMONICS=!1,t.USESPHERICALINVERTEX=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.LINEARSPECULARREFLECTION=!1,t.RADIANCEOCCLUSION=!1,t.HORIZONOCCLUSION=!1,t.INSTANCES=!1,t.THIN_INSTANCES=!1,t.PREPASS=!1,t.SCENE_MRT_COUNT=0,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.NONUNIFORMSCALING=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.MULTIVIEW=!1,t.USEPHYSICALLIGHTFALLOFF=!1,t.USEGLTFLIGHTFALLOFF=!1,t.TWOSIDEDLIGHTING=!1,t.SHADOWFLOAT=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.LOGARITHMICDEPTH=!1,t.FORCENORMALFORWARD=!1,t.SPECULARAA=!1,t.CLEARCOAT=!1,t.CLEARCOAT_DEFAULTIOR=!1,t.CLEARCOAT_TEXTURE=!1,t.CLEARCOAT_TEXTUREDIRECTUV=0,t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_BUMPDIRECTUV=0,t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1,t.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,t.ANISOTROPIC=!1,t.ANISOTROPIC_TEXTURE=!1,t.ANISOTROPIC_TEXTUREDIRECTUV=0,t.BRDF_V_HEIGHT_CORRELATED=!1,t.MS_BRDF_ENERGY_CONSERVATION=!1,t.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!1,t.SHEEN=!1,t.SHEEN_TEXTURE=!1,t.SHEEN_TEXTUREDIRECTUV=0,t.SHEEN_LINKWITHALBEDO=!1,t.SHEEN_ROUGHNESS=!1,t.SHEEN_ALBEDOSCALING=!1,t.SUBSURFACE=!1,t.SS_REFRACTION=!1,t.SS_TRANSLUCENCY=!1,t.SS_SCATTERING=!1,t.SS_THICKNESSANDMASK_TEXTURE=!1,t.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,t.SS_REFRACTIONMAP_3D=!1,t.SS_REFRACTIONMAP_OPPOSITEZ=!1,t.SS_LODINREFRACTIONALPHA=!1,t.SS_GAMMAREFRACTION=!1,t.SS_RGBDREFRACTION=!1,t.SS_LINEARSPECULARREFRACTION=!1,t.SS_LINKREFRACTIONTOTRANSPARENCY=!1,t.SS_ALBEDOFORREFRACTIONTINT=!1,t.SS_MASK_FROM_THICKNESS_TEXTURE=!1,t.UNLIT=!1,t.DEBUGMODE=0,t.rebuild(),t}return Object(n.__extends)(t,e),t.prototype.reset=function(){e.prototype.reset.call(this),this.ALPHATESTVALUE="0.5",this.PBR=!0},t}(b.MaterialDefines),O=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i._directIntensity=1,i._emissiveIntensity=1,i._environmentIntensity=1,i._specularIntensity=1,i._lightingInfos=new c.Vector4(i._directIntensity,i._emissiveIntensity,i._environmentIntensity,i._specularIntensity),i._disableBumpMap=!1,i._albedoTexture=null,i._ambientTexture=null,i._ambientTextureStrength=1,i._ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,i._opacityTexture=null,i._reflectionTexture=null,i._emissiveTexture=null,i._reflectivityTexture=null,i._metallicTexture=null,i._metallic=null,i._roughness=null,i._metallicF0Factor=1,i._metallicReflectanceColor=g.Color3.White(),i._metallicReflectanceTexture=null,i._microSurfaceTexture=null,i._bumpTexture=null,i._lightmapTexture=null,i._ambientColor=new g.Color3(0,0,0),i._albedoColor=new g.Color3(1,1,1),i._reflectivityColor=new g.Color3(1,1,1),i._reflectionColor=new g.Color3(1,1,1),i._emissiveColor=new g.Color3(0,0,0),i._microSurface=.9,i._useLightmapAsShadowmap=!1,i._useHorizonOcclusion=!0,i._useRadianceOcclusion=!0,i._useAlphaFromAlbedoTexture=!1,i._useSpecularOverAlpha=!0,i._useMicroSurfaceFromReflectivityMapAlpha=!1,i._useRoughnessFromMetallicTextureAlpha=!0,i._useRoughnessFromMetallicTextureGreen=!1,i._useMetallnessFromMetallicTextureBlue=!1,i._useAmbientOcclusionFromMetallicTextureRed=!1,i._useAmbientInGrayScale=!1,i._useAutoMicroSurfaceFromReflectivityMap=!1,i._lightFalloff=t.LIGHTFALLOFF_PHYSICAL,i._useRadianceOverAlpha=!0,i._useObjectSpaceNormalMap=!1,i._useParallax=!1,i._useParallaxOcclusion=!1,i._parallaxScaleBias=.05,i._disableLighting=!1,i._maxSimultaneousLights=4,i._invertNormalMapX=!1,i._invertNormalMapY=!1,i._twoSidedLighting=!1,i._alphaCutOff=.4,i._forceAlphaTest=!1,i._useAlphaFresnel=!1,i._useLinearAlphaFresnel=!1,i._environmentBRDFTexture=null,i._forceIrradianceInFragment=!1,i._realTimeFiltering=!1,i._realTimeFilteringQuality=S.Constants.TEXTURE_FILTERING_QUALITY_LOW,i._forceNormalForward=!1,i._enableSpecularAntiAliasing=!1,i._imageProcessingObserver=null,i._renderTargets=new s.SmartArray(16),i._globalAmbientColor=new g.Color3(0,0,0),i._useLogarithmicDepth=!1,i._unlit=!1,i._debugMode=0,i.debugMode=0,i.debugLimit=-1,i.debugFactor=1,i.clearCoat=new d.PBRClearCoatConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i.anisotropy=new h.PBRAnisotropicConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i.brdf=new f.PBRBRDFConfiguration(i._markAllSubMeshesAsMiscDirty.bind(i)),i.sheen=new p.PBRSheenConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i.detailMap=new C.DetailMapConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i._rebuildInParallel=!1,i._attachImageProcessingConfiguration(null),i.getRenderTargetTextures=function(){return i._renderTargets.reset(),P.MaterialFlags.ReflectionTextureEnabled&&i._reflectionTexture&&i._reflectionTexture.isRenderTarget&&i._renderTargets.push(i._reflectionTexture),i.subSurface.fillRenderTargetTextures(i._renderTargets),i._renderTargets},i._environmentBRDFTexture=a.BRDFTextureTools.GetEnvironmentBRDFTexture(n),i.subSurface=new m.PBRSubSurfaceConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i),i._markScenePrePassDirty.bind(i),n),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"realTimeFiltering",{get:function(){return this._realTimeFiltering},set:function(e){this._realTimeFiltering=e,this.markAsDirty(S.Constants.MATERIAL_TextureDirtyFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realTimeFilteringQuality",{get:function(){return this._realTimeFilteringQuality},set:function(e){this._realTimeFilteringQuality=e,this.markAsDirty(S.Constants.MATERIAL_TextureDirtyFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRenderToMRT",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add((function(){t._markAllSubMeshesAsImageProcessingDirty()}))))},Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!!(P.MaterialFlags.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||this.subSurface.hasRenderTargetTextures()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseMaterial"},Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_disableAlphaBlending",{get:function(){return this.subSurface.disableAlphaBlending||this._transparencyMode===t.PBRMATERIAL_OPAQUE||this._transparencyMode===t.PBRMATERIAL_ALPHATEST},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromAlbedoTexture())},t.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest||!this.subSurface.disableAlphaBlending&&null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&(null==this._transparencyMode||this._transparencyMode===t.PBRMATERIAL_ALPHATEST)},t.prototype._shouldUseAlphaFromAlbedoTexture=function(){return null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&this._useAlphaFromAlbedoTexture&&this._transparencyMode!==t.PBRMATERIAL_OPAQUE},t.prototype.getAlphaTestTexture=function(){return this._albedoTexture},t.prototype.isReadyForSubMesh=function(e,t,r){if(t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new R);var n=t._materialDefines;if(this._isReadyForSubMesh(t))return!0;var i=this.getScene(),s=i.getEngine();if(n._areTexturesDirty&&i.texturesEnabled){if(this._albedoTexture&&P.MaterialFlags.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking())return!1;if(this._ambientTexture&&P.MaterialFlags.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking())return!1;if(this._opacityTexture&&P.MaterialFlags.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;var a=this._getReflectionTexture();if(a&&P.MaterialFlags.ReflectionTextureEnabled){if(!a.isReadyOrNotBlocking())return!1;if(a.irradianceTexture&&!a.irradianceTexture.isReadyOrNotBlocking())return!1}if(this._lightmapTexture&&P.MaterialFlags.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking())return!1;if(this._emissiveTexture&&P.MaterialFlags.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(P.MaterialFlags.SpecularTextureEnabled){if(this._metallicTexture){if(!this._metallicTexture.isReadyOrNotBlocking())return!1}else if(this._reflectivityTexture&&!this._reflectivityTexture.isReadyOrNotBlocking())return!1;if(this._metallicReflectanceTexture&&!this._metallicReflectanceTexture.isReadyOrNotBlocking())return!1;if(this._microSurfaceTexture&&!this._microSurfaceTexture.isReadyOrNotBlocking())return!1}if(s.getCaps().standardDerivatives&&this._bumpTexture&&P.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady())return!1;if(this._environmentBRDFTexture&&P.MaterialFlags.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(!(this.subSurface.isReadyForSubMesh(n,i)&&this.clearCoat.isReadyForSubMesh(n,i,s,this._disableBumpMap)&&this.sheen.isReadyForSubMesh(n,i)&&this.anisotropy.isReadyForSubMesh(n,i)&&this.detailMap.isReadyForSubMesh(n,i)))return!1;if(n._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;s.getCaps().standardDerivatives||e.isVerticesDataPresent(u.VertexBuffer.NormalKind)||(e.createNormals(!0),o.Logger.Warn("PBRMaterial: Normals have been created for the mesh: "+e.name));var l=t.effect,c=n._areLightsDisposed,d=this._prepareEffect(e,n,this.onCompiled,this.onError,r,null,t.getRenderingMesh().hasThinInstances);if(d)if(this._onEffectCreatedObservable&&(x.effect=d,x.subMesh=t,this._onEffectCreatedObservable.notifyObservers(x)),this.allowShaderHotSwapping&&l&&!d.isReady()){if(d=l,this._rebuildInParallel=!0,n.markAsUnprocessed(),c)return n._areLightsDisposed=!0,!1}else this._rebuildInParallel=!1,i.resetCachedMaterial(),t.setEffect(d,n),this.buildUniformLayout();return!(!t.effect||!t.effect.isReady()||(n._renderId=i.getRenderId(),t.effect._wasPreviouslyReady=!0,0))},t.prototype.isMetallicWorkflow=function(){return!(null==this._metallic&&null==this._roughness&&!this._metallicTexture)},t.prototype._prepareEffect=function(e,t,r,n,i,o,s){if(void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),this._prepareDefines(e,t,i,o,s),!t.isDirty)return null;t.markAsProcessed();var a=this.getScene().getEngine(),l=new E.EffectFallbacks,c=0;t.USESPHERICALINVERTEX&&l.addFallback(c++,"USESPHERICALINVERTEX"),t.FOG&&l.addFallback(c,"FOG"),t.SPECULARAA&&l.addFallback(c,"SPECULARAA"),t.POINTSIZE&&l.addFallback(c,"POINTSIZE"),t.LOGARITHMICDEPTH&&l.addFallback(c,"LOGARITHMICDEPTH"),t.PARALLAX&&l.addFallback(c,"PARALLAX"),t.PARALLAXOCCLUSION&&l.addFallback(c++,"PARALLAXOCCLUSION"),c=h.PBRAnisotropicConfiguration.AddFallbacks(t,l,c),c=h.PBRAnisotropicConfiguration.AddFallbacks(t,l,c),c=m.PBRSubSurfaceConfiguration.AddFallbacks(t,l,c),c=p.PBRSheenConfiguration.AddFallbacks(t,l,c),t.ENVIRONMENTBRDF&&l.addFallback(c++,"ENVIRONMENTBRDF"),t.TANGENT&&l.addFallback(c++,"TANGENT"),t.BUMP&&l.addFallback(c++,"BUMP"),c=T.MaterialHelper.HandleFallbacksForShadows(t,l,this._maxSimultaneousLights,c++),t.SPECULARTERM&&l.addFallback(c++,"SPECULARTERM"),t.USESPHERICALFROMREFLECTIONMAP&&l.addFallback(c++,"USESPHERICALFROMREFLECTIONMAP"),t.USEIRRADIANCEMAP&&l.addFallback(c++,"USEIRRADIANCEMAP"),t.LIGHTMAP&&l.addFallback(c++,"LIGHTMAP"),t.NORMAL&&l.addFallback(c++,"NORMAL"),t.AMBIENT&&l.addFallback(c++,"AMBIENT"),t.EMISSIVE&&l.addFallback(c++,"EMISSIVE"),t.VERTEXCOLOR&&l.addFallback(c++,"VERTEXCOLOR"),t.MORPHTARGETS&&l.addFallback(c++,"MORPHTARGETS"),t.MULTIVIEW&&l.addFallback(0,"MULTIVIEW");var f=[u.VertexBuffer.PositionKind];t.NORMAL&&f.push(u.VertexBuffer.NormalKind),t.TANGENT&&f.push(u.VertexBuffer.TangentKind),t.UV1&&f.push(u.VertexBuffer.UVKind),t.UV2&&f.push(u.VertexBuffer.UV2Kind),t.VERTEXCOLOR&&f.push(u.VertexBuffer.ColorKind),T.MaterialHelper.PrepareAttributesForBones(f,e,t,l),T.MaterialHelper.PrepareAttributesForInstances(f,t),T.MaterialHelper.PrepareAttributesForMorphTargets(f,e,t);var g="pbr",_=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","vReflectivityColor","vMetallicReflectanceFactors","vEmissiveColor","visibility","vReflectionColor","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vReflectionPosition","vReflectionSize","vEmissiveInfos","vReflectivityInfos","vReflectionFilteringInfo","vMetallicReflectanceInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","albedoMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","metallicReflectanceMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX_ZZ","vSphericalYY_ZZ","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vSphericalL00","vSphericalL1_1","vSphericalL10","vSphericalL11","vSphericalL2_2","vSphericalL2_1","vSphericalL20","vSphericalL21","vSphericalL22","vReflectionMicrosurfaceInfos","vTangentSpaceParams","boneTextureWidth","vDebugMode"],y=["albedoSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","microSurfaceSampler","environmentBrdfSampler","boneSampler","metallicReflectanceSampler"],b=["Material","Scene"];C.DetailMapConfiguration.AddUniforms(_),C.DetailMapConfiguration.AddSamplers(y),m.PBRSubSurfaceConfiguration.AddUniforms(_),m.PBRSubSurfaceConfiguration.AddSamplers(y),d.PBRClearCoatConfiguration.AddUniforms(_),d.PBRClearCoatConfiguration.AddSamplers(y),h.PBRAnisotropicConfiguration.AddUniforms(_),h.PBRAnisotropicConfiguration.AddSamplers(y),p.PBRSheenConfiguration.AddUniforms(_),p.PBRSheenConfiguration.AddSamplers(y),v.ImageProcessingConfiguration&&(v.ImageProcessingConfiguration.PrepareUniforms(_,t),v.ImageProcessingConfiguration.PrepareSamplers(y,t)),T.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:_,uniformBuffersNames:b,samplers:y,defines:t,maxSimultaneousLights:this._maxSimultaneousLights});var A={};this.customShaderNameResolve&&(g=this.customShaderNameResolve(g,_,b,y,t,f,A));var M=t.toString();return a.createEffect(g,{attributes:f,uniformsNames:_,uniformBuffersNames:b,samplers:y,defines:M,fallbacks:l,onCompiled:r,onError:n,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:t.NUM_MORPH_INFLUENCERS},processFinalCode:A.processFinalCode,multiTarget:t.PREPASS},a)},t.prototype._prepareDefines=function(e,r,n,i,o){void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=!1);var s=this.getScene(),a=s.getEngine();if(T.MaterialHelper.PrepareDefinesForLights(s,e,r,!0,this._maxSimultaneousLights,this._disableLighting),r._needNormals=!0,T.MaterialHelper.PrepareDefinesForMultiview(s,r),T.MaterialHelper.PrepareDefinesForPrePass(s,r,this.canRenderToMRT),r.METALLICWORKFLOW=this.isMetallicWorkflow(),r._areTexturesDirty){if(r._needUVs=!1,s.texturesEnabled){s.getEngine().getCaps().textureLOD&&(r.LODBASEDMICROSFURACE=!0),this._albedoTexture&&P.MaterialFlags.DiffuseTextureEnabled?(T.MaterialHelper.PrepareDefinesForMergedUV(this._albedoTexture,r,"ALBEDO"),r.GAMMAALBEDO=this._albedoTexture.gammaSpace):r.ALBEDO=!1,this._ambientTexture&&P.MaterialFlags.AmbientTextureEnabled?(T.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture,r,"AMBIENT"),r.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):r.AMBIENT=!1,this._opacityTexture&&P.MaterialFlags.OpacityTextureEnabled?(T.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture,r,"OPACITY"),r.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):r.OPACITY=!1;var l=this._getReflectionTexture();if(l&&P.MaterialFlags.ReflectionTextureEnabled){switch(r.REFLECTION=!0,r.GAMMAREFLECTION=l.gammaSpace,r.RGBDREFLECTION=l.isRGBD,r.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!l.invertZ:l.invertZ,r.LODINREFLECTIONALPHA=l.lodLevelInAlpha,r.LINEARSPECULARREFLECTION=l.linearSpecularLOD,this.realTimeFiltering&&this.realTimeFilteringQuality>0?(r.NUM_SAMPLES=""+this.realTimeFilteringQuality,a.webGLVersion>1&&(r.NUM_SAMPLES=r.NUM_SAMPLES+"u"),r.REALTIME_FILTERING=!0):r.REALTIME_FILTERING=!1,l.coordinatesMode===M.Texture.INVCUBIC_MODE&&(r.INVERTCUBICMAP=!0),r.REFLECTIONMAP_3D=l.isCube,r.REFLECTIONMAP_CUBIC=!1,r.REFLECTIONMAP_EXPLICIT=!1,r.REFLECTIONMAP_PLANAR=!1,r.REFLECTIONMAP_PROJECTION=!1,r.REFLECTIONMAP_SKYBOX=!1,r.REFLECTIONMAP_SPHERICAL=!1,r.REFLECTIONMAP_EQUIRECTANGULAR=!1,r.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,r.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,l.coordinatesMode){case M.Texture.EXPLICIT_MODE:r.REFLECTIONMAP_EXPLICIT=!0;break;case M.Texture.PLANAR_MODE:r.REFLECTIONMAP_PLANAR=!0;break;case M.Texture.PROJECTION_MODE:r.REFLECTIONMAP_PROJECTION=!0;break;case M.Texture.SKYBOX_MODE:r.REFLECTIONMAP_SKYBOX=!0;break;case M.Texture.SPHERICAL_MODE:r.REFLECTIONMAP_SPHERICAL=!0;break;case M.Texture.EQUIRECTANGULAR_MODE:r.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case M.Texture.FIXED_EQUIRECTANGULAR_MODE:r.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case M.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:r.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case M.Texture.CUBIC_MODE:case M.Texture.INVCUBIC_MODE:default:r.REFLECTIONMAP_CUBIC=!0,r.USE_LOCAL_REFLECTIONMAP_CUBIC=!!l.boundingBoxSize}l.coordinatesMode!==M.Texture.SKYBOX_MODE&&(l.irradianceTexture?(r.USEIRRADIANCEMAP=!0,r.USESPHERICALFROMREFLECTIONMAP=!1):l.isCube&&(r.USESPHERICALFROMREFLECTIONMAP=!0,r.USEIRRADIANCEMAP=!1,this._forceIrradianceInFragment||this.realTimeFiltering||s.getEngine().getCaps().maxVaryingVectors<=8?r.USESPHERICALINVERTEX=!1:r.USESPHERICALINVERTEX=!0))}else r.REFLECTION=!1,r.REFLECTIONMAP_3D=!1,r.REFLECTIONMAP_SPHERICAL=!1,r.REFLECTIONMAP_PLANAR=!1,r.REFLECTIONMAP_CUBIC=!1,r.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,r.REFLECTIONMAP_PROJECTION=!1,r.REFLECTIONMAP_SKYBOX=!1,r.REFLECTIONMAP_EXPLICIT=!1,r.REFLECTIONMAP_EQUIRECTANGULAR=!1,r.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,r.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,r.INVERTCUBICMAP=!1,r.USESPHERICALFROMREFLECTIONMAP=!1,r.USEIRRADIANCEMAP=!1,r.USESPHERICALINVERTEX=!1,r.REFLECTIONMAP_OPPOSITEZ=!1,r.LODINREFLECTIONALPHA=!1,r.GAMMAREFLECTION=!1,r.RGBDREFLECTION=!1,r.LINEARSPECULARREFLECTION=!1;this._lightmapTexture&&P.MaterialFlags.LightmapTextureEnabled?(T.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture,r,"LIGHTMAP"),r.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,r.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace,r.RGBDLIGHTMAP=this._lightmapTexture.isRGBD):r.LIGHTMAP=!1,this._emissiveTexture&&P.MaterialFlags.EmissiveTextureEnabled?T.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture,r,"EMISSIVE"):r.EMISSIVE=!1,P.MaterialFlags.SpecularTextureEnabled?(this._metallicTexture?(T.MaterialHelper.PrepareDefinesForMergedUV(this._metallicTexture,r,"REFLECTIVITY"),r.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,r.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,r.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,r.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed):this._reflectivityTexture?(T.MaterialHelper.PrepareDefinesForMergedUV(this._reflectivityTexture,r,"REFLECTIVITY"),r.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,r.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap):r.REFLECTIVITY=!1,this._metallicReflectanceTexture?T.MaterialHelper.PrepareDefinesForMergedUV(this._metallicReflectanceTexture,r,"METALLIC_REFLECTANCE"):r.METALLIC_REFLECTANCE=!1,this._microSurfaceTexture?T.MaterialHelper.PrepareDefinesForMergedUV(this._microSurfaceTexture,r,"MICROSURFACEMAP"):r.MICROSURFACEMAP=!1):(r.REFLECTIVITY=!1,r.MICROSURFACEMAP=!1),s.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&P.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap?(T.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture,r,"BUMP"),this._useParallax&&this._albedoTexture&&P.MaterialFlags.DiffuseTextureEnabled?(r.PARALLAX=!0,r.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):r.PARALLAX=!1,r.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):r.BUMP=!1,this._environmentBRDFTexture&&P.MaterialFlags.ReflectionTextureEnabled?(r.ENVIRONMENTBRDF=!0,r.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(r.ENVIRONMENTBRDF=!1,r.ENVIRONMENTBRDF_RGBD=!1),this._shouldUseAlphaFromAlbedoTexture()?r.ALPHAFROMALBEDO=!0:r.ALPHAFROMALBEDO=!1}r.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===t.LIGHTFALLOFF_STANDARD?(r.USEPHYSICALLIGHTFALLOFF=!1,r.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===t.LIGHTFALLOFF_GLTF?(r.USEPHYSICALLIGHTFALLOFF=!1,r.USEGLTFLIGHTFALLOFF=!0):(r.USEPHYSICALLIGHTFALLOFF=!0,r.USEGLTFLIGHTFALLOFF=!1),r.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?r.TWOSIDEDLIGHTING=!0:r.TWOSIDEDLIGHTING=!1,r.SPECULARAA=s.getEngine().getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(r._areTexturesDirty||r._areMiscDirty)&&(r.ALPHATESTVALUE=this._alphaCutOff+(this._alphaCutOff%1==0?".":""),r.PREMULTIPLYALPHA=this.alphaMode===S.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===S.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,r.ALPHABLEND=this.needAlphaBlendingForMesh(e),r.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,r.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel),r._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(r),r.FORCENORMALFORWARD=this._forceNormalForward,r.RADIANCEOCCLUSION=this._useRadianceOcclusion,r.HORIZONOCCLUSION=this._useHorizonOcclusion,r._areMiscDirty&&(T.MaterialHelper.PrepareDefinesForMisc(e,s,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,r),r.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(u.VertexBuffer.NormalKind),r.DEBUGMODE=this._debugMode),this.detailMap.prepareDefines(r,s),this.subSurface.prepareDefines(r,s),this.clearCoat.prepareDefines(r,s),this.anisotropy.prepareDefines(r,e,s),this.brdf.prepareDefines(r),this.sheen.prepareDefines(r,s),T.MaterialHelper.PrepareDefinesForFrameBoundValues(s,a,r,!!n,i,o),T.MaterialHelper.PrepareDefinesForAttributes(e,r,!0,!0,!0,this._transparencyMode!==t.PBRMATERIAL_OPAQUE)},t.prototype.forceCompilation=function(e,t,r){var i=this,o=Object(n.__assign)({clipPlane:!1,useInstances:!1},r),s=new R,a=this._prepareEffect(e,s,void 0,void 0,o.useInstances,o.clipPlane,e.hasThinInstances);this._onEffectCreatedObservable&&(x.effect=a,x.subMesh=null,this._onEffectCreatedObservable.notifyObservers(x)),a.isReady()?t&&t(this):a.onCompileObservable.add((function(){t&&t(i)}))},t.prototype.buildUniformLayout=function(){var e=this._uniformBuffer;e.addUniform("vAlbedoInfos",2),e.addUniform("vAmbientInfos",4),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vReflectivityInfos",3),e.addUniform("vMicroSurfaceSamplerInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionFilteringInfo",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vBumpInfos",3),e.addUniform("albedoMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("reflectivityMatrix",16),e.addUniform("microSurfaceSamplerMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("reflectionMatrix",16),e.addUniform("vReflectionColor",3),e.addUniform("vAlbedoColor",4),e.addUniform("vLightingIntensity",4),e.addUniform("vReflectionMicrosurfaceInfos",3),e.addUniform("pointSize",1),e.addUniform("vReflectivityColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("visibility",1),e.addUniform("vMetallicReflectanceFactors",4),e.addUniform("vMetallicReflectanceInfos",2),e.addUniform("metallicReflectanceMatrix",16),d.PBRClearCoatConfiguration.PrepareUniformBuffer(e),h.PBRAnisotropicConfiguration.PrepareUniformBuffer(e),p.PBRSheenConfiguration.PrepareUniformBuffer(e),m.PBRSubSurfaceConfiguration.PrepareUniformBuffer(e),C.DetailMapConfiguration.PrepareUniformBuffer(e),e.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this.subSurface.unbind(this._activeEffect)&&(t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,t,r){var n=this.getScene(),i=r._materialDefines;if(i){var o=r.effect;if(o){this._activeEffect=o,i.INSTANCES&&!i.THIN_INSTANCES||this.bindOnlyWorldMatrix(e),i.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var s=this._mustRebind(n,o,t.visibility);T.MaterialHelper.BindBonesParameters(t,this._activeEffect);var a=null,c=this._uniformBuffer;if(s){var u=n.getEngine();if(c.bindToEffect(o,"Material"),this.bindViewProjection(o),a=this._getReflectionTexture(),!c.useUbo||!this.isFrozen||!c.isSync){if(n.texturesEnabled){if(this._albedoTexture&&P.MaterialFlags.DiffuseTextureEnabled&&(c.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),T.MaterialHelper.BindTextureMatrix(this._albedoTexture,c,"albedo")),this._ambientTexture&&P.MaterialFlags.AmbientTextureEnabled&&(c.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),T.MaterialHelper.BindTextureMatrix(this._ambientTexture,c,"ambient")),this._opacityTexture&&P.MaterialFlags.OpacityTextureEnabled&&(c.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),T.MaterialHelper.BindTextureMatrix(this._opacityTexture,c,"opacity")),a&&P.MaterialFlags.ReflectionTextureEnabled){if(c.updateMatrix("reflectionMatrix",a.getReflectionTextureMatrix()),c.updateFloat2("vReflectionInfos",a.level,0),a.boundingBoxSize){var d=a;c.updateVector3("vReflectionPosition",d.boundingBoxPosition),c.updateVector3("vReflectionSize",d.boundingBoxSize)}if(this.realTimeFiltering){var h=a.getSize().width;c.updateFloat2("vReflectionFilteringInfo",h,_.Scalar.Log2(h))}if(!i.USEIRRADIANCEMAP){var f=a.sphericalPolynomial;if(i.USESPHERICALFROMREFLECTIONMAP&&f)if(i.SPHERICAL_HARMONICS){var p=f.preScaledHarmonics;this._activeEffect.setVector3("vSphericalL00",p.l00),this._activeEffect.setVector3("vSphericalL1_1",p.l1_1),this._activeEffect.setVector3("vSphericalL10",p.l10),this._activeEffect.setVector3("vSphericalL11",p.l11),this._activeEffect.setVector3("vSphericalL2_2",p.l2_2),this._activeEffect.setVector3("vSphericalL2_1",p.l2_1),this._activeEffect.setVector3("vSphericalL20",p.l20),this._activeEffect.setVector3("vSphericalL21",p.l21),this._activeEffect.setVector3("vSphericalL22",p.l22)}else this._activeEffect.setFloat3("vSphericalX",f.x.x,f.x.y,f.x.z),this._activeEffect.setFloat3("vSphericalY",f.y.x,f.y.y,f.y.z),this._activeEffect.setFloat3("vSphericalZ",f.z.x,f.z.y,f.z.z),this._activeEffect.setFloat3("vSphericalXX_ZZ",f.xx.x-f.zz.x,f.xx.y-f.zz.y,f.xx.z-f.zz.z),this._activeEffect.setFloat3("vSphericalYY_ZZ",f.yy.x-f.zz.x,f.yy.y-f.zz.y,f.yy.z-f.zz.z),this._activeEffect.setFloat3("vSphericalZZ",f.zz.x,f.zz.y,f.zz.z),this._activeEffect.setFloat3("vSphericalXY",f.xy.x,f.xy.y,f.xy.z),this._activeEffect.setFloat3("vSphericalYZ",f.yz.x,f.yz.y,f.yz.z),this._activeEffect.setFloat3("vSphericalZX",f.zx.x,f.zx.y,f.zx.z)}c.updateFloat3("vReflectionMicrosurfaceInfos",a.getSize().width,a.lodGenerationScale,a.lodGenerationOffset)}this._emissiveTexture&&P.MaterialFlags.EmissiveTextureEnabled&&(c.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),T.MaterialHelper.BindTextureMatrix(this._emissiveTexture,c,"emissive")),this._lightmapTexture&&P.MaterialFlags.LightmapTextureEnabled&&(c.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),T.MaterialHelper.BindTextureMatrix(this._lightmapTexture,c,"lightmap")),P.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?(c.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),T.MaterialHelper.BindTextureMatrix(this._metallicTexture,c,"reflectivity")):this._reflectivityTexture&&(c.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),T.MaterialHelper.BindTextureMatrix(this._reflectivityTexture,c,"reflectivity")),this._metallicReflectanceTexture&&(c.updateFloat2("vMetallicReflectanceInfos",this._metallicReflectanceTexture.coordinatesIndex,this._metallicReflectanceTexture.level),T.MaterialHelper.BindTextureMatrix(this._metallicReflectanceTexture,c,"metallicReflectance")),this._microSurfaceTexture&&(c.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),T.MaterialHelper.BindTextureMatrix(this._microSurfaceTexture,c,"microSurfaceSampler"))),this._bumpTexture&&u.getCaps().standardDerivatives&&P.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&(c.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),T.MaterialHelper.BindTextureMatrix(this._bumpTexture,c,"bump"),n._mirroredCameraPosition?c.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):c.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1))}if(this.pointsCloud&&c.updateFloat("pointSize",this.pointSize),i.METALLICWORKFLOW){g.TmpColors.Color3[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,g.TmpColors.Color3[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness,c.updateColor4("vReflectivityColor",g.TmpColors.Color3[0],1);var m=this.subSurface.indexOfRefraction,v=Math.pow((m-1)/(m+1),2);this._metallicReflectanceColor.scaleToRef(v*this._metallicF0Factor,g.TmpColors.Color3[0]);var y=this._metallicF0Factor;c.updateColor4("vMetallicReflectanceFactors",g.TmpColors.Color3[0],y)}else c.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface);c.updateColor3("vEmissiveColor",P.MaterialFlags.EmissiveTextureEnabled?this._emissiveColor:g.Color3.BlackReadOnly),c.updateColor3("vReflectionColor",this._reflectionColor),!i.SS_REFRACTION&&this.subSurface.linkRefractionWithTransparency?c.updateColor4("vAlbedoColor",this._albedoColor,1):c.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity*n.environmentIntensity,this._lightingInfos.w=this._specularIntensity,c.updateVector4("vLightingIntensity",this._lightingInfos)}c.updateFloat("visibility",t.visibility),n.texturesEnabled&&(this._albedoTexture&&P.MaterialFlags.DiffuseTextureEnabled&&c.setTexture("albedoSampler",this._albedoTexture),this._ambientTexture&&P.MaterialFlags.AmbientTextureEnabled&&c.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&P.MaterialFlags.OpacityTextureEnabled&&c.setTexture("opacitySampler",this._opacityTexture),a&&P.MaterialFlags.ReflectionTextureEnabled&&(i.LODBASEDMICROSFURACE?c.setTexture("reflectionSampler",a):(c.setTexture("reflectionSampler",a._lodTextureMid||a),c.setTexture("reflectionSamplerLow",a._lodTextureLow||a),c.setTexture("reflectionSamplerHigh",a._lodTextureHigh||a)),i.USEIRRADIANCEMAP&&c.setTexture("irradianceSampler",a.irradianceTexture)),i.ENVIRONMENTBRDF&&c.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),this._emissiveTexture&&P.MaterialFlags.EmissiveTextureEnabled&&c.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&P.MaterialFlags.LightmapTextureEnabled&&c.setTexture("lightmapSampler",this._lightmapTexture),P.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?c.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&c.setTexture("reflectivitySampler",this._reflectivityTexture),this._metallicReflectanceTexture&&c.setTexture("metallicReflectanceSampler",this._metallicReflectanceTexture),this._microSurfaceTexture&&c.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&u.getCaps().standardDerivatives&&P.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&c.setTexture("bumpSampler",this._bumpTexture)),this.detailMap.bindForSubMesh(c,n,this.isFrozen),this.subSurface.bindForSubMesh(c,n,u,this.isFrozen,i.LODBASEDMICROSFURACE,this.realTimeFiltering),this.clearCoat.bindForSubMesh(c,n,u,this._disableBumpMap,this.isFrozen,this._invertNormalMapX,this._invertNormalMapY),this.anisotropy.bindForSubMesh(c,n,this.isFrozen),this.sheen.bindForSubMesh(c,n,this.isFrozen),T.MaterialHelper.BindClipPlane(this._activeEffect,n),n.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor);var b=n._forcedViewPosition?n._forcedViewPosition:n._mirroredCameraPosition?n._mirroredCameraPosition:n.activeCamera.globalPosition,A=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);o.setFloat4("vEyePosition",b.x,b.y,b.z,A?-1:1),o.setColor3("vAmbientColor",this._globalAmbientColor),o.setFloat2("vDebugMode",this.debugLimit,this.debugFactor)}!s&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&T.MaterialHelper.BindLights(n,t,this._activeEffect,i,this._maxSimultaneousLights,this._rebuildInParallel),(n.fogEnabled&&t.applyFog&&n.fogMode!==l.Scene.FOGMODE_NONE||a)&&this.bindView(o),T.MaterialHelper.BindFogParameters(n,t,this._activeEffect,!0),i.NUM_MORPH_INFLUENCERS&&T.MaterialHelper.BindMorphTargetParameters(t,this._activeEffect),this._imageProcessingConfiguration.bind(this._activeEffect),T.MaterialHelper.BindLogDepth(i,this._activeEffect,n)),c.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this.detailMap.getAnimatables(e),this.subSurface.getAnimatables(e),this.clearCoat.getAnimatables(e),this.sheen.getAnimatables(e),this.anisotropy.getAnimatables(e),e},t.prototype._getReflectionTexture=function(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._albedoTexture&&t.push(this._albedoTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._reflectivityTexture&&t.push(this._reflectivityTexture),this._metallicTexture&&t.push(this._metallicTexture),this._metallicReflectanceTexture&&t.push(this._metallicReflectanceTexture),this._microSurfaceTexture&&t.push(this._microSurfaceTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this.detailMap.getActiveTextures(t),this.subSurface.getActiveTextures(t),this.clearCoat.getActiveTextures(t),this.sheen.getActiveTextures(t),this.anisotropy.getActiveTextures(t),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._albedoTexture===t||this._ambientTexture===t||this._opacityTexture===t||this._reflectionTexture===t||this._reflectivityTexture===t||this._metallicTexture===t||this._metallicReflectanceTexture===t||this._microSurfaceTexture===t||this._bumpTexture===t||this._lightmapTexture===t||this.detailMap.hasTexture(t)||this.subSurface.hasTexture(t)||this.clearCoat.hasTexture(t)||this.sheen.hasTexture(t)||this.anisotropy.hasTexture(t)},t.prototype.setPrePassRenderer=function(e){return this.subSurface.isScatteringEnabled&&(e.subSurfaceConfiguration.enabled=!0,e.materialsShouldRenderIrradiance=!0),!0},t.prototype.dispose=function(t,r){var n,i,o,s,a,l,c,u,d,h,f;r&&(this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),null===(n=this._albedoTexture)||void 0===n||n.dispose(),null===(i=this._ambientTexture)||void 0===i||i.dispose(),null===(o=this._opacityTexture)||void 0===o||o.dispose(),null===(s=this._reflectionTexture)||void 0===s||s.dispose(),null===(a=this._emissiveTexture)||void 0===a||a.dispose(),null===(l=this._metallicTexture)||void 0===l||l.dispose(),null===(c=this._reflectivityTexture)||void 0===c||c.dispose(),null===(u=this._bumpTexture)||void 0===u||u.dispose(),null===(d=this._lightmapTexture)||void 0===d||d.dispose(),null===(h=this._metallicReflectanceTexture)||void 0===h||h.dispose(),null===(f=this._microSurfaceTexture)||void 0===f||f.dispose()),this.detailMap.dispose(r),this.subSurface.dispose(r),this.clearCoat.dispose(r),this.sheen.dispose(r),this.anisotropy.dispose(r),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,r)},t.PBRMATERIAL_OPAQUE=y.Material.MATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=y.Material.MATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=y.Material.MATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=y.Material.MATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=0,t.LIGHTFALLOFF_PHYSICAL=0,t.LIGHTFALLOFF_GLTF=1,t.LIGHTFALLOFF_STANDARD=2,Object(n.__decorate)([Object(i.serializeAsImageProcessingConfiguration)()],t.prototype,"_imageProcessingConfiguration",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"debugMode",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useLogarithmicDepth",null),t}(A.PushMaterial)},"./Materials/PBR/pbrBaseSimpleMaterial.ts":
- /*!************************************************!*\
- !*** ./Materials/PBR/pbrBaseSimpleMaterial.ts ***!
- \************************************************/
- /*! exports provided: PBRBaseSimpleMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRBaseSimpleMaterial",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.maxSimultaneousLights=4,n.disableLighting=!1,n.invertNormalMapX=!1,n.invertNormalMapY=!1,n.emissiveColor=new o.Color3(0,0,0),n.occlusionStrength=1,n.useLightmapAsShadowmap=!1,n._useAlphaFromAlbedoTexture=!0,n._useAmbientInGrayScale=!0,n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"doubleSided",{get:function(){return this._twoSidedLighting},set:function(e){this._twoSidedLighting!==e&&(this._twoSidedLighting=e,this.backFaceCulling=!e,this._markAllSubMeshesAsTexturesDirty())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseSimpleMaterial"},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectionTexture")],t.prototype,"environmentTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_bumpTexture")],t.prototype,"normalTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("emissive"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_ambientTextureStrength")],t.prototype,"occlusionStrength",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_ambientTexture")],t.prototype,"occlusionTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_alphaCutOff")],t.prototype,"alphaCutOff",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"doubleSided",null),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),t}(r(/*! ./pbrBaseMaterial */"./Materials/PBR/pbrBaseMaterial.ts").PBRBaseMaterial)},"./Materials/PBR/pbrClearCoatConfiguration.ts":
- /*!****************************************************!*\
- !*** ./Materials/PBR/pbrClearCoatConfiguration.ts ***!
- \****************************************************/
- /*! exports provided: PBRClearCoatConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRClearCoatConfiguration",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),l=function(){function e(t){this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indexOfRefraction=e._DefaultIndexOfRefraction,this.indexOfRefraction=e._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._bumpTexture=null,this.bumpTexture=null,this._isTintEnabled=!1,this.isTintEnabled=!1,this.tintColor=o.Color3.White(),this.tintColorAtDistance=1,this.tintThickness=1,this._tintTexture=null,this.tintTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=t}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t,r,n){if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&s.MaterialFlags.ClearCoatTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(r.getCaps().standardDerivatives&&this._bumpTexture&&s.MaterialFlags.ClearCoatBumpTextureEnabled&&!n&&!this._bumpTexture.isReady())return!1;if(this._isTintEnabled&&this._tintTexture&&s.MaterialFlags.ClearCoatTintTextureEnabled&&!this._tintTexture.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(t,r){this._isEnabled?(t.CLEARCOAT=!0,t._areTexturesDirty&&r.texturesEnabled&&(this._texture&&s.MaterialFlags.ClearCoatTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._texture,t,"CLEARCOAT_TEXTURE"):t.CLEARCOAT_TEXTURE=!1,this._bumpTexture&&s.MaterialFlags.ClearCoatBumpTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture,t,"CLEARCOAT_BUMP"):t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_DEFAULTIOR=this._indexOfRefraction===e._DefaultIndexOfRefraction,this._isTintEnabled?(t.CLEARCOAT_TINT=!0,this._tintTexture&&s.MaterialFlags.ClearCoatTintTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._tintTexture,t,"CLEARCOAT_TINT_TEXTURE"):t.CLEARCOAT_TINT_TEXTURE=!1):(t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1))):(t.CLEARCOAT=!1,t.CLEARCOAT_TEXTURE=!1,t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1)},e.prototype.bindForSubMesh=function(e,t,r,n,i,o,l){if(!e.useUbo||!i||!e.isSync){this._texture&&s.MaterialFlags.ClearCoatTextureEnabled&&(e.updateFloat2("vClearCoatInfos",this._texture.coordinatesIndex,this._texture.level),a.MaterialHelper.BindTextureMatrix(this._texture,e,"clearCoat")),this._bumpTexture&&r.getCaps().standardDerivatives&&s.MaterialFlags.ClearCoatTextureEnabled&&!n&&(e.updateFloat2("vClearCoatBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level),a.MaterialHelper.BindTextureMatrix(this._bumpTexture,e,"clearCoatBump"),t._mirroredCameraPosition?e.updateFloat2("vClearCoatTangentSpaceParams",o?1:-1,l?1:-1):e.updateFloat2("vClearCoatTangentSpaceParams",o?-1:1,l?-1:1)),this._tintTexture&&s.MaterialFlags.ClearCoatTintTextureEnabled&&(e.updateFloat2("vClearCoatTintInfos",this._tintTexture.coordinatesIndex,this._tintTexture.level),a.MaterialHelper.BindTextureMatrix(this._tintTexture,e,"clearCoatTint")),e.updateFloat2("vClearCoatParams",this.intensity,this.roughness);var c=1-this._indexOfRefraction,u=1+this._indexOfRefraction,d=Math.pow(-c/u,2),h=1/this._indexOfRefraction;e.updateFloat4("vClearCoatRefractionParams",d,h,c,u),this._isTintEnabled&&(e.updateFloat4("vClearCoatTintParams",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintThickness)),e.updateFloat("clearCoatColorAtDistance",Math.max(1e-5,this.tintColorAtDistance)))}t.texturesEnabled&&(this._texture&&s.MaterialFlags.ClearCoatTextureEnabled&&e.setTexture("clearCoatSampler",this._texture),this._bumpTexture&&r.getCaps().standardDerivatives&&s.MaterialFlags.ClearCoatBumpTextureEnabled&&!n&&e.setTexture("clearCoatBumpSampler",this._bumpTexture),this._isTintEnabled&&this._tintTexture&&s.MaterialFlags.ClearCoatTintTextureEnabled&&e.setTexture("clearCoatTintSampler",this._tintTexture))},e.prototype.hasTexture=function(e){return this._texture===e||this._bumpTexture===e||this._tintTexture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture),this._bumpTexture&&e.push(this._bumpTexture),this._tintTexture&&e.push(this._tintTexture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._tintTexture&&this._tintTexture.animations&&this._tintTexture.animations.length>0&&e.push(this._tintTexture)},e.prototype.dispose=function(e){e&&(this._texture&&this._texture.dispose(),this._bumpTexture&&this._bumpTexture.dispose(),this._tintTexture&&this._tintTexture.dispose())},e.prototype.getClassName=function(){return"PBRClearCoatConfiguration"},e.AddFallbacks=function(e,t,r){return e.CLEARCOAT_BUMP&&t.addFallback(r++,"CLEARCOAT_BUMP"),e.CLEARCOAT_TINT&&t.addFallback(r++,"CLEARCOAT_TINT"),e.CLEARCOAT&&t.addFallback(r++,"CLEARCOAT"),r},e.AddUniforms=function(e){e.push("vClearCoatTangentSpaceParams","vClearCoatParams","vClearCoatRefractionParams","vClearCoatTintParams","clearCoatColorAtDistance","clearCoatMatrix","clearCoatBumpMatrix","clearCoatTintMatrix","vClearCoatInfos","vClearCoatBumpInfos","vClearCoatTintInfos")},e.AddSamplers=function(e){e.push("clearCoatSampler","clearCoatBumpSampler","clearCoatTintSampler")},e.PrepareUniformBuffer=function(e){e.addUniform("vClearCoatParams",2),e.addUniform("vClearCoatRefractionParams",4),e.addUniform("vClearCoatInfos",2),e.addUniform("clearCoatMatrix",16),e.addUniform("vClearCoatBumpInfos",2),e.addUniform("vClearCoatTangentSpaceParams",2),e.addUniform("clearCoatBumpMatrix",16),e.addUniform("vClearCoatTintParams",4),e.addUniform("clearCoatColorAtDistance",1),e.addUniform("vClearCoatTintInfos",2),e.addUniform("clearCoatTintMatrix",16)},e.prototype.copyTo=function(e){i.SerializationHelper.Clone((function(){return e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse((function(){return n}),e,t,r)},e._DefaultIndexOfRefraction=1.5,Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indexOfRefraction",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"bumpTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTintEnabled",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"tintColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"tintColorAtDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"tintThickness",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"tintTexture",void 0),e}()},"./Materials/PBR/pbrMaterial.ts":
- /*!**************************************!*\
- !*** ./Materials/PBR/pbrMaterial.ts ***!
- \**************************************/
- /*! exports provided: PBRMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRMaterial",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/brdfTextureTools */"./Misc/brdfTextureTools.ts"),s=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ./pbrBaseMaterial */"./Materials/PBR/pbrBaseMaterial.ts"),l=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),c=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i.directIntensity=1,i.emissiveIntensity=1,i.environmentIntensity=1,i.specularIntensity=1,i.disableBumpMap=!1,i.ambientTextureStrength=1,i.ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,i.metallicF0Factor=1,i.metallicReflectanceColor=s.Color3.White(),i.ambientColor=new s.Color3(0,0,0),i.albedoColor=new s.Color3(1,1,1),i.reflectivityColor=new s.Color3(1,1,1),i.reflectionColor=new s.Color3(1,1,1),i.emissiveColor=new s.Color3(0,0,0),i.microSurface=1,i.useLightmapAsShadowmap=!1,i.useAlphaFromAlbedoTexture=!1,i.forceAlphaTest=!1,i.alphaCutOff=.4,i.useSpecularOverAlpha=!0,i.useMicroSurfaceFromReflectivityMapAlpha=!1,i.useRoughnessFromMetallicTextureAlpha=!0,i.useRoughnessFromMetallicTextureGreen=!1,i.useMetallnessFromMetallicTextureBlue=!1,i.useAmbientOcclusionFromMetallicTextureRed=!1,i.useAmbientInGrayScale=!1,i.useAutoMicroSurfaceFromReflectivityMap=!1,i.useRadianceOverAlpha=!0,i.useObjectSpaceNormalMap=!1,i.useParallax=!1,i.useParallaxOcclusion=!1,i.parallaxScaleBias=.05,i.disableLighting=!1,i.forceIrradianceInFragment=!1,i.maxSimultaneousLights=4,i.invertNormalMapX=!1,i.invertNormalMapY=!1,i.twoSidedLighting=!1,i.useAlphaFresnel=!1,i.useLinearAlphaFresnel=!1,i.environmentBRDFTexture=null,i.forceNormalForward=!1,i.enableSpecularAntiAliasing=!1,i.useHorizonOcclusion=!0,i.useRadianceOcclusion=!0,i.unlit=!1,i._environmentBRDFTexture=o.BRDFTextureTools.GetEnvironmentBRDFTexture(n),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this.subSurface.refractionTexture},set:function(e){this.subSurface.refractionTexture=e,e?this.subSurface.isRefractionEnabled=!0:this.subSurface.linkRefractionWithTransparency||(this.subSurface.isRefractionEnabled=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"indexOfRefraction",{get:function(){return this.subSurface.indexOfRefraction},set:function(e){this.subSurface.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"invertRefractionY",{get:function(){return this.subSurface.invertRefractionY},set:function(e){this.subSurface.invertRefractionY=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkRefractionWithTransparency",{get:function(){return this.subSurface.linkRefractionWithTransparency},set:function(e){this.subSurface.linkRefractionWithTransparency=e,e&&(this.subSurface.isRefractionEnabled=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"usePhysicalLightFalloff",{get:function(){return this._lightFalloff===a.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL},set:function(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?a.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL:a.PBRBaseMaterial.LIGHTFALLOFF_STANDARD)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useGLTFLightFalloff",{get:function(){return this._lightFalloff===a.PBRBaseMaterial.LIGHTFALLOFF_GLTF},set:function(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?a.PBRBaseMaterial.LIGHTFALLOFF_GLTF:a.PBRBaseMaterial.LIGHTFALLOFF_STANDARD)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this._imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this._imageProcessingConfiguration.colorCurves},set:function(e){this._imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"PBRMaterial"},t.prototype.clone=function(e){var r=this,n=i.SerializationHelper.Clone((function(){return new t(e,r.getScene())}),this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.PBRMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n);return e.clearCoat&&o.clearCoat.parse(e.clearCoat,r,n),e.anisotropy&&o.anisotropy.parse(e.anisotropy,r,n),e.brdf&&o.brdf.parse(e.brdf,r,n),e.sheen&&o.sheen.parse(e.sheen,r,n),e.subSurface&&o.subSurface.parse(e.subSurface,r,n),o},t.PBRMATERIAL_OPAQUE=a.PBRBaseMaterial.PBRMATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=a.PBRBaseMaterial.PBRMATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=a.PBRBaseMaterial.PBRMATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=a.PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=a.PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"directIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"disableBumpMap",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureStrength",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicF0Factor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicReflectanceColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicReflectanceTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurfaceTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("ambient"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("albedo"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("reflectivity"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("reflection"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("emissive"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurface",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromAlbedoTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"forceAlphaTest",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"alphaCutOff",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientInGrayScale",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"usePhysicalLightFalloff",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useGLTFLightFalloff",null),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"parallaxScaleBias",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceIrradianceInFragment",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFresnel",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLinearAlphaFresnel",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentBRDFTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceNormalForward",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableSpecularAntiAliasing",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useHorizonOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"unlit",void 0),t}(a.PBRBaseMaterial);l._TypeStore.RegisteredTypes["BABYLON.PBRMaterial"]=c},"./Materials/PBR/pbrMetallicRoughnessMaterial.ts":
- /*!*******************************************************!*\
- !*** ./Materials/PBR/pbrMetallicRoughnessMaterial.ts ***!
- \*******************************************************/
- /*! exports provided: PBRMetallicRoughnessMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRMetallicRoughnessMaterial",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ./pbrBaseSimpleMaterial */"./Materials/PBR/pbrBaseSimpleMaterial.ts"),s=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._useRoughnessFromMetallicTextureAlpha=!1,n._useRoughnessFromMetallicTextureGreen=!0,n._useMetallnessFromMetallicTextureBlue=!0,n.metallic=1,n.roughness=1,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PBRMetallicRoughnessMaterial"},t.prototype.clone=function(e){var r=this,n=i.SerializationHelper.Clone((function(){return new t(e,r.getScene())}),this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.PBRMetallicRoughnessMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n);return e.clearCoat&&o.clearCoat.parse(e.clearCoat,r,n),e.anisotropy&&o.anisotropy.parse(e.anisotropy,r,n),e.brdf&&o.brdf.parse(e.brdf,r,n),e.sheen&&o.sheen.parse(e.sheen,r,n),e.subSurface&&o.subSurface.parse(e.subSurface,r,n),o},Object(n.__decorate)([Object(i.serializeAsColor3)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"baseColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"baseTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_metallicTexture")],t.prototype,"metallicRoughnessTexture",void 0),t}(o.PBRBaseSimpleMaterial);s._TypeStore.RegisteredTypes["BABYLON.PBRMetallicRoughnessMaterial"]=a},"./Materials/PBR/pbrSheenConfiguration.ts":
- /*!************************************************!*\
- !*** ./Materials/PBR/pbrSheenConfiguration.ts ***!
- \************************************************/
- /*! exports provided: PBRSheenConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRSheenConfiguration",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../../Materials/materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),l=function(){function e(e){this._isEnabled=!1,this.isEnabled=!1,this._linkSheenWithAlbedo=!1,this.linkSheenWithAlbedo=!1,this.intensity=1,this.color=o.Color3.White(),this._texture=null,this.texture=null,this._roughness=null,this.roughness=null,this._albedoScaling=!1,this.albedoScaling=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){return!(e._areTexturesDirty&&t.texturesEnabled&&this._texture&&s.MaterialFlags.SheenTextureEnabled&&!this._texture.isReadyOrNotBlocking())},e.prototype.prepareDefines=function(e,t){this._isEnabled?(e.SHEEN=this._isEnabled,e.SHEEN_LINKWITHALBEDO=this._linkSheenWithAlbedo,e.SHEEN_ROUGHNESS=null!==this._roughness,e.SHEEN_ALBEDOSCALING=this._albedoScaling,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&s.MaterialFlags.SheenTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._texture,e,"SHEEN_TEXTURE"):e.SHEEN_TEXTURE=!1)):(e.SHEEN=!1,e.SHEEN_TEXTURE=!1,e.SHEEN_LINKWITHALBEDO=!1,e.SHEEN_ROUGHNESS=!1,e.SHEEN_ALBEDOSCALING=!1)},e.prototype.bindForSubMesh=function(e,t,r){e.useUbo&&r&&e.isSync||(this._texture&&s.MaterialFlags.SheenTextureEnabled&&(e.updateFloat2("vSheenInfos",this._texture.coordinatesIndex,this._texture.level),a.MaterialHelper.BindTextureMatrix(this._texture,e,"sheen")),e.updateFloat4("vSheenColor",this.color.r,this.color.g,this.color.b,this.intensity),null!==this._roughness&&e.updateFloat("vSheenRoughness",this._roughness)),t.texturesEnabled&&this._texture&&s.MaterialFlags.SheenTextureEnabled&&e.setTexture("sheenSampler",this._texture)},e.prototype.hasTexture=function(e){return this._texture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)},e.prototype.dispose=function(e){e&&this._texture&&this._texture.dispose()},e.prototype.getClassName=function(){return"PBRSheenConfiguration"},e.AddFallbacks=function(e,t,r){return e.SHEEN&&t.addFallback(r++,"SHEEN"),r},e.AddUniforms=function(e){e.push("vSheenColor","vSheenRoughness","vSheenInfos","sheenMatrix")},e.PrepareUniformBuffer=function(e){e.addUniform("vSheenColor",4),e.addUniform("vSheenRoughness",1),e.addUniform("vSheenInfos",2),e.addUniform("sheenMatrix",16)},e.AddSamplers=function(e){e.push("sheenSampler")},e.prototype.copyTo=function(e){i.SerializationHelper.Clone((function(){return e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse((function(){return n}),e,t,r)},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkSheenWithAlbedo",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"color",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"albedoScaling",void 0),e}()},"./Materials/PBR/pbrSpecularGlossinessMaterial.ts":
- /*!********************************************************!*\
- !*** ./Materials/PBR/pbrSpecularGlossinessMaterial.ts ***!
- \********************************************************/
- /*! exports provided: PBRSpecularGlossinessMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRSpecularGlossinessMaterial",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ./pbrBaseSimpleMaterial */"./Materials/PBR/pbrBaseSimpleMaterial.ts"),s=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._useMicroSurfaceFromReflectivityMapAlpha=!0,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PBRSpecularGlossinessMaterial"},t.prototype.clone=function(e){var r=this,n=i.SerializationHelper.Clone((function(){return new t(e,r.getScene())}),this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.PBRSpecularGlossinessMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n);return e.clearCoat&&o.clearCoat.parse(e.clearCoat,r,n),e.anisotropy&&o.anisotropy.parse(e.anisotropy,r,n),e.brdf&&o.brdf.parse(e.brdf,r,n),e.sheen&&o.sheen.parse(e.sheen,r,n),e.subSurface&&o.subSurface.parse(e.subSurface,r,n),o},Object(n.__decorate)([Object(i.serializeAsColor3)("diffuse"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"diffuseColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"diffuseTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("specular"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectivityColor")],t.prototype,"specularColor",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_microSurface")],t.prototype,"glossiness",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectivityTexture")],t.prototype,"specularGlossinessTexture",void 0),t}(o.PBRBaseSimpleMaterial);s._TypeStore.RegisteredTypes["BABYLON.PBRSpecularGlossinessMaterial"]=a},"./Materials/PBR/pbrSubSurfaceConfiguration.ts":
- /*!*****************************************************!*\
- !*** ./Materials/PBR/pbrSubSurfaceConfiguration.ts ***!
- \*****************************************************/
- /*! exports provided: PBRSubSurfaceConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRSubSurfaceConfiguration",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),c=function(){function e(e,t,r){this._isRefractionEnabled=!1,this.isRefractionEnabled=!1,this._isTranslucencyEnabled=!1,this.isTranslucencyEnabled=!1,this._isScatteringEnabled=!1,this.isScatteringEnabled=!1,this._scatteringDiffusionProfileIndex=0,this.refractionIntensity=1,this.translucencyIntensity=1,this.useAlbedoToTintRefraction=!1,this._thicknessTexture=null,this.thicknessTexture=null,this._refractionTexture=null,this.refractionTexture=null,this._indexOfRefraction=1.5,this.indexOfRefraction=1.5,this._volumeIndexOfRefraction=-1,this._invertRefractionY=!1,this.invertRefractionY=!1,this._linkRefractionWithTransparency=!1,this.linkRefractionWithTransparency=!1,this.minimumThickness=0,this.maximumThickness=1,this.tintColor=o.Color3.White(),this.tintColorAtDistance=1,this.diffusionDistance=o.Color3.White(),this._useMaskFromThicknessTexture=!1,this.useMaskFromThicknessTexture=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e,this._internalMarkScenePrePassDirty=t,this._scene=r}return Object.defineProperty(e.prototype,"scatteringDiffusionProfile",{get:function(){return this._scene.prePassRenderer?this._scene.prePassRenderer.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex]:null},set:function(e){this._scene.enablePrePassRenderer()&&e&&(this._scatteringDiffusionProfileIndex=this._scene.prePassRenderer.subSurfaceConfiguration.addDiffusionProfile(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeIndexOfRefraction",{get:function(){return this._volumeIndexOfRefraction>=1?this._volumeIndexOfRefraction:this._indexOfRefraction},set:function(e){this._volumeIndexOfRefraction=e>=1?e:-1},enumerable:!1,configurable:!0}),e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype._markScenePrePassDirty=function(){this._internalMarkScenePrePassDirty()},e.prototype.isReadyForSubMesh=function(e,t){if(e._areTexturesDirty&&t.texturesEnabled){if(this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking())return!1;var r=this._getRefractionTexture(t);if(r&&s.MaterialFlags.RefractionTextureEnabled&&!r.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(e,t){if(e._areTexturesDirty&&(e.SUBSURFACE=!1,e.SS_TRANSLUCENCY=this._isTranslucencyEnabled,e.SS_SCATTERING=this._isScatteringEnabled,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_MASK_FROM_THICKNESS_TEXTURE=!1,e.SS_REFRACTION=!1,e.SS_REFRACTIONMAP_3D=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled)&&(e.SUBSURFACE=!0,e._areTexturesDirty&&t.texturesEnabled&&this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&a.MaterialHelper.PrepareDefinesForMergedUV(this._thicknessTexture,e,"SS_THICKNESSANDMASK_TEXTURE"),e.SS_MASK_FROM_THICKNESS_TEXTURE=this._useMaskFromThicknessTexture),this._isRefractionEnabled&&t.texturesEnabled)){var r=this._getRefractionTexture(t);r&&s.MaterialFlags.RefractionTextureEnabled&&(e.SS_REFRACTION=!0,e.SS_REFRACTIONMAP_3D=r.isCube,e.SS_GAMMAREFRACTION=r.gammaSpace,e.SS_RGBDREFRACTION=r.isRGBD,e.SS_LINEARSPECULARREFRACTION=r.linearSpecularLOD,e.SS_REFRACTIONMAP_OPPOSITEZ=r.invertZ,e.SS_LODINREFRACTIONALPHA=r.lodLevelInAlpha,e.SS_LINKREFRACTIONTOTRANSPARENCY=this._linkRefractionWithTransparency,e.SS_ALBEDOFORREFRACTIONTINT=this.useAlbedoToTintRefraction)}},e.prototype.bindForSubMesh=function(e,t,r,n,i,o){var c=this._getRefractionTexture(t);if(!e.useUbo||!n||!e.isSync){if(this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&(e.updateFloat2("vThicknessInfos",this._thicknessTexture.coordinatesIndex,this._thicknessTexture.level),a.MaterialHelper.BindTextureMatrix(this._thicknessTexture,e,"thickness")),e.updateFloat2("vThicknessParam",this.minimumThickness,this.maximumThickness-this.minimumThickness),c&&s.MaterialFlags.RefractionTextureEnabled){e.updateMatrix("refractionMatrix",c.getReflectionTextureMatrix());var u=1;c.isCube||c.depth&&(u=c.depth);var d=c.getSize().width,h=this.volumeIndexOfRefraction;e.updateFloat4("vRefractionInfos",c.level,1/h,u,this._invertRefractionY?-1:1),e.updateFloat3("vRefractionMicrosurfaceInfos",d,c.lodGenerationScale,c.lodGenerationOffset),o&&e.updateFloat2("vRefractionFilteringInfo",d,l.Scalar.Log2(d))}this.isScatteringEnabled&&e.updateFloat("scatteringDiffusionProfile",this._scatteringDiffusionProfileIndex),e.updateColor3("vDiffusionDistance",this.diffusionDistance),e.updateFloat4("vTintColor",this.tintColor.r,this.tintColor.g,this.tintColor.b,this.tintColorAtDistance),e.updateFloat3("vSubSurfaceIntensity",this.refractionIntensity,this.translucencyIntensity,0)}t.texturesEnabled&&(this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&e.setTexture("thicknessSampler",this._thicknessTexture),c&&s.MaterialFlags.RefractionTextureEnabled&&(i?e.setTexture("refractionSampler",c):(e.setTexture("refractionSampler",c._lodTextureMid||c),e.setTexture("refractionSamplerLow",c._lodTextureLow||c),e.setTexture("refractionSamplerHigh",c._lodTextureHigh||c))))},e.prototype.unbind=function(e){return!(!this._refractionTexture||!this._refractionTexture.isRenderTarget||(e.setTexture("refractionSampler",null),0))},e.prototype._getRefractionTexture=function(e){return this._refractionTexture?this._refractionTexture:this._isRefractionEnabled?e.environmentTexture:null},Object.defineProperty(e.prototype,"disableAlphaBlending",{get:function(){return this.isRefractionEnabled&&this._linkRefractionWithTransparency},enumerable:!1,configurable:!0}),e.prototype.fillRenderTargetTextures=function(e){s.MaterialFlags.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&e.push(this._refractionTexture)},e.prototype.hasTexture=function(e){return this._thicknessTexture===e||this._refractionTexture===e},e.prototype.hasRenderTargetTextures=function(){return!!(s.MaterialFlags.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)},e.prototype.getActiveTextures=function(e){this._thicknessTexture&&e.push(this._thicknessTexture),this._refractionTexture&&e.push(this._refractionTexture)},e.prototype.getAnimatables=function(e){this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture)},e.prototype.dispose=function(e){e&&(this._thicknessTexture&&this._thicknessTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose())},e.prototype.getClassName=function(){return"PBRSubSurfaceConfiguration"},e.AddFallbacks=function(e,t,r){return e.SS_SCATTERING&&t.addFallback(r++,"SS_SCATTERING"),e.SS_TRANSLUCENCY&&t.addFallback(r++,"SS_TRANSLUCENCY"),r},e.AddUniforms=function(e){e.push("vDiffusionDistance","vTintColor","vSubSurfaceIntensity","vRefractionMicrosurfaceInfos","vRefractionFilteringInfo","vRefractionInfos","vThicknessInfos","vThicknessParam","refractionMatrix","thicknessMatrix","scatteringDiffusionProfile")},e.AddSamplers=function(e){e.push("thicknessSampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh")},e.PrepareUniformBuffer=function(e){e.addUniform("vRefractionMicrosurfaceInfos",3),e.addUniform("vRefractionFilteringInfo",2),e.addUniform("vRefractionInfos",4),e.addUniform("refractionMatrix",16),e.addUniform("vThicknessInfos",2),e.addUniform("thicknessMatrix",16),e.addUniform("vThicknessParam",2),e.addUniform("vDiffusionDistance",3),e.addUniform("vTintColor",4),e.addUniform("vSubSurfaceIntensity",3),e.addUniform("scatteringDiffusionProfile",1)},e.prototype.copyTo=function(e){i.SerializationHelper.Clone((function(){return e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse((function(){return n}),e,t,r)},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isRefractionEnabled",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTranslucencyEnabled",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markScenePrePassDirty")],e.prototype,"isScatteringEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_scatteringDiffusionProfileIndex",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"refractionIntensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"translucencyIntensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"useAlbedoToTintRefraction",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"thicknessTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"refractionTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indexOfRefraction",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"volumeIndexOfRefraction",null),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"invertRefractionY",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkRefractionWithTransparency",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"minimumThickness",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"maximumThickness",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"tintColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"tintColorAtDistance",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"diffusionDistance",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"useMaskFromThicknessTexture",void 0),e}()},"./Materials/Textures/Filtering/hdrFiltering.ts":
- /*!******************************************************!*\
- !*** ./Materials/Textures/Filtering/hdrFiltering.ts ***!
- \******************************************************/
- /*! exports provided: HDRFiltering */function(e,t,r){"use strict";r.r(t),r.d(t,"HDRFiltering",(function(){return l}));var n=r(/*! ../../../Maths/math */"./Maths/math.ts"),i=r(/*! ../../../Maths/math.scalar */"./Maths/math.scalar.ts"),o=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../../../Materials/effectRenderer */"./Materials/effectRenderer.ts"),a=(r(/*! ../../../Shaders/hdrFiltering.vertex */"./Shaders/hdrFiltering.vertex.ts"),r(/*! ../../../Shaders/hdrFiltering.fragment */"./Shaders/hdrFiltering.fragment.ts"),r(/*! ../../../Misc/logger */"./Misc/logger.ts")),l=function(){function e(e,t){void 0===t&&(t={}),this._lodGenerationOffset=0,this._lodGenerationScale=.8,this.quality=o.Constants.TEXTURE_FILTERING_QUALITY_OFFLINE,this.hdrScale=1,this._engine=e,this.hdrScale=t.hdrScale||this.hdrScale,this.quality=t.hdrScale||this.quality}return e.prototype._createRenderTarget=function(e){var t=o.Constants.TEXTURETYPE_UNSIGNED_BYTE;this._engine.getCaps().textureHalfFloatRender?t=o.Constants.TEXTURETYPE_HALF_FLOAT:this._engine.getCaps().textureFloatRender&&(t=o.Constants.TEXTURETYPE_FLOAT);var r=this._engine.createRenderTargetCubeTexture(e,{format:o.Constants.TEXTUREFORMAT_RGBA,type:t,generateMipMaps:!1,generateDepthBuffer:!1,generateStencilBuffer:!1,samplingMode:o.Constants.TEXTURE_NEAREST_SAMPLINGMODE});return this._engine.updateTextureWrappingMode(r,o.Constants.TEXTURE_CLAMP_ADDRESSMODE,o.Constants.TEXTURE_CLAMP_ADDRESSMODE,o.Constants.TEXTURE_CLAMP_ADDRESSMODE),this._engine.updateTextureSamplingMode(o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,r,!0),r},e.prototype._prefilterInternal=function(e){var t=e.getSize().width,r=Math.round(i.Scalar.Log2(t))+1,s=this._effectWrapper.effect,a=this._createRenderTarget(t);this._effectRenderer.setViewport();var l=e.getInternalTexture();l&&this._engine.updateTextureSamplingMode(o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,l,!0),this._effectRenderer.applyEffectWrapper(this._effectWrapper);var c=[[new n.Vector3(0,0,-1),new n.Vector3(0,-1,0),new n.Vector3(1,0,0)],[new n.Vector3(0,0,1),new n.Vector3(0,-1,0),new n.Vector3(-1,0,0)],[new n.Vector3(1,0,0),new n.Vector3(0,0,1),new n.Vector3(0,1,0)],[new n.Vector3(1,0,0),new n.Vector3(0,0,-1),new n.Vector3(0,-1,0)],[new n.Vector3(1,0,0),new n.Vector3(0,-1,0),new n.Vector3(0,0,1)],[new n.Vector3(-1,0,0),new n.Vector3(0,-1,0),new n.Vector3(0,0,-1)]];s.setFloat("hdrScale",this.hdrScale),s.setFloat2("vFilteringInfo",e.getSize().width,r),s.setTexture("inputTexture",e);for(var u=0;u<6;u++){s.setVector3("up",c[u][0]),s.setVector3("right",c[u][1]),s.setVector3("front",c[u][2]);for(var d=0;d<r;d++){this._engine.bindFramebuffer(a,u,void 0,void 0,!0,d),this._effectRenderer.applyEffectWrapper(this._effectWrapper);var h=Math.pow(2,(d-this._lodGenerationOffset)/this._lodGenerationScale)/t;0===d&&(h=0),s.setFloat("alphaG",h),this._effectRenderer.draw()}}return this._effectRenderer.restoreStates(),this._engine.restoreDefaultFramebuffer(),this._engine._releaseFramebufferObjects(a),this._engine._releaseTexture(e._texture),a._swapAndDie(e._texture),e._prefiltered=!0,e},e.prototype._createEffect=function(e,t){var r=[];return e.gammaSpace&&r.push("#define GAMMA_INPUT"),r.push("#define NUM_SAMPLES "+this.quality+"u"),new s.EffectWrapper({engine:this._engine,name:"hdrFiltering",vertexShader:"hdrFiltering",fragmentShader:"hdrFiltering",samplerNames:["inputTexture"],uniformNames:["vSampleDirections","vWeights","up","right","front","vFilteringInfo","hdrScale","alphaG"],useShaderStore:!0,defines:r,onCompiled:t})},e.prototype.isReady=function(e){return e.isReady()&&this._effectWrapper.effect.isReady()},e.prototype.prefilter=function(e,t){var r=this;if(void 0===t&&(t=null),1!==this._engine.webGLVersion)return new Promise((function(n){r._effectRenderer=new s.EffectRenderer(r._engine),r._effectWrapper=r._createEffect(e),r._effectWrapper.effect.executeWhenCompiled((function(){r._prefilterInternal(e),r._effectRenderer.dispose(),r._effectWrapper.dispose(),n(),t&&t()}))}));a.Logger.Warn("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.")},e}()},"./Materials/Textures/Loaders/basisTextureLoader.ts":
- /*!**********************************************************!*\
- !*** ./Materials/Textures/Loaders/basisTextureLoader.ts ***!
- \**********************************************************/
- /*! exports provided: _BasisTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_BasisTextureLoader",(function(){return a}));var n=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../../../Misc/basis */"./Misc/basis.ts"),o=r(/*! ../../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),a=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return s.StringTools.EndsWith(e,".basis")},e.prototype.loadCubeData=function(e,t,r,n,s){if(!Array.isArray(e)){var a=t.getEngine().getCaps(),l={supportedCompressionFormats:{etc1:!!a.etc1,s3tc:!!a.s3tc,pvrtc:!!a.pvrtc,etc2:!!a.etc2}};i.BasisTools.TranscodeAsync(e,l).then((function(e){var r=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;i.BasisTools.LoadTextureFromTranscodeResult(t,e),t.getEngine()._setCubeMapTextureParams(r),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()})).catch((function(e){o.Tools.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),t.isReady=!0}))}},e.prototype.loadData=function(e,t,r){var n=t.getEngine().getCaps(),s={supportedCompressionFormats:{etc1:!!n.etc1,s3tc:!!n.s3tc,pvrtc:!!n.pvrtc,etc2:!!n.etc2}};i.BasisTools.TranscodeAsync(e,s).then((function(e){var n=e.fileInfo.images[0].levels[0],o=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;r(n.width,n.height,o,-1!==e.format,(function(){i.BasisTools.LoadTextureFromTranscodeResult(t,e)}))})).catch((function(e){o.Tools.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),r(0,0,!1,!1,(function(){}))}))},e}();n.Engine._TextureLoaders.push(new a)},"./Materials/Textures/Loaders/ddsTextureLoader.ts":
- /*!********************************************************!*\
- !*** ./Materials/Textures/Loaders/ddsTextureLoader.ts ***!
- \********************************************************/
- /*! exports provided: _DDSTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_DDSTextureLoader",(function(){return a}));var n=r(/*! ../../../Maths/sphericalPolynomial */"./Maths/sphericalPolynomial.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/dds */"./Misc/dds.ts"),s=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),a=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e){return s.StringTools.EndsWith(e,".dds")},e.prototype.loadCubeData=function(e,t,r,i,s){var a,l=t.getEngine(),c=!1;if(Array.isArray(e))for(var u=0;u<e.length;u++){var d=e[u];a=o.DDSTools.GetDDSInfo(d),t.width=a.width,t.height=a.height,c=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&t.generateMipMaps,l._unpackFlipY(a.isCompressed),o.DDSTools.UploadDDSLevels(l,t,d,a,c,6,-1,u),a.isFourCC||1!==a.mipmapCount||l.generateMipMapsForCubemap(t)}else{var h=e;a=o.DDSTools.GetDDSInfo(h),t.width=a.width,t.height=a.height,r&&(a.sphericalPolynomial=new n.SphericalPolynomial),c=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&t.generateMipMaps,l._unpackFlipY(a.isCompressed),o.DDSTools.UploadDDSLevels(l,t,h,a,c,6),a.isFourCC||1!==a.mipmapCount||l.generateMipMapsForCubemap(t,!1)}l._setCubeMapTextureParams(c),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),i&&i({isDDS:!0,width:t.width,info:a,data:e,texture:t})},e.prototype.loadData=function(e,t,r){var n=o.DDSTools.GetDDSInfo(e),i=(n.isRGB||n.isLuminance||n.mipmapCount>1)&&t.generateMipMaps&&n.width>>n.mipmapCount-1==1;r(n.width,n.height,i,n.isFourCC,(function(){o.DDSTools.UploadDDSLevels(t.getEngine(),t,e,n,i,1)}))},e}();i.Engine._TextureLoaders.push(new a)},"./Materials/Textures/Loaders/envTextureLoader.ts":
- /*!********************************************************!*\
- !*** ./Materials/Textures/Loaders/envTextureLoader.ts ***!
- \********************************************************/
- /*! exports provided: _ENVTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_ENVTextureLoader",(function(){return s}));var n=r(/*! ../../../Misc/environmentTextureTools */"./Misc/environmentTextureTools.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),s=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return o.StringTools.EndsWith(e,".env")},e.prototype.loadCubeData=function(e,t,r,i,o){if(!Array.isArray(e)){var s=n.EnvironmentTextureTools.GetEnvInfo(e);s?(t.width=s.width,t.height=s.width,n.EnvironmentTextureTools.UploadEnvSpherical(t,s),n.EnvironmentTextureTools.UploadEnvLevelsAsync(t,e,s).then((function(){t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),i&&i()}))):o&&o("Can not parse the environment file",null)}},e.prototype.loadData=function(e,t,r){throw".env not supported in 2d."},e}();i.Engine._TextureLoaders.push(new s)},"./Materials/Textures/Loaders/index.ts":
- /*!*********************************************!*\
- !*** ./Materials/Textures/Loaders/index.ts ***!
- \*********************************************/
- /*! exports provided: _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, _BasisTextureLoader */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./ddsTextureLoader */"./Materials/Textures/Loaders/ddsTextureLoader.ts");r.d(t,"_DDSTextureLoader",(function(){return n._DDSTextureLoader}));var i=r(/*! ./envTextureLoader */"./Materials/Textures/Loaders/envTextureLoader.ts");r.d(t,"_ENVTextureLoader",(function(){return i._ENVTextureLoader}));var o=r(/*! ./ktxTextureLoader */"./Materials/Textures/Loaders/ktxTextureLoader.ts");r.d(t,"_KTXTextureLoader",(function(){return o._KTXTextureLoader}));var s=r(/*! ./tgaTextureLoader */"./Materials/Textures/Loaders/tgaTextureLoader.ts");r.d(t,"_TGATextureLoader",(function(){return s._TGATextureLoader}));var a=r(/*! ./basisTextureLoader */"./Materials/Textures/Loaders/basisTextureLoader.ts");r.d(t,"_BasisTextureLoader",(function(){return a._BasisTextureLoader}))},"./Materials/Textures/Loaders/ktxTextureLoader.ts":
- /*!********************************************************!*\
- !*** ./Materials/Textures/Loaders/ktxTextureLoader.ts ***!
- \********************************************************/
- /*! exports provided: _KTXTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_KTXTextureLoader",(function(){return l}));var n=r(/*! ../../../Misc/khronosTextureContainer */"./Misc/khronosTextureContainer.ts"),i=r(/*! ../../../Misc/khronosTextureContainer2 */"./Misc/khronosTextureContainer2.ts"),o=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),a=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),l=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t){return s.StringTools.EndsWith(e,".ktx")||s.StringTools.EndsWith(e,".ktx2")||"image/ktx"===t||"image/ktx2"===t},e.prototype.loadCubeData=function(e,t,r,i,o){if(!Array.isArray(e)){t._invertVScale=!t.invertY;var s=t.getEngine(),a=new n.KhronosTextureContainer(e,6),l=a.numberOfMipmapLevels>1&&t.generateMipMaps;s._unpackFlipY(!0),a.uploadLevels(t,t.generateMipMaps),t.width=a.pixelWidth,t.height=a.pixelHeight,s._setCubeMapTextureParams(l),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),i&&i()}},e.prototype.loadData=function(e,t,r){if(n.KhronosTextureContainer.IsValid(e)){t._invertVScale=!t.invertY;var o=new n.KhronosTextureContainer(e,1);r(o.pixelWidth,o.pixelHeight,t.generateMipMaps,!0,(function(){o.uploadLevels(t,t.generateMipMaps)}),o.isInvalid)}else i.KhronosTextureContainer2.IsValid(e)?new i.KhronosTextureContainer2(t.getEngine()).uploadAsync(e,t).then((function(){r(t.width,t.height,!1,!0,(function(){}),!1)}),(function(e){a.Logger.Warn("Failed to load KTX2 texture data: "+e.message),r(0,0,!1,!1,(function(){}),!0)})):(a.Logger.Error("texture missing KTX identifier"),r(0,0,!1,!1,(function(){}),!0))},e}();o.Engine._TextureLoaders.unshift(new l)},"./Materials/Textures/Loaders/tgaTextureLoader.ts":
- /*!********************************************************!*\
- !*** ./Materials/Textures/Loaders/tgaTextureLoader.ts ***!
- \********************************************************/
- /*! exports provided: _TGATextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_TGATextureLoader",(function(){return s}));var n=r(/*! ../../../Misc/tga */"./Misc/tga.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),s=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return o.StringTools.EndsWith(e,".tga")},e.prototype.loadCubeData=function(e,t,r,n,i){throw".env not supported in Cube."},e.prototype.loadData=function(e,t,r){var i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=n.TGATools.GetTGAHeader(i);r(o.width,o.height,t.generateMipMaps,!1,(function(){n.TGATools.UploadContent(t,i)}))},e}();i.Engine._TextureLoaders.push(new s)},"./Materials/Textures/MultiviewRenderTarget.ts":
- /*!*****************************************************!*\
- !*** ./Materials/Textures/MultiviewRenderTarget.ts ***!
- \*****************************************************/
- /*! exports provided: MultiviewRenderTarget */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiviewRenderTarget",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),o=r(/*! ../Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=function(e){function t(t,r){void 0===r&&(r=512);var n=e.call(this,"multiview rtt",r,t,!1,!0,o.InternalTextureSource.Unknown,!1,void 0,!1,!1,!0,void 0,!0)||this,i=t.getEngine().createMultiviewRenderTargetTexture(n.getRenderWidth(),n.getRenderHeight());return i.isMultiview=!0,i.format=s.Constants.TEXTUREFORMAT_RGBA,n._texture=i,n.samples=n._getEngine().getCaps().maxSamples||n.samples,n}return Object(n.__extends)(t,e),t.prototype._bindFrameBuffer=function(e){void 0===e&&(e=0),this._texture&&this.getScene().getEngine().bindMultiviewFramebuffer(this._texture)},t.prototype.getViewCount=function(){return 2},t}(i.RenderTargetTexture)},"./Materials/Textures/Packer/frame.ts":
- /*!********************************************!*\
- !*** ./Materials/Textures/Packer/frame.ts ***!
- \********************************************/
- /*! exports provided: TexturePackerFrame */function(e,t,r){"use strict";r.r(t),r.d(t,"TexturePackerFrame",(function(){return n}));var n=function(e,t,r){this.id=e,this.scale=t,this.offset=r}},"./Materials/Textures/Packer/index.ts":
- /*!********************************************!*\
- !*** ./Materials/Textures/Packer/index.ts ***!
- \********************************************/
- /*! exports provided: TexturePacker, TexturePackerFrame */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./packer */"./Materials/Textures/Packer/packer.ts");r.d(t,"TexturePacker",(function(){return n.TexturePacker}));var i=r(/*! ./frame */"./Materials/Textures/Packer/frame.ts");r.d(t,"TexturePackerFrame",(function(){return i.TexturePackerFrame}))},"./Materials/Textures/Packer/packer.ts":
- /*!*********************************************!*\
- !*** ./Materials/Textures/Packer/packer.ts ***!
- \*********************************************/
- /*! exports provided: TexturePacker */function(e,t,r){"use strict";r.r(t),r.d(t,"TexturePacker",(function(){return h}));var n=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../../../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../texture */"./Materials/Textures/texture.ts"),s=r(/*! ../dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),a=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ./frame */"./Materials/Textures/Packer/frame.ts"),u=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),d=r(/*! ../../../Misc/tools */"./Misc/tools.ts"),h=function(){function e(t,r,n,o){var s,a,c,u,d,h,f,p,m,g,_,v,y;return this.name=t,this.meshes=r,this.scene=o,this.options=n,this.options.map=null!==(s=this.options.map)&&void 0!==s?s:["ambientTexture","bumpTexture","diffuseTexture","emissiveTexture","lightmapTexture","opacityTexture","reflectionTexture","refractionTexture","specularTexture"],this.options.uvsIn=null!==(a=this.options.uvsIn)&&void 0!==a?a:i.VertexBuffer.UVKind,this.options.uvsOut=null!==(c=this.options.uvsOut)&&void 0!==c?c:i.VertexBuffer.UVKind,this.options.layout=null!==(u=this.options.layout)&&void 0!==u?u:e.LAYOUT_STRIP,this.options.layout===e.LAYOUT_COLNUM&&(this.options.colnum=null!==(d=this.options.colnum)&&void 0!==d?d:8),this.options.updateInputMeshes=null===(h=this.options.updateInputMeshes)||void 0===h||h,this.options.disposeSources=null===(f=this.options.disposeSources)||void 0===f||f,this._expecting=0,this.options.fillBlanks=null===(p=this.options.fillBlanks)||void 0===p||p,!0===this.options.fillBlanks&&(this.options.customFillColor=null!==(m=this.options.customFillColor)&&void 0!==m?m:"black"),this.options.frameSize=null!==(g=this.options.frameSize)&&void 0!==g?g:256,this.options.paddingRatio=null!==(_=this.options.paddingRatio)&&void 0!==_?_:.0115,this._paddingValue=Math.ceil(this.options.frameSize*this.options.paddingRatio),this._paddingValue%2!=0&&this._paddingValue++,this.options.paddingMode=null!==(v=this.options.paddingMode)&&void 0!==v?v:e.SUBUV_WRAP,this.options.paddingMode===e.SUBUV_COLOR&&(this.options.paddingColor=null!==(y=this.options.paddingColor)&&void 0!==y?y:new l.Color4(0,0,0,1)),this.sets={},this.frames=[],this}return e.prototype._createFrames=function(e){for(var t=this,r=this._calculateSize(),i=new a.Vector2(1,1).divide(r),c=0,u=this._expecting,h=this.meshes.length,f=Object.keys(this.sets),p=0;p<f.length;p++){var m=f[p],g=new s.DynamicTexture(this.name+".TexturePack."+m+"Set",{width:r.x,height:r.y},this.scene,!0,o.Texture.TRILINEAR_SAMPLINGMODE,n.Engine.TEXTUREFORMAT_RGBA),_=g.getContext();_.fillStyle="rgba(0,0,0,0)",_.fillRect(0,0,r.x,r.y),g.update(!1),this.sets[m]=g}var v=this.options.frameSize||256,y=this._paddingValue,b=v+2*y;for(p=0;p<h;p++)for(var A=this.meshes[p].material,T=function(n){var o=new s.DynamicTexture("temp",b,M.scene,!0),a=o.getContext(),h=M._getFrameOffset(p),m=function(){c++,o.update(!1);var n=a.getImageData(0,0,b,b),s=t.sets[g];if(s.getContext().putImageData(n,r.x*h.x,r.y*h.y),o.dispose(),s.update(!1),c==u)return t._calculateMeshUVFrames(v,y,r,i,t.options.updateInputMeshes||!1),void e()},g=f[n]||"_blank";if(A&&null!==A[g]){var _=A[g],T=new Image;_ instanceof s.DynamicTexture?T.src=_.getContext().canvas.toDataURL("image/png"):T.src=_.url,d.Tools.SetCorsBehavior(T.src,T),T.onload=function(){a.fillStyle="rgba(0,0,0,0)",a.fillRect(0,0,b,b),o.update(!1),a.setTransform(1,0,0,-1,0,0);var e=[0,0,1,0,1,1,0,1,-1,1,-1,0,-2,0,-1,1,-1];switch(t.options.paddingMode){case 0:for(var r=0;r<9;r++)a.drawImage(T,0,0,T.width,T.height,y+v*e[r],y+v*e[r+1]-b,v,v);break;case 1:for(var n=0;n<y;n++)a.drawImage(T,0,0,T.width,T.height,n+v*e[0],y-b,v,v),a.drawImage(T,0,0,T.width,T.height,2*y-n,y-b,v,v),a.drawImage(T,0,0,T.width,T.height,y,n-b,v,v),a.drawImage(T,0,0,T.width,T.height,y,2*y-n-b,v,v);a.drawImage(T,0,0,T.width,T.height,y+v*e[0],y+v*e[1]-b,v,v);break;case 2:a.fillStyle=(t.options.paddingColor||l.Color3.Black()).toHexString(),a.fillRect(0,0,b,-b),a.clearRect(y,y,v,v),a.drawImage(T,0,0,T.width,T.height,y+v*e[0],y+v*e[1]-b,v,v)}a.setTransform(1,0,0,1,0,0),m()}}else a.fillStyle="rgba(0,0,0,0)",M.options.fillBlanks&&(a.fillStyle=M.options.customFillColor),a.fillRect(0,0,b,b),m()},M=this,P=0;P<f.length;P++)T(P)},e.prototype._calculateSize=function(){var e=this.meshes.length||0,t=this.options.frameSize||0,r=this._paddingValue||0;switch(this.options.layout){case 0:return new a.Vector2(t*e+2*r*e,t+2*r);case 1:var n=Math.max(2,Math.ceil(Math.sqrt(e))),i=t*n+2*r*n;return new a.Vector2(i,i);case 2:var o=this.options.colnum||1,s=Math.max(1,Math.ceil(e/o));return new a.Vector2(t*o+2*r*o,t*s+2*r*s)}return a.Vector2.Zero()},e.prototype._calculateMeshUVFrames=function(e,t,r,n,i){for(var o=this.meshes.length,s=0;s<o;s++){var l=this.meshes[s],u=new a.Vector2(e/r.x,e/r.y),d=n.clone().scale(t),h=this._getFrameOffset(s).add(d),f=new c.TexturePackerFrame(s,u,h);this.frames.push(f),i&&(this._updateMeshUV(l,s),this._updateTextureReferences(l))}},e.prototype._getFrameOffset=function(e){var t,r,n,i=this.meshes.length;switch(this.options.layout){case 0:return t=1/i,new a.Vector2(e*t,0);case 1:var o=Math.max(2,Math.ceil(Math.sqrt(i)));return n=e-(r=Math.floor(e/o))*o,t=1/o,new a.Vector2(n*t,r*t);case 2:var s=this.options.colnum||1,l=Math.max(1,Math.ceil(i/s));return r=e-(n=Math.floor(e/l))*l,t=new a.Vector2(1/s,1/l),new a.Vector2(n*t.x,r*t.y)}return a.Vector2.Zero()},e.prototype._updateMeshUV=function(e,t){var r=this.frames[t],n=e.getVerticesData(this.options.uvsIn||i.VertexBuffer.UVKind),o=[],s=0;n.length&&(s=n.length||0);for(var a=0;a<s;a+=2)o.push(n[a]*r.scale.x+r.offset.x,n[a+1]*r.scale.y+r.offset.y);e.setVerticesData(this.options.uvsOut||i.VertexBuffer.UVKind,o)},e.prototype._updateTextureReferences=function(e,t){void 0===t&&(t=!1);for(var r=e.material,n=Object.keys(this.sets),i=function(e){e.dispose&&e.dispose()},o=0;o<n.length;o++){var s=n[o];if(t)null!==r[s]&&i(r[s]),r[s]=this.sets[s];else{if(!r)return;null!==r[s]&&(i(r[s]),r[s]=this.sets[s])}}},e.prototype.setMeshToFrame=function(e,t,r){void 0===r&&(r=!1),this._updateMeshUV(e,t),r&&this._updateTextureReferences(e,!0)},e.prototype.processAsync=function(){var e=this;return new Promise((function(t,r){try{if(0===e.meshes.length)return void t();for(var n=0,i=function(r){var i=e.meshes[r],o=i.material;if(!o)return++n===e.meshes.length?{value:e._createFrames(t)}:"continue";o.forceCompilationAsync(i).then((function(){!function(r){if(n++,e.options.map){for(var i=0;i<e.options.map.length;i++)null!==r[e.options.map[i]]&&(e.sets[e.options.map[i]]||(e.sets[e.options.map[i]]=!0),e._expecting++);n===e.meshes.length&&e._createFrames(t)}}(o)}))},o=0;o<e.meshes.length;o++){var s=i(o);if("object"==typeof s)return s.value}}catch(e){return r(e)}}))},e.prototype.dispose=function(){for(var e=Object.keys(this.sets),t=0;t<e.length;t++){var r=e[t];this.sets[r].dispose()}},e.prototype.download=function(e,t){var r=this;void 0===e&&(e="png"),void 0===t&&(t=1),setTimeout((function(){var n={name:r.name,sets:{},options:{},frames:[]},i=Object.keys(r.sets),o=Object.keys(r.options);try{for(var s=0;s<i.length;s++){var a=i[s],l=r.sets[a];n.sets[a]=l.getContext().canvas.toDataURL("image/"+e,t)}for(s=0;s<o.length;s++){var c=o[s];n.options[c]=r.options[c]}for(s=0;s<r.frames.length;s++){var d=r.frames[s];n.frames.push(d.scale.x,d.scale.y,d.offset.x,d.offset.y)}}catch(e){return void u.Logger.Warn("Unable to download: "+e)}var h="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(n,null,4)),f=document.createElement("a");f.setAttribute("href",h),f.setAttribute("download",r.name+"_texurePackage.json"),document.body.appendChild(f),f.click(),f.remove()}),0)},e.prototype.updateFromJSON=function(e){try{var t=JSON.parse(e);this.name=t.name;for(var r=Object.keys(t.options),n=0;n<r.length;n++)this.options[r[n]]=t.options[r[n]];for(n=0;n<t.frames.length;n+=4){var i=new c.TexturePackerFrame(n/4,new a.Vector2(t.frames[n],t.frames[n+1]),new a.Vector2(t.frames[n+2],t.frames[n+3]));this.frames.push(i)}var s=Object.keys(t.sets);for(n=0;n<s.length;n++){var l=new o.Texture(t.sets[s[n]],this.scene,!1,!1);this.sets[s[n]]=l}}catch(e){u.Logger.Warn("Unable to update from JSON: "+e)}},e.LAYOUT_STRIP=0,e.LAYOUT_POWER2=1,e.LAYOUT_COLNUM=2,e.SUBUV_WRAP=0,e.SUBUV_EXTEND=1,e.SUBUV_COLOR=2,e}()},"./Materials/Textures/Procedurals/customProceduralTexture.ts":
- /*!*******************************************************************!*\
- !*** ./Materials/Textures/Procedurals/customProceduralTexture.ts ***!
- \*******************************************************************/
- /*! exports provided: CustomProceduralTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"CustomProceduralTexture",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../../../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ./proceduralTexture */"./Materials/Textures/Procedurals/proceduralTexture.ts"),c=r(/*! ../../../Misc/webRequest */"./Misc/webRequest.ts"),u=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t,n,null,i,o,s)||this;return a._animate=!0,a._time=0,a._texturePath=r,a._loadJson(r),a.refreshRate=1,a}return Object(n.__extends)(t,e),t.prototype._loadJson=function(e){var t=this,r=function(){try{t.setFragment(t._texturePath)}catch(e){i.Logger.Error("No json or ShaderStore or DOM element found for CustomProceduralTexture")}},n=e+"/config.json",o=new c.WebRequest;o.open("GET",n),o.addEventListener("load",(function(){if(200===o.status||o.responseText&&o.responseText.length>0)try{t._config=JSON.parse(o.response),t.updateShaderUniforms(),t.updateTextures(),t.setFragment(t._texturePath+"/custom"),t._animate=t._config.animate,t.refreshRate=t._config.refreshrate}catch(e){r()}else r()}),!1),o.addEventListener("error",(function(){r()}),!1);try{o.send()}catch(e){i.Logger.Error("CustomProceduralTexture: Error on XHR send request.")}},t.prototype.isReady=function(){if(!e.prototype.isReady.call(this))return!1;for(var t in this._textures)if(!this._textures[t].isReady())return!1;return!0},t.prototype.render=function(t){var r=this.getScene();this._animate&&r&&(this._time+=.03*r.getAnimationRatio(),this.updateShaderUniforms()),e.prototype.render.call(this,t)},t.prototype.updateTextures=function(){for(var e=0;e<this._config.sampler2Ds.length;e++)this.setTexture(this._config.sampler2Ds[e].sample2Dname,new a.Texture(this._texturePath+"/"+this._config.sampler2Ds[e].textureRelativeUrl,this.getScene()))},t.prototype.updateShaderUniforms=function(){if(this._config)for(var e=0;e<this._config.uniforms.length;e++){var t=this._config.uniforms[e];switch(t.type){case"float":this.setFloat(t.name,t.value);break;case"color3":this.setColor3(t.name,new s.Color3(t.r,t.g,t.b));break;case"color4":this.setColor4(t.name,new s.Color4(t.r,t.g,t.b,t.a));break;case"vector2":this.setVector2(t.name,new o.Vector2(t.x,t.y));break;case"vector3":this.setVector3(t.name,new o.Vector3(t.x,t.y,t.z))}}this.setFloat("time",this._time)},Object.defineProperty(t.prototype,"animate",{get:function(){return this._animate},set:function(e){this._animate=e},enumerable:!1,configurable:!0}),t}(l.ProceduralTexture)},"./Materials/Textures/Procedurals/index.ts":
- /*!*************************************************!*\
- !*** ./Materials/Textures/Procedurals/index.ts ***!
- \*************************************************/
- /*! exports provided: CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./customProceduralTexture */"./Materials/Textures/Procedurals/customProceduralTexture.ts");r.d(t,"CustomProceduralTexture",(function(){return n.CustomProceduralTexture}));var i=r(/*! ./noiseProceduralTexture */"./Materials/Textures/Procedurals/noiseProceduralTexture.ts");r.d(t,"NoiseProceduralTexture",(function(){return i.NoiseProceduralTexture}));var o=r(/*! ./proceduralTexture */"./Materials/Textures/Procedurals/proceduralTexture.ts");r.d(t,"ProceduralTexture",(function(){return o.ProceduralTexture}));var s=r(/*! ./proceduralTextureSceneComponent */"./Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts");r.d(t,"ProceduralTextureSceneComponent",(function(){return s.ProceduralTextureSceneComponent}))},"./Materials/Textures/Procedurals/noiseProceduralTexture.ts":
- /*!******************************************************************!*\
- !*** ./Materials/Textures/Procedurals/noiseProceduralTexture.ts ***!
- \******************************************************************/
- /*! exports provided: NoiseProceduralTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"NoiseProceduralTexture",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Engines/engineStore */"./Engines/engineStore.ts"),o=r(/*! ./proceduralTexture */"./Materials/Textures/Procedurals/proceduralTexture.ts"),s=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),a=(r(/*! ../../../Shaders/noise.fragment */"./Shaders/noise.fragment.ts"),function(e){function t(t,r,n,o,s){void 0===r&&(r=256),void 0===n&&(n=i.EngineStore.LastCreatedScene);var a=e.call(this,t,r,"noise",n,o,s)||this;return a._time=0,a.brightness=.2,a.octaves=3,a.persistence=.8,a.animationSpeedFactor=1,a.autoClear=!1,a._updateShaderUniforms(),a}return Object(n.__extends)(t,e),t.prototype._updateShaderUniforms=function(){var e=this.getScene();e&&(this._time+=e.getAnimationRatio()*this.animationSpeedFactor*.01,this.setFloat("brightness",this.brightness),this.setFloat("persistence",this.persistence),this.setFloat("timeScale",this._time))},t.prototype._getDefines=function(){return"#define OCTAVES "+(0|this.octaves)},t.prototype.render=function(t){this._updateShaderUniforms(),e.prototype.render.call(this,t)},t.prototype.serialize=function(){var e={customType:"BABYLON.NoiseProceduralTexture"};return e.brightness=this.brightness,e.octaves=this.octaves,e.persistence=this.persistence,e.animationSpeedFactor=this.animationSpeedFactor,e.size=this.getSize().width,e.generateMipMaps=this._generateMipMaps,e},t.prototype.clone=function(){var e=this.getSize(),r=new t(this.name,e.width,this.getScene(),this._fallbackTexture?this._fallbackTexture:void 0,this._generateMipMaps);return r.hasAlpha=this.hasAlpha,r.level=this.level,r.coordinatesMode=this.coordinatesMode,r.brightness=this.brightness,r.octaves=this.octaves,r.persistence=this.persistence,r.animationSpeedFactor=this.animationSpeedFactor,r},t.Parse=function(e,r){var n=new t(e.name,e.size,r,void 0,e.generateMipMaps);return n.brightness=e.brightness,n.octaves=e.octaves,n.persistence=e.persistence,n.animationSpeedFactor=e.animationSpeedFactor,n},t}(o.ProceduralTexture));s._TypeStore.RegisteredTypes["BABYLON.NoiseProceduralTexture"]=a},"./Materials/Textures/Procedurals/proceduralTexture.ts":
- /*!*************************************************************!*\
- !*** ./Materials/Textures/Procedurals/proceduralTexture.ts ***!
- \*************************************************************/
- /*! exports provided: ProceduralTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"ProceduralTexture",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../../../sceneComponent */"./sceneComponent.ts"),l=r(/*! ../../../Materials/material */"./Materials/material.ts"),c=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),d=r(/*! ./proceduralTextureSceneComponent */"./Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts"),h=(r(/*! ../../../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),r(/*! ../../../Engines/Extensions/engine.renderTargetCube */"./Engines/Extensions/engine.renderTargetCube.ts"),r(/*! ../../../Shaders/procedural.vertex */"./Shaders/procedural.vertex.ts"),function(e){function t(t,r,n,i,l,c,u){void 0===l&&(l=null),void 0===c&&(c=!0),void 0===u&&(u=!1);var h=e.call(this,null,i,!c)||this;h.isCube=u,h.isEnabled=!0,h.autoClear=!0,h.onGeneratedObservable=new o.Observable,h._textures={},h._currentRefreshId=-1,h._frameId=-1,h._refreshRate=1,h._vertexBuffers={},h._uniforms=new Array,h._samplers=new Array,h._floats={},h._ints={},h._floatsArrays={},h._colors3={},h._colors4={},h._vectors2={},h._vectors3={},h._matrices={},h._fallbackTextureUsed=!1,h._cachedDefines="",h._contentUpdateId=-1;var f=(i=h.getScene())._getComponent(a.SceneComponentConstants.NAME_PROCEDURALTEXTURE);f||(f=new d.ProceduralTextureSceneComponent(i),i._addComponent(f)),i.proceduralTextures.push(h),h._fullEngine=i.getEngine(),h.name=t,h.isRenderTarget=!0,h._size=r,h._generateMipMaps=c,h.setFragment(n),h._fallbackTexture=l,u?(h._texture=h._fullEngine.createRenderTargetCubeTexture(r,{generateMipMaps:c,generateDepthBuffer:!1,generateStencilBuffer:!1}),h.setFloat("face",0)):h._texture=h._fullEngine.createRenderTargetTexture(r,{generateMipMaps:c,generateDepthBuffer:!1,generateStencilBuffer:!1});var p=[];return p.push(1,1),p.push(-1,1),p.push(-1,-1),p.push(1,-1),h._vertexBuffers[s.VertexBuffer.PositionKind]=new s.VertexBuffer(h._fullEngine,p,s.VertexBuffer.PositionKind,!1,!1,2),h._createIndexBuffer(),h}return Object(n.__extends)(t,e),t.prototype.getEffect=function(){return this._effect},t.prototype.getContent=function(){return this._contentData&&this._frameId===this._contentUpdateId||(this._contentData=this.readPixels(0,0,this._contentData),this._contentUpdateId=this._frameId),this._contentData},t.prototype._createIndexBuffer=function(){var e=this._fullEngine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},t.prototype._rebuild=function(){var e=this._vertexBuffers[s.VertexBuffer.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===u.RenderTargetTexture.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=u.RenderTargetTexture.REFRESHRATE_RENDER_ONCE)},t.prototype.reset=function(){void 0!==this._effect&&this._effect.dispose()},t.prototype._getDefines=function(){return""},t.prototype.isReady=function(){var e,t=this,r=this._fullEngine;if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;var n=this._getDefines();return!(!this._effect||n!==this._cachedDefines||!this._effect.isReady())||(e=void 0!==this._fragment.fragmentElement?{vertex:"procedural",fragmentElement:this._fragment.fragmentElement}:{vertex:"procedural",fragment:this._fragment},this._cachedDefines=n,this._effect=r.createEffect(e,[s.VertexBuffer.PositionKind],this._uniforms,this._samplers,n,void 0,void 0,(function(){t.releaseInternalTexture(),t._fallbackTexture&&(t._texture=t._fallbackTexture._texture,t._texture&&t._texture.incrementReferences()),t._fallbackTextureUsed=!0})),this._effect.isReady())},t.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},t.prototype.setFragment=function(e){this._fragment=e},Object.defineProperty(t.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!1,configurable:!0}),t.prototype._shouldRender=function(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)},t.prototype.getRenderSize=function(){return this._size},t.prototype.resize=function(e,t){this._fallbackTextureUsed||(this.releaseInternalTexture(),this._texture=this._fullEngine.createRenderTargetTexture(e,t),this._size=e,this._generateMipMaps=t)},t.prototype._checkUniform=function(e){-1===this._uniforms.indexOf(e)&&this._uniforms.push(e)},t.prototype.setTexture=function(e,t){return-1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this},t.prototype.setFloat=function(e,t){return this._checkUniform(e),this._floats[e]=t,this},t.prototype.setInt=function(e,t){return this._checkUniform(e),this._ints[e]=t,this},t.prototype.setFloats=function(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this},t.prototype.setColor3=function(e,t){return this._checkUniform(e),this._colors3[e]=t,this},t.prototype.setColor4=function(e,t){return this._checkUniform(e),this._colors4[e]=t,this},t.prototype.setVector2=function(e,t){return this._checkUniform(e),this._vectors2[e]=t,this},t.prototype.setVector3=function(e,t){return this._checkUniform(e),this._vectors3[e]=t,this},t.prototype.setMatrix=function(e,t){return this._checkUniform(e),this._matrices[e]=t,this},t.prototype.render=function(e){var t=this.getScene();if(t){var r=this._fullEngine;for(var n in r.enableEffect(this._effect),r.setState(!1),this._textures)this._effect.setTexture(n,this._textures[n]);for(n in this._ints)this._effect.setInt(n,this._ints[n]);for(n in this._floats)this._effect.setFloat(n,this._floats[n]);for(n in this._floatsArrays)this._effect.setArray(n,this._floatsArrays[n]);for(n in this._colors3)this._effect.setColor3(n,this._colors3[n]);for(n in this._colors4){var i=this._colors4[n];this._effect.setFloat4(n,i.r,i.g,i.b,i.a)}for(n in this._vectors2)this._effect.setVector2(n,this._vectors2[n]);for(n in this._vectors3)this._effect.setVector3(n,this._vectors3[n]);for(n in this._matrices)this._effect.setMatrix(n,this._matrices[n]);if(this._texture){if(this.isCube)for(var o=0;o<6;o++)r.bindFramebuffer(this._texture,o,void 0,void 0,!0),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this._effect.setFloat("face",o),this.autoClear&&r.clear(t.clearColor,!0,!1,!1),r.drawElementsType(l.Material.TriangleFillMode,0,6),5===o&&r.generateMipMapsForCubemap(this._texture);else r.bindFramebuffer(this._texture,0,void 0,void 0,!0),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this.autoClear&&r.clear(t.clearColor,!0,!1,!1),r.drawElementsType(l.Material.TriangleFillMode,0,6);r.unBindFramebuffer(this._texture,this.isCube),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}}},t.prototype.clone=function(){var e=this.getSize(),r=new t(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return r.hasAlpha=this.hasAlpha,r.level=this.level,r.coordinatesMode=this.coordinatesMode,r},t.prototype.dispose=function(){var t=this.getScene();if(t){var r=t.proceduralTextures.indexOf(this);r>=0&&t.proceduralTextures.splice(r,1);var n=this._vertexBuffers[s.VertexBuffer.PositionKind];n&&(n.dispose(),this._vertexBuffers[s.VertexBuffer.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),e.prototype.dispose.call(this)}},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"autoClear",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_generateMipMaps",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_size",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"refreshRate",null),t}(c.Texture))},"./Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts":
- /*!***************************************************************************!*\
- !*** ./Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts ***!
- \***************************************************************************/
- /*! exports provided: ProceduralTextureSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"ProceduralTextureSceneComponent",(function(){return o}));var n=r(/*! ../../../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../../../sceneComponent */"./sceneComponent.ts"),o=function(){function e(e){this.name=i.SceneComponentConstants.NAME_PROCEDURALTEXTURE,this.scene=e,this.scene.proceduralTextures=new Array}return e.prototype.register=function(){this.scene._beforeClearStage.registerStep(i.SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._beforeClear=function(){if(this.scene.proceduralTexturesEnabled){n.Tools.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(var e=0;e<this.scene.proceduralTextures.length;e++){var t=this.scene.proceduralTextures[e];t._shouldRender()&&t.render()}n.Tools.EndPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0)}},e}()},"./Materials/Textures/baseTexture.polynomial.ts":
- /*!******************************************************!*\
- !*** ./Materials/Textures/baseTexture.polynomial.ts ***!
- \******************************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),i=r(/*! ./baseTexture */"./Materials/Textures/baseTexture.ts");Object.defineProperty(i.BaseTexture.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial)return this._texture._sphericalPolynomial;if(this._texture.isReady)return this._texture._sphericalPolynomial=n.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this),this._texture._sphericalPolynomial}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})},"./Materials/Textures/baseTexture.ts":
- /*!*******************************************!*\
- !*** ./Materials/Textures/baseTexture.ts ***!
- \*******************************************/
- /*! exports provided: BaseTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseTexture",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../../Misc/guid */"./Misc/guid.ts"),u=r(/*! ../../Maths/math.size */"./Maths/math.size.ts"),d=(r(/*! ../../Misc/fileTools */"./Misc/fileTools.ts"),function(){function e(t){this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this.getAlphaFromRGB=!1,this.level=1,this.coordinatesIndex=0,this._coordinatesMode=l.Constants.TEXTURE_EXPLICIT_MODE,this.wrapU=l.Constants.TEXTURE_WRAP_ADDRESSMODE,this.wrapV=l.Constants.TEXTURE_WRAP_ADDRESSMODE,this.wrapR=l.Constants.TEXTURE_WRAP_ADDRESSMODE,this.anisotropicFilteringLevel=e.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,this.gammaSpace=!0,this.invertZ=!1,this.lodLevelInAlpha=!1,this.isRenderTarget=!1,this._prefiltered=!1,this.animations=new Array,this.onDisposeObservable=new o.Observable,this._onDisposeObserver=null,this.delayLoadState=l.Constants.DELAYLOADSTATE_NONE,this._scene=null,this._engine=null,this._texture=null,this._uid=null,this._cachedSize=u.Size.Zero(),t?e._isScene(t)?this._scene=t:this._engine=t:this._scene=a.EngineStore.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._uid=null}return Object.defineProperty(e.prototype,"hasAlpha",{get:function(){return this._hasAlpha},set:function(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag|l.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinatesMode",{get:function(){return this._coordinatesMode},set:function(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCube",{get:function(){return!!this._texture&&this._texture.isCube},set:function(e){this._texture&&(this._texture.isCube=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"is3D",{get:function(){return!!this._texture&&this._texture.is3D},set:function(e){this._texture&&(this._texture.is3D=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"is2DArray",{get:function(){return!!this._texture&&this._texture.is2DArray},set:function(e){this._texture&&(this._texture.is2DArray=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRGBD",{get:function(){return null!=this._texture&&this._texture._isRGBD},set:function(e){this._texture&&(this._texture._isRGBD=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"noMipmap",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lodGenerationOffset",{get:function(){return this._texture?this._texture._lodGenerationOffset:0},set:function(e){this._texture&&(this._texture._lodGenerationOffset=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lodGenerationScale",{get:function(){return this._texture?this._texture._lodGenerationScale:0},set:function(e){this._texture&&(this._texture._lodGenerationScale=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linearSpecularLOD",{get:function(){return!!this._texture&&this._texture._linearSpecularLOD},set:function(e){this._texture&&(this._texture._linearSpecularLOD=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"irradianceTexture",{get:function(){return this._texture?this._texture._irradianceTexture:null},set:function(e){this._texture&&(this._texture._irradianceTexture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uid",{get:function(){return this._uid||(this._uid=c.GUID.RandomId()),this._uid},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name},e.prototype.getClassName=function(){return"BaseTexture"},Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBlocking",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype._getEngine=function(){return this._engine},e.prototype.getTextureMatrix=function(){return s.Matrix.IdentityReadOnly},e.prototype.getReflectionTextureMatrix=function(){return s.Matrix.IdentityReadOnly},e.prototype.getInternalTexture=function(){return this._texture},e.prototype.isReadyOrNotBlocking=function(){return!this.isBlocking||this.isReady()},e.prototype.isReady=function(){return this.delayLoadState===l.Constants.DELAYLOADSTATE_NOTLOADED?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady},e.prototype.getSize=function(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize},e.prototype.getBaseSize=function(){return this.isReady()&&this._texture?this._texture._size?new u.Size(this._texture._size,this._texture._size):new u.Size(this._texture.baseWidth,this._texture.baseHeight):u.Size.Zero()},e.prototype.updateSamplingMode=function(e){if(this._texture){var t=this._getEngine();t&&t.updateTextureSamplingMode(e,this._texture)}},e.prototype.scale=function(e){},Object.defineProperty(e.prototype,"canRescale",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype._getFromCache=function(e,t,r,n){var i=this._getEngine();if(!i)return null;for(var o=i.getLoadedTexturesCache(),s=0;s<o.length;s++){var a=o[s];if(!(void 0!==n&&n!==a.invertY||a.url!==e||a.generateMipMaps!==!t||r&&r!==a.samplingMode))return a.incrementReferences(),a}return null},e.prototype._rebuild=function(){},e.prototype.delayLoad=function(){},e.prototype.clone=function(){return null},Object.defineProperty(e.prototype,"textureType",{get:function(){return this._texture&&void 0!==this._texture.type?this._texture.type:l.Constants.TEXTURETYPE_UNSIGNED_INT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textureFormat",{get:function(){return this._texture&&void 0!==this._texture.format?this._texture.format:l.Constants.TEXTUREFORMAT_RGBA},enumerable:!1,configurable:!0}),e.prototype._markAllSubMeshesAsTexturesDirty=function(){var e=this.getScene();e&&e.markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag)},e.prototype.readPixels=function(e,t,r){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=null),!this._texture)return null;var n=this.getSize(),i=n.width,o=n.height,s=this._getEngine();if(!s)return null;0!=t&&(i/=Math.pow(2,t),o/=Math.pow(2,t),i=Math.round(i),o=Math.round(o));try{return this._texture.isCube?s._readTexturePixels(this._texture,i,o,e,t,r):s._readTexturePixels(this._texture,i,o,-1,t,r)}catch(e){return null}},e.prototype.releaseInternalTexture=function(){this._texture&&(this._texture.dispose(),this._texture=null)},Object.defineProperty(e.prototype,"_lodTextureHigh",{get:function(){return this._texture?this._texture._lodTextureHigh:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_lodTextureMid",{get:function(){return this._texture?this._texture._lodTextureMid:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_lodTextureLow",{get:function(){return this._texture?this._texture._lodTextureLow:null},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene._removePendingData(this);var e=this._scene.textures.indexOf(this);e>=0&&this._scene.textures.splice(e,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null}void 0!==this._texture&&(this.releaseInternalTexture(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._engine=null)},e.prototype.serialize=function(){if(!this.name)return null;var e=i.SerializationHelper.Serialize(this);return i.SerializationHelper.AppendSerializedAnimations(this,e),e},e.WhenAllReady=function(e,t){var r=e.length;if(0!==r)for(var n,i,o=function(){if((n=e[s]).isReady())0==--r&&t();else if(i=n.onLoadObservable){var o=function(){i.removeCallback(o),0==--r&&t()};i.add(o)}},s=0;s<e.length;s++)o();else t()},e._isScene=function(e){return"Scene"===e.getClassName()},e.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,Object(n.__decorate)([Object(i.serialize)()],e.prototype,"uniqueId",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"name",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"metadata",void 0),Object(n.__decorate)([Object(i.serialize)("hasAlpha")],e.prototype,"_hasAlpha",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"getAlphaFromRGB",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"level",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"coordinatesIndex",void 0),Object(n.__decorate)([Object(i.serialize)("coordinatesMode")],e.prototype,"_coordinatesMode",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wrapU",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wrapV",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wrapR",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"anisotropicFilteringLevel",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"isCube",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"is3D",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"is2DArray",null),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"gammaSpace",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"invertZ",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"lodLevelInAlpha",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"lodGenerationOffset",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"lodGenerationScale",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"linearSpecularLOD",null),Object(n.__decorate)([Object(i.serializeAsTexture)()],e.prototype,"irradianceTexture",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"isRenderTarget",void 0),e}())},"./Materials/Textures/colorGradingTexture.ts":
- /*!***************************************************!*\
- !*** ./Materials/Textures/colorGradingTexture.ts ***!
- \***************************************************/
- /*! exports provided: ColorGradingTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorGradingTexture",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),l=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n){void 0===n&&(n=null);var o=e.call(this,r)||this;if(!t)return o;if(o._textureMatrix=i.Matrix.Identity(),o.name=t,o.url=t,o._onLoad=n,o._texture=o._getFromCache(t,!0),o._texture)o._triggerOnLoad();else{var a=o.getScene();a&&a.useDelayedTextureLoading?o.delayLoadState=s.Constants.DELAYLOADSTATE_NOTLOADED:o.loadTexture()}return o}return Object(n.__extends)(t,e),t.prototype._triggerOnLoad=function(){this._onLoad&&this._onLoad()},t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.load3dlTexture=function(){var e,r=this,n=this._getEngine();e=1===n.webGLVersion?n.createRawTexture(null,1,1,s.Constants.TEXTUREFORMAT_RGBA,!1,!1,s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,null,s.Constants.TEXTURETYPE_UNSIGNED_INT):n.createRawTexture3D(null,1,1,1,s.Constants.TEXTUREFORMAT_RGBA,!1,!1,s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,null,s.Constants.TEXTURETYPE_UNSIGNED_INT),this._texture=e,this._texture.isReady=!1,this.isCube=!1,this.is3D=n.webGLVersion>1,this.wrapU=s.Constants.TEXTURE_CLAMP_ADDRESSMODE,this.wrapV=s.Constants.TEXTURE_CLAMP_ADDRESSMODE,this.wrapR=s.Constants.TEXTURE_CLAMP_ADDRESSMODE,this.anisotropicFilteringLevel=1;var i=function(i){if("string"==typeof i){for(var o,a=null,l=null,c=i.split("\n"),u=0,d=0,h=0,f=0,p=0,m=0;m<c.length;m++)if(o=c[m],t._noneEmptyLineRegex.test(o)&&0!==o.indexOf("#")){var g=o.split(" ");if(0!==u){if(0!=u){var _=Math.max(parseInt(g[0]),0),v=Math.max(parseInt(g[1]),0),y=Math.max(parseInt(g[2]),0);p=Math.max(_,p),p=Math.max(v,p),p=Math.max(y,p);var b=4*(d+f*u+h*u*u);l&&(l[b+0]=_,l[b+1]=v,l[b+2]=y),++h%u==0&&(h=0,++f%u==0&&(d++,f=0))}}else u=g.length,a=new Uint8Array(u*u*u*4),l=new Float32Array(u*u*u*4)}if(l&&a)for(m=0;m<l.length;m++)if(m>0&&(m+1)%4==0)a[m]=255;else{var A=l[m];a[m]=A/p*255}e.is3D?(e.updateSize(u,u,u),n.updateRawTexture3D(e,a,s.Constants.TEXTUREFORMAT_RGBA,!1)):(e.updateSize(u*u,u),n.updateRawTexture(e,a,s.Constants.TEXTUREFORMAT_RGBA,!1)),e.isReady=!0,r._triggerOnLoad()}},o=this.getScene();return o?o._loadFile(this.url,i):n._loadFile(this.url,i),this._texture},t.prototype.loadTexture=function(){this.url&&this.url.toLocaleLowerCase().indexOf(".3dl")==this.url.length-4&&this.load3dlTexture()},t.prototype.clone=function(){var e=new t(this.url,this.getScene()||this._getEngine());return e.level=this.level,e},t.prototype.delayLoad=function(){this.delayLoadState===s.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=s.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,!0),this._texture||this.loadTexture())},t.Parse=function(e,r){var n=null;return e.name&&!e.isRenderTarget&&((n=new t(e.name,r)).name=e.name,n.level=e.level),n},t.prototype.serialize=function(){if(!this.name)return null;var e={};return e.name=this.name,e.level=this.level,e.customType="BABYLON.ColorGradingTexture",e},t._noneEmptyLineRegex=/\S+/,t}(o.BaseTexture));a._TypeStore.RegisteredTypes["BABYLON.ColorGradingTexture"]=l},"./Materials/Textures/cubeTexture.ts":
- /*!*******************************************!*\
- !*** ./Materials/Textures/cubeTexture.ts ***!
- \*******************************************/
- /*! exports provided: CubeTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"CubeTexture",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),l=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),d=(r(/*! ../../Engines/Extensions/engine.cubeTexture */"./Engines/Extensions/engine.cubeTexture.ts"),r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts")),h=r(/*! ../../Misc/observable */"./Misc/observable.ts"),f=function(e){function t(t,r,n,i,a,u,d,f,p,m,g,_,v){var y;void 0===n&&(n=null),void 0===i&&(i=!1),void 0===a&&(a=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===f&&(f=c.Constants.TEXTUREFORMAT_RGBA),void 0===p&&(p=!1),void 0===m&&(m=null),void 0===g&&(g=!1),void 0===_&&(_=.8),void 0===v&&(v=0);var b=e.call(this,r)||this;if(b.onLoadObservable=new h.Observable,b.boundingBoxPosition=s.Vector3.Zero(),b._rotationY=0,b._files=null,b._forcedExtension=null,b._extensions=null,b.name=t,b.url=t,b._noMipmap=i,b.hasAlpha=!1,b._format=f,b.isCube=!0,b._textureMatrix=s.Matrix.Identity(),b._createPolynomials=g,b.coordinatesMode=l.Texture.CUBIC_MODE,b._extensions=n,b._files=a,b._forcedExtension=m,!t&&!a)return b;var A=t.lastIndexOf("."),T=m||(A>-1?t.substring(A).toLowerCase():""),M=".dds"===T,P=".env"===T;if(P?(b.gammaSpace=!1,b._prefiltered=!1,b.anisotropicFilteringLevel=1):(b._prefiltered=p,p&&(b.gammaSpace=!1,b.anisotropicFilteringLevel=1)),b._texture=b._getFromCache(t,i),!a&&(P||M||n||(n=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),a=[],n))for(var S=0;S<n.length;S++)a.push(t+n[S]);b._files=a;var E=function(){b.onLoadObservable.notifyObservers(b),u&&u()};if(b._texture)b._texture.isReady?o.Tools.SetImmediate((function(){return E()})):b._texture.onLoadedObservable.add((function(){return E()}));else{var C=b.getScene();(null==C?void 0:C.useDelayedTextureLoading)?b.delayLoadState=c.Constants.DELAYLOADSTATE_NOTLOADED:(b._texture=p?b._getEngine().createPrefilteredCubeTexture(t,C,_,v,u,d,f,m,b._createPolynomials):b._getEngine().createCubeTexture(t,C,a,i,u,d,b._format,m,!1,_,v),null===(y=b._texture)||void 0===y||y.onLoadedObservable.add((function(){return b.onLoadObservable.notifyObservers(b)})))}return b}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"boundingBoxSize",{get:function(){return this._boundingBoxSize},set:function(e){if(!this._boundingBoxSize||!this._boundingBoxSize.equals(e)){this._boundingBoxSize=e;var t=this.getScene();t&&t.markAllMaterialsAsDirty(c.Constants.MATERIAL_TextureDirtyFlag)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationY",{get:function(){return this._rotationY},set:function(e){this._rotationY=e,this.setReflectionTextureMatrix(s.Matrix.RotationY(this._rotationY))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return this._noMipmap},enumerable:!1,configurable:!0}),t.CreateFromImages=function(e,r,n){var i="";return e.forEach((function(e){return i+=e})),new t(i,r,null,n,e)},t.CreateFromPrefilteredData=function(e,r,n,i){void 0===n&&(n=null),void 0===i&&(i=!0);var o=r.useDelayedTextureLoading;r.useDelayedTextureLoading=!1;var s=new t(e,r,null,!1,null,null,null,void 0,!0,n,i);return r.useDelayedTextureLoading=o,s},t.prototype.getClassName=function(){return"CubeTexture"},t.prototype.updateURL=function(e,t,r,n){var i;void 0===n&&(n=!1),this.url&&(this.releaseInternalTexture(),null===(i=this.getScene())||void 0===i||i.markAllMaterialsAsDirty(c.Constants.MATERIAL_TextureDirtyFlag)),this.name&&!d.StringTools.StartsWith(this.name,"data:")||(this.name=e),this.url=e,this.delayLoadState=c.Constants.DELAYLOADSTATE_NOTLOADED,this._prefiltered=n,this._prefiltered&&(this.gammaSpace=!1,this.anisotropicFilteringLevel=1),this._forcedExtension=t||null,r&&(this._delayedOnLoad=r),this.delayLoad(t)},t.prototype.delayLoad=function(e){var t,r=this;if(this.delayLoadState===c.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=c.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap),!this._texture)){var n=this.getScene();this._prefiltered?this._texture=this._getEngine().createPrefilteredCubeTexture(this.url,n,.8,0,this._delayedOnLoad,void 0,this._format,void 0,this._createPolynomials):this._texture=this._getEngine().createCubeTexture(this.url,n,this._files,this._noMipmap,this._delayedOnLoad,null,this._format,e),null===(t=this._texture)||void 0===t||t.onLoadedObservable.add((function(){return r.onLoadObservable.notifyObservers(r)}))}},t.prototype.getReflectionTextureMatrix=function(){return this._textureMatrix},t.prototype.setReflectionTextureMatrix=function(e){var t,r=this;e.updateFlag!==this._textureMatrix.updateFlag&&(e.isIdentity()!==this._textureMatrix.isIdentity()&&(null===(t=this.getScene())||void 0===t||t.markAllMaterialsAsDirty(c.Constants.MATERIAL_TextureDirtyFlag,(function(e){return-1!==e.getActiveTextures().indexOf(r)}))),this._textureMatrix=e)},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse((function(){var i=!1;return e.prefiltered&&(i=e.prefiltered),new t(n+e.name,r,e.extensions,!1,e.files||null,null,null,void 0,i,e.forcedExtension)}),e,r);if(e.boundingBoxPosition&&(o.boundingBoxPosition=s.Vector3.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(o.boundingBoxSize=s.Vector3.FromArray(e.boundingBoxSize)),e.animations)for(var a=0;a<e.animations.length;a++){var l=e.animations[a],c=u._TypeStore.GetClass("BABYLON.Animation");c&&o.animations.push(c.Parse(l))}return o},t.prototype.clone=function(){var e=this,r=0,n=i.SerializationHelper.Clone((function(){var n=new t(e.url,e.getScene()||e._getEngine(),e._extensions,e._noMipmap,e._files);return r=n.uniqueId,n}),this);return n.uniqueId=r,n},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"url",void 0),Object(n.__decorate)([Object(i.serialize)("rotationY")],t.prototype,"rotationY",null),Object(n.__decorate)([Object(i.serialize)("files")],t.prototype,"_files",void 0),Object(n.__decorate)([Object(i.serialize)("forcedExtension")],t.prototype,"_forcedExtension",void 0),Object(n.__decorate)([Object(i.serialize)("extensions")],t.prototype,"_extensions",void 0),Object(n.__decorate)([Object(i.serializeAsMatrix)("textureMatrix")],t.prototype,"_textureMatrix",void 0),t}(a.BaseTexture);l.Texture._CubeTextureParser=f.Parse,u._TypeStore.RegisteredTypes["BABYLON.CubeTexture"]=f},"./Materials/Textures/dynamicTexture.ts":
- /*!**********************************************!*\
- !*** ./Materials/Textures/dynamicTexture.ts ***!
- \**********************************************/
- /*! exports provided: DynamicTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"DynamicTexture",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../../Engines/Extensions/engine.dynamicTexture */"./Engines/Extensions/engine.dynamicTexture.ts"),r(/*! ../../Misc/canvasGenerator */"./Misc/canvasGenerator.ts")),l=function(e){function t(t,r,n,i,l,c){void 0===n&&(n=null),void 0===l&&(l=s.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===c&&(c=s.Constants.TEXTUREFORMAT_RGBA);var u=e.call(this,null,n,!i,void 0,l,void 0,void 0,void 0,void 0,c)||this;u.name=t,u.wrapU=o.Texture.CLAMP_ADDRESSMODE,u.wrapV=o.Texture.CLAMP_ADDRESSMODE,u._generateMipMaps=i;var d=u._getEngine();if(!d)return u;r.getContext?(u._canvas=r,u._texture=d.createDynamicTexture(r.width,r.height,i,l)):(u._canvas=a.CanvasGenerator.CreateCanvas(1,1),r.width||0===r.width?u._texture=d.createDynamicTexture(r.width,r.height,i,l):u._texture=d.createDynamicTexture(r,r,i,l));var h=u.getSize();return u._canvas.width=h.width,u._canvas.height=h.height,u._context=u._canvas.getContext("2d"),u}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"DynamicTexture"},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype._recreate=function(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)},t.prototype.scale=function(e){var t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)},t.prototype.scaleTo=function(e,t){var r=this.getSize();r.width=e,r.height=t,this._recreate(r)},t.prototype.getContext=function(){return this._context},t.prototype.clear=function(){var e=this.getSize();this._context.fillRect(0,0,e.width,e.height)},t.prototype.update=function(e,t){void 0===t&&(t=!1),this._getEngine().updateDynamicTexture(this._texture,this._canvas,void 0===e||e,t,this._format||void 0)},t.prototype.drawText=function(e,t,r,n,i,o,s,a){void 0===a&&(a=!0);var l=this.getSize();if(o&&(this._context.fillStyle=o,this._context.fillRect(0,0,l.width,l.height)),this._context.font=n,null==t){var c=this._context.measureText(e);t=(l.width-c.width)/2}if(null==r){var u=parseInt(n.replace(/\D/g,""));r=l.height/2+u/3.65}this._context.fillStyle=i||"",this._context.fillText(e,t,r),a&&this.update(s)},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var r=this.getSize(),n=new t(this.name,r,e,this._generateMipMaps);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.wrapU=this.wrapU,n.wrapV=this.wrapV,n},t.prototype.serialize=function(){var t=this.getScene();t&&!t.isReady()&&i.Logger.Warn("The scene must be ready before serializing the dynamic texture");var r=e.prototype.serialize.call(this);return this._IsCanvasElement(this._canvas)&&(r.base64String=this._canvas.toDataURL()),r.invertY=this._invertY,r.samplingMode=this.samplingMode,r},t.prototype._IsCanvasElement=function(e){return void 0!==e.toDataURL},t.prototype._rebuild=function(){this.update()},t}(o.Texture)},"./Materials/Textures/equiRectangularCubeTexture.ts":
- /*!**********************************************************!*\
- !*** ./Materials/Textures/equiRectangularCubeTexture.ts ***!
- \**********************************************************/
- /*! exports provided: EquiRectangularCubeTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"EquiRectangularCubeTexture",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/HighDynamicRange/panoramaToCubemap */"./Misc/HighDynamicRange/panoramaToCubemap.ts"),o=r(/*! ./baseTexture */"./Materials/Textures/baseTexture.ts"),s=r(/*! ./texture */"./Materials/Textures/texture.ts"),a=r(/*! ../../Misc/tools */"./Misc/tools.ts"),l=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),r(/*! ../../Engines/constants */"./Engines/constants.ts")),c=function(e){function t(t,r,n,i,o,c,u){void 0===i&&(i=!1),void 0===o&&(o=!0),void 0===c&&(c=null),void 0===u&&(u=null);var d=e.call(this,r)||this;if(d._onLoad=null,d._onError=null,d.coordinatesMode=s.Texture.CUBIC_MODE,!t)throw new Error("Image url is not set");return d.name=t,d.url=t,d._size=n,d._noMipmap=i,d.gammaSpace=o,d._onLoad=c,d._onError=u,d.hasAlpha=!1,d.isCube=!0,d._texture=d._getFromCache(t,d._noMipmap),d._texture?c&&(d._texture.isReady?a.Tools.SetImmediate((function(){return c()})):d._texture.onLoadedObservable.add(c)):r.useDelayedTextureLoading?d.delayLoadState=l.Constants.DELAYLOADSTATE_NOTLOADED:d.loadImage(d.loadTexture.bind(d),d._onError),d}return Object(n.__extends)(t,e),t.prototype.loadImage=function(e,t){var r=this,n=document.createElement("canvas"),i=new Image;i.addEventListener("load",(function(){r._width=i.width,r._height=i.height,n.width=r._width,n.height=r._height;var t=n.getContext("2d");t.drawImage(i,0,0);var o=t.getImageData(0,0,i.width,i.height);r._buffer=o.data.buffer,n.remove(),e()})),i.addEventListener("error",(function(e){t&&t(r.getClassName()+" could not be loaded",e)})),i.src=this.url},t.prototype.loadTexture=function(){var e=this,r=this.getScene();r&&(this._texture=r.getEngine().createRawCubeTextureFromUrl(this.url,r,this._size,l.Constants.TEXTUREFORMAT_RGB,r.getEngine().getCaps().textureFloat?l.Constants.TEXTURETYPE_FLOAT:l.Constants.TEXTURETYPE_UNSIGNED_INTEGER,this._noMipmap,(function(){for(var r=e.getFloat32ArrayFromArrayBuffer(e._buffer),n=i.PanoramaToCubeMapTools.ConvertPanoramaToCubemap(r,e._width,e._height,e._size),o=[],s=0;s<6;s++){var a=n[t._FacesMapping[s]];o.push(a)}return o}),null,this._onLoad,this._onError))},t.prototype.getFloat32ArrayFromArrayBuffer=function(e){for(var t=new DataView(e),r=new Float32Array(3*e.byteLength/4),n=0,i=0;i<e.byteLength;i++)(i+1)%4!=0&&(r[n++]=t.getUint8(i)/255);return r},t.prototype.getClassName=function(){return"EquiRectangularCubeTexture"},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var r=new t(this.url,e,this._size,this._noMipmap,this.gammaSpace);return r.level=this.level,r.wrapU=this.wrapU,r.wrapV=this.wrapV,r.coordinatesIndex=this.coordinatesIndex,r.coordinatesMode=this.coordinatesMode,r},t._FacesMapping=["right","left","up","down","front","back"],t}(o.BaseTexture)},"./Materials/Textures/hdrCubeTexture.ts":
- /*!**********************************************!*\
- !*** ./Materials/Textures/hdrCubeTexture.ts ***!
- \**********************************************/
- /*! exports provided: HDRCubeTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"HDRCubeTexture",(function(){return p}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),s=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../../Misc/HighDynamicRange/hdr */"./Misc/HighDynamicRange/hdr.ts"),c=r(/*! ../../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),u=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),d=r(/*! ../../Misc/tools */"./Misc/tools.ts"),h=r(/*! ../../Maths/math.constants */"./Maths/math.constants.ts"),f=r(/*! ../../Materials/Textures/Filtering/hdrFiltering */"./Materials/Textures/Filtering/hdrFiltering.ts"),p=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),r(/*! ../../Materials/Textures/baseTexture.polynomial */"./Materials/Textures/baseTexture.polynomial.ts"),function(e){function t(t,r,n,o,l,c,u,h,f){var p;void 0===o&&(o=!1),void 0===l&&(l=!0),void 0===c&&(c=!1),void 0===u&&(u=!1),void 0===h&&(h=null),void 0===f&&(f=null);var m=e.call(this,r)||this;return m._generateHarmonics=!0,m._onLoad=null,m._onError=null,m.coordinatesMode=s.Texture.CUBIC_MODE,m._isBlocking=!0,m._rotationY=0,m.boundingBoxPosition=i.Vector3.Zero(),t?(m.name=t,m.url=t,m.hasAlpha=!1,m.isCube=!0,m._textureMatrix=i.Matrix.Identity(),m._prefilterOnLoad=u,m._onLoad=h,m._onError=f,m.gammaSpace=c,m._noMipmap=o,m._size=n,m._generateHarmonics=l,m._texture=m._getFromCache(t,m._noMipmap),m._texture?h&&(m._texture.isReady?d.Tools.SetImmediate((function(){return h()})):m._texture.onLoadedObservable.add(h)):(null===(p=m.getScene())||void 0===p?void 0:p.useDelayedTextureLoading)?m.delayLoadState=a.Constants.DELAYLOADSTATE_NOTLOADED:m.loadTexture(),m):m}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return this._isBlocking},set:function(e){this._isBlocking=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationY",{get:function(){return this._rotationY},set:function(e){this._rotationY=e,this.setReflectionTextureMatrix(i.Matrix.RotationY(this._rotationY))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"boundingBoxSize",{get:function(){return this._boundingBoxSize},set:function(e){if(!this._boundingBoxSize||!this._boundingBoxSize.equals(e)){this._boundingBoxSize=e;var t=this.getScene();t&&t.markAllMaterialsAsDirty(a.Constants.MATERIAL_TextureDirtyFlag)}},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"HDRCubeTexture"},t.prototype.loadTexture=function(){var e=this,r=this._getEngine();if(this._getEngine().webGLVersion>=2&&this._prefilterOnLoad){var n=this._onLoad,i=new f.HDRFiltering(r);this._onLoad=function(){i.prefilter(e,n)}}this._texture=r.createRawCubeTextureFromUrl(this.url,this.getScene(),this._size,a.Constants.TEXTUREFORMAT_RGB,r.getCaps().textureFloat?a.Constants.TEXTURETYPE_FLOAT:a.Constants.TEXTURETYPE_UNSIGNED_INT,this._noMipmap,(function(n){e.lodGenerationOffset=0,e.lodGenerationScale=.8;var i=l.HDRTools.GetCubeMapTextureData(n,e._size);if(e._generateHarmonics){var o=c.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial(i);e.sphericalPolynomial=o}for(var s=[],a=null,u=0;u<6;u++){if(!r.getCaps().textureFloat){var d=new ArrayBuffer(e._size*e._size*3);a=new Uint8Array(d)}var f=i[t._facesMapping[u]];if(e.gammaSpace||a)for(var p=0;p<e._size*e._size;p++)if(e.gammaSpace&&(f[3*p+0]=Math.pow(f[3*p+0],h.ToGammaSpace),f[3*p+1]=Math.pow(f[3*p+1],h.ToGammaSpace),f[3*p+2]=Math.pow(f[3*p+2],h.ToGammaSpace)),a){var m=Math.max(255*f[3*p+0],0),g=Math.max(255*f[3*p+1],0),_=Math.max(255*f[3*p+2],0),v=Math.max(Math.max(m,g),_);if(v>255){var y=255/v;m*=y,g*=y,_*=y}a[3*p+0]=m,a[3*p+1]=g,a[3*p+2]=_}a?s.push(a):s.push(f)}return s}),null,this._onLoad,this._onError)},t.prototype.clone=function(){var e=new t(this.url,this.getScene()||this._getEngine(),this._size,this._noMipmap,this._generateHarmonics,this.gammaSpace);return e.level=this.level,e.wrapU=this.wrapU,e.wrapV=this.wrapV,e.coordinatesIndex=this.coordinatesIndex,e.coordinatesMode=this.coordinatesMode,e},t.prototype.delayLoad=function(){this.delayLoadState===a.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=a.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap),this._texture||this.loadTexture())},t.prototype.getReflectionTextureMatrix=function(){return this._textureMatrix},t.prototype.setReflectionTextureMatrix=function(e){var t,r=this;this._textureMatrix=e,e.updateFlag!==this._textureMatrix.updateFlag&&e.isIdentity()!==this._textureMatrix.isIdentity()&&(null===(t=this.getScene())||void 0===t||t.markAllMaterialsAsDirty(a.Constants.MATERIAL_TextureDirtyFlag,(function(e){return-1!==e.getActiveTextures().indexOf(r)})))},t.Parse=function(e,r,n){var o=null;return e.name&&!e.isRenderTarget&&((o=new t(n+e.name,r,e.size,e.noMipmap,e.generateHarmonics,e.useInGammaSpace)).name=e.name,o.hasAlpha=e.hasAlpha,o.level=e.level,o.coordinatesMode=e.coordinatesMode,o.isBlocking=e.isBlocking),o&&(e.boundingBoxPosition&&(o.boundingBoxPosition=i.Vector3.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(o.boundingBoxSize=i.Vector3.FromArray(e.boundingBoxSize)),e.rotationY&&(o.rotationY=e.rotationY)),o},t.prototype.serialize=function(){if(!this.name)return null;var e={};return e.name=this.name,e.hasAlpha=this.hasAlpha,e.isCube=!0,e.level=this.level,e.size=this._size,e.coordinatesMode=this.coordinatesMode,e.useInGammaSpace=this.gammaSpace,e.generateHarmonics=this._generateHarmonics,e.customType="BABYLON.HDRCubeTexture",e.noMipmap=this._noMipmap,e.isBlocking=this._isBlocking,e.rotationY=this._rotationY,e},t._facesMapping=["right","left","up","down","front","back"],t}(o.BaseTexture));u._TypeStore.RegisteredTypes["BABYLON.HDRCubeTexture"]=p},"./Materials/Textures/htmlElementTexture.ts":
- /*!**************************************************!*\
- !*** ./Materials/Textures/htmlElementTexture.ts ***!
- \**************************************************/
- /*! exports provided: HtmlElementTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"HtmlElementTexture",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=(r(/*! ../../Engines/Extensions/engine.dynamicTexture */"./Engines/Extensions/engine.dynamicTexture.ts"),r(/*! ../../Engines/Extensions/engine.videoTexture */"./Engines/Extensions/engine.videoTexture.ts"),function(e){function t(r,i,o){var a=e.call(this,o.scene||o.engine)||this;return i&&(o.engine||o.scene)?(o=Object(n.__assign)(Object(n.__assign)({},t.DefaultOptions),o),a._generateMipMaps=o.generateMipMaps,a._samplingMode=o.samplingMode,a._textureMatrix=s.Matrix.Identity(),a.name=r,a.element=i,a._isVideo=i instanceof HTMLVideoElement,a.anisotropicFilteringLevel=1,a._createInternalTexture(),a):a}return Object(n.__extends)(t,e),t.prototype._createInternalTexture=function(){var e=0,t=0;this._isVideo?(e=this.element.videoWidth,t=this.element.videoHeight):(e=this.element.width,t=this.element.height);var r=this._getEngine();r&&(this._texture=r.createDynamicTexture(e,t,this._generateMipMaps,this._samplingMode)),this.update()},t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.update=function(e){void 0===e&&(e=null);var t=this._getEngine();if(null!=this._texture&&null!=t)if(this._isVideo){var r=this.element;if(r.readyState<r.HAVE_CURRENT_DATA)return;t.updateVideoTexture(this._texture,r,null===e||e)}else{var n=this.element;t.updateDynamicTexture(this._texture,n,null===e||e,!1)}},t.DefaultOptions={generateMipMaps:!1,samplingMode:o.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,engine:null,scene:null},t}(i.BaseTexture))},"./Materials/Textures/index.ts":
- /*!*************************************!*\
- !*** ./Materials/Textures/index.ts ***!
- \*************************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./baseTexture */"./Materials/Textures/baseTexture.ts");r.d(t,"BaseTexture",(function(){return n.BaseTexture})),r(/*! ./baseTexture.polynomial */"./Materials/Textures/baseTexture.polynomial.ts");var i=r(/*! ./colorGradingTexture */"./Materials/Textures/colorGradingTexture.ts");r.d(t,"ColorGradingTexture",(function(){return i.ColorGradingTexture}));var o=r(/*! ./cubeTexture */"./Materials/Textures/cubeTexture.ts");r.d(t,"CubeTexture",(function(){return o.CubeTexture}));var s=r(/*! ./dynamicTexture */"./Materials/Textures/dynamicTexture.ts");r.d(t,"DynamicTexture",(function(){return s.DynamicTexture}));var a=r(/*! ./equiRectangularCubeTexture */"./Materials/Textures/equiRectangularCubeTexture.ts");r.d(t,"EquiRectangularCubeTexture",(function(){return a.EquiRectangularCubeTexture}));var l=r(/*! ./Filtering/hdrFiltering */"./Materials/Textures/Filtering/hdrFiltering.ts");r.d(t,"HDRFiltering",(function(){return l.HDRFiltering}));var c=r(/*! ./hdrCubeTexture */"./Materials/Textures/hdrCubeTexture.ts");r.d(t,"HDRCubeTexture",(function(){return c.HDRCubeTexture}));var u=r(/*! ./htmlElementTexture */"./Materials/Textures/htmlElementTexture.ts");r.d(t,"HtmlElementTexture",(function(){return u.HtmlElementTexture}));var d=r(/*! ./internalTexture */"./Materials/Textures/internalTexture.ts");r.d(t,"InternalTextureSource",(function(){return d.InternalTextureSource})),r.d(t,"InternalTexture",(function(){return d.InternalTexture}));var h=r(/*! ./internalTextureLoader */"./Materials/Textures/internalTextureLoader.ts");for(var f in h)["BaseTexture","ColorGradingTexture","CubeTexture","DynamicTexture","EquiRectangularCubeTexture","HDRFiltering","HDRCubeTexture","HtmlElementTexture","InternalTextureSource","InternalTexture","default"].indexOf(f)<0&&function(e){r.d(t,e,(function(){return h[e]}))}(f);var p=r(/*! ./Loaders/index */"./Materials/Textures/Loaders/index.ts");r.d(t,"_DDSTextureLoader",(function(){return p._DDSTextureLoader})),r.d(t,"_ENVTextureLoader",(function(){return p._ENVTextureLoader})),r.d(t,"_KTXTextureLoader",(function(){return p._KTXTextureLoader})),r.d(t,"_TGATextureLoader",(function(){return p._TGATextureLoader})),r.d(t,"_BasisTextureLoader",(function(){return p._BasisTextureLoader}));var m=r(/*! ./mirrorTexture */"./Materials/Textures/mirrorTexture.ts");r.d(t,"MirrorTexture",(function(){return m.MirrorTexture}));var g=r(/*! ./multiRenderTarget */"./Materials/Textures/multiRenderTarget.ts");r.d(t,"MultiRenderTarget",(function(){return g.MultiRenderTarget}));var _=r(/*! ./Packer/index */"./Materials/Textures/Packer/index.ts");r.d(t,"TexturePacker",(function(){return _.TexturePacker})),r.d(t,"TexturePackerFrame",(function(){return _.TexturePackerFrame}));var v=r(/*! ./Procedurals/index */"./Materials/Textures/Procedurals/index.ts");r.d(t,"CustomProceduralTexture",(function(){return v.CustomProceduralTexture})),r.d(t,"NoiseProceduralTexture",(function(){return v.NoiseProceduralTexture})),r.d(t,"ProceduralTexture",(function(){return v.ProceduralTexture})),r.d(t,"ProceduralTextureSceneComponent",(function(){return v.ProceduralTextureSceneComponent}));var y=r(/*! ./rawCubeTexture */"./Materials/Textures/rawCubeTexture.ts");r.d(t,"RawCubeTexture",(function(){return y.RawCubeTexture}));var b=r(/*! ./rawTexture */"./Materials/Textures/rawTexture.ts");r.d(t,"RawTexture",(function(){return b.RawTexture}));var A=r(/*! ./rawTexture2DArray */"./Materials/Textures/rawTexture2DArray.ts");r.d(t,"RawTexture2DArray",(function(){return A.RawTexture2DArray}));var T=r(/*! ./rawTexture3D */"./Materials/Textures/rawTexture3D.ts");r.d(t,"RawTexture3D",(function(){return T.RawTexture3D}));var M=r(/*! ./refractionTexture */"./Materials/Textures/refractionTexture.ts");r.d(t,"RefractionTexture",(function(){return M.RefractionTexture}));var P=r(/*! ./renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts");r.d(t,"RenderTargetTexture",(function(){return P.RenderTargetTexture}));var S=r(/*! ./texture */"./Materials/Textures/texture.ts");r.d(t,"Texture",(function(){return S.Texture}));var E=r(/*! ./videoTexture */"./Materials/Textures/videoTexture.ts");r.d(t,"VideoTexture",(function(){return E.VideoTexture}))},"./Materials/Textures/internalTexture.ts":
- /*!***********************************************!*\
- !*** ./Materials/Textures/internalTexture.ts ***!
- \***********************************************/
- /*! exports provided: InternalTextureSource, InternalTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"InternalTextureSource",(function(){return n})),r.d(t,"InternalTexture",(function(){return l}));var n,i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../../Misc/devTools */"./Misc/devTools.ts");!function(e){e[e.Unknown=0]="Unknown",e[e.Url=1]="Url",e[e.Temp=2]="Temp",e[e.Raw=3]="Raw",e[e.Dynamic=4]="Dynamic",e[e.RenderTarget=5]="RenderTarget",e[e.MultiRenderTarget=6]="MultiRenderTarget",e[e.Cube=7]="Cube",e[e.CubeRaw=8]="CubeRaw",e[e.CubePrefiltered=9]="CubePrefiltered",e[e.Raw3D=10]="Raw3D",e[e.Raw2DArray=11]="Raw2DArray",e[e.Depth=12]="Depth",e[e.CubeRawRGBD=13]="CubeRawRGBD"}(n||(n={}));var l=function(){function e(e,t,r){void 0===r&&(r=!1),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.samplingMode=-1,this.generateMipMaps=!1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new i.Observable,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=n.Unknown,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._MSAARenderBuffer=null,this._attachments=null,this._textureArray=null,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._isDisabled=!1,this._compression=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._comparisonFunction=0,this._sphericalPolynomial=null,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._webGLTexture=null,this._references=1,this._engine=e,this._source=t,r||(this._webGLTexture=e._createTexture())}return e.prototype.getEngine=function(){return this._engine},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!1,configurable:!0}),e.prototype.incrementReferences=function(){this._references++},e.prototype.updateSize=function(e,t,r){void 0===r&&(r=1),this.width=e,this.height=t,this.depth=r,this.baseWidth=e,this.baseHeight=t,this.baseDepth=r,this._size=e*t*r},e.prototype._rebuild=function(){var t,r=this;switch(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedAnisotropicFilteringLevel=null,this.source){case n.Temp:return;case n.Url:return void(t=this._engine.createTexture(this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,(function(){t._swapAndDie(r),r.isReady=!0}),null,this._buffer,void 0,this.format));case n.Raw:return(t=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.Raw3D:return(t=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.Raw2DArray:return(t=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.Dynamic:return(t=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode))._swapAndDie(this),void this._engine.updateDynamicTexture(this,this._engine.getRenderingCanvas(),this.invertY,void 0,void 0,!0);case n.RenderTarget:var i=new o.RenderTargetCreationOptions;if(i.generateDepthBuffer=this._generateDepthBuffer,i.generateMipMaps=this.generateMipMaps,i.generateStencilBuffer=this._generateStencilBuffer,i.samplingMode=this.samplingMode,i.type=this.type,this.isCube)t=this._engine.createRenderTargetCubeTexture(this.width,i);else{var a={width:this.width,height:this.height,layers:this.is2DArray?this.depth:void 0};t=this._engine.createRenderTargetTexture(a,i)}return t._swapAndDie(this),void(this.isReady=!0);case n.Depth:var l={bilinearFiltering:this.samplingMode!==s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,comparisonFunction:this._comparisonFunction,generateStencil:this._generateStencilBuffer,isCube:this.isCube},c={width:this.width,height:this.height,layers:this.is2DArray?this.depth:void 0};return(t=this._engine.createDepthStencilTexture(c,l))._swapAndDie(this),void(this.isReady=!0);case n.Cube:return void(t=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,(function(){t._swapAndDie(r),r.isReady=!0}),null,this.format,this._extension));case n.CubeRaw:return(t=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this),void(this.isReady=!0);case n.CubeRawRGBD:return t=this._engine.createRawCubeTexture(null,this.width,this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),void e._UpdateRGBDAsync(t,this._bufferViewArrayArray,this._sphericalPolynomial,this._lodGenerationScale,this._lodGenerationOffset).then((function(){t._swapAndDie(r),r.isReady=!0}));case n.CubePrefiltered:return void((t=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,(function(e){e&&e._swapAndDie(r),r.isReady=!0}),null,this.format,this._extension))._sphericalPolynomial=this._sphericalPolynomial)}},e.prototype._swapAndDie=function(e){e._webGLTexture=this._webGLTexture,e._isRGBD=this._isRGBD,this._framebuffer&&(e._framebuffer=this._framebuffer),this._depthStencilBuffer&&(e._depthStencilBuffer=this._depthStencilBuffer),e._depthStencilTexture=this._depthStencilTexture,this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);var t,r=this._engine.getLoadedTexturesCache();-1!==(t=r.indexOf(this))&&r.splice(t,1),-1===(t=r.indexOf(e))&&r.push(e)},e.prototype.dispose=function(){this._webGLTexture&&(this._references--,0===this._references&&(this._engine._releaseTexture(this),this._webGLTexture=null))},e._UpdateRGBDAsync=function(e,t,r,n,i){throw a._DevTools.WarnImport("environmentTextureTools")},e}()},"./Materials/Textures/internalTextureLoader.ts":
- /*!*****************************************************!*\
- !*** ./Materials/Textures/internalTextureLoader.ts ***!
- \*****************************************************/
- /*! no static exports found */function(e,t){},"./Materials/Textures/mirrorTexture.ts":
- /*!*********************************************!*\
- !*** ./Materials/Textures/mirrorTexture.ts ***!
- \*********************************************/
- /*! exports provided: MirrorTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"MirrorTexture",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),a=r(/*! ../../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../../Maths/math.plane */"./Maths/math.plane.ts"),u=function(e){function t(t,r,n,s,a,u,d){void 0===a&&(a=l.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===u&&(u=o.Texture.BILINEAR_SAMPLINGMODE),void 0===d&&(d=!0);var h=e.call(this,t,r,n,s,!0,a,!1,u,d)||this;return h.scene=n,h.mirrorPlane=new c.Plane(0,1,0,1),h._transformMatrix=i.Matrix.Zero(),h._mirrorMatrix=i.Matrix.Zero(),h._adaptiveBlurKernel=0,h._blurKernelX=0,h._blurKernelY=0,h._blurRatio=1,h.ignoreCameraViewport=!0,h._updateGammaSpace(),h._imageProcessingConfigChangeObserver=n.imageProcessingConfiguration.onUpdateParameters.add((function(){h._updateGammaSpace})),h.onBeforeRenderObservable.add((function(){i.Matrix.ReflectionToRef(h.mirrorPlane,h._mirrorMatrix),h._savedViewMatrix=n.getViewMatrix(),h._mirrorMatrix.multiplyToRef(h._savedViewMatrix,h._transformMatrix),n.setTransformMatrix(h._transformMatrix,n.getProjectionMatrix()),n.clipPlane=h.mirrorPlane,n.getEngine().cullBackFaces=!1,n._mirroredCameraPosition=i.Vector3.TransformCoordinates(n.activeCamera.globalPosition,h._mirrorMatrix)})),h.onAfterRenderObservable.add((function(){n.setTransformMatrix(h._savedViewMatrix,n.getProjectionMatrix()),n.getEngine().cullBackFaces=!0,n._mirroredCameraPosition=null,n.clipPlane=null})),h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"blurRatio",{get:function(){return this._blurRatio},set:function(e){this._blurRatio!==e&&(this._blurRatio=e,this._preparePostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"adaptiveBlurKernel",{set:function(e){this._adaptiveBlurKernel=e,this._autoComputeBlurKernel()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurKernel",{set:function(e){this.blurKernelX=e,this.blurKernelY=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelX",{get:function(){return this._blurKernelX},set:function(e){this._blurKernelX!==e&&(this._blurKernelX=e,this._preparePostProcesses())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelY",{get:function(){return this._blurKernelY},set:function(e){this._blurKernelY!==e&&(this._blurKernelY=e,this._preparePostProcesses())},enumerable:!1,configurable:!0}),t.prototype._autoComputeBlurKernel=function(){var e=this.getScene().getEngine(),t=this.getRenderWidth()/e.getRenderWidth(),r=this.getRenderHeight()/e.getRenderHeight();this.blurKernelX=this._adaptiveBlurKernel*t,this.blurKernelY=this._adaptiveBlurKernel*r},t.prototype._onRatioRescale=function(){this._sizeRatio&&(this.resize(this._initialSizeParameter),this._adaptiveBlurKernel||this._preparePostProcesses()),this._adaptiveBlurKernel&&this._autoComputeBlurKernel()},t.prototype._updateGammaSpace=function(){this.gammaSpace=!this.scene.imageProcessingConfiguration.isEnabled||!this.scene.imageProcessingConfiguration.applyByPostProcess},t.prototype._preparePostProcesses=function(){if(this.clearPostProcesses(!0),this._blurKernelX&&this._blurKernelY){var e=this.getScene().getEngine(),t=e.getCaps().textureFloatRender?l.Constants.TEXTURETYPE_FLOAT:l.Constants.TEXTURETYPE_HALF_FLOAT;this._blurX=new a.BlurPostProcess("horizontal blur",new i.Vector2(1,0),this._blurKernelX,this._blurRatio,null,o.Texture.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurX.autoClear=!1,1===this._blurRatio&&this.samples<2&&this._texture?this._blurX.inputTexture=this._texture:this._blurX.alwaysForcePOT=!0,this._blurY=new a.BlurPostProcess("vertical blur",new i.Vector2(0,1),this._blurKernelY,this._blurRatio,null,o.Texture.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurY.autoClear=!1,this._blurY.alwaysForcePOT=1!==this._blurRatio,this.addPostProcess(this._blurX),this.addPostProcess(this._blurY)}else this._blurY&&(this.removePostProcess(this._blurY),this._blurY.dispose(),this._blurY=null),this._blurX&&(this.removePostProcess(this._blurX),this._blurX.dispose(),this._blurX=null)},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var r=this.getSize(),n=new t(this.name,r.width,e,this._renderTargetOptions.generateMipMaps,this._renderTargetOptions.type,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.mirrorPlane=this.mirrorPlane.clone(),this.renderList&&(n.renderList=this.renderList.slice(0)),n},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.mirrorPlane.asArray(),t},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver)},t}(s.RenderTargetTexture);o.Texture._CreateMirror=function(e,t,r,n){return new u(e,t,r,n)}},"./Materials/Textures/multiRenderTarget.ts":
- /*!*************************************************!*\
- !*** ./Materials/Textures/multiRenderTarget.ts ***!
- \*************************************************/
- /*! exports provided: MultiRenderTarget */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiRenderTarget",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../../Engines/Extensions/engine.multiRender */"./Engines/Extensions/engine.multiRender.ts"),function(e){function t(t,r,n,o,a){var l=this,c=!(!a||!a.generateMipMaps)&&a.generateMipMaps,u=!(!a||!a.generateDepthTexture)&&a.generateDepthTexture,d=!a||void 0===a.doNotChangeAspectRatio||a.doNotChangeAspectRatio;if((l=e.call(this,t,r,o,c,d)||this).isSupported){for(var h=[],f=[],p=0;p<n;p++)a&&a.types&&void 0!==a.types[p]?h.push(a.types[p]):h.push(a&&a.defaultType?a.defaultType:s.Constants.TEXTURETYPE_UNSIGNED_INT),a&&a.samplingModes&&void 0!==a.samplingModes[p]?f.push(a.samplingModes[p]):f.push(i.Texture.BILINEAR_SAMPLINGMODE);var m=!a||void 0===a.generateDepthBuffer||a.generateDepthBuffer,g=!(!a||void 0===a.generateStencilBuffer)&&a.generateStencilBuffer;return l._size=r,l._multiRenderTargetOptions={samplingModes:f,generateMipMaps:c,generateDepthBuffer:m,generateStencilBuffer:g,generateDepthTexture:u,types:h,textureCount:n},l._count=n,l._createInternalTextures(),l._createTextures(),l}l.dispose()}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"isSupported",{get:function(){return this._getEngine().webGLVersion>1||this._getEngine().getCaps().drawBuffersExtension},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textures",{get:function(){return this._textures},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTexture",{get:function(){return this._textures[this._textures.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapU",{set:function(e){if(this._textures)for(var t=0;t<this._textures.length;t++)this._textures[t].wrapU=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapV",{set:function(e){if(this._textures)for(var t=0;t<this._textures.length;t++)this._textures[t].wrapV=e},enumerable:!1,configurable:!0}),t.prototype._rebuild=function(){this.releaseInternalTextures(),this._createInternalTextures();for(var e=0;e<this._internalTextures.length;e++)this._textures[e]._texture=this._internalTextures[e];this._texture=this._internalTextures[0],1!==this.samples&&this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures,this.samples)},t.prototype._createInternalTextures=function(){this._internalTextures=this._getEngine().createMultipleRenderTarget(this._size,this._multiRenderTargetOptions)},t.prototype._createTextures=function(){this._textures=[];for(var e=0;e<this._internalTextures.length;e++){var t=new i.Texture(null,this.getScene());t._texture=this._internalTextures[e],this._textures.push(t)}this._texture=this._internalTextures[0]},Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures,e))},enumerable:!1,configurable:!0}),t.prototype.resize=function(e){this._size=e,this._rebuild()},t.prototype.unbindFrameBuffer=function(e,t){var r=this;e.unBindMultiColorAttachmentFramebuffer(this._internalTextures,this.isCube,(function(){r.onAfterRenderObservable.notifyObservers(t)}))},t.prototype.dispose=function(){this.releaseInternalTextures(),e.prototype.dispose.call(this)},t.prototype.releaseInternalTextures=function(){if(this._internalTextures)for(var e=this._internalTextures.length-1;e>=0;e--)void 0!==this._internalTextures[e]&&(this._internalTextures[e].dispose(),this._internalTextures.splice(e,1))},t}(o.RenderTargetTexture))},"./Materials/Textures/rawCubeTexture.ts":
- /*!**********************************************!*\
- !*** ./Materials/Textures/rawCubeTexture.ts ***!
- \**********************************************/
- /*! exports provided: RawCubeTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RawCubeTexture",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/environmentTextureTools */"./Misc/environmentTextureTools.ts"),s=r(/*! ./internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ./cubeTexture */"./Materials/Textures/cubeTexture.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),c=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,i,o,s,a,c,u){void 0===i&&(i=l.Constants.TEXTUREFORMAT_RGBA),void 0===o&&(o=l.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===c&&(c=l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===u&&(u=null);var d=e.call(this,"",t)||this;return d._texture=t.getEngine().createRawCubeTexture(r,n,i,o,s,a,c,u),d}return Object(n.__extends)(t,e),t.prototype.update=function(e,t,r,n,i){void 0===i&&(i=null),this._texture.getEngine().updateRawCubeTexture(this._texture,e,t,r,n,i)},t.prototype.updateRGBDAsync=function(e,r,n,i){return void 0===r&&(r=null),void 0===n&&(n=.8),void 0===i&&(i=0),t._UpdateRGBDAsync(this._texture,e,r,n,i)},t.prototype.clone=function(){var e=this;return i.SerializationHelper.Clone((function(){var r=e.getScene(),n=e._texture,i=new t(r,n._bufferViewArray,n.width,n.format,n.type,n.generateMipMaps,n.invertY,n.samplingMode,n._compression);return n.source===s.InternalTextureSource.CubeRawRGBD&&i.updateRGBDAsync(n._bufferViewArrayArray,n._sphericalPolynomial,n._lodGenerationScale,n._lodGenerationOffset),i}),this)},t._UpdateRGBDAsync=function(e,t,r,n,i){return e._source=s.InternalTextureSource.CubeRawRGBD,e._bufferViewArrayArray=t,e._lodGenerationScale=n,e._lodGenerationOffset=i,e._sphericalPolynomial=r,o.EnvironmentTextureTools.UploadLevelsAsync(e,t).then((function(){e.isReady=!0}))},t}(a.CubeTexture))},"./Materials/Textures/rawTexture.ts":
- /*!******************************************!*\
- !*** ./Materials/Textures/rawTexture.ts ***!
- \******************************************/
- /*! exports provided: RawTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RawTexture",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,s,a,l,c,u,d){void 0===l&&(l=!0),void 0===c&&(c=!1),void 0===u&&(u=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===d&&(d=o.Constants.TEXTURETYPE_UNSIGNED_INT);var h=e.call(this,null,a,!l,c)||this;return h.format=s,h._texture=a.getEngine().createRawTexture(t,r,n,s,l,c,u,null,d),h.wrapU=i.Texture.CLAMP_ADDRESSMODE,h.wrapV=i.Texture.CLAMP_ADDRESSMODE,h}return Object(n.__extends)(t,e),t.prototype.update=function(e){this._getEngine().updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t.CreateLuminanceTexture=function(e,r,n,i,s,a,l){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===l&&(l=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,r,n,o.Constants.TEXTUREFORMAT_LUMINANCE,i,s,a,l)},t.CreateLuminanceAlphaTexture=function(e,r,n,i,s,a,l){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===l&&(l=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,r,n,o.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA,i,s,a,l)},t.CreateAlphaTexture=function(e,r,n,i,s,a,l){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===l&&(l=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,r,n,o.Constants.TEXTUREFORMAT_ALPHA,i,s,a,l)},t.CreateRGBTexture=function(e,r,n,i,s,a,l,c){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===l&&(l=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===c&&(c=o.Constants.TEXTURETYPE_UNSIGNED_INT),new t(e,r,n,o.Constants.TEXTUREFORMAT_RGB,i,s,a,l,c)},t.CreateRGBATexture=function(e,r,n,i,s,a,l,c){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===l&&(l=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===c&&(c=o.Constants.TEXTURETYPE_UNSIGNED_INT),new t(e,r,n,o.Constants.TEXTUREFORMAT_RGBA,i,s,a,l,c)},t.CreateRTexture=function(e,r,n,s,a,l,c,u){return void 0===a&&(a=!0),void 0===l&&(l=!1),void 0===c&&(c=i.Texture.TRILINEAR_SAMPLINGMODE),void 0===u&&(u=o.Constants.TEXTURETYPE_FLOAT),new t(e,r,n,o.Constants.TEXTUREFORMAT_R,s,a,l,c,u)},t}(i.Texture))},"./Materials/Textures/rawTexture2DArray.ts":
- /*!*************************************************!*\
- !*** ./Materials/Textures/rawTexture2DArray.ts ***!
- \*************************************************/
- /*! exports provided: RawTexture2DArray */function(e,t,r){"use strict";r.r(t),r.d(t,"RawTexture2DArray",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,s,a,l,c,u,d,h){void 0===c&&(c=!0),void 0===u&&(u=!1),void 0===d&&(d=i.Texture.TRILINEAR_SAMPLINGMODE),void 0===h&&(h=o.Constants.TEXTURETYPE_UNSIGNED_INT);var f=e.call(this,null,l,!c,u)||this;return f.format=a,f._texture=l.getEngine().createRawTexture2DArray(t,r,n,s,a,c,u,d,null,h),f.is2DArray=!0,f}return Object(n.__extends)(t,e),t.prototype.update=function(e){this._texture&&this._getEngine().updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t}(i.Texture))},"./Materials/Textures/rawTexture3D.ts":
- /*!********************************************!*\
- !*** ./Materials/Textures/rawTexture3D.ts ***!
- \********************************************/
- /*! exports provided: RawTexture3D */function(e,t,r){"use strict";r.r(t),r.d(t,"RawTexture3D",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,s,a,l,c,u,d,h){void 0===c&&(c=!0),void 0===u&&(u=!1),void 0===d&&(d=i.Texture.TRILINEAR_SAMPLINGMODE),void 0===h&&(h=o.Constants.TEXTURETYPE_UNSIGNED_INT);var f=e.call(this,null,l,!c,u)||this;return f.format=a,f._texture=l.getEngine().createRawTexture3D(t,r,n,s,a,c,u,d,null,h),f.is3D=!0,f}return Object(n.__extends)(t,e),t.prototype.update=function(e){this._texture&&this._getEngine().updateRawTexture3D(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t}(i.Texture))},"./Materials/Textures/refractionTexture.ts":
- /*!*************************************************!*\
- !*** ./Materials/Textures/refractionTexture.ts ***!
- \*************************************************/
- /*! exports provided: RefractionTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RefractionTexture",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.plane */"./Maths/math.plane.ts"),o=function(e){function t(t,r,n,o){var s=e.call(this,t,r,n,o,!0)||this;return s.refractionPlane=new i.Plane(0,1,0,1),s.depth=2,s.onBeforeRenderObservable.add((function(){n.clipPlane=s.refractionPlane})),s.onAfterRenderObservable.add((function(){n.clipPlane=null})),s}return Object(n.__extends)(t,e),t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var r=this.getSize(),n=new t(this.name,r.width,e,this._generateMipMaps);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.refractionPlane=this.refractionPlane.clone(),this.renderList&&(n.renderList=this.renderList.slice(0)),n.depth=this.depth,n},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.refractionPlane.asArray(),t.depth=this.depth,t},t}(r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts").RenderTargetTexture)},"./Materials/Textures/renderTargetCreationOptions.ts":
- /*!***********************************************************!*\
- !*** ./Materials/Textures/renderTargetCreationOptions.ts ***!
- \***********************************************************/
- /*! exports provided: RenderTargetCreationOptions */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderTargetCreationOptions",(function(){return n}));var n=function(){}},"./Materials/Textures/renderTargetTexture.ts":
- /*!***************************************************!*\
- !*** ./Materials/Textures/renderTargetTexture.ts ***!
- \***************************************************/
- /*! exports provided: RenderTargetTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderTargetTexture",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../../PostProcesses/postProcessManager */"./PostProcesses/postProcessManager.ts"),c=r(/*! ../../Rendering/renderingManager */"./Rendering/renderingManager.ts"),u=r(/*! ../../Engines/constants */"./Engines/constants.ts"),d=(r(/*! ../../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),r(/*! ../../Engines/Extensions/engine.renderTargetCube */"./Engines/Extensions/engine.renderTargetCube.ts"),r(/*! ../../Engines/engine */"./Engines/engine.ts")),h=function(e){function t(t,r,n,o,l,d,h,f,p,m,g,_,v){void 0===l&&(l=!0),void 0===d&&(d=u.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1),void 0===f&&(f=a.Texture.TRILINEAR_SAMPLINGMODE),void 0===p&&(p=!0),void 0===m&&(m=!1),void 0===g&&(g=!1),void 0===_&&(_=u.Constants.TEXTUREFORMAT_RGBA),void 0===v&&(v=!1);var y=e.call(this,null,n,!o)||this;return y.isCube=h,y.renderParticles=!0,y.renderSprites=!1,y.coordinatesMode=a.Texture.PROJECTION_MODE,y.ignoreCameraViewport=!1,y.onBeforeBindObservable=new i.Observable,y.onAfterUnbindObservable=new i.Observable,y.onBeforeRenderObservable=new i.Observable,y.onAfterRenderObservable=new i.Observable,y.onClearObservable=new i.Observable,y.onResizeObservable=new i.Observable,y._currentRefreshId=-1,y._refreshRate=1,y._samples=1,y.boundingBoxPosition=s.Vector3.Zero(),(n=y.getScene())?(y.renderList=new Array,y.name=t,y.isRenderTarget=!0,y._initialSizeParameter=r,y._processSizeParameter(r),y._resizeObserver=y.getScene().getEngine().onResizeObservable.add((function(){})),y._generateMipMaps=!!o,y._doNotChangeAspectRatio=l,y._renderingManager=new c.RenderingManager(n),y._renderingManager._useSceneAutoClearSetup=!0,g||(y._renderTargetOptions={generateMipMaps:o,type:d,format:_,samplingMode:f,generateDepthBuffer:p,generateStencilBuffer:m},f===a.Texture.NEAREST_SAMPLINGMODE&&(y.wrapU=a.Texture.CLAMP_ADDRESSMODE,y.wrapV=a.Texture.CLAMP_ADDRESSMODE),v||(h?(y._texture=n.getEngine().createRenderTargetCubeTexture(y.getRenderSize(),y._renderTargetOptions),y.coordinatesMode=a.Texture.INVCUBIC_MODE,y._textureMatrix=s.Matrix.Identity()):y._texture=n.getEngine().createRenderTargetTexture(y._size,y._renderTargetOptions))),y):y}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"renderList",{get:function(){return this._renderList},set:function(e){this._renderList=e,this._renderList&&this._hookArray(this._renderList)},enumerable:!1,configurable:!0}),t.prototype._hookArray=function(e){var t=this,r=e.push;e.push=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=0===e.length,s=r.apply(e,n);return o&&t.getScene()&&t.getScene().meshes.forEach((function(e){e._markSubMeshesAsLightDirty()})),s};var n=e.splice;e.splice=function(r,i){var o=n.apply(e,[r,i]);return 0===e.length&&t.getScene().meshes.forEach((function(e){e._markSubMeshesAsLightDirty()})),o}},Object.defineProperty(t.prototype,"onAfterUnbind",{set:function(e){this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onClear",{set:function(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderTargetOptions",{get:function(){return this._renderTargetOptions},enumerable:!1,configurable:!0}),t.prototype._onRatioRescale=function(){this._sizeRatio&&this.resize(this._initialSizeParameter)},Object.defineProperty(t.prototype,"boundingBoxSize",{get:function(){return this._boundingBoxSize},set:function(e){if(!this._boundingBoxSize||!this._boundingBoxSize.equals(e)){this._boundingBoxSize=e;var t=this.getScene();t&&t.markAllMaterialsAsDirty(u.Constants.MATERIAL_TextureDirtyFlag)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthStencilTexture",{get:function(){var e;return(null===(e=this.getInternalTexture())||void 0===e?void 0:e._depthStencilTexture)||null},enumerable:!1,configurable:!0}),t.prototype.createDepthStencilTexture=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=!0),void 0===r&&(r=!1);var n=this.getInternalTexture();if(this.getScene()&&n){var i=this.getScene().getEngine();n._depthStencilTexture=i.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:r,isCube:this.isCube})}},t.prototype._processSizeParameter=function(e){if(e.ratio){this._sizeRatio=e.ratio;var t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e},Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){if(this._samples!==e){var t=this.getScene();t&&(this._samples=t.getEngine().updateRenderTargetTextureSampleCount(this._texture,e))}},enumerable:!1,configurable:!0}),t.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},Object.defineProperty(t.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!1,configurable:!0}),t.prototype.addPostProcess=function(e){if(!this._postProcessManager){var t=this.getScene();if(!t)return;this._postProcessManager=new l.PostProcessManager(t),this._postProcesses=new Array}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1},t.prototype.clearPostProcesses=function(e){if(void 0===e&&(e=!1),this._postProcesses){if(e)for(var t=0,r=this._postProcesses;t<r.length;t++)r[t].dispose();this._postProcesses=[]}},t.prototype.removePostProcess=function(e){if(this._postProcesses){var t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}},t.prototype._shouldRender=function(){return-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)},t.prototype.getRenderSize=function(){return this.getRenderWidth()},t.prototype.getRenderWidth=function(){return this._size.width?this._size.width:this._size},t.prototype.getRenderHeight=function(){return this._size.width?this._size.height:this._size},t.prototype.getRenderLayers=function(){var e=this._size.layers;return e||0},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.scale=function(e){var t=Math.max(1,this.getRenderSize()*e);this.resize(t)},t.prototype.getReflectionTextureMatrix=function(){return this.isCube?this._textureMatrix:e.prototype.getReflectionTextureMatrix.call(this)},t.prototype.resize=function(e){var t=this.isCube;this.releaseInternalTexture();var r=this.getScene();r&&(this._processSizeParameter(e),this._texture=t?r.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):r.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))},t.prototype.render=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!1),a=this.getScene()){var r,n=a.getEngine();if(void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses),this._waitingRenderList){this.renderList=[];for(var i=0;i<this._waitingRenderList.length;i++){var o=this._waitingRenderList[i],s=a.getMeshByID(o);s&&this.renderList.push(s)}delete this._waitingRenderList}if(this.renderListPredicate){var a;if(this.renderList?this.renderList.length=0:this.renderList=[],!(a=this.getScene()))return;var l=a.meshes;for(i=0;i<l.length;i++){var c=l[i];this.renderListPredicate(c)&&this.renderList.push(c)}}if(this.onBeforeBindObservable.notifyObservers(this),this.activeCamera?(r=this.activeCamera,n.setViewport(this.activeCamera.viewport,this.getRenderWidth(),this.getRenderHeight()),this.activeCamera!==a.activeCamera&&a.setTransformMatrix(this.activeCamera.getViewMatrix(),this.activeCamera.getProjectionMatrix(!0))):(r=a.activeCamera)&&n.setViewport(r.viewport,this.getRenderWidth(),this.getRenderHeight()),this._defaultRenderListPrepared=!1,this.is2DArray)for(var u=0;u<this.getRenderLayers();u++)this.renderToTarget(0,e,t,u,r),a.incrementRenderId(),a.resetCachedMaterial();else if(this.isCube)for(var d=0;d<6;d++)this.renderToTarget(d,e,t,void 0,r),a.incrementRenderId(),a.resetCachedMaterial();else this.renderToTarget(0,e,t,void 0,r);this.onAfterUnbindObservable.notifyObservers(this),a.activeCamera&&((a.getEngine().scenes.length>1||this.activeCamera&&this.activeCamera!==a.activeCamera)&&a.setTransformMatrix(a.activeCamera.getViewMatrix(),a.activeCamera.getProjectionMatrix(!0)),n.setViewport(a.activeCamera.viewport)),a.resetCachedMaterial()}},t.prototype._bestReflectionRenderTargetDimension=function(e,t){var r=e*t,n=d.Engine.NearestPOT(r+16384/(128+r));return Math.min(d.Engine.FloorPOT(e),n)},t.prototype._prepareRenderingManager=function(e,t,r,n){var i=this.getScene();if(i){this._renderingManager.reset();for(var o=i.getRenderId(),s=0;s<t;s++){var a=e[s];if(a){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(a,this.refreshRate)){this.resetRefreshCounter();continue}}else if(!a.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}a._preActivateForIntermediateRendering(o);var l=void 0;if(l=!(!n||!r)&&0==(a.layerMask&r.layerMask),a.isEnabled()&&a.isVisible&&a.subMeshes&&!l&&a._activate(o,!0)&&a.subMeshes.length){a.isAnInstance?a._internalAbstractMeshDataInfo._actAsRegularMesh||(a=a.sourceMesh):a._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,a._internalAbstractMeshDataInfo._isActiveIntermediate=!0;for(var c=0;c<a.subMeshes.length;c++){var u=a.subMeshes[c];this._renderingManager.dispatch(u,a)}}}}for(var d=0;d<i.particleSystems.length;d++){var h=i.particleSystems[d],f=h.emitter;h.isStarted()&&f&&f.position&&f.isEnabled()&&e.indexOf(f)>=0&&this._renderingManager.dispatchParticles(h)}}},t.prototype._bindFrameBuffer=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0);var r=this.getScene();if(r){var n=r.getEngine();this._texture&&n.bindFramebuffer(this._texture,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}},t.prototype.unbindFrameBuffer=function(e,t){var r=this;this._texture&&e.unBindFramebuffer(this._texture,this.isCube,(function(){r.onAfterRenderObservable.notifyObservers(t)}))},t.prototype.renderToTarget=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=null);var s=this.getScene();if(s){var a=s.getEngine();if(this._texture){this._postProcessManager?this._postProcessManager._prepareFrame(this._texture,this._postProcesses):t&&s.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(e,n),this.is2DArray?this.onBeforeRenderObservable.notifyObservers(n):this.onBeforeRenderObservable.notifyObservers(e);var l=null,c=this.renderList?this.renderList:s.getActiveMeshes().data,u=this.renderList?this.renderList.length:s.getActiveMeshes().length;this.getCustomRenderList&&(l=this.getCustomRenderList(this.is2DArray?n:e,c,u)),l?this._prepareRenderingManager(l,l.length,i,!1):(this._defaultRenderListPrepared||(this._prepareRenderingManager(c,u,i,!this.renderList),this._defaultRenderListPrepared=!0),l=c),this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(a):a.clear(this.clearColor||s.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||s.updateTransformMatrix(!0);for(var d=0,h=s._beforeRenderTargetDrawStage;d<h.length;d++)h[d].action(this);this._renderingManager.render(this.customRenderFunction,l,this.renderParticles,this.renderSprites);for(var f=0,p=s._afterRenderTargetDrawStage;f<p.length;f++)p[f].action(this);this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._texture,e,this._postProcesses,this.ignoreCameraViewport):t&&s.postProcessManager._finalizeFrame(!1,this._texture,e),this._doNotChangeAspectRatio||s.updateTransformMatrix(!0),r&&o.Tools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),a),this.isCube&&5!==e?this.onAfterRenderObservable.notifyObservers(e):(this.isCube&&5===e&&a.generateMipMapsForCubemap(this._texture),this.unbindFrameBuffer(a,e))}}},t.prototype.setRenderingOrder=function(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._renderingManager.setRenderingOrder(e,t,r,n)},t.prototype.setRenderingAutoClearDepthStencil=function(e,t){this._renderingManager.setRenderingAutoClearDepthStencil(e,t),this._renderingManager._useSceneAutoClearSetup=!1},t.prototype.clone=function(){var e=this.getSize(),r=new t(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer);return r.hasAlpha=this.hasAlpha,r.level=this.level,r.coordinatesMode=this.coordinatesMode,this.renderList&&(r.renderList=this.renderList.slice(0)),r},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);if(t.renderTargetSize=this.getRenderSize(),t.renderList=[],this.renderList)for(var r=0;r<this.renderList.length;r++)t.renderList.push(this.renderList[r].id);return t},t.prototype.disposeFramebufferObjects=function(){var e=this.getInternalTexture(),t=this.getScene();e&&t&&t.getEngine()._releaseFramebufferObjects(e)},t.prototype.dispose=function(){this.onResizeObservable.clear(),this.onClearObservable.clear(),this.onAfterRenderObservable.clear(),this.onAfterUnbindObservable.clear(),this.onBeforeBindObservable.clear(),this.onBeforeRenderObservable.clear(),this._postProcessManager&&(this._postProcessManager.dispose(),this._postProcessManager=null),this.clearPostProcesses(!0),this._resizeObserver&&(this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this.renderList=null;var t=this.getScene();if(t){var r=t.customRenderTargets.indexOf(this);r>=0&&t.customRenderTargets.splice(r,1);for(var n=0,i=t.cameras;n<i.length;n++){var o=i[n];(r=o.customRenderTargets.indexOf(this))>=0&&o.customRenderTargets.splice(r,1)}this.depthStencilTexture&&this.getScene().getEngine()._releaseTexture(this.depthStencilTexture),e.prototype.dispose.call(this)}},t.prototype._rebuild=function(){this.refreshRate===t.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=t.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()},t.prototype.freeRenderingGroups=function(){this._renderingManager&&this._renderingManager.freeRenderingGroups()},t.prototype.getViewCount=function(){return 1},t.REFRESHRATE_RENDER_ONCE=0,t.REFRESHRATE_RENDER_ONEVERYFRAME=1,t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2,t}(a.Texture);a.Texture._CreateRenderTargetTexture=function(e,t,r,n){return new h(e,t,r,n)}},"./Materials/Textures/texture.ts":
- /*!***************************************!*\
- !*** ./Materials/Textures/texture.ts ***!
- \***************************************/
- /*! exports provided: Texture */function(e,t,r){"use strict";r.r(t),r.d(t,"Texture",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),u=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),d=r(/*! ../../Misc/timingTools */"./Misc/timingTools.ts"),h=r(/*! ../../Misc/instantiationTools */"./Misc/instantiationTools.ts"),f=r(/*! ../../Maths/math.plane */"./Maths/math.plane.ts"),p=r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts"),m=function(e){function t(r,n,i,s,a,c,u,h,f,p,m){void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===a&&(a=t.TRILINEAR_SAMPLINGMODE),void 0===c&&(c=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===f&&(f=!1);var g=e.call(this,n)||this;g.url=null,g.uOffset=0,g.vOffset=0,g.uScale=1,g.vScale=1,g.uAng=0,g.vAng=0,g.wAng=0,g.uRotationCenter=.5,g.vRotationCenter=.5,g.wRotationCenter=.5,g.inspectableCustomProperties=null,g._noMipmap=!1,g._invertY=!1,g._rowGenerationMatrix=null,g._cachedTextureMatrix=null,g._projectionModeMatrix=null,g._t0=null,g._t1=null,g._t2=null,g._cachedUOffset=-1,g._cachedVOffset=-1,g._cachedUScale=0,g._cachedVScale=0,g._cachedUAng=-1,g._cachedVAng=-1,g._cachedWAng=-1,g._cachedProjectionMatrixId=-1,g._cachedCoordinatesMode=-1,g._initialSamplingMode=t.BILINEAR_SAMPLINGMODE,g._buffer=null,g._deleteBuffer=!1,g._format=null,g._delayedOnLoad=null,g._delayedOnError=null,g.onLoadObservable=new o.Observable,g._isBlocking=!0,g.name=r||"",g.url=r,g._noMipmap=i,g._invertY=s,g._initialSamplingMode=a,g._buffer=h,g._deleteBuffer=f,g._mimeType=m,p&&(g._format=p);var _=g.getScene(),v=g._getEngine();if(!v)return g;v.onBeforeTextureInitObservable.notifyObservers(g);var y=function(){g._texture&&(g._texture._invertVScale&&(g.vScale*=-1,g.vOffset+=1),null!==g._texture._cachedWrapU&&(g.wrapU=g._texture._cachedWrapU,g._texture._cachedWrapU=null),null!==g._texture._cachedWrapV&&(g.wrapV=g._texture._cachedWrapV,g._texture._cachedWrapV=null),null!==g._texture._cachedWrapR&&(g.wrapR=g._texture._cachedWrapR,g._texture._cachedWrapR=null)),g.onLoadObservable.hasObservers()&&g.onLoadObservable.notifyObservers(g),c&&c(),!g.isBlocking&&_&&_.resetCachedMaterial()};return g.url?(g._texture=g._getFromCache(g.url,i,a,s),g._texture?g._texture.isReady?d.TimingTools.SetImmediate((function(){return y()})):g._texture.onLoadedObservable.add(y):_&&_.useDelayedTextureLoading?(g.delayLoadState=l.Constants.DELAYLOADSTATE_NOTLOADED,g._delayedOnLoad=y,g._delayedOnError=u):(g._texture=v.createTexture(g.url,i,s,_,a,y,u,g._buffer,void 0,g._format,null,m),f&&delete g._buffer),g):(g._delayedOnLoad=y,g._delayedOnError=u,g)}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return this._noMipmap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return this._isBlocking},set:function(e){this._isBlocking=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"samplingMode",{get:function(){return this._texture?this._texture.samplingMode:this._initialSamplingMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"invertY",{get:function(){return this._invertY},enumerable:!1,configurable:!0}),t.prototype.updateURL=function(e,t,r){void 0===t&&(t=null),this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag)),this.name&&!p.StringTools.StartsWith(this.name,"data:")||(this.name=e),this.url=e,this._buffer=t,this.delayLoadState=l.Constants.DELAYLOADSTATE_NOTLOADED,r&&(this._delayedOnLoad=r),this.delayLoad()},t.prototype.delayLoad=function(){if(this.delayLoadState===l.Constants.DELAYLOADSTATE_NOTLOADED){var e=this.getScene();e&&(this.delayLoadState=l.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap,this.samplingMode,this._invertY),this._texture?this._delayedOnLoad&&(this._texture.isReady?d.TimingTools.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(this.url,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,null,this._mimeType),this._deleteBuffer&&delete this._buffer),this._delayedOnLoad=null,this._delayedOnError=null)}},t.prototype._prepareRowForTextureGeneration=function(e,t,r,n){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,r-=this.wRotationCenter,s.Vector3.TransformCoordinatesFromFloatsToRef(e,t,r,this._rowGenerationMatrix,n),n.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,n.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,n.z+=this.wRotationCenter},t.prototype.getTextureMatrix=function(e){var t=this;if(void 0===e&&(e=1),this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedTextureMatrix||(this._cachedTextureMatrix=s.Matrix.Zero(),this._rowGenerationMatrix=new s.Matrix,this._t0=s.Vector3.Zero(),this._t1=s.Vector3.Zero(),this._t2=s.Vector3.Zero()),s.Matrix.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),s.Matrix.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix);var r=this.getScene();return r?(r.markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag,(function(e){return e.hasTexture(t)})),this._cachedTextureMatrix):this._cachedTextureMatrix},t.prototype.getReflectionTextureMatrix=function(){var e=this,r=this.getScene();if(!r)return this._cachedTextureMatrix;if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale===this._cachedUScale&&this.vScale===this._cachedVScale&&this.coordinatesMode===this._cachedCoordinatesMode){if(this.coordinatesMode!==t.PROJECTION_MODE)return this._cachedTextureMatrix;if(this._cachedProjectionMatrixId===r.getProjectionMatrix().updateFlag)return this._cachedTextureMatrix}switch(this._cachedTextureMatrix||(this._cachedTextureMatrix=s.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=s.Matrix.Zero()),this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale,this._cachedVScale=this.vScale,this._cachedCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case t.PLANAR_MODE:s.Matrix.IdentityToRef(this._cachedTextureMatrix),this._cachedTextureMatrix[0]=this.uScale,this._cachedTextureMatrix[5]=this.vScale,this._cachedTextureMatrix[12]=this.uOffset,this._cachedTextureMatrix[13]=this.vOffset;break;case t.PROJECTION_MODE:s.Matrix.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);var n=r.getProjectionMatrix();this._cachedProjectionMatrixId=n.updateFlag,n.multiplyToRef(this._projectionModeMatrix,this._cachedTextureMatrix);break;default:s.Matrix.IdentityToRef(this._cachedTextureMatrix)}return r.markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag,(function(t){return-1!==t.getActiveTextures().indexOf(e)})),this._cachedTextureMatrix},t.prototype.clone=function(){var e=this;return i.SerializationHelper.Clone((function(){return new t(e._texture?e._texture.url:null,e.getScene(),e._noMipmap,e._invertY,e.samplingMode,void 0,void 0,e._texture?e._texture._buffer:void 0)}),this)},t.prototype.serialize=function(){var r=this.name;t.SerializeBuffers||p.StringTools.StartsWith(this.name,"data:")&&(this.name=""),p.StringTools.StartsWith(this.name,"data:")&&this.url===this.name&&(this.url="");var n=e.prototype.serialize.call(this);return n?(t.SerializeBuffers&&("string"==typeof this._buffer&&"data:"===this._buffer.substr(0,5)?(n.base64String=this._buffer,n.name=n.name.replace("data:","")):this.url&&p.StringTools.StartsWith(this.url,"data:")&&this._buffer instanceof Uint8Array&&(n.base64String="data:image/png;base64,"+p.StringTools.EncodeArrayBufferToBase64(this._buffer))),n.invertY=this._invertY,n.samplingMode=this.samplingMode,this.name=r,n):null},t.prototype.getClassName=function(){return"Texture"},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null},t.Parse=function(e,r,n){if(e.customType){var o=h.InstantiationTools.Instantiate(e.customType).Parse(e,r,n);return e.samplingMode&&o.updateSamplingMode&&o._samplingMode&&o._samplingMode!==e.samplingMode&&o.updateSamplingMode(e.samplingMode),o}if(e.isCube&&!e.isRenderTarget)return t._CubeTextureParser(e,r,n);if(!e.name&&!e.isRenderTarget)return null;var s=i.SerializationHelper.Parse((function(){var i,o=!0;if(e.noMipmap&&(o=!1),e.mirrorPlane){var s=t._CreateMirror(e.name,e.renderTargetSize,r,o);return s._waitingRenderList=e.renderList,s.mirrorPlane=f.Plane.FromArray(e.mirrorPlane),s}if(e.isRenderTarget){var a=null;if(e.isCube){if(r.reflectionProbes)for(var l=0;l<r.reflectionProbes.length;l++){var c=r.reflectionProbes[l];if(c.name===e.name)return c.cubeTexture}}else(a=t._CreateRenderTargetTexture(e.name,e.renderTargetSize,r,o))._waitingRenderList=e.renderList;return a}if(e.base64String)i=t.CreateFromBase64String(e.base64String,e.name,r,!o,e.invertY);else{var u=void 0;u=e.name&&e.name.indexOf("://")>0?e.name:n+e.name,(p.StringTools.StartsWith(e.url,"data:")||t.UseSerializedUrlIfAny&&e.url)&&(u=e.url),i=new t(u,r,!o,e.invertY)}return i}),e,r);if(s&&s._texture&&(s._texture._cachedWrapU=null,s._texture._cachedWrapV=null,s._texture._cachedWrapR=null),e.samplingMode){var a=e.samplingMode;s&&s.samplingMode!==a&&s.updateSamplingMode(a)}if(s&&e.animations)for(var l=0;l<e.animations.length;l++){var u=e.animations[l],d=c._TypeStore.GetClass("BABYLON.Animation");d&&s.animations.push(d.Parse(u))}return s},t.CreateFromBase64String=function(e,r,n,i,o,s,a,c,u){return void 0===s&&(s=t.TRILINEAR_SAMPLINGMODE),void 0===a&&(a=null),void 0===c&&(c=null),void 0===u&&(u=l.Constants.TEXTUREFORMAT_RGBA),new t("data:"+r,n,i,o,s,a,c,e,!1,u)},t.LoadFromDataString=function(e,r,n,i,o,s,a,c,u,d){return void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===s&&(s=!0),void 0===a&&(a=t.TRILINEAR_SAMPLINGMODE),void 0===c&&(c=null),void 0===u&&(u=null),void 0===d&&(d=l.Constants.TEXTUREFORMAT_RGBA),"data:"!==e.substr(0,5)&&(e="data:"+e),new t(e,n,o,s,a,c,u,r,i,d)},t.SerializeBuffers=!0,t._CubeTextureParser=function(e,t,r){throw u._DevTools.WarnImport("CubeTexture")},t._CreateMirror=function(e,t,r,n){throw u._DevTools.WarnImport("MirrorTexture")},t._CreateRenderTargetTexture=function(e,t,r,n){throw u._DevTools.WarnImport("RenderTargetTexture")},t.NEAREST_SAMPLINGMODE=l.Constants.TEXTURE_NEAREST_SAMPLINGMODE,t.NEAREST_NEAREST_MIPLINEAR=l.Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR,t.BILINEAR_SAMPLINGMODE=l.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,t.LINEAR_LINEAR_MIPNEAREST=l.Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST,t.TRILINEAR_SAMPLINGMODE=l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,t.LINEAR_LINEAR_MIPLINEAR=l.Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR,t.NEAREST_NEAREST_MIPNEAREST=l.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST,t.NEAREST_LINEAR_MIPNEAREST=l.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST,t.NEAREST_LINEAR_MIPLINEAR=l.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR,t.NEAREST_LINEAR=l.Constants.TEXTURE_NEAREST_LINEAR,t.NEAREST_NEAREST=l.Constants.TEXTURE_NEAREST_NEAREST,t.LINEAR_NEAREST_MIPNEAREST=l.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST,t.LINEAR_NEAREST_MIPLINEAR=l.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR,t.LINEAR_LINEAR=l.Constants.TEXTURE_LINEAR_LINEAR,t.LINEAR_NEAREST=l.Constants.TEXTURE_LINEAR_NEAREST,t.EXPLICIT_MODE=l.Constants.TEXTURE_EXPLICIT_MODE,t.SPHERICAL_MODE=l.Constants.TEXTURE_SPHERICAL_MODE,t.PLANAR_MODE=l.Constants.TEXTURE_PLANAR_MODE,t.CUBIC_MODE=l.Constants.TEXTURE_CUBIC_MODE,t.PROJECTION_MODE=l.Constants.TEXTURE_PROJECTION_MODE,t.SKYBOX_MODE=l.Constants.TEXTURE_SKYBOX_MODE,t.INVCUBIC_MODE=l.Constants.TEXTURE_INVCUBIC_MODE,t.EQUIRECTANGULAR_MODE=l.Constants.TEXTURE_EQUIRECTANGULAR_MODE,t.FIXED_EQUIRECTANGULAR_MODE=l.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,t.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=l.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,t.CLAMP_ADDRESSMODE=l.Constants.TEXTURE_CLAMP_ADDRESSMODE,t.WRAP_ADDRESSMODE=l.Constants.TEXTURE_WRAP_ADDRESSMODE,t.MIRROR_ADDRESSMODE=l.Constants.TEXTURE_MIRROR_ADDRESSMODE,t.UseSerializedUrlIfAny=!1,Object(n.__decorate)([Object(i.serialize)()],t.prototype,"url",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"uOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"vOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"uScale",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"vScale",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"uAng",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"vAng",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"wAng",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"uRotationCenter",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"vRotationCenter",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"wRotationCenter",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"isBlocking",null),t}(a.BaseTexture);i.SerializationHelper._TextureParser=m.Parse},"./Materials/Textures/videoTexture.ts":
- /*!********************************************!*\
- !*** ./Materials/Textures/videoTexture.ts ***!
- \********************************************/
- /*! exports provided: VideoTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"VideoTexture",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=(r(/*! ../../Engines/Extensions/engine.videoTexture */"./Engines/Extensions/engine.videoTexture.ts"),r(/*! ../../Engines/Extensions/engine.dynamicTexture */"./Engines/Extensions/engine.dynamicTexture.ts"),function(e){function t(t,r,n,i,s,l,c){void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===l&&(l=a.Texture.TRILINEAR_SAMPLINGMODE),void 0===c&&(c={autoPlay:!0,loop:!0,autoUpdateTexture:!0});var u=e.call(this,null,n,!i,s)||this;u._onUserActionRequestedObservable=null,u._stillImageCaptured=!1,u._displayingPosterTexture=!1,u._frameId=-1,u._currentSrc=null,u._createInternalTexture=function(){if(null!=u._texture){if(!u._displayingPosterTexture)return;u._texture.dispose(),u._displayingPosterTexture=!1}if(!u._getEngine().needPOTTextures||o.Tools.IsExponentOfTwo(u.video.videoWidth)&&o.Tools.IsExponentOfTwo(u.video.videoHeight)?(u.wrapU=a.Texture.WRAP_ADDRESSMODE,u.wrapV=a.Texture.WRAP_ADDRESSMODE):(u.wrapU=a.Texture.CLAMP_ADDRESSMODE,u.wrapV=a.Texture.CLAMP_ADDRESSMODE,u._generateMipMaps=!1),u._texture=u._getEngine().createDynamicTexture(u.video.videoWidth,u.video.videoHeight,u._generateMipMaps,u.samplingMode),u.video.autoplay||u._settings.poster)u._texture.isReady=!0,u._updateInternalTexture(),u.onLoadObservable.hasObservers()&&u.onLoadObservable.notifyObservers(u);else{var e=u.video.onplaying,t=!1,r=u.video.muted;u.video.muted=!0,u.video.onplaying=function(){u.video.muted=r,u.video.onplaying=e,u._texture.isReady=!0,u._updateInternalTexture(),t||u.video.pause(),u.onLoadObservable.hasObservers()&&u.onLoadObservable.notifyObservers(u)};var n=u.video.play();n?n.then((function(){})).catch((function(){t=!0,u._onUserActionRequestedObservable&&u._onUserActionRequestedObservable.hasObservers()&&u._onUserActionRequestedObservable.notifyObservers(u)})):(u.video.onplaying=e,u._texture.isReady=!0,u._updateInternalTexture(),u.onLoadObservable.hasObservers()&&u.onLoadObservable.notifyObservers(u))}},u.reset=function(){null!=u._texture&&(u._displayingPosterTexture||(u._texture.dispose(),u._texture=null))},u._updateInternalTexture=function(){if(null!=u._texture&&u._texture.isReady&&!(u.video.readyState<u.video.HAVE_CURRENT_DATA||u._displayingPosterTexture)){var e=u.getScene().getFrameId();u._frameId!==e&&(u._frameId=e,u._getEngine().updateVideoTexture(u._texture,u.video,u._invertY))}},u._generateMipMaps=i,u._initialSamplingMode=l,u.autoUpdateTexture=c.autoUpdateTexture,u._currentSrc=r,u.name=t||u._getName(r),u.video=u._getVideo(r),u._settings=c,c.poster&&(u.video.poster=c.poster),void 0!==c.autoPlay&&(u.video.autoplay=c.autoPlay),void 0!==c.loop&&(u.video.loop=c.loop),u.video.setAttribute("playsinline",""),u.video.addEventListener("paused",u._updateInternalTexture),u.video.addEventListener("seeked",u._updateInternalTexture),u.video.addEventListener("emptied",u.reset),u._createInternalTextureOnEvent=c.poster&&!c.autoPlay?"play":"canplay",u.video.addEventListener(u._createInternalTextureOnEvent,u._createInternalTexture);var d=u.video.readyState>=u.video.HAVE_CURRENT_DATA;return!c.poster||c.autoPlay&&d?d&&u._createInternalTexture():(u._texture=u._getEngine().createTexture(c.poster,!1,!u.invertY,n),u._displayingPosterTexture=!0),u}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"onUserActionRequestedObservable",{get:function(){return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new i.Observable),this._onUserActionRequestedObservable},enumerable:!1,configurable:!0}),t.prototype._getName=function(e){return e instanceof HTMLVideoElement?e.currentSrc:"object"==typeof e?e.toString():e},t.prototype._getVideo=function(e){if(e instanceof HTMLVideoElement)return o.Tools.SetCorsBehavior(e.currentSrc,e),e;var t=document.createElement("video");return"string"==typeof e?(o.Tools.SetCorsBehavior(e,t),t.src=e):(o.Tools.SetCorsBehavior(e[0],t),e.forEach((function(e){var r=document.createElement("source");r.src=e,t.appendChild(r)}))),t},t.prototype._rebuild=function(){this.update()},t.prototype.update=function(){this.autoUpdateTexture&&this.updateTexture(!0)},t.prototype.updateTexture=function(e){e&&(this.video.paused&&this._stillImageCaptured||(this._stillImageCaptured=!0,this._updateInternalTexture()))},t.prototype.updateURL=function(e){this.video.src=e,this._currentSrc=e},t.prototype.clone=function(){return new t(this.name,this._currentSrc,this.getScene(),this._generateMipMaps,this.invertY,this.samplingMode,this._settings)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._currentSrc=null,this._onUserActionRequestedObservable&&(this._onUserActionRequestedObservable.clear(),this._onUserActionRequestedObservable=null),this.video.removeEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this.video.removeEventListener("paused",this._updateInternalTexture),this.video.removeEventListener("seeked",this._updateInternalTexture),this.video.removeEventListener("emptied",this.reset),this.video.pause()},t.CreateFromStreamAsync=function(e,r){var n=document.createElement("video");return n.setAttribute("autoplay",""),n.setAttribute("muted","true"),n.setAttribute("playsinline",""),n.muted=!0,void 0!==n.mozSrcObject?n.mozSrcObject=r:"object"==typeof n.srcObject?n.srcObject=r:(window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,n.src=window.URL&&window.URL.createObjectURL(r)),new Promise((function(r){var i=function(){r(new t("video",n,e,!0,!0)),n.removeEventListener("playing",i)};n.addEventListener("playing",i),n.play()}))},t.CreateFromWebCamAsync=function(e,t,r){var n,i=this;return void 0===r&&(r=!1),t&&t.deviceId&&(n={exact:t.deviceId}),navigator.mediaDevices?navigator.mediaDevices.getUserMedia({video:t,audio:r}).then((function(t){return i.CreateFromStreamAsync(e,t)})):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia&&navigator.getUserMedia({video:{deviceId:n,width:{min:t&&t.minWidth||256,max:t&&t.maxWidth||640},height:{min:t&&t.minHeight||256,max:t&&t.maxHeight||480}},audio:r},(function(t){return i.CreateFromStreamAsync(e,t)}),(function(e){s.Logger.Error(e.name)})),Promise.reject("No support for userMedia on this device"))},t.CreateFromWebCam=function(e,t,r,n){void 0===n&&(n=!1),this.CreateFromWebCamAsync(e,r,n).then((function(e){t&&t(e)})).catch((function(e){s.Logger.Error(e.name)}))},t}(a.Texture))},"./Materials/colorCurves.ts":
- /*!**********************************!*\
- !*** ./Materials/colorCurves.ts ***!
- \**********************************/
- /*! exports provided: ColorCurves */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorCurves",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=function(){function e(){this._dirty=!0,this._tempColor=new o.Color4(0,0,0,0),this._globalCurve=new o.Color4(0,0,0,0),this._highlightsCurve=new o.Color4(0,0,0,0),this._midtonesCurve=new o.Color4(0,0,0,0),this._shadowsCurve=new o.Color4(0,0,0,0),this._positiveCurve=new o.Color4(0,0,0,0),this._negativeCurve=new o.Color4(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}return Object.defineProperty(e.prototype,"globalHue",{get:function(){return this._globalHue},set:function(e){this._globalHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalDensity",{get:function(){return this._globalDensity},set:function(e){this._globalDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalSaturation",{get:function(){return this._globalSaturation},set:function(e){this._globalSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalExposure",{get:function(){return this._globalExposure},set:function(e){this._globalExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsHue",{get:function(){return this._highlightsHue},set:function(e){this._highlightsHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsDensity",{get:function(){return this._highlightsDensity},set:function(e){this._highlightsDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsSaturation",{get:function(){return this._highlightsSaturation},set:function(e){this._highlightsSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightsExposure",{get:function(){return this._highlightsExposure},set:function(e){this._highlightsExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesHue",{get:function(){return this._midtonesHue},set:function(e){this._midtonesHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesDensity",{get:function(){return this._midtonesDensity},set:function(e){this._midtonesDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesSaturation",{get:function(){return this._midtonesSaturation},set:function(e){this._midtonesSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"midtonesExposure",{get:function(){return this._midtonesExposure},set:function(e){this._midtonesExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsHue",{get:function(){return this._shadowsHue},set:function(e){this._shadowsHue=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsDensity",{get:function(){return this._shadowsDensity},set:function(e){this._shadowsDensity=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsSaturation",{get:function(){return this._shadowsSaturation},set:function(e){this._shadowsSaturation=e,this._dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowsExposure",{get:function(){return this._shadowsExposure},set:function(e){this._shadowsExposure=e,this._dirty=!0},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"ColorCurves"},e.Bind=function(e,t,r,n,i){void 0===r&&(r="vCameraColorCurvePositive"),void 0===n&&(n="vCameraColorCurveNeutral"),void 0===i&&(i="vCameraColorCurveNegative"),e._dirty&&(e._dirty=!1,e.getColorGradingDataToRef(e._globalHue,e._globalDensity,e._globalSaturation,e._globalExposure,e._globalCurve),e.getColorGradingDataToRef(e._highlightsHue,e._highlightsDensity,e._highlightsSaturation,e._highlightsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._highlightsCurve),e.getColorGradingDataToRef(e._midtonesHue,e._midtonesDensity,e._midtonesSaturation,e._midtonesExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._midtonesCurve),e.getColorGradingDataToRef(e._shadowsHue,e._shadowsDensity,e._shadowsSaturation,e._shadowsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._shadowsCurve),e._highlightsCurve.subtractToRef(e._midtonesCurve,e._positiveCurve),e._midtonesCurve.subtractToRef(e._shadowsCurve,e._negativeCurve)),t&&(t.setFloat4(r,e._positiveCurve.r,e._positiveCurve.g,e._positiveCurve.b,e._positiveCurve.a),t.setFloat4(n,e._midtonesCurve.r,e._midtonesCurve.g,e._midtonesCurve.b,e._midtonesCurve.a),t.setFloat4(i,e._negativeCurve.r,e._negativeCurve.g,e._negativeCurve.b,e._negativeCurve.a))},e.PrepareUniforms=function(e){e.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")},e.prototype.getColorGradingDataToRef=function(t,r,n,i,o){null!=t&&(t=e.clamp(t,0,360),r=e.clamp(r,-100,100),n=e.clamp(n,-100,100),i=e.clamp(i,-100,100),r=e.applyColorGradingSliderNonlinear(r),r*=.5,i=e.applyColorGradingSliderNonlinear(i),r<0&&(r*=-1,t=(t+180)%360),e.fromHSBToRef(t,r,50+.25*i,o),o.scaleToRef(2,o),o.a=1+.01*n)},e.applyColorGradingSliderNonlinear=function(e){e/=100;var t=Math.abs(e);return t=Math.pow(t,2),e<0&&(t*=-1),t*=100},e.fromHSBToRef=function(t,r,n,i){var o=e.clamp(t,0,360),s=e.clamp(r/100,0,1),a=e.clamp(n/100,0,1);if(0===s)i.r=a,i.g=a,i.b=a;else{o/=60;var l=Math.floor(o),c=o-l,u=a*(1-s),d=a*(1-s*c),h=a*(1-s*(1-c));switch(l){case 0:i.r=a,i.g=h,i.b=u;break;case 1:i.r=d,i.g=a,i.b=u;break;case 2:i.r=u,i.g=a,i.b=h;break;case 3:i.r=u,i.g=d,i.b=a;break;case 4:i.r=h,i.g=u,i.b=a;break;default:i.r=a,i.g=u,i.b=d}}i.a=1},e.clamp=function(e,t,r){return Math.min(Math.max(e,t),r)},e.prototype.clone=function(){return i.SerializationHelper.Clone((function(){return new e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.Parse=function(t){return i.SerializationHelper.Parse((function(){return new e}),t,null,null)},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalHue",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalDensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalSaturation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalExposure",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsHue",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsDensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsSaturation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsExposure",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesHue",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesDensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesSaturation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesExposure",void 0),e}();i.SerializationHelper._ColorCurvesParser=s.Parse},"./Materials/effect.ts":
- /*!*****************************!*\
- !*** ./Materials/effect.ts ***!
- \*****************************/
- /*! exports provided: Effect */function(e,t,r){"use strict";r.r(t),r.d(t,"Effect",(function(){return l}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),s=r(/*! ../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../Engines/Processors/shaderProcessor */"./Engines/Processors/shaderProcessor.ts"),l=function(){function e(t,r,i,s,l,c,u,d,h,f){var p,m=this;void 0===s&&(s=null),void 0===c&&(c=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===h&&(h=null),this.name=null,this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new n.Observable,this.onErrorObservable=new n.Observable,this._onBindObservable=null,this._wasPreviouslyReady=!1,this._bonesComputationForcedToCPU=!1,this._multiTarget=!1,this._uniformBuffersNames={},this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._pipelineContext=null,this._valueCache={},this.name=t;var g,_,v=null;if(r.attributes){var y=r;if(this._engine=i,this._attributesNames=y.attributes,this._uniformsNames=y.uniformsNames.concat(y.samplers),this._samplerList=y.samplers.slice(),this.defines=y.defines,this.onError=y.onError,this.onCompiled=y.onCompiled,this._fallbacks=y.fallbacks,this._indexParameters=y.indexParameters,this._transformFeedbackVaryings=y.transformFeedbackVaryings||null,this._multiTarget=!!y.multiTarget,y.uniformBuffersNames){this._uniformBuffersNamesList=y.uniformBuffersNames.slice();for(var b=0;b<y.uniformBuffersNames.length;b++)this._uniformBuffersNames[y.uniformBuffersNames[b]]=b}v=null!==(p=y.processFinalCode)&&void 0!==p?p:null}else this._engine=l,this.defines=null==c?"":c,this._uniformsNames=i.concat(s),this._samplerList=s?s.slice():[],this._attributesNames=r,this._uniformBuffersNamesList=[],this.onError=h,this.onCompiled=d,this._indexParameters=f,this._fallbacks=u;this._attributeLocationByName={},this.uniqueId=e._uniqueIdSeed++;var A=o.DomManagement.IsWindowObjectExist()?this._engine.getHostDocument():null;t.vertexSource?g="source:"+t.vertexSource:t.vertexElement?(g=A?A.getElementById(t.vertexElement):null)||(g=t.vertexElement):g=t.vertex||t,t.fragmentSource?_="source:"+t.fragmentSource:t.fragmentElement?(_=A?A.getElementById(t.fragmentElement):null)||(_=t.fragmentElement):_=t.fragment||t;var T={defines:this.defines.split("\n"),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:this._engine._shaderProcessor,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:e.ShadersRepository,includesShadersStore:e.IncludesShadersStore,version:(100*this._engine.webGLVersion).toString(),platformName:this._engine.webGLVersion>=2?"WEBGL2":"WEBGL1"};this._loadShader(g,"Vertex","",(function(e){m._loadShader(_,"Fragment","Pixel",(function(r){a.ShaderProcessor.Process(e,T,(function(e){v&&(e=v("vertex",e)),T.isFragment=!0,a.ShaderProcessor.Process(r,T,(function(r){v&&(r=v("fragment",r)),m._useFinalCode(e,r,t)}))}))}))}))}return Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new n.Observable),this._onBindObservable},enumerable:!1,configurable:!0}),e.prototype._useFinalCode=function(e,t,r){if(r){var n=r.vertexElement||r.vertex||r.spectorName||r,i=r.fragmentElement||r.fragment||r.spectorName||r;this._vertexSourceCode="#define SHADER_NAME vertex:"+n+"\n"+e,this._fragmentSourceCode="#define SHADER_NAME fragment:"+i+"\n"+t}else this._vertexSourceCode=e,this._fragmentSourceCode=t;this._prepareEffect()},Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){try{return this._isReadyInternal()}catch(e){return!1}},e.prototype._isReadyInternal=function(){return!!this._isReady||!!this._pipelineContext&&this._pipelineContext.isReady},e.prototype.getEngine=function(){return this._engine},e.prototype.getPipelineContext=function(){return this._pipelineContext},e.prototype.getAttributesNames=function(){return this._attributesNames},e.prototype.getAttributeLocation=function(e){return this._attributes[e]},e.prototype.getAttributeLocationByName=function(e){return this._attributeLocationByName[e]},e.prototype.getAttributesCount=function(){return this._attributes.length},e.prototype.getUniformIndex=function(e){return this._uniformsNames.indexOf(e)},e.prototype.getUniform=function(e){return this._uniforms[e]},e.prototype.getSamplers=function(){return this._samplerList},e.prototype.getUniformNames=function(){return this._uniformsNames},e.prototype.getUniformBuffersNames=function(){return this._uniformBuffersNamesList},e.prototype.getIndexParameters=function(){return this._indexParameters},e.prototype.getCompilationError=function(){return this._compilationError},e.prototype.allFallbacksProcessed=function(){return this._allFallbacksProcessed},e.prototype.executeWhenCompiled=function(e){var t=this;this.isReady()?e(this):(this.onCompileObservable.add((function(t){e(t)})),this._pipelineContext&&!this._pipelineContext.isAsync||setTimeout((function(){t._checkIsReady(null)}),16))},e.prototype._checkIsReady=function(e){var t=this;try{if(this._isReadyInternal())return}catch(t){return void this._processCompilationErrors(t,e)}setTimeout((function(){t._checkIsReady(e)}),16)},e.prototype._loadShader=function(t,r,n,i){var s;"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?i(o.DomManagement.GetDOMTextContent(t)):"source:"!==t.substr(0,7)?"base64:"!==t.substr(0,7)?e.ShadersStore[t+r+"Shader"]?i(e.ShadersStore[t+r+"Shader"]):n&&e.ShadersStore[t+n+"Shader"]?i(e.ShadersStore[t+n+"Shader"]):(s="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(s+"."+r.toLowerCase()+".fx",i)):i(window.atob(t.substr(7))):i(t.substr(7))},Object.defineProperty(e.prototype,"vertexSourceCode",{get:function(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:this._vertexSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fragmentSourceCode",{get:function(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:this._fragmentSourceCode},enumerable:!1,configurable:!0}),e.prototype._rebuildProgram=function(e,t,r,n){var o=this;this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=function(e,t){n&&n(t)},this.onCompiled=function(){var e=o.getEngine().scenes;if(e)for(var t=0;t<e.length;t++)e[t].markAllMaterialsAsDirty(i.Constants.MATERIAL_AllDirtyFlag);o._pipelineContext._handlesSpectorRebuildCallback(r)},this._fallbacks=null,this._prepareEffect()},e.prototype._prepareEffect=function(){var e=this,t=this._attributesNames,r=this.defines;this._valueCache={};var n=this._pipelineContext;try{var i=this._engine;this._pipelineContext=i.createPipelineContext();var o=this._rebuildProgram.bind(this);this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?i._preparePipelineContext(this._pipelineContext,this._vertexSourceCodeOverride,this._fragmentSourceCodeOverride,!0,o,null,this._transformFeedbackVaryings):i._preparePipelineContext(this._pipelineContext,this._vertexSourceCode,this._fragmentSourceCode,!1,o,r,this._transformFeedbackVaryings),i._executeWhenRenderingStateIsCompiled(this._pipelineContext,(function(){if(i.supportsUniformBuffers)for(var r in e._uniformBuffersNames)e.bindUniformBlock(r,e._uniformBuffersNames[r]);var o;if(i.getUniforms(e._pipelineContext,e._uniformsNames).forEach((function(t,r){e._uniforms[e._uniformsNames[r]]=t})),e._attributes=i.getAttributes(e._pipelineContext,t),t)for(var s=0;s<t.length;s++){var a=t[s];e._attributeLocationByName[a]=e._attributes[s]}for(o=0;o<e._samplerList.length;o++)null==e.getUniform(e._samplerList[o])&&(e._samplerList.splice(o,1),o--);e._samplerList.forEach((function(t,r){e._samplers[t]=r})),i.bindSamplers(e),e._compilationError="",e._isReady=!0,e.onCompiled&&e.onCompiled(e),e.onCompileObservable.notifyObservers(e),e.onCompileObservable.clear(),e._fallbacks&&e._fallbacks.unBindMesh(),n&&e.getEngine()._deletePipelineContext(n)})),this._pipelineContext.isAsync&&this._checkIsReady(n)}catch(e){this._processCompilationErrors(e,n)}},e.prototype._getShaderCodeAndErrorLine=function(e,t,r){var n=r?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/,i=null;if(t&&e){var o=t.match(n);if(o&&2===o.length){var s=parseInt(o[1]),a=e.split("\n",-1);a.length>=s&&(i="Offending line ["+s+"] in "+(r?"fragment":"vertex")+" code: "+a[s-1])}}return[e,i]},e.prototype._processCompilationErrors=function(t,r){var n,i,o,a,l;void 0===r&&(r=null),this._compilationError=t.message;var c=this._attributesNames,u=this._fallbacks;if(s.Logger.Error("Unable to compile effect:"),s.Logger.Error("Uniforms: "+this._uniformsNames.map((function(e){return" "+e}))),s.Logger.Error("Attributes: "+c.map((function(e){return" "+e}))),s.Logger.Error("Defines:\r\n"+this.defines),e.LogShaderCodeOnCompilationError){var d=null,h=null,f=null;(null===(o=this._pipelineContext)||void 0===o?void 0:o._getVertexShaderCode())&&(f=(n=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1))[0],d=n[1],f&&(s.Logger.Error("Vertex code:"),s.Logger.Error(f))),(null===(a=this._pipelineContext)||void 0===a?void 0:a._getFragmentShaderCode())&&(f=(i=this._getShaderCodeAndErrorLine(null===(l=this._pipelineContext)||void 0===l?void 0:l._getFragmentShaderCode(),this._compilationError,!0))[0],h=i[1],f&&(s.Logger.Error("Fragment code:"),s.Logger.Error(f))),d&&s.Logger.Error(d),h&&s.Logger.Error(h)}s.Logger.Error("Error: "+this._compilationError),r&&(this._pipelineContext=r,this._isReady=!0,this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)),u?(this._pipelineContext=null,u.hasMoreFallbacks?(this._allFallbacksProcessed=!1,s.Logger.Error("Trying next fallback."),this.defines=u.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):this._allFallbacksProcessed=!0},Object.defineProperty(e.prototype,"isSupported",{get:function(){return""===this._compilationError},enumerable:!1,configurable:!0}),e.prototype._bindTexture=function(e,t){this._engine._bindTexture(this._samplers[e],t)},e.prototype.setTexture=function(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t)},e.prototype.setDepthStencilTexture=function(e,t){this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t)},e.prototype.setTextureArray=function(e,t){var r=e+"Ex";if(-1===this._samplerList.indexOf(r+"0")){for(var n=this._samplerList.indexOf(e),i=1;i<t.length;i++){var o=r+(i-1).toString();this._samplerList.splice(n+i,0,o)}for(var s=0,a=0,l=this._samplerList;a<l.length;a++){var c=l[a];this._samplers[c]=s,s+=1}}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t)},e.prototype.setTextureFromPostProcess=function(e,t){this._engine.setTextureFromPostProcess(this._samplers[e],t)},e.prototype.setTextureFromPostProcessOutput=function(e,t){this._engine.setTextureFromPostProcessOutput(this._samplers[e],t)},e.prototype._cacheMatrix=function(e,t){var r=this._valueCache[e],n=t.updateFlag;return(void 0===r||r!==n)&&(this._valueCache[e]=n,!0)},e.prototype._cacheFloat2=function(e,t,r){var n=this._valueCache[e];if(!n||2!==n.length)return n=[t,r],this._valueCache[e]=n,!0;var i=!1;return n[0]!==t&&(n[0]=t,i=!0),n[1]!==r&&(n[1]=r,i=!0),i},e.prototype._cacheFloat3=function(e,t,r,n){var i=this._valueCache[e];if(!i||3!==i.length)return i=[t,r,n],this._valueCache[e]=i,!0;var o=!1;return i[0]!==t&&(i[0]=t,o=!0),i[1]!==r&&(i[1]=r,o=!0),i[2]!==n&&(i[2]=n,o=!0),o},e.prototype._cacheFloat4=function(e,t,r,n,i){var o=this._valueCache[e];if(!o||4!==o.length)return o=[t,r,n,i],this._valueCache[e]=o,!0;var s=!1;return o[0]!==t&&(o[0]=t,s=!0),o[1]!==r&&(o[1]=r,s=!0),o[2]!==n&&(o[2]=n,s=!0),o[3]!==i&&(o[3]=i,s=!0),s},e.prototype.bindUniformBuffer=function(t,r){var n=this._uniformBuffersNames[r];void 0!==n&&e._baseCache[n]!==t&&(e._baseCache[n]=t,this._engine.bindUniformBufferBase(t,n))},e.prototype.bindUniformBlock=function(e,t){this._engine.bindUniformBlock(this._pipelineContext,e,t)},e.prototype.setInt=function(e,t){var r=this._valueCache[e];return void 0!==r&&r===t||(this._valueCache[e]=t,this._engine.setInt(this._uniforms[e],t)),this},e.prototype.setIntArray=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray(this._uniforms[e],t),this},e.prototype.setIntArray2=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray2(this._uniforms[e],t),this},e.prototype.setIntArray3=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray3(this._uniforms[e],t),this},e.prototype.setIntArray4=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray4(this._uniforms[e],t),this},e.prototype.setFloatArray=function(e,t){return this._valueCache[e]=null,this._engine.setArray(this._uniforms[e],t),this},e.prototype.setFloatArray2=function(e,t){return this._valueCache[e]=null,this._engine.setArray2(this._uniforms[e],t),this},e.prototype.setFloatArray3=function(e,t){return this._valueCache[e]=null,this._engine.setArray3(this._uniforms[e],t),this},e.prototype.setFloatArray4=function(e,t){return this._valueCache[e]=null,this._engine.setArray4(this._uniforms[e],t),this},e.prototype.setArray=function(e,t){return this._valueCache[e]=null,this._engine.setArray(this._uniforms[e],t),this},e.prototype.setArray2=function(e,t){return this._valueCache[e]=null,this._engine.setArray2(this._uniforms[e],t),this},e.prototype.setArray3=function(e,t){return this._valueCache[e]=null,this._engine.setArray3(this._uniforms[e],t),this},e.prototype.setArray4=function(e,t){return this._valueCache[e]=null,this._engine.setArray4(this._uniforms[e],t),this},e.prototype.setMatrices=function(e,t){return t?(this._valueCache[e]=null,this._engine.setMatrices(this._uniforms[e],t),this):this},e.prototype.setMatrix=function(e,t){return this._cacheMatrix(e,t)&&this._engine.setMatrices(this._uniforms[e],t.toArray()),this},e.prototype.setMatrix3x3=function(e,t){return this._valueCache[e]=null,this._engine.setMatrix3x3(this._uniforms[e],t),this},e.prototype.setMatrix2x2=function(e,t){return this._valueCache[e]=null,this._engine.setMatrix2x2(this._uniforms[e],t),this},e.prototype.setFloat=function(e,t){var r=this._valueCache[e];return void 0!==r&&r===t||(this._valueCache[e]=t,this._engine.setFloat(this._uniforms[e],t)),this},e.prototype.setBool=function(e,t){var r=this._valueCache[e];return void 0!==r&&r===t||(this._valueCache[e]=t,this._engine.setInt(this._uniforms[e],t?1:0)),this},e.prototype.setVector2=function(e,t){return this._cacheFloat2(e,t.x,t.y)&&this._engine.setFloat2(this._uniforms[e],t.x,t.y),this},e.prototype.setFloat2=function(e,t,r){return this._cacheFloat2(e,t,r)&&this._engine.setFloat2(this._uniforms[e],t,r),this},e.prototype.setVector3=function(e,t){return this._cacheFloat3(e,t.x,t.y,t.z)&&this._engine.setFloat3(this._uniforms[e],t.x,t.y,t.z),this},e.prototype.setFloat3=function(e,t,r,n){return this._cacheFloat3(e,t,r,n)&&this._engine.setFloat3(this._uniforms[e],t,r,n),this},e.prototype.setVector4=function(e,t){return this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&this._engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w),this},e.prototype.setFloat4=function(e,t,r,n,i){return this._cacheFloat4(e,t,r,n,i)&&this._engine.setFloat4(this._uniforms[e],t,r,n,i),this},e.prototype.setColor3=function(e,t){return this._cacheFloat3(e,t.r,t.g,t.b)&&this._engine.setFloat3(this._uniforms[e],t.r,t.g,t.b),this},e.prototype.setColor4=function(e,t,r){return this._cacheFloat4(e,t.r,t.g,t.b,r)&&this._engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,r),this},e.prototype.setDirectColor4=function(e,t){return this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&this._engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a),this},e.prototype.dispose=function(){this._engine._releaseEffect(this)},e.RegisterShader=function(t,r,n){r&&(e.ShadersStore[t+"PixelShader"]=r),n&&(e.ShadersStore[t+"VertexShader"]=n)},e.ResetCache=function(){e._baseCache={}},e.ShadersRepository="src/Shaders/",e.LogShaderCodeOnCompilationError=!0,e._uniqueIdSeed=0,e._baseCache={},e.ShadersStore={},e.IncludesShadersStore={},e}()},"./Materials/effectFallbacks.ts":
- /*!**************************************!*\
- !*** ./Materials/effectFallbacks.ts ***!
- \**************************************/
- /*! exports provided: EffectFallbacks */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectFallbacks",(function(){return n}));var n=function(){function e(){this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}return e.prototype.unBindMesh=function(){this._mesh=null},e.prototype.addFallback=function(e,t){this._defines[e]||(e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)},e.prototype.addCPUSkinningFallback=function(e,t){this._mesh=t,e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e)},Object.defineProperty(e.prototype,"hasMoreFallbacks",{get:function(){return this._currentRank<=this._maxRank},enumerable:!1,configurable:!0}),e.prototype.reduce=function(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;for(var r=this._mesh.getScene(),n=0;n<r.meshes.length;n++){var i=r.meshes[n];if(i.material){if(i.computeBonesUsingShaders&&0!==i.numBoneInfluencers)if(i.material.getEffect()===t)i.computeBonesUsingShaders=!1;else if(i.subMeshes)for(var o=0,s=i.subMeshes;o<s.length;o++)if(s[o].effect===t){i.computeBonesUsingShaders=!1;break}}else!this._mesh.material&&i.computeBonesUsingShaders&&i.numBoneInfluencers>0&&(i.computeBonesUsingShaders=!1)}}else{var a=this._defines[this._currentRank];if(a)for(n=0;n<a.length;n++)e=e.replace("#define "+a[n],"");this._currentRank++}return e},e}()},"./Materials/effectRenderer.ts":
- /*!*************************************!*\
- !*** ./Materials/effectRenderer.ts ***!
- \*************************************/
- /*! exports provided: EffectRenderer, EffectWrapper */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectRenderer",(function(){return c})),r.d(t,"EffectWrapper",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Maths/math.viewport */"./Maths/math.viewport.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../Misc/observable */"./Misc/observable.ts"),l=r(/*! ./effect */"./Materials/effect.ts"),c=(r(/*! ../Shaders/postprocess.vertex */"./Shaders/postprocess.vertex.ts"),function(){function e(t,r){var s;void 0===r&&(r=e._DefaultOptions),this.engine=t,this._fullscreenViewport=new o.Viewport(0,0,1,1),r=Object(n.__assign)(Object(n.__assign)({},e._DefaultOptions),r),this._vertexBuffers=((s={})[i.VertexBuffer.PositionKind]=new i.VertexBuffer(t,r.positions,i.VertexBuffer.PositionKind,!1,!1,2),s),this._indexBuffer=t.createIndexBuffer(r.indices)}return e.prototype.setViewport=function(e){void 0===e&&(e=this._fullscreenViewport),this.engine.setViewport(e)},e.prototype.bindBuffers=function(e){this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)},e.prototype.applyEffectWrapper=function(e){this.engine.depthCullingState.depthTest=!1,this.engine.stencilState.stencilTest=!1,this.engine.enableEffect(e.effect),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})},e.prototype.restoreStates=function(){this.engine.depthCullingState.depthTest=!0,this.engine.stencilState.stencilTest=!0},e.prototype.draw=function(){this.engine.drawElementsType(s.Constants.MATERIAL_TriangleFillMode,0,6)},e.prototype.isRenderTargetTexture=function(e){return void 0!==e.renderList},e.prototype.render=function(e,t){if(void 0===t&&(t=null),e.effect.isReady()){this.setViewport();var r=null===t?null:this.isRenderTargetTexture(t)?t.getInternalTexture():t;r&&this.engine.bindFramebuffer(r),this.applyEffectWrapper(e),this.draw(),r&&this.engine.unBindFramebuffer(r),this.restoreStates()}},e.prototype.dispose=function(){var e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[i.VertexBuffer.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer)},e._DefaultOptions={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]},e}()),u=function(){function e(e){var t,r=this;this.onApplyObservable=new a.Observable;var n=e.uniformNames||[];e.vertexShader?t={fragmentSource:e.fragmentShader,vertexSource:e.vertexShader,spectorName:e.name||"effectWrapper"}:(n.push("scale"),t={fragmentSource:e.fragmentShader,vertex:"postprocess",spectorName:e.name||"effectWrapper"},this.onApplyObservable.add((function(){r.effect.setFloat2("scale",1,1)})));var i=e.defines?e.defines.join("\n"):"";e.useShaderStore?(t.fragment=t.fragmentSource,t.vertex||(t.vertex=t.vertexSource),delete t.fragmentSource,delete t.vertexSource,this.effect=e.engine.createEffect(t.spectorName,e.attributeNames||["position"],n,e.samplerNames,i,void 0,e.onCompiled)):this.effect=new l.Effect(t,e.attributeNames||["position"],n,e.samplerNames,e.engine,i,void 0,e.onCompiled)}return e.prototype.dispose=function(){this.effect.dispose()},e}()},"./Materials/fresnelParameters.ts":
- /*!****************************************!*\
- !*** ./Materials/fresnelParameters.ts ***!
- \****************************************/
- /*! exports provided: FresnelParameters */function(e,t,r){"use strict";r.r(t),r.d(t,"FresnelParameters",(function(){return l}));var n=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=function(){function e(e){void 0===e&&(e={}),this._isEnabled=!0,this.bias=void 0===e.bias?0:e.bias,this.power=void 0===e.power?1:e.power,this.leftColor=e.leftColor||i.Color3.White(),this.rightColor=e.rightColor||i.Color3.Black(),!1===e.isEnabled&&(this.isEnabled=!1)}return Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,o.Engine.MarkAllMaterialsAsDirty(a.Constants.MATERIAL_FresnelDirtyFlag|a.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.equals=function(e){return e&&this.bias===e.bias&&this.power===e.power&&this.leftColor.equals(e.leftColor)&&this.rightColor.equals(e.rightColor)&&this.isEnabled===e.isEnabled},e.prototype.serialize=function(){return{isEnabled:this.isEnabled,leftColor:this.leftColor.asArray(),rightColor:this.rightColor.asArray(),bias:this.bias,power:this.power}},e.Parse=function(t){return new e({isEnabled:t.isEnabled,leftColor:i.Color3.FromArray(t.leftColor),rightColor:i.Color3.FromArray(t.rightColor),bias:t.bias,power:t.power||1})},e}();s.SerializationHelper._FresnelParametersParser=l.Parse},"./Materials/iEffectFallbacks.ts":
- /*!***************************************!*\
- !*** ./Materials/iEffectFallbacks.ts ***!
- \***************************************/
- /*! no static exports found */function(e,t){},"./Materials/imageProcessingConfiguration.ts":
- /*!***************************************************!*\
- !*** ./Materials/imageProcessingConfiguration.ts ***!
- \***************************************************/
- /*! exports provided: ImageProcessingConfigurationDefines, ImageProcessingConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"ImageProcessingConfigurationDefines",(function(){return u})),r.d(t,"ImageProcessingConfiguration",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Misc/tools */"./Misc/tools.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Materials/materialDefines */"./Materials/materialDefines.ts"),c=r(/*! ../Materials/colorCurves */"./Materials/colorCurves.ts"),u=function(e){function t(){var t=e.call(this)||this;return t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.rebuild(),t}return Object(n.__extends)(t,e),t}(l.MaterialDefines),d=function(){function e(){this.colorCurves=new c.ColorCurves,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=e.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCentreX=0,this.vignetteCentreY=0,this.vignetteWeight=1.5,this.vignetteColor=new a.Color4(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=e.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.onUpdateParameters=new o.Observable}return Object.defineProperty(e.prototype,"colorCurvesEnabled",{get:function(){return this._colorCurvesEnabled},set:function(e){this._colorCurvesEnabled!==e&&(this._colorCurvesEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingTexture",{get:function(){return this._colorGradingTexture},set:function(e){this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingEnabled",{get:function(){return this._colorGradingEnabled},set:function(e){this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingWithGreenDepth",{get:function(){return this._colorGradingWithGreenDepth},set:function(e){this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingBGR",{get:function(){return this._colorGradingBGR},set:function(e){this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exposure",{get:function(){return this._exposure},set:function(e){this._exposure!==e&&(this._exposure=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toneMappingEnabled",{get:function(){return this._toneMappingEnabled},set:function(e){this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toneMappingType",{get:function(){return this._toneMappingType},set:function(e){this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contrast",{get:function(){return this._contrast},set:function(e){this._contrast!==e&&(this._contrast=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignetteBlendMode",{get:function(){return this._vignetteBlendMode},set:function(e){this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vignetteEnabled",{get:function(){return this._vignetteEnabled},set:function(e){this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"applyByPostProcess",{get:function(){return this._applyByPostProcess},set:function(e){this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())},enumerable:!1,configurable:!0}),e.prototype._updateParameters=function(){this.onUpdateParameters.notifyObservers(this)},e.prototype.getClassName=function(){return"ImageProcessingConfiguration"},e.PrepareUniforms=function(e,t){t.EXPOSURE&&e.push("exposureLinear"),t.CONTRAST&&e.push("contrast"),t.COLORGRADING&&e.push("colorTransformSettings"),t.VIGNETTE&&(e.push("vInverseScreenSize"),e.push("vignetteSettings1"),e.push("vignetteSettings2")),t.COLORCURVES&&c.ColorCurves.PrepareUniforms(e)},e.PrepareSamplers=function(e,t){t.COLORGRADING&&e.push("txColorTransform")},e.prototype.prepareDefines=function(t,r){if(void 0===r&&(r=!1),r!==this.applyByPostProcess||!this._isEnabled)return t.VIGNETTE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.EXPOSURE=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.IMAGEPROCESSING=!1,void(t.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled);switch(t.VIGNETTE=this.vignetteEnabled,t.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===e._VIGNETTEMODE_MULTIPLY,t.VIGNETTEBLENDMODEOPAQUE=!t.VIGNETTEBLENDMODEMULTIPLY,t.TONEMAPPING=this.toneMappingEnabled,this._toneMappingType){case e.TONEMAPPING_ACES:t.TONEMAPPING_ACES=!0;break;default:t.TONEMAPPING_ACES=!1}t.CONTRAST=1!==this.contrast,t.EXPOSURE=1!==this.exposure,t.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,t.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,t.COLORGRADING?t.COLORGRADING3D=this.colorGradingTexture.is3D:t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,t.SAMPLER3DBGRMAP=this.colorGradingBGR,t.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,t.IMAGEPROCESSING=t.VIGNETTE||t.TONEMAPPING||t.CONTRAST||t.EXPOSURE||t.COLORCURVES||t.COLORGRADING},e.prototype.isReady=function(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()},e.prototype.bind=function(e,t){if(this._colorCurvesEnabled&&this.colorCurves&&c.ColorCurves.Bind(this.colorCurves,e),this._vignetteEnabled){var r=1/e.getEngine().getRenderWidth(),n=1/e.getEngine().getRenderHeight();e.setFloat2("vInverseScreenSize",r,n);var i=null!=t?t:n/r,o=Math.tan(.5*this.vignetteCameraFov),a=o*i,l=Math.sqrt(a*o);a=s.Tools.Mix(a,l,this.vignetteStretch),o=s.Tools.Mix(o,l,this.vignetteStretch),e.setFloat4("vignetteSettings1",a,o,-a*this.vignetteCentreX,-o*this.vignetteCentreY);var u=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,u)}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);var d=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(d-1)/d,.5/d,d,this.colorGradingTexture.level)}},e.prototype.clone=function(){return i.SerializationHelper.Clone((function(){return new e}),this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.Parse=function(t){return i.SerializationHelper.Parse((function(){return new e}),t,null,null)},Object.defineProperty(e,"VIGNETTEMODE_MULTIPLY",{get:function(){return this._VIGNETTEMODE_MULTIPLY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"VIGNETTEMODE_OPAQUE",{get:function(){return this._VIGNETTEMODE_OPAQUE},enumerable:!1,configurable:!0}),e.TONEMAPPING_STANDARD=0,e.TONEMAPPING_ACES=1,e._VIGNETTEMODE_MULTIPLY=0,e._VIGNETTEMODE_OPAQUE=1,Object(n.__decorate)([Object(i.serializeAsColorCurves)()],e.prototype,"colorCurves",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorCurvesEnabled",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("colorGradingTexture")],e.prototype,"_colorGradingTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorGradingEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorGradingWithGreenDepth",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorGradingBGR",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_exposure",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_toneMappingEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_toneMappingType",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_contrast",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteStretch",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteCentreX",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteCentreY",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteWeight",void 0),Object(n.__decorate)([Object(i.serializeAsColor4)()],e.prototype,"vignetteColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteCameraFov",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_vignetteBlendMode",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_vignetteEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_applyByPostProcess",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_isEnabled",void 0),e}();i.SerializationHelper._ImageProcessingConfigurationParser=d.Parse},"./Materials/index.ts":
- /*!****************************!*\
- !*** ./Materials/index.ts ***!
- \****************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Background/index */"./Materials/Background/index.ts");r.d(t,"BackgroundMaterial",(function(){return n.BackgroundMaterial}));var i=r(/*! ./colorCurves */"./Materials/colorCurves.ts");r.d(t,"ColorCurves",(function(){return i.ColorCurves}));var o=r(/*! ./iEffectFallbacks */"./Materials/iEffectFallbacks.ts");for(var s in o)["BackgroundMaterial","ColorCurves","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(s);var a=r(/*! ./effectFallbacks */"./Materials/effectFallbacks.ts");r.d(t,"EffectFallbacks",(function(){return a.EffectFallbacks}));var l=r(/*! ./effect */"./Materials/effect.ts");r.d(t,"Effect",(function(){return l.Effect}));var c=r(/*! ./fresnelParameters */"./Materials/fresnelParameters.ts");r.d(t,"FresnelParameters",(function(){return c.FresnelParameters}));var u=r(/*! ./imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts");r.d(t,"ImageProcessingConfigurationDefines",(function(){return u.ImageProcessingConfigurationDefines})),r.d(t,"ImageProcessingConfiguration",(function(){return u.ImageProcessingConfiguration}));var d=r(/*! ./material */"./Materials/material.ts");r.d(t,"Material",(function(){return d.Material}));var h=r(/*! ./materialDefines */"./Materials/materialDefines.ts");r.d(t,"MaterialDefines",(function(){return h.MaterialDefines}));var f=r(/*! ./materialHelper */"./Materials/materialHelper.ts");r.d(t,"MaterialHelper",(function(){return f.MaterialHelper}));var p=r(/*! ./multiMaterial */"./Materials/multiMaterial.ts");r.d(t,"MultiMaterial",(function(){return p.MultiMaterial}));var m=r(/*! ./PBR/index */"./Materials/PBR/index.ts");r.d(t,"PBRMaterialDefines",(function(){return m.PBRMaterialDefines})),r.d(t,"PBRBaseMaterial",(function(){return m.PBRBaseMaterial})),r.d(t,"PBRBaseSimpleMaterial",(function(){return m.PBRBaseSimpleMaterial})),r.d(t,"PBRMaterial",(function(){return m.PBRMaterial})),r.d(t,"PBRMetallicRoughnessMaterial",(function(){return m.PBRMetallicRoughnessMaterial})),r.d(t,"PBRSpecularGlossinessMaterial",(function(){return m.PBRSpecularGlossinessMaterial}));var g=r(/*! ./pushMaterial */"./Materials/pushMaterial.ts");r.d(t,"PushMaterial",(function(){return g.PushMaterial}));var _=r(/*! ./shaderMaterial */"./Materials/shaderMaterial.ts");r.d(t,"ShaderMaterial",(function(){return _.ShaderMaterial}));var v=r(/*! ./standardMaterial */"./Materials/standardMaterial.ts");r.d(t,"StandardMaterialDefines",(function(){return v.StandardMaterialDefines})),r.d(t,"StandardMaterial",(function(){return v.StandardMaterial}));var y=r(/*! ./Textures/index */"./Materials/Textures/index.ts");for(var s in y)["BackgroundMaterial","ColorCurves","EffectFallbacks","Effect","FresnelParameters","ImageProcessingConfigurationDefines","ImageProcessingConfiguration","Material","MaterialDefines","MaterialHelper","MultiMaterial","PBRMaterialDefines","PBRBaseMaterial","PBRBaseSimpleMaterial","PBRMaterial","PBRMetallicRoughnessMaterial","PBRSpecularGlossinessMaterial","PushMaterial","ShaderMaterial","StandardMaterialDefines","StandardMaterial","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return y[e]}))}(s);var b=r(/*! ./uniformBuffer */"./Materials/uniformBuffer.ts");r.d(t,"UniformBuffer",(function(){return b.UniformBuffer}));var A=r(/*! ./materialFlags */"./Materials/materialFlags.ts");r.d(t,"MaterialFlags",(function(){return A.MaterialFlags}));var T=r(/*! ./Node/index */"./Materials/Node/index.ts");r.d(t,"NodeMaterialBlockTargets",(function(){return T.NodeMaterialBlockTargets})),r.d(t,"NodeMaterialBlockConnectionPointTypes",(function(){return T.NodeMaterialBlockConnectionPointTypes})),r.d(t,"NodeMaterialBlockConnectionPointMode",(function(){return T.NodeMaterialBlockConnectionPointMode})),r.d(t,"NodeMaterialSystemValues",(function(){return T.NodeMaterialSystemValues})),r.d(t,"NodeMaterialModes",(function(){return T.NodeMaterialModes})),r.d(t,"NodeMaterialConnectionPointCompatibilityStates",(function(){return T.NodeMaterialConnectionPointCompatibilityStates})),r.d(t,"NodeMaterialConnectionPointDirection",(function(){return T.NodeMaterialConnectionPointDirection})),r.d(t,"NodeMaterialConnectionPoint",(function(){return T.NodeMaterialConnectionPoint})),r.d(t,"NodeMaterialBlock",(function(){return T.NodeMaterialBlock})),r.d(t,"NodeMaterialDefines",(function(){return T.NodeMaterialDefines})),r.d(t,"NodeMaterial",(function(){return T.NodeMaterial})),r.d(t,"VertexOutputBlock",(function(){return T.VertexOutputBlock})),r.d(t,"BonesBlock",(function(){return T.BonesBlock})),r.d(t,"InstancesBlock",(function(){return T.InstancesBlock})),r.d(t,"MorphTargetsBlock",(function(){return T.MorphTargetsBlock})),r.d(t,"LightInformationBlock",(function(){return T.LightInformationBlock})),r.d(t,"FragmentOutputBlock",(function(){return T.FragmentOutputBlock})),r.d(t,"ImageProcessingBlock",(function(){return T.ImageProcessingBlock})),r.d(t,"PerturbNormalBlock",(function(){return T.PerturbNormalBlock})),r.d(t,"DiscardBlock",(function(){return T.DiscardBlock})),r.d(t,"FrontFacingBlock",(function(){return T.FrontFacingBlock})),r.d(t,"DerivativeBlock",(function(){return T.DerivativeBlock})),r.d(t,"FragCoordBlock",(function(){return T.FragCoordBlock})),r.d(t,"ScreenSizeBlock",(function(){return T.ScreenSizeBlock})),r.d(t,"FogBlock",(function(){return T.FogBlock})),r.d(t,"LightBlock",(function(){return T.LightBlock})),r.d(t,"TextureBlock",(function(){return T.TextureBlock})),r.d(t,"ReflectionTextureBlock",(function(){return T.ReflectionTextureBlock})),r.d(t,"CurrentScreenBlock",(function(){return T.CurrentScreenBlock})),r.d(t,"InputBlock",(function(){return T.InputBlock})),r.d(t,"AnimatedInputBlockTypes",(function(){return T.AnimatedInputBlockTypes})),r.d(t,"MultiplyBlock",(function(){return T.MultiplyBlock})),r.d(t,"AddBlock",(function(){return T.AddBlock})),r.d(t,"ScaleBlock",(function(){return T.ScaleBlock})),r.d(t,"ClampBlock",(function(){return T.ClampBlock})),r.d(t,"CrossBlock",(function(){return T.CrossBlock})),r.d(t,"DotBlock",(function(){return T.DotBlock})),r.d(t,"TransformBlock",(function(){return T.TransformBlock})),r.d(t,"RemapBlock",(function(){return T.RemapBlock})),r.d(t,"NormalizeBlock",(function(){return T.NormalizeBlock})),r.d(t,"TrigonometryBlockOperations",(function(){return T.TrigonometryBlockOperations})),r.d(t,"TrigonometryBlock",(function(){return T.TrigonometryBlock})),r.d(t,"ColorMergerBlock",(function(){return T.ColorMergerBlock})),r.d(t,"VectorMergerBlock",(function(){return T.VectorMergerBlock})),r.d(t,"ColorSplitterBlock",(function(){return T.ColorSplitterBlock})),r.d(t,"VectorSplitterBlock",(function(){return T.VectorSplitterBlock})),r.d(t,"LerpBlock",(function(){return T.LerpBlock})),r.d(t,"DivideBlock",(function(){return T.DivideBlock})),r.d(t,"SubtractBlock",(function(){return T.SubtractBlock})),r.d(t,"StepBlock",(function(){return T.StepBlock})),r.d(t,"OneMinusBlock",(function(){return T.OneMinusBlock})),r.d(t,"ViewDirectionBlock",(function(){return T.ViewDirectionBlock})),r.d(t,"FresnelBlock",(function(){return T.FresnelBlock})),r.d(t,"MaxBlock",(function(){return T.MaxBlock})),r.d(t,"MinBlock",(function(){return T.MinBlock})),r.d(t,"DistanceBlock",(function(){return T.DistanceBlock})),r.d(t,"LengthBlock",(function(){return T.LengthBlock})),r.d(t,"NegateBlock",(function(){return T.NegateBlock})),r.d(t,"PowBlock",(function(){return T.PowBlock})),r.d(t,"RandomNumberBlock",(function(){return T.RandomNumberBlock})),r.d(t,"ArcTan2Block",(function(){return T.ArcTan2Block})),r.d(t,"SmoothStepBlock",(function(){return T.SmoothStepBlock})),r.d(t,"ReciprocalBlock",(function(){return T.ReciprocalBlock})),r.d(t,"ReplaceColorBlock",(function(){return T.ReplaceColorBlock})),r.d(t,"PosterizeBlock",(function(){return T.PosterizeBlock})),r.d(t,"WaveBlockKind",(function(){return T.WaveBlockKind})),r.d(t,"WaveBlock",(function(){return T.WaveBlock})),r.d(t,"GradientBlockColorStep",(function(){return T.GradientBlockColorStep})),r.d(t,"GradientBlock",(function(){return T.GradientBlock})),r.d(t,"NLerpBlock",(function(){return T.NLerpBlock})),r.d(t,"WorleyNoise3DBlock",(function(){return T.WorleyNoise3DBlock})),r.d(t,"SimplexPerlin3DBlock",(function(){return T.SimplexPerlin3DBlock})),r.d(t,"NormalBlendBlock",(function(){return T.NormalBlendBlock})),r.d(t,"Rotate2dBlock",(function(){return T.Rotate2dBlock})),r.d(t,"ReflectBlock",(function(){return T.ReflectBlock})),r.d(t,"RefractBlock",(function(){return T.RefractBlock})),r.d(t,"DesaturateBlock",(function(){return T.DesaturateBlock})),r.d(t,"PBRMetallicRoughnessBlock",(function(){return T.PBRMetallicRoughnessBlock})),r.d(t,"SheenBlock",(function(){return T.SheenBlock})),r.d(t,"AmbientOcclusionBlock",(function(){return T.AmbientOcclusionBlock})),r.d(t,"ReflectivityBlock",(function(){return T.ReflectivityBlock})),r.d(t,"AnisotropyBlock",(function(){return T.AnisotropyBlock})),r.d(t,"ReflectionBlock",(function(){return T.ReflectionBlock})),r.d(t,"ClearCoatBlock",(function(){return T.ClearCoatBlock})),r.d(t,"RefractionBlock",(function(){return T.RefractionBlock})),r.d(t,"SubSurfaceBlock",(function(){return T.SubSurfaceBlock})),r.d(t,"ParticleTextureBlock",(function(){return T.ParticleTextureBlock})),r.d(t,"ParticleRampGradientBlock",(function(){return T.ParticleRampGradientBlock})),r.d(t,"ParticleBlendMultiplyBlock",(function(){return T.ParticleBlendMultiplyBlock})),r.d(t,"ModBlock",(function(){return T.ModBlock})),r.d(t,"NodeMaterialOptimizer",(function(){return T.NodeMaterialOptimizer})),r.d(t,"PropertyTypeForEdition",(function(){return T.PropertyTypeForEdition})),r.d(t,"editableInPropertyPage",(function(){return T.editableInPropertyPage}));var M=r(/*! ./effectRenderer */"./Materials/effectRenderer.ts");r.d(t,"EffectRenderer",(function(){return M.EffectRenderer})),r.d(t,"EffectWrapper",(function(){return M.EffectWrapper}));var P=r(/*! ./shadowDepthWrapper */"./Materials/shadowDepthWrapper.ts");r.d(t,"ShadowDepthWrapper",(function(){return P.ShadowDepthWrapper}))},"./Materials/material.detailMapConfiguration.ts":
- /*!******************************************************!*\
- !*** ./Materials/material.detailMapConfiguration.ts ***!
- \******************************************************/
- /*! exports provided: DetailMapConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"DetailMapConfiguration",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./material */"./Materials/material.ts"),o=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ./materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ./materialHelper */"./Materials/materialHelper.ts"),l=function(){function e(e){this._texture=null,this.diffuseBlendLevel=.5,this.roughnessBlendLevel=.5,this.bumpLevel=1,this._normalBlendMethod=i.Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){var r=t.getEngine();return!(e._areTexturesDirty&&t.texturesEnabled&&r.getCaps().standardDerivatives&&this._texture&&s.MaterialFlags.DetailTextureEnabled&&!this._texture.isReady())},e.prototype.prepareDefines=function(e,t){if(this._isEnabled){e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;var r=t.getEngine();e._areTexturesDirty&&(r.getCaps().standardDerivatives&&this._texture&&s.MaterialFlags.DetailTextureEnabled&&this._isEnabled?(a.MaterialHelper.PrepareDefinesForMergedUV(this._texture,e,"DETAIL"),e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):e.DETAIL=!1)}else e.DETAIL=!1},e.prototype.bindForSubMesh=function(e,t,r){this._isEnabled&&(e.useUbo&&r&&e.isSync||this._texture&&s.MaterialFlags.DetailTextureEnabled&&(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),a.MaterialHelper.BindTextureMatrix(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&s.MaterialFlags.DetailTextureEnabled&&e.setTexture("detailSampler",this._texture))},e.prototype.hasTexture=function(e){return this._texture===e},e.prototype.getActiveTextures=function(e){this._texture&&e.push(this._texture)},e.prototype.getAnimatables=function(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)},e.prototype.dispose=function(e){var t;e&&(null===(t=this._texture)||void 0===t||t.dispose())},e.prototype.getClassName=function(){return"DetailMap"},e.AddUniforms=function(e){e.push("vDetailInfos")},e.AddSamplers=function(e){e.push("detailSampler")},e.PrepareUniformBuffer=function(e){e.addUniform("vDetailInfos",4),e.addUniform("detailMatrix",16)},e.prototype.copyTo=function(e){o.SerializationHelper.Clone((function(){return e}),this)},e.prototype.serialize=function(){return o.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;o.SerializationHelper.Parse((function(){return n}),e,t,r)},Object(n.__decorate)([Object(o.serializeAsTexture)("detailTexture"),Object(o.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"diffuseBlendLevel",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"roughnessBlendLevel",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"bumpLevel",void 0),Object(n.__decorate)([Object(o.serialize)(),Object(o.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"normalBlendMethod",void 0),Object(n.__decorate)([Object(o.serialize)(),Object(o.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),e}()},"./Materials/material.ts":
- /*!*******************************!*\
- !*** ./Materials/material.ts ***!
- \*******************************/
- /*! exports provided: Material */function(e,t,r){"use strict";r.r(t),r.d(t,"Material",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),c=r(/*! ./uniformBuffer */"./Materials/uniformBuffer.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),h=r(/*! ../Maths/math.plane */"./Maths/math.plane.ts"),f=function(){function e(t,r,n){this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this.onCompiled=null,this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new s.Observable,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=u.Constants.ALPHA_COMBINE,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.disableColorWrite=!1,this.forceDepthWrite=!1,this.depthFunction=0,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this._effect=null,this._useUBO=!1,this._fillMode=e.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._forceAlphaTest=!1,this._transparencyMode=null,this.name=t,this.id=t||o.Tools.RandomId(),this._scene=r||a.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.useRightHandedSystem?this.sideOrientation=e.ClockWiseSideOrientation:this.sideOrientation=e.CounterClockWiseSideOrientation,this._uniformBuffer=new c.UniformBuffer(this._scene.getEngine()),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,n||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={})}return Object.defineProperty(e.prototype,"canRenderToMRT",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backFaceCulling",{get:function(){return this._backFaceCulling},set:function(t){this._backFaceCulling!==t&&(this._backFaceCulling=t,this.markAsDirty(e.TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRenderTargetTextures",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new s.Observable),this._onBindObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBind",{set:function(e){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onUnBindObservable",{get:function(){return this._onUnBindObservable||(this._onUnBindObservable=new s.Observable),this._onUnBindObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onEffectCreatedObservable",{get:function(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new s.Observable),this._onEffectCreatedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaMode",{get:function(){return this._alphaMode},set:function(t){this._alphaMode!==t&&(this._alphaMode=t,this.markAsDirty(e.TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needDepthPrePass",{get:function(){return this._needDepthPrePass},set:function(e){this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fogEnabled",{get:function(){return this._fogEnabled},set:function(t){this._fogEnabled!==t&&(this._fogEnabled=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wireframe",{get:function(){switch(this._fillMode){case e.WireFrameFillMode:case e.LineListDrawMode:case e.LineLoopDrawMode:case e.LineStripDrawMode:return!0}return this._scene.forceWireframe},set:function(t){this.fillMode=t?e.WireFrameFillMode:e.TriangleFillMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsCloud",{get:function(){switch(this._fillMode){case e.PointFillMode:case e.PointListDrawMode:return!0}return this._scene.forcePointsCloud},set:function(t){this.fillMode=t?e.PointFillMode:e.TriangleFillMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(t){this._fillMode!==t&&(this._fillMode=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!1,configurable:!0}),e.prototype.toString=function(e){return"Name: "+this.name},e.prototype.getClassName=function(){return"Material"},Object.defineProperty(e.prototype,"isFrozen",{get:function(){return this.checkReadyOnlyOnce},enumerable:!1,configurable:!0}),e.prototype.freeze=function(){this.markDirty(),this.checkReadyOnlyOnce=!0},e.prototype.unfreeze=function(){this.markDirty(),this.checkReadyOnlyOnce=!1},e.prototype.isReady=function(e,t){return!0},e.prototype.isReadyForSubMesh=function(e,t,r){return!1},e.prototype.getEffect=function(){return this._effect},e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"transparencyMode",{get:function(){return this._transparencyMode},set:function(t){this._transparencyMode!==t&&(this._transparencyMode=t,this._forceAlphaTest=t===e.MATERIAL_ALPHATESTANDBLEND,this._markAllSubMeshesAsTexturesAndMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_disableAlphaBlending",{get:function(){return this._transparencyMode===e.MATERIAL_OPAQUE||this._transparencyMode===e.MATERIAL_ALPHATEST},enumerable:!1,configurable:!0}),e.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&this.alpha<1},e.prototype.needAlphaBlendingForMesh=function(e){return!(this._disableAlphaBlending&&e.visibility>=1)&&(this.needAlphaBlending()||e.visibility<1||e.hasVertexAlpha)},e.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest},e.prototype._shouldTurnAlphaTestOn=function(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.markDirty=function(){for(var e=0,t=this.getScene().meshes;e<t.length;e++){var r=t[e];if(r.subMeshes)for(var n=0,i=r.subMeshes;n<i.length;n++){var o=i[n];o.getMaterial()===this&&o.effect&&(o.effect._wasPreviouslyReady=!1)}}},e.prototype._preBind=function(t,r){void 0===r&&(r=null);var n=this._scene.getEngine(),i=(null==r?this.sideOrientation:r)===e.ClockWiseSideOrientation;return n.enableEffect(t||this._effect),n.setState(this.backFaceCulling,this.zOffset,!1,i),i},e.prototype.bind=function(e,t){},e.prototype.bindForSubMesh=function(e,t,r){},e.prototype.bindOnlyWorldMatrix=function(e){},e.prototype.bindSceneUniformBuffer=function(e,t){t.bindToEffect(e,"Scene")},e.prototype.bindView=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("view",this.getScene().getViewMatrix())},e.prototype.bindViewProjection=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("viewProjection",this.getScene().getTransformMatrix())},e.prototype._afterBind=function(e){if(this._scene._cachedMaterial=this,this._scene._cachedVisibility=e?e.visibility:1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){var t=this._scene.getEngine();this._cachedDepthWriteState=t.getDepthWrite(),t.setDepthWrite(!1)}this.disableColorWrite&&(t=this._scene.getEngine(),this._cachedColorWriteState=t.getColorWrite(),t.setColorWrite(!1)),0!==this.depthFunction&&(t=this._scene.getEngine(),this._cachedDepthFunctionState=t.getDepthFunction()||0,t.setDepthFunction(this.depthFunction))},e.prototype.unbind=function(){this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),0!==this.depthFunction&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)},e.prototype.getActiveTextures=function(){return[]},e.prototype.hasTexture=function(e){return!1},e.prototype.clone=function(e){return null},e.prototype.getBindedMeshes=function(){var e=this;if(this.meshMap){var t=new Array;for(var r in this.meshMap){var n=this.meshMap[r];n&&t.push(n)}return t}return this._scene.meshes.filter((function(t){return t.material===e}))},e.prototype.forceCompilation=function(e,t,r,i){var o=this,s=Object(n.__assign)({clipPlane:!1,useInstances:!1},r),a=this.getScene(),c=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;var u=function(){if(o._scene&&o._scene.getEngine()){var r=a.clipPlane;if(s.clipPlane&&(a.clipPlane=new h.Plane(0,0,0,1)),o._storeEffectOnSubMeshes){var n=!0,d=null;if(e.subMeshes){var f=new l.SubMesh(0,0,0,0,0,e,void 0,!1,!1);f._materialDefines&&(f._materialDefines._renderId=-1),o.isReadyForSubMesh(e,f,s.useInstances)||(f.effect&&f.effect.getCompilationError()&&f.effect.allFallbacksProcessed()?d=f.effect.getCompilationError():(n=!1,setTimeout(u,16)))}n&&(o.allowShaderHotSwapping=c,d&&i&&i(d),t&&t(o))}else o.isReady()?(o.allowShaderHotSwapping=c,t&&t(o)):setTimeout(u,16);s.clipPlane&&(a.clipPlane=r)}};u()},e.prototype.forceCompilationAsync=function(e,t){var r=this;return new Promise((function(n,i){r.forceCompilation(e,(function(){n()}),t,(function(e){i(e)}))}))},e.prototype.markAsDirty=function(t){this.getScene().blockMaterialDirtyMechanism||(e._DirtyCallbackArray.length=0,t&e.TextureDirtyFlag&&e._DirtyCallbackArray.push(e._TextureDirtyCallBack),t&e.LightDirtyFlag&&e._DirtyCallbackArray.push(e._LightsDirtyCallBack),t&e.FresnelDirtyFlag&&e._DirtyCallbackArray.push(e._FresnelDirtyCallBack),t&e.AttributesDirtyFlag&&e._DirtyCallbackArray.push(e._AttributeDirtyCallBack),t&e.MiscDirtyFlag&&e._DirtyCallbackArray.push(e._MiscDirtyCallBack),e._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(e._RunDirtyCallBacks),this.getScene().resetCachedMaterial())},e.prototype._markAllSubMeshesAsDirty=function(e){if(!this.getScene().blockMaterialDirtyMechanism)for(var t=0,r=this.getScene().meshes;t<r.length;t++){var n=r[t];if(n.subMeshes)for(var i=0,o=n.subMeshes;i<o.length;i++){var s=o[i];s.getMaterial()===this&&s._materialDefines&&e(s._materialDefines)}}},e.prototype._markScenePrePassDirty=function(){if(!this.getScene().blockMaterialDirtyMechanism){var e=this.getScene().enablePrePassRenderer();e&&e.markAsDirty()}},e.prototype._markAllSubMeshesAsAllDirty=function(){this._markAllSubMeshesAsDirty(e._AllDirtyCallBack)},e.prototype._markAllSubMeshesAsImageProcessingDirty=function(){this._markAllSubMeshesAsDirty(e._ImageProcessingDirtyCallBack)},e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._markAllSubMeshesAsDirty(e._TextureDirtyCallBack)},e.prototype._markAllSubMeshesAsFresnelDirty=function(){this._markAllSubMeshesAsDirty(e._FresnelDirtyCallBack)},e.prototype._markAllSubMeshesAsFresnelAndMiscDirty=function(){this._markAllSubMeshesAsDirty(e._FresnelAndMiscDirtyCallBack)},e.prototype._markAllSubMeshesAsLightsDirty=function(){this._markAllSubMeshesAsDirty(e._LightsDirtyCallBack)},e.prototype._markAllSubMeshesAsAttributesDirty=function(){this._markAllSubMeshesAsDirty(e._AttributeDirtyCallBack)},e.prototype._markAllSubMeshesAsMiscDirty=function(){this._markAllSubMeshesAsDirty(e._MiscDirtyCallBack)},e.prototype._markAllSubMeshesAsTexturesAndMiscDirty=function(){this._markAllSubMeshesAsDirty(e._TextureAndMiscDirtyCallBack)},e.prototype.setPrePassRenderer=function(e){return!1},e.prototype.dispose=function(e,t,r){var n=this.getScene();if(n.stopAnimation(this),n.freeProcessedMaterials(),n.removeMaterial(this),!0!==r)if(this.meshMap)for(var i in this.meshMap)(a=this.meshMap[i])&&(a.material=null,this.releaseVertexArrayObject(a,e));else for(var o=0,s=n.meshes;o<s.length;o++){var a;(a=s[o]).material!==this||a.sourceMesh||(a.material=null,this.releaseVertexArrayObject(a,e))}this._uniformBuffer.dispose(),e&&this._effect&&(this._storeEffectOnSubMeshes||this._effect.dispose(),this._effect=null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear()},e.prototype.releaseVertexArrayObject=function(e,t){if(e.geometry){var r=e.geometry;if(this._storeEffectOnSubMeshes)for(var n=0,i=e.subMeshes;n<i.length;n++){var o=i[n];r._releaseVertexArrayObject(o._materialEffect),t&&o._materialEffect&&o._materialEffect.dispose()}else r._releaseVertexArrayObject(this._effect)}},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.Parse=function(e,t,r){if(e.customType){if("BABYLON.PBRMaterial"===e.customType&&e.overloadedAlbedo&&(e.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return d.Logger.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null}else e.customType="BABYLON.StandardMaterial";return o.Tools.Instantiate(e.customType).Parse(e,t,r)},e.TriangleFillMode=u.Constants.MATERIAL_TriangleFillMode,e.WireFrameFillMode=u.Constants.MATERIAL_WireFrameFillMode,e.PointFillMode=u.Constants.MATERIAL_PointFillMode,e.PointListDrawMode=u.Constants.MATERIAL_PointListDrawMode,e.LineListDrawMode=u.Constants.MATERIAL_LineListDrawMode,e.LineLoopDrawMode=u.Constants.MATERIAL_LineLoopDrawMode,e.LineStripDrawMode=u.Constants.MATERIAL_LineStripDrawMode,e.TriangleStripDrawMode=u.Constants.MATERIAL_TriangleStripDrawMode,e.TriangleFanDrawMode=u.Constants.MATERIAL_TriangleFanDrawMode,e.ClockWiseSideOrientation=u.Constants.MATERIAL_ClockWiseSideOrientation,e.CounterClockWiseSideOrientation=u.Constants.MATERIAL_CounterClockWiseSideOrientation,e.TextureDirtyFlag=u.Constants.MATERIAL_TextureDirtyFlag,e.LightDirtyFlag=u.Constants.MATERIAL_LightDirtyFlag,e.FresnelDirtyFlag=u.Constants.MATERIAL_FresnelDirtyFlag,e.AttributesDirtyFlag=u.Constants.MATERIAL_AttributesDirtyFlag,e.MiscDirtyFlag=u.Constants.MATERIAL_MiscDirtyFlag,e.AllDirtyFlag=u.Constants.MATERIAL_AllDirtyFlag,e.MATERIAL_OPAQUE=0,e.MATERIAL_ALPHATEST=1,e.MATERIAL_ALPHABLEND=2,e.MATERIAL_ALPHATESTANDBLEND=3,e.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,e.MATERIAL_NORMALBLENDMETHOD_RNM=1,e._AllDirtyCallBack=function(e){return e.markAllAsDirty()},e._ImageProcessingDirtyCallBack=function(e){return e.markAsImageProcessingDirty()},e._TextureDirtyCallBack=function(e){return e.markAsTexturesDirty()},e._FresnelDirtyCallBack=function(e){return e.markAsFresnelDirty()},e._MiscDirtyCallBack=function(e){return e.markAsMiscDirty()},e._LightsDirtyCallBack=function(e){return e.markAsLightDirty()},e._AttributeDirtyCallBack=function(e){return e.markAsAttributesDirty()},e._FresnelAndMiscDirtyCallBack=function(t){e._FresnelDirtyCallBack(t),e._MiscDirtyCallBack(t)},e._TextureAndMiscDirtyCallBack=function(t){e._TextureDirtyCallBack(t),e._MiscDirtyCallBack(t)},e._DirtyCallbackArray=[],e._RunDirtyCallBacks=function(t){for(var r=0,n=e._DirtyCallbackArray;r<n.length;r++)(0,n[r])(t)},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"id",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"uniqueId",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"name",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"checkReadyOnEveryCall",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"checkReadyOnlyOnce",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"state",void 0),Object(n.__decorate)([Object(i.serialize)("alpha")],e.prototype,"_alpha",void 0),Object(n.__decorate)([Object(i.serialize)("backFaceCulling")],e.prototype,"_backFaceCulling",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"sideOrientation",void 0),Object(n.__decorate)([Object(i.serialize)("alphaMode")],e.prototype,"_alphaMode",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_needDepthPrePass",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"disableDepthWrite",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"disableColorWrite",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"forceDepthWrite",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"depthFunction",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"separateCullingPass",void 0),Object(n.__decorate)([Object(i.serialize)("fogEnabled")],e.prototype,"_fogEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"pointSize",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"zOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"pointsCloud",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"fillMode",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"transparencyMode",null),e}()},"./Materials/materialDefines.ts":
- /*!**************************************!*\
- !*** ./Materials/materialDefines.ts ***!
- \**************************************/
- /*! exports provided: MaterialDefines */function(e,t,r){"use strict";r.r(t),r.d(t,"MaterialDefines",(function(){return n}));var n=function(){function e(){this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),e.prototype.markAsProcessed=function(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._areImageProcessingDirty=!1},e.prototype.markAsUnprocessed=function(){this._isDirty=!0},e.prototype.markAllAsDirty=function(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0},e.prototype.markAsImageProcessingDirty=function(){this._areImageProcessingDirty=!0,this._isDirty=!0},e.prototype.markAsLightDirty=function(e){void 0===e&&(e=!1),this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0},e.prototype.markAsAttributesDirty=function(){this._areAttributesDirty=!0,this._isDirty=!0},e.prototype.markAsTexturesDirty=function(){this._areTexturesDirty=!0,this._isDirty=!0},e.prototype.markAsFresnelDirty=function(){this._areFresnelDirty=!0,this._isDirty=!0},e.prototype.markAsMiscDirty=function(){this._areMiscDirty=!0,this._isDirty=!0},e.prototype.rebuild=function(){this._keys&&delete this._keys,this._keys=[];for(var e=0,t=Object.keys(this);e<t.length;e++){var r=t[e];"_"!==r[0]&&this._keys.push(r)}},e.prototype.isEqual=function(e){if(this._keys.length!==e._keys.length)return!1;for(var t=0;t<this._keys.length;t++){var r=this._keys[t];if(this[r]!==e[r])return!1}return!0},e.prototype.cloneTo=function(e){this._keys.length!==e._keys.length&&(e._keys=this._keys.slice(0));for(var t=0;t<this._keys.length;t++){var r=this._keys[t];e[r]=this[r]}},e.prototype.reset=function(){for(var e=0;e<this._keys.length;e++){var t=this._keys[e];switch(typeof this[t]){case"number":this[t]=0;break;case"string":this[t]="";break;default:this[t]=!1}}},e.prototype.toString=function(){for(var e="",t=0;t<this._keys.length;t++){var r=this._keys[t],n=this[r];switch(typeof n){case"number":case"string":e+="#define "+r+" "+n+"\n";break;default:n&&(e+="#define "+r+"\n")}}return e},e}()},"./Materials/materialFlags.ts":
- /*!************************************!*\
- !*** ./Materials/materialFlags.ts ***!
- \************************************/
- /*! exports provided: MaterialFlags */function(e,t,r){"use strict";r.r(t),r.d(t,"MaterialFlags",(function(){return o}));var n=r(/*! ../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=function(){function e(){}return Object.defineProperty(e,"DiffuseTextureEnabled",{get:function(){return this._DiffuseTextureEnabled},set:function(e){this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DetailTextureEnabled",{get:function(){return this._DetailTextureEnabled},set:function(e){this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AmbientTextureEnabled",{get:function(){return this._AmbientTextureEnabled},set:function(e){this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"OpacityTextureEnabled",{get:function(){return this._OpacityTextureEnabled},set:function(e){this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ReflectionTextureEnabled",{get:function(){return this._ReflectionTextureEnabled},set:function(e){this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EmissiveTextureEnabled",{get:function(){return this._EmissiveTextureEnabled},set:function(e){this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SpecularTextureEnabled",{get:function(){return this._SpecularTextureEnabled},set:function(e){this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"BumpTextureEnabled",{get:function(){return this._BumpTextureEnabled},set:function(e){this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LightmapTextureEnabled",{get:function(){return this._LightmapTextureEnabled},set:function(e){this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RefractionTextureEnabled",{get:function(){return this._RefractionTextureEnabled},set:function(e){this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ColorGradingTextureEnabled",{get:function(){return this._ColorGradingTextureEnabled},set:function(e){this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"FresnelEnabled",{get:function(){return this._FresnelEnabled},set:function(e){this._FresnelEnabled!==e&&(this._FresnelEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_FresnelDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ClearCoatTextureEnabled",{get:function(){return this._ClearCoatTextureEnabled},set:function(e){this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ClearCoatBumpTextureEnabled",{get:function(){return this._ClearCoatBumpTextureEnabled},set:function(e){this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ClearCoatTintTextureEnabled",{get:function(){return this._ClearCoatTintTextureEnabled},set:function(e){this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SheenTextureEnabled",{get:function(){return this._SheenTextureEnabled},set:function(e){this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"AnisotropicTextureEnabled",{get:function(){return this._AnisotropicTextureEnabled},set:function(e){this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ThicknessTextureEnabled",{get:function(){return this._ThicknessTextureEnabled},set:function(e){this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,n.Engine.MarkAllMaterialsAsDirty(i.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),e._DiffuseTextureEnabled=!0,e._DetailTextureEnabled=!0,e._AmbientTextureEnabled=!0,e._OpacityTextureEnabled=!0,e._ReflectionTextureEnabled=!0,e._EmissiveTextureEnabled=!0,e._SpecularTextureEnabled=!0,e._BumpTextureEnabled=!0,e._LightmapTextureEnabled=!0,e._RefractionTextureEnabled=!0,e._ColorGradingTextureEnabled=!0,e._FresnelEnabled=!0,e._ClearCoatTextureEnabled=!0,e._ClearCoatBumpTextureEnabled=!0,e._ClearCoatTintTextureEnabled=!0,e._SheenTextureEnabled=!0,e._AnisotropicTextureEnabled=!0,e._ThicknessTextureEnabled=!0,e}()},"./Materials/materialHelper.ts":
- /*!*************************************!*\
- !*** ./Materials/materialHelper.ts ***!
- \*************************************/
- /*! exports provided: MaterialHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"MaterialHelper",(function(){return c}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../scene */"./scene.ts"),o=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Lights/light */"./Lights/light.ts"),l=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=function(){function e(){}return e.BindEyePosition=function(e,t,r){if(void 0===r&&(r="vEyePosition"),t._forcedViewPosition)e.setVector3(r,t._forcedViewPosition);else{var n=t.activeCamera.globalPosition;n||(n=t.activeCamera.devicePosition),e.setVector3(r,t._mirroredCameraPosition?t._mirroredCameraPosition:n)}},e.PrepareDefinesForMergedUV=function(e,t,r){t._needUVs=!0,t[r]=!0,e.getTextureMatrix().isIdentityAs3x2()?(t[r+"DIRECTUV"]=e.coordinatesIndex+1,0===e.coordinatesIndex?t.MAINUV1=!0:t.MAINUV2=!0):t[r+"DIRECTUV"]=0},e.BindTextureMatrix=function(e,t,r){var n=e.getTextureMatrix();t.updateMatrix(r+"Matrix",n)},e.GetFogState=function(e,t){return t.fogEnabled&&e.applyFog&&t.fogMode!==i.Scene.FOGMODE_NONE},e.PrepareDefinesForMisc=function(e,t,r,n,i,o,s){s._areMiscDirty&&(s.LOGARITHMICDEPTH=r,s.POINTSIZE=n,s.FOG=i&&this.GetFogState(e,t),s.NONUNIFORMSCALING=e.nonUniformScaling,s.ALPHATEST=o)},e.PrepareDefinesForFrameBoundValues=function(e,t,r,n,i,o){void 0===i&&(i=null),void 0===o&&(o=!1);var s,a,l,c,u,d,h=!1;s=null==i?void 0!==e.clipPlane&&null!==e.clipPlane:i,a=null==i?void 0!==e.clipPlane2&&null!==e.clipPlane2:i,l=null==i?void 0!==e.clipPlane3&&null!==e.clipPlane3:i,c=null==i?void 0!==e.clipPlane4&&null!==e.clipPlane4:i,u=null==i?void 0!==e.clipPlane5&&null!==e.clipPlane5:i,d=null==i?void 0!==e.clipPlane6&&null!==e.clipPlane6:i,r.CLIPPLANE!==s&&(r.CLIPPLANE=s,h=!0),r.CLIPPLANE2!==a&&(r.CLIPPLANE2=a,h=!0),r.CLIPPLANE3!==l&&(r.CLIPPLANE3=l,h=!0),r.CLIPPLANE4!==c&&(r.CLIPPLANE4=c,h=!0),r.CLIPPLANE5!==u&&(r.CLIPPLANE5=u,h=!0),r.CLIPPLANE6!==d&&(r.CLIPPLANE6=d,h=!0),r.DEPTHPREPASS!==!t.getColorWrite()&&(r.DEPTHPREPASS=!r.DEPTHPREPASS,h=!0),r.INSTANCES!==n&&(r.INSTANCES=n,h=!0),r.THIN_INSTANCES!==o&&(r.THIN_INSTANCES=o,h=!0),h&&r.markAsUnprocessed()},e.PrepareDefinesForBones=function(e,t){if(e.useBones&&e.computeBonesUsingShaders&&e.skeleton){t.NUM_BONE_INFLUENCERS=e.numBoneInfluencers;var r=void 0!==t.BONETEXTURE;e.skeleton.isUsingTextureForMatrices&&r?t.BONETEXTURE=!0:(t.BonesPerMesh=e.skeleton.bones.length+1,t.BONETEXTURE=!r&&void 0)}else t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0},e.PrepareDefinesForMorphTargets=function(e,t){var r=e.morphTargetManager;r?(t.MORPHTARGETS_UV=r.supportsUVs&&t.UV1,t.MORPHTARGETS_TANGENT=r.supportsTangents&&t.TANGENT,t.MORPHTARGETS_NORMAL=r.supportsNormals&&t.NORMAL,t.MORPHTARGETS=r.numInfluencers>0,t.NUM_MORPH_INFLUENCERS=r.numInfluencers):(t.MORPHTARGETS_UV=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)},e.PrepareDefinesForAttributes=function(e,t,r,n,i,o){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!t._areAttributesDirty&&t._needNormals===t._normals&&t._needUVs===t._uvs)return!1;if(t._normals=t._needNormals,t._uvs=t._needUVs,t.NORMAL=t._needNormals&&e.isVerticesDataPresent(s.VertexBuffer.NormalKind),t._needNormals&&e.isVerticesDataPresent(s.VertexBuffer.TangentKind)&&(t.TANGENT=!0),t._needUVs?(t.UV1=e.isVerticesDataPresent(s.VertexBuffer.UVKind),t.UV2=e.isVerticesDataPresent(s.VertexBuffer.UV2Kind)):(t.UV1=!1,t.UV2=!1),r){var a=e.useVertexColors&&e.isVerticesDataPresent(s.VertexBuffer.ColorKind);t.VERTEXCOLOR=a,t.VERTEXALPHA=e.hasVertexAlpha&&a&&o}return n&&this.PrepareDefinesForBones(e,t),i&&this.PrepareDefinesForMorphTargets(e,t),!0},e.PrepareDefinesForMultiview=function(e,t){if(e.activeCamera){var r=t.MULTIVIEW;t.MULTIVIEW=null!==e.activeCamera.outputRenderTarget&&e.activeCamera.outputRenderTarget.getViewCount()>1,t.MULTIVIEW!=r&&t.markAsUnprocessed()}},e.PrepareDefinesForPrePass=function(e,t,r){var n=t.PREPASS;e.prePassRenderer&&r?(t.PREPASS=!0,t.SCENE_MRT_COUNT=e.prePassRenderer.mrtCount):t.PREPASS=!1,t.PREPASS!=n&&(t.markAsUnprocessed(),t.markAsImageProcessingDirty())},e.PrepareDefinesForLight=function(e,t,r,n,i,o,s){switch(s.needNormals=!0,void 0===i["LIGHT"+n]&&(s.needRebuild=!0),i["LIGHT"+n]=!0,i["SPOTLIGHT"+n]=!1,i["HEMILIGHT"+n]=!1,i["POINTLIGHT"+n]=!1,i["DIRLIGHT"+n]=!1,r.prepareLightSpecificDefines(i,n),i["LIGHT_FALLOFF_PHYSICAL"+n]=!1,i["LIGHT_FALLOFF_GLTF"+n]=!1,i["LIGHT_FALLOFF_STANDARD"+n]=!1,r.falloffType){case a.Light.FALLOFF_GLTF:i["LIGHT_FALLOFF_GLTF"+n]=!0;break;case a.Light.FALLOFF_PHYSICAL:i["LIGHT_FALLOFF_PHYSICAL"+n]=!0;break;case a.Light.FALLOFF_STANDARD:i["LIGHT_FALLOFF_STANDARD"+n]=!0}if(o&&!r.specular.equalsFloats(0,0,0)&&(s.specularEnabled=!0),i["SHADOW"+n]=!1,i["SHADOWCSM"+n]=!1,i["SHADOWCSMDEBUG"+n]=!1,i["SHADOWCSMNUM_CASCADES"+n]=!1,i["SHADOWCSMUSESHADOWMAXZ"+n]=!1,i["SHADOWCSMNOBLEND"+n]=!1,i["SHADOWCSM_RIGHTHANDED"+n]=!1,i["SHADOWPCF"+n]=!1,i["SHADOWPCSS"+n]=!1,i["SHADOWPOISSON"+n]=!1,i["SHADOWESM"+n]=!1,i["SHADOWCUBE"+n]=!1,i["SHADOWLOWQUALITY"+n]=!1,i["SHADOWMEDIUMQUALITY"+n]=!1,t&&t.receiveShadows&&e.shadowsEnabled&&r.shadowEnabled){var l=r.getShadowGenerator();if(l){var c=l.getShadowMap();c&&c.renderList&&c.renderList.length>0&&(s.shadowEnabled=!0,l.prepareDefines(i,n))}}r.lightmapMode!=a.Light.LIGHTMAP_DEFAULT?(s.lightmapMode=!0,i["LIGHTMAPEXCLUDED"+n]=!0,i["LIGHTMAPNOSPECULAR"+n]=r.lightmapMode==a.Light.LIGHTMAP_SHADOWSONLY):(i["LIGHTMAPEXCLUDED"+n]=!1,i["LIGHTMAPNOSPECULAR"+n]=!1)},e.PrepareDefinesForLights=function(e,t,r,n,i,o){if(void 0===i&&(i=4),void 0===o&&(o=!1),!r._areLightsDirty)return r._needNormals;var s=0,a={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(e.lightsEnabled&&!o)for(var l=0,c=t.lightSources;l<c.length;l++){var u=c[l];if(this.PrepareDefinesForLight(e,t,u,s,r,n,a),++s===i)break}r.SPECULARTERM=a.specularEnabled,r.SHADOWS=a.shadowEnabled;for(var d=s;d<i;d++)void 0!==r["LIGHT"+d]&&(r["LIGHT"+d]=!1,r["HEMILIGHT"+d]=!1,r["POINTLIGHT"+d]=!1,r["DIRLIGHT"+d]=!1,r["SPOTLIGHT"+d]=!1,r["SHADOW"+d]=!1,r["SHADOWCSM"+d]=!1,r["SHADOWCSMDEBUG"+d]=!1,r["SHADOWCSMNUM_CASCADES"+d]=!1,r["SHADOWCSMUSESHADOWMAXZ"+d]=!1,r["SHADOWCSMNOBLEND"+d]=!1,r["SHADOWCSM_RIGHTHANDED"+d]=!1,r["SHADOWPCF"+d]=!1,r["SHADOWPCSS"+d]=!1,r["SHADOWPOISSON"+d]=!1,r["SHADOWESM"+d]=!1,r["SHADOWCUBE"+d]=!1,r["SHADOWLOWQUALITY"+d]=!1,r["SHADOWMEDIUMQUALITY"+d]=!1);var h=e.getEngine().getCaps();return void 0===r.SHADOWFLOAT&&(a.needRebuild=!0),r.SHADOWFLOAT=a.shadowEnabled&&(h.textureFloatRender&&h.textureFloatLinearFiltering||h.textureHalfFloatRender&&h.textureHalfFloatLinearFiltering),r.LIGHTMAPEXCLUDED=a.lightmapMode,a.needRebuild&&r.rebuild(),a.needNormals},e.PrepareUniformsAndSamplersForLight=function(e,t,r,n,i){void 0===i&&(i=null),t.push("vLightData"+e,"vLightDiffuse"+e,"vLightSpecular"+e,"vLightDirection"+e,"vLightFalloff"+e,"vLightGround"+e,"lightMatrix"+e,"shadowsInfo"+e,"depthValues"+e),i&&i.push("Light"+e),r.push("shadowSampler"+e),r.push("depthSampler"+e),t.push("viewFrustumZ"+e,"cascadeBlendFactor"+e,"lightSizeUVCorrection"+e,"depthCorrection"+e,"penumbraDarkness"+e,"frustumLengths"+e),n&&(r.push("projectionLightSampler"+e),t.push("textureProjectionMatrix"+e))},e.PrepareUniformsAndSamplersList=function(e,t,r,n){var i;void 0===n&&(n=4);var o=null;if(e.uniformsNames){var s=e;i=s.uniformsNames,o=s.uniformBuffersNames,t=s.samplers,r=s.defines,n=s.maxSimultaneousLights||0}else i=e,t||(t=[]);for(var a=0;a<n&&r["LIGHT"+a];a++)this.PrepareUniformsAndSamplersForLight(a,i,t,r["PROJECTEDLIGHTTEXTURE"+a],o);r.NUM_MORPH_INFLUENCERS&&i.push("morphTargetInfluences")},e.HandleFallbacksForShadows=function(e,t,r,n){void 0===r&&(r=4),void 0===n&&(n=0);for(var i=0,o=0;o<r&&e["LIGHT"+o];o++)o>0&&(i=n+o,t.addFallback(i,"LIGHT"+o)),e.SHADOWS||(e["SHADOW"+o]&&t.addFallback(n,"SHADOW"+o),e["SHADOWPCF"+o]&&t.addFallback(n,"SHADOWPCF"+o),e["SHADOWPCSS"+o]&&t.addFallback(n,"SHADOWPCSS"+o),e["SHADOWPOISSON"+o]&&t.addFallback(n,"SHADOWPOISSON"+o),e["SHADOWESM"+o]&&t.addFallback(n,"SHADOWESM"+o));return i++},e.PrepareAttributesForMorphTargetsInfluencers=function(e,t,r){this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS=r,this.PrepareAttributesForMorphTargets(e,t,this._TmpMorphInfluencers)},e.PrepareAttributesForMorphTargets=function(e,t,r){var i=r.NUM_MORPH_INFLUENCERS;if(i>0&&o.EngineStore.LastCreatedEngine)for(var a=o.EngineStore.LastCreatedEngine.getCaps().maxVertexAttribs,l=t.morphTargetManager,c=l&&l.supportsNormals&&r.NORMAL,u=l&&l.supportsTangents&&r.TANGENT,d=l&&l.supportsUVs&&r.UV1,h=0;h<i;h++)e.push(s.VertexBuffer.PositionKind+h),c&&e.push(s.VertexBuffer.NormalKind+h),u&&e.push(s.VertexBuffer.TangentKind+h),d&&e.push(s.VertexBuffer.UVKind+"_"+h),e.length>a&&n.Logger.Error("Cannot add more vertex attributes for mesh "+t.name)},e.PrepareAttributesForBones=function(e,t,r,n){r.NUM_BONE_INFLUENCERS>0&&(n.addCPUSkinningFallback(0,t),e.push(s.VertexBuffer.MatricesIndicesKind),e.push(s.VertexBuffer.MatricesWeightsKind),r.NUM_BONE_INFLUENCERS>4&&(e.push(s.VertexBuffer.MatricesIndicesExtraKind),e.push(s.VertexBuffer.MatricesWeightsExtraKind)))},e.PrepareAttributesForInstances=function(e,t){(t.INSTANCES||t.THIN_INSTANCES)&&this.PushAttributesForInstances(e)},e.PushAttributesForInstances=function(e){e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3")},e.BindLightProperties=function(e,t,r){e.transferToEffect(t,r+"")},e.BindLight=function(e,t,r,n,i,o){void 0===o&&(o=!1),e._bindLight(t,r,n,i,o)},e.BindLights=function(e,t,r,n,i,o){void 0===i&&(i=4),void 0===o&&(o=!1);for(var s=Math.min(t.lightSources.length,i),a=0;a<s;a++){var l=t.lightSources[a];this.BindLight(l,a,e,r,"boolean"==typeof n?n:n.SPECULARTERM,o)}},e.BindFogParameters=function(e,t,r,n){void 0===n&&(n=!1),e.fogEnabled&&t.applyFog&&e.fogMode!==i.Scene.FOGMODE_NONE&&(r.setFloat4("vFogInfos",e.fogMode,e.fogStart,e.fogEnd,e.fogDensity),n?(e.fogColor.toLinearSpaceToRef(this._tempFogColor),r.setColor3("vFogColor",this._tempFogColor)):r.setColor3("vFogColor",e.fogColor))},e.BindBonesParameters=function(e,t){if(t&&e&&(e.computeBonesUsingShaders&&t._bonesComputationForcedToCPU&&(e.computeBonesUsingShaders=!1),e.useBones&&e.computeBonesUsingShaders&&e.skeleton)){var r=e.skeleton;if(r.isUsingTextureForMatrices&&t.getUniformIndex("boneTextureWidth")>-1){var n=r.getTransformMatrixTexture(e);t.setTexture("boneSampler",n),t.setFloat("boneTextureWidth",4*(r.bones.length+1))}else{var i=r.getTransformMatrices(e);i&&t.setMatrices("mBones",i)}}},e.BindMorphTargetParameters=function(e,t){var r=e.morphTargetManager;e&&r&&t.setFloatArray("morphTargetInfluences",r.influences)},e.BindLogDepth=function(e,t,r){e.LOGARITHMICDEPTH&&t.setFloat("logarithmicDepthConstant",2/(Math.log(r.activeCamera.maxZ+1)/Math.LN2))},e.BindClipPlane=function(e,t){if(t.clipPlane){var r=t.clipPlane;e.setFloat4("vClipPlane",r.normal.x,r.normal.y,r.normal.z,r.d)}t.clipPlane2&&(r=t.clipPlane2,e.setFloat4("vClipPlane2",r.normal.x,r.normal.y,r.normal.z,r.d)),t.clipPlane3&&(r=t.clipPlane3,e.setFloat4("vClipPlane3",r.normal.x,r.normal.y,r.normal.z,r.d)),t.clipPlane4&&(r=t.clipPlane4,e.setFloat4("vClipPlane4",r.normal.x,r.normal.y,r.normal.z,r.d)),t.clipPlane5&&(r=t.clipPlane5,e.setFloat4("vClipPlane5",r.normal.x,r.normal.y,r.normal.z,r.d)),t.clipPlane6&&(r=t.clipPlane6,e.setFloat4("vClipPlane6",r.normal.x,r.normal.y,r.normal.z,r.d))},e._TmpMorphInfluencers={NUM_MORPH_INFLUENCERS:0},e._tempFogColor=l.Color3.Black(),e}()},"./Materials/multiMaterial.ts":
- /*!************************************!*\
- !*** ./Materials/multiMaterial.ts ***!
- \************************************/
- /*! exports provided: MultiMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiMaterial",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/material */"./Materials/material.ts"),o=r(/*! ../Misc/tags */"./Misc/tags.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=function(e){function t(t,r){var n=e.call(this,t,r,!0)||this;return r.multiMaterials.push(n),n.subMaterials=new Array,n._storeEffectOnSubMeshes=!0,n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"subMaterials",{get:function(){return this._subMaterials},set:function(e){this._subMaterials=e,this._hookArray(e)},enumerable:!1,configurable:!0}),t.prototype.getChildren=function(){return this.subMaterials},t.prototype._hookArray=function(e){var t=this,r=e.push;e.push=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r.apply(e,n);return t._markAllSubMeshesAsTexturesDirty(),o};var n=e.splice;e.splice=function(r,i){var o=n.apply(e,[r,i]);return t._markAllSubMeshesAsTexturesDirty(),o}},t.prototype.getSubMaterial=function(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]},t.prototype.getActiveTextures=function(){var t;return(t=e.prototype.getActiveTextures.call(this)).concat.apply(t,this.subMaterials.map((function(e){return e?e.getActiveTextures():[]})))},t.prototype.getClassName=function(){return"MultiMaterial"},t.prototype.isReadyForSubMesh=function(e,t,r){for(var n=0;n<this.subMaterials.length;n++){var i=this.subMaterials[n];if(i){if(i._storeEffectOnSubMeshes){if(!i.isReadyForSubMesh(e,t,r))return!1;continue}if(!i.isReady(e))return!1}}return!0},t.prototype.clone=function(e,r){for(var n=new t(e,this.getScene()),i=0;i<this.subMaterials.length;i++){var o=null,s=this.subMaterials[i];o=r&&s?s.clone(e+"-"+s.name):this.subMaterials[i],n.subMaterials.push(o)}return n},t.prototype.serialize=function(){var e={};e.name=this.name,e.id=this.id,o.Tags&&(e.tags=o.Tags.GetTags(this)),e.materials=[];for(var t=0;t<this.subMaterials.length;t++){var r=this.subMaterials[t];r?e.materials.push(r.id):e.materials.push(null)}return e},t.prototype.dispose=function(t,r,n){var i=this.getScene();if(i){if(n)for(var o=0;o<this.subMaterials.length;o++){var s=this.subMaterials[o];s&&s.dispose(t,r)}(o=i.multiMaterials.indexOf(this))>=0&&i.multiMaterials.splice(o,1),e.prototype.dispose.call(this,t,r)}},t.ParseMultiMaterial=function(e,r){var n=new t(e.name,r);n.id=e.id,o.Tags&&o.Tags.AddTagsTo(n,e.tags);for(var i=0;i<e.materials.length;i++){var s=e.materials[i];s?n.subMaterials.push(r.getLastMaterialByID(s)):n.subMaterials.push(null)}return n},t}(i.Material);s._TypeStore.RegisteredTypes["BABYLON.MultiMaterial"]=a},"./Materials/pushMaterial.ts":
- /*!***********************************!*\
- !*** ./Materials/pushMaterial.ts ***!
- \***********************************/
- /*! exports provided: PushMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PushMaterial",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._normalMatrix=new i.Matrix,n._storeEffectOnSubMeshes=!0,n}return Object(n.__extends)(t,e),t.prototype.getEffect=function(){return this._activeEffect},t.prototype.isReady=function(e,t){return!!e&&(!e.subMeshes||0===e.subMeshes.length||this.isReadyForSubMesh(e,e.subMeshes[0],t))},t.prototype._isReadyForSubMesh=function(e){var t=e._materialDefines;return!(this.checkReadyOnEveryCall||!e.effect||!t||t._renderId!==this.getScene().getRenderId())},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindOnlyNormalMatrix=function(e){this._activeEffect.setMatrix("normalMatrix",e)},t.prototype.bind=function(e,t){t&&this.bindForSubMesh(e,t,t.subMeshes[0])},t.prototype._afterBind=function(t,r){void 0===r&&(r=null),e.prototype._afterBind.call(this,t),this.getScene()._cachedEffect=r},t.prototype._mustRebind=function(e,t,r){return void 0===r&&(r=1),e.isCachedMaterialInvalid(this,t,r)},t}(r(/*! ../Materials/material */"./Materials/material.ts").Material)},"./Materials/shaderMaterial.ts":
- /*!*************************************!*\
- !*** ./Materials/shaderMaterial.ts ***!
- \*************************************/
- /*! exports provided: ShaderMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderMaterial",(function(){return g}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ./materialHelper */"./Materials/materialHelper.ts"),c=r(/*! ./material */"./Materials/material.ts"),u=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),d=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),h=r(/*! ./effectFallbacks */"./Materials/effectFallbacks.ts"),f=r(/*! ../Misc/webRequest */"./Misc/webRequest.ts"),p=r(/*! ../Engines/engine */"./Engines/engine.ts"),m={effect:null,subMesh:null},g=function(e){function t(t,r,i,s){void 0===s&&(s={});var a=e.call(this,t,r)||this;return a._textures={},a._textureArrays={},a._floats={},a._ints={},a._floatsArrays={},a._colors3={},a._colors3Arrays={},a._colors4={},a._colors4Arrays={},a._vectors2={},a._vectors3={},a._vectors4={},a._matrices={},a._matrixArrays={},a._matrices3x3={},a._matrices2x2={},a._vectors2Arrays={},a._vectors3Arrays={},a._vectors4Arrays={},a._cachedWorldViewMatrix=new o.Matrix,a._cachedWorldViewProjectionMatrix=new o.Matrix,a._multiview=!1,a._shaderPath=i,a._options=Object(n.__assign)({needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],defines:[]},s),a}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"shaderPath",{get:function(){return this._shaderPath},set:function(e){this._shaderPath=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"ShaderMaterial"},t.prototype.needAlphaBlending=function(){return this.alpha<1||this._options.needAlphaBlending},t.prototype.needAlphaTesting=function(){return this._options.needAlphaTesting},t.prototype._checkUniform=function(e){-1===this._options.uniforms.indexOf(e)&&this._options.uniforms.push(e)},t.prototype.setTexture=function(e,t){return-1===this._options.samplers.indexOf(e)&&this._options.samplers.push(e),this._textures[e]=t,this},t.prototype.setTextureArray=function(e,t){return-1===this._options.samplers.indexOf(e)&&this._options.samplers.push(e),this._checkUniform(e),this._textureArrays[e]=t,this},t.prototype.setFloat=function(e,t){return this._checkUniform(e),this._floats[e]=t,this},t.prototype.setInt=function(e,t){return this._checkUniform(e),this._ints[e]=t,this},t.prototype.setFloats=function(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this},t.prototype.setColor3=function(e,t){return this._checkUniform(e),this._colors3[e]=t,this},t.prototype.setColor3Array=function(e,t){return this._checkUniform(e),this._colors3Arrays[e]=t.reduce((function(e,t){return t.toArray(e,e.length),e}),[]),this},t.prototype.setColor4=function(e,t){return this._checkUniform(e),this._colors4[e]=t,this},t.prototype.setColor4Array=function(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((function(e,t){return t.toArray(e,e.length),e}),[]),this},t.prototype.setVector2=function(e,t){return this._checkUniform(e),this._vectors2[e]=t,this},t.prototype.setVector3=function(e,t){return this._checkUniform(e),this._vectors3[e]=t,this},t.prototype.setVector4=function(e,t){return this._checkUniform(e),this._vectors4[e]=t,this},t.prototype.setMatrix=function(e,t){return this._checkUniform(e),this._matrices[e]=t,this},t.prototype.setMatrices=function(e,t){this._checkUniform(e);for(var r=new Float32Array(16*t.length),n=0;n<t.length;n++)t[n].copyToArray(r,16*n);return this._matrixArrays[e]=r,this},t.prototype.setMatrix3x3=function(e,t){return this._checkUniform(e),this._matrices3x3[e]=t,this},t.prototype.setMatrix2x2=function(e,t){return this._checkUniform(e),this._matrices2x2[e]=t,this},t.prototype.setArray2=function(e,t){return this._checkUniform(e),this._vectors2Arrays[e]=t,this},t.prototype.setArray3=function(e,t){return this._checkUniform(e),this._vectors3Arrays[e]=t,this},t.prototype.setArray4=function(e,t){return this._checkUniform(e),this._vectors4Arrays[e]=t,this},t.prototype._checkCache=function(e,t){return!e||!this._effect||-1!==this._effect.defines.indexOf("#define INSTANCES")===t},t.prototype.isReadyForSubMesh=function(e,t,r){return this.isReady(e,r)},t.prototype.isReady=function(e,t){var r,n;if(this._effect&&this.isFrozen&&this._effect._wasPreviouslyReady)return!0;var i=this.getScene(),o=i.getEngine();if(!this.checkReadyOnEveryCall&&this._renderId===i.getRenderId()&&this._checkCache(e,t))return!0;var a=[],c=[],u=new h.EffectFallbacks;o.getCaps().multiview&&i.activeCamera&&i.activeCamera.outputRenderTarget&&i.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,a.push("#define MULTIVIEW"),-1!==this._options.uniforms.indexOf("viewProjection")&&-1===this._options.uniforms.push("viewProjectionR")&&this._options.uniforms.push("viewProjectionR"));for(var d=0;d<this._options.defines.length;d++)a.push(this._options.defines[d]);for(d=0;d<this._options.attributes.length;d++)c.push(this._options.attributes[d]);e&&e.isVerticesDataPresent(s.VertexBuffer.ColorKind)&&(c.push(s.VertexBuffer.ColorKind),a.push("#define VERTEXCOLOR")),t&&(a.push("#define INSTANCES"),l.MaterialHelper.PushAttributesForInstances(c),(null==e?void 0:e.hasThinInstances)&&a.push("#define THIN_INSTANCES"));var f=0;if(e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){c.push(s.VertexBuffer.MatricesIndicesKind),c.push(s.VertexBuffer.MatricesWeightsKind),e.numBoneInfluencers>4&&(c.push(s.VertexBuffer.MatricesIndicesExtraKind),c.push(s.VertexBuffer.MatricesWeightsExtraKind));var p=e.skeleton;f=e.numBoneInfluencers,a.push("#define NUM_BONE_INFLUENCERS "+f),u.addCPUSkinningFallback(0,e),p.isUsingTextureForMatrices?(a.push("#define BONETEXTURE"),-1===this._options.uniforms.indexOf("boneTextureWidth")&&this._options.uniforms.push("boneTextureWidth"),-1===this._options.samplers.indexOf("boneSampler")&&this._options.samplers.push("boneSampler")):(a.push("#define BonesPerMesh "+(p.bones.length+1)),-1===this._options.uniforms.indexOf("mBones")&&this._options.uniforms.push("mBones"))}else a.push("#define NUM_BONE_INFLUENCERS 0");for(var g in this._textures)if(!this._textures[g].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&a.push("#define ALPHATEST");var _=this._shaderPath,v=this._options.uniforms,y=this._options.uniformBuffers,b=this._options.samplers;this.customShaderNameResolve&&(v=v.slice(),y=y.slice(),b=b.slice(),_=this.customShaderNameResolve(_,v,y,b,a,c));var A=this._effect,T=a.join("\n");return this._cachedDefines!==T&&(this._cachedDefines=T,this._effect=o.createEffect(_,{attributes:c,uniformsNames:v,uniformBuffersNames:y,samplers:b,defines:T,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:f}},o),this._onEffectCreatedObservable&&(m.effect=this._effect,this._onEffectCreatedObservable.notifyObservers(m))),null!==(n=!(null===(r=this._effect)||void 0===r?void 0:r.isReady()))&&void 0!==n&&!n&&(A!==this._effect&&i.resetCachedMaterial(),this._renderId=i.getRenderId(),this._effect._wasPreviouslyReady=!0,!0)},t.prototype.bindOnlyWorldMatrix=function(e,t){var r=this.getScene(),n=null!=t?t:this._effect;n&&(-1!==this._options.uniforms.indexOf("world")&&n.setMatrix("world",e),-1!==this._options.uniforms.indexOf("worldView")&&(e.multiplyToRef(r.getViewMatrix(),this._cachedWorldViewMatrix),n.setMatrix("worldView",this._cachedWorldViewMatrix)),-1!==this._options.uniforms.indexOf("worldViewProjection")&&(e.multiplyToRef(r.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),n.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)))},t.prototype.bindForSubMesh=function(e,t,r){this.bind(e,t,r._effectOverride)},t.prototype.bind=function(e,t,r){this.bindOnlyWorldMatrix(e,r);var n=null!=r?r:this._effect;if(n&&this.getScene().getCachedMaterial()!==this){var i;for(i in-1!==this._options.uniforms.indexOf("view")&&n.setMatrix("view",this.getScene().getViewMatrix()),-1!==this._options.uniforms.indexOf("projection")&&n.setMatrix("projection",this.getScene().getProjectionMatrix()),-1!==this._options.uniforms.indexOf("viewProjection")&&(n.setMatrix("viewProjection",this.getScene().getTransformMatrix()),this._multiview&&n.setMatrix("viewProjectionR",this.getScene()._transformMatrixR)),this.getScene().activeCamera&&-1!==this._options.uniforms.indexOf("cameraPosition")&&n.setVector3("cameraPosition",this.getScene().activeCamera.globalPosition),l.MaterialHelper.BindBonesParameters(t,n),this._textures)n.setTexture(i,this._textures[i]);for(i in this._textureArrays)n.setTextureArray(i,this._textureArrays[i]);for(i in this._ints)n.setInt(i,this._ints[i]);for(i in this._floats)n.setFloat(i,this._floats[i]);for(i in this._floatsArrays)n.setArray(i,this._floatsArrays[i]);for(i in this._colors3)n.setColor3(i,this._colors3[i]);for(i in this._colors3Arrays)n.setArray3(i,this._colors3Arrays[i]);for(i in this._colors4){var o=this._colors4[i];n.setFloat4(i,o.r,o.g,o.b,o.a)}for(i in this._colors4Arrays)n.setArray4(i,this._colors4Arrays[i]);for(i in this._vectors2)n.setVector2(i,this._vectors2[i]);for(i in this._vectors3)n.setVector3(i,this._vectors3[i]);for(i in this._vectors4)n.setVector4(i,this._vectors4[i]);for(i in this._matrices)n.setMatrix(i,this._matrices[i]);for(i in this._matrixArrays)n.setMatrices(i,this._matrixArrays[i]);for(i in this._matrices3x3)n.setMatrix3x3(i,this._matrices3x3[i]);for(i in this._matrices2x2)n.setMatrix2x2(i,this._matrices2x2[i]);for(i in this._vectors2Arrays)n.setArray2(i,this._vectors2Arrays[i]);for(i in this._vectors3Arrays)n.setArray3(i,this._vectors3Arrays[i]);for(i in this._vectors4Arrays)n.setArray4(i,this._vectors4Arrays[i])}var s=this._effect;this._effect=n,this._afterBind(t),this._effect=s},t.prototype._afterBind=function(t){e.prototype._afterBind.call(this,t),this.getScene()._cachedEffect=this._effect},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);for(var r in this._textures)t.push(this._textures[r]);for(var r in this._textureArrays)for(var n=this._textureArrays[r],i=0;i<n.length;i++)t.push(n[i]);return t},t.prototype.hasTexture=function(t){if(e.prototype.hasTexture.call(this,t))return!0;for(var r in this._textures)if(this._textures[r]===t)return!0;for(var r in this._textureArrays)for(var n=this._textureArrays[r],i=0;i<n.length;i++)if(n[i]===t)return!0;return!1},t.prototype.clone=function(e){var r=this,o=i.SerializationHelper.Clone((function(){return new t(e,r.getScene(),r._shaderPath,r._options)}),this);for(var s in o.name=e,o.id=e,"object"==typeof o._shaderPath&&(o._shaderPath=Object(n.__assign)({},o._shaderPath)),this._options=Object(n.__assign)({},this._options),Object.keys(this._options).forEach((function(e){var t=r._options[e];Array.isArray(t)&&(r._options[e]=t.slice(0))})),this._textures)o.setTexture(s,this._textures[s]);for(var s in this._floats)o.setFloat(s,this._floats[s]);for(var s in this._floatsArrays)o.setFloats(s,this._floatsArrays[s]);for(var s in this._colors3)o.setColor3(s,this._colors3[s]);for(var s in this._colors4)o.setColor4(s,this._colors4[s]);for(var s in this._vectors2)o.setVector2(s,this._vectors2[s]);for(var s in this._vectors3)o.setVector3(s,this._vectors3[s]);for(var s in this._vectors4)o.setVector4(s,this._vectors4[s]);for(var s in this._matrices)o.setMatrix(s,this._matrices[s]);for(var s in this._matrices3x3)o.setMatrix3x3(s,this._matrices3x3[s]);for(var s in this._matrices2x2)o.setMatrix2x2(s,this._matrices2x2[s]);return o},t.prototype.dispose=function(t,r,n){if(r){var i;for(i in this._textures)this._textures[i].dispose();for(i in this._textureArrays)for(var o=this._textureArrays[i],s=0;s<o.length;s++)o[s].dispose()}this._textures={},e.prototype.dispose.call(this,t,r,n)},t.prototype.serialize=function(){var e,t=i.SerializationHelper.Serialize(this);for(e in t.customType="BABYLON.ShaderMaterial",t.options=this._options,t.shaderPath=this._shaderPath,t.textures={},this._textures)t.textures[e]=this._textures[e].serialize();for(e in t.textureArrays={},this._textureArrays){t.textureArrays[e]=[];for(var r=this._textureArrays[e],n=0;n<r.length;n++)t.textureArrays[e].push(r[n].serialize())}for(e in t.floats={},this._floats)t.floats[e]=this._floats[e];for(e in t.FloatArrays={},this._floatsArrays)t.FloatArrays[e]=this._floatsArrays[e];for(e in t.colors3={},this._colors3)t.colors3[e]=this._colors3[e].asArray();for(e in t.colors3Arrays={},this._colors3Arrays)t.colors3Arrays[e]=this._colors3Arrays[e];for(e in t.colors4={},this._colors4)t.colors4[e]=this._colors4[e].asArray();for(e in t.colors4Arrays={},this._colors4Arrays)t.colors4Arrays[e]=this._colors4Arrays[e];for(e in t.vectors2={},this._vectors2)t.vectors2[e]=this._vectors2[e].asArray();for(e in t.vectors3={},this._vectors3)t.vectors3[e]=this._vectors3[e].asArray();for(e in t.vectors4={},this._vectors4)t.vectors4[e]=this._vectors4[e].asArray();for(e in t.matrices={},this._matrices)t.matrices[e]=this._matrices[e].asArray();for(e in t.matrixArray={},this._matrixArrays)t.matrixArray[e]=this._matrixArrays[e];for(e in t.matrices3x3={},this._matrices3x3)t.matrices3x3[e]=this._matrices3x3[e];for(e in t.matrices2x2={},this._matrices2x2)t.matrices2x2[e]=this._matrices2x2[e];for(e in t.vectors2Arrays={},this._vectors2Arrays)t.vectors2Arrays[e]=this._vectors2Arrays[e];for(e in t.vectors3Arrays={},this._vectors3Arrays)t.vectors3Arrays[e]=this._vectors3Arrays[e];for(e in t.vectors4Arrays={},this._vectors4Arrays)t.vectors4Arrays[e]=this._vectors4Arrays[e];return t},t.Parse=function(e,r,n){var s,l=i.SerializationHelper.Parse((function(){return new t(e.name,r,e.shaderPath,e.options)}),e,r,n);for(s in e.textures)l.setTexture(s,a.Texture.Parse(e.textures[s],r,n));for(s in e.textureArrays){for(var c=e.textureArrays[s],u=new Array,h=0;h<c.length;h++)u.push(a.Texture.Parse(c[h],r,n));l.setTextureArray(s,u)}for(s in e.floats)l.setFloat(s,e.floats[s]);for(s in e.floatsArrays)l.setFloats(s,e.floatsArrays[s]);for(s in e.colors3)l.setColor3(s,d.Color3.FromArray(e.colors3[s]));for(s in e.colors3Arrays){var f=e.colors3Arrays[s].reduce((function(e,t,r){return r%3==0?e.push([t]):e[e.length-1].push(t),e}),[]).map((function(e){return d.Color3.FromArray(e)}));l.setColor3Array(s,f)}for(s in e.colors4)l.setColor4(s,d.Color4.FromArray(e.colors4[s]));for(s in e.colors4Arrays)f=e.colors4Arrays[s].reduce((function(e,t,r){return r%4==0?e.push([t]):e[e.length-1].push(t),e}),[]).map((function(e){return d.Color4.FromArray(e)})),l.setColor4Array(s,f);for(s in e.vectors2)l.setVector2(s,o.Vector2.FromArray(e.vectors2[s]));for(s in e.vectors3)l.setVector3(s,o.Vector3.FromArray(e.vectors3[s]));for(s in e.vectors4)l.setVector4(s,o.Vector4.FromArray(e.vectors4[s]));for(s in e.matrices)l.setMatrix(s,o.Matrix.FromArray(e.matrices[s]));for(s in e.matrixArray)l._matrixArrays[s]=new Float32Array(e.matrixArray[s]);for(s in e.matrices3x3)l.setMatrix3x3(s,e.matrices3x3[s]);for(s in e.matrices2x2)l.setMatrix2x2(s,e.matrices2x2[s]);for(s in e.vectors2Arrays)l.setArray2(s,e.vectors2Arrays[s]);for(s in e.vectors3Arrays)l.setArray3(s,e.vectors3Arrays[s]);for(s in e.vectors4Arrays)l.setArray4(s,e.vectors4Arrays[s]);return l},t.ParseFromFileAsync=function(e,t,r,n){var i=this;return void 0===n&&(n=""),new Promise((function(o,s){var a=new f.WebRequest;a.addEventListener("readystatechange",(function(){if(4==a.readyState)if(200==a.status){var t=JSON.parse(a.responseText),l=i.Parse(t,r||p.Engine.LastCreatedScene,n);e&&(l.name=e),o(l)}else s("Unable to load the ShaderMaterial")})),a.open("GET",t),a.send()}))},t.CreateFromSnippetAsync=function(e,t,r){var n=this;return void 0===r&&(r=""),new Promise((function(i,o){var s=new f.WebRequest;s.addEventListener("readystatechange",(function(){if(4==s.readyState)if(200==s.status){var a=JSON.parse(JSON.parse(s.responseText).jsonPayload),l=JSON.parse(a.shaderMaterial),c=n.Parse(l,t||p.Engine.LastCreatedScene,r);c.snippetId=e,i(c)}else o("Unable to load the snippet "+e)})),s.open("GET",n.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()}))},t.SnippetUrl="https://snippet.babylonjs.com",t}(c.Material);u._TypeStore.RegisteredTypes["BABYLON.ShaderMaterial"]=g},"./Materials/shadowDepthWrapper.ts":
- /*!*****************************************!*\
- !*** ./Materials/shadowDepthWrapper.ts ***!
- \*****************************************/
- /*! exports provided: ShadowDepthWrapper */function(e,t,r){"use strict";r.r(t),r.d(t,"ShadowDepthWrapper",(function(){return s}));var n=r(/*! ./effect */"./Materials/effect.ts"),i=r(/*! ../Misc/guid */"./Misc/guid.ts"),o=function(){function e(){this.mm=new Map}return e.prototype.get=function(e,t){var r=this.mm.get(e);if(void 0!==r)return r.get(t)},e.prototype.set=function(e,t,r){var n=this.mm.get(e);void 0===n&&this.mm.set(e,n=new Map),n.set(t,r)},e}(),s=function(){function e(e,t,r){var n=this;this._baseMaterial=e,this._scene=t,this._options=r,this._subMeshToEffect=new Map,this._subMeshToDepthEffect=new o,this._meshes=new Map;var i="NodeMaterial"===e.getClassName()?"u_":"";this._matriceNames={world:i+"world",view:i+"view",projection:i+"projection",viewProjection:i+"viewProjection",worldView:i+"worldView",worldViewProjection:i+"worldViewProjection"},this._onEffectCreatedObserver=this._baseMaterial.onEffectCreatedObservable.add((function(e){var t,r=null===(t=e.subMesh)||void 0===t?void 0:t.getMesh();r&&!n._meshes.has(r)&&n._meshes.set(r,r.onDisposeObservable.add((function(e){for(var t=n._subMeshToEffect.keys(),r=t.next();!0!==r.done;r=t.next()){var i=r.value;(null==i?void 0:i.getMesh())===e&&(n._subMeshToEffect.delete(i),n._subMeshToDepthEffect.mm.delete(i))}}))),n._subMeshToEffect.set(e.subMesh,e.effect),n._subMeshToDepthEffect.mm.delete(e.subMesh)}))}return Object.defineProperty(e.prototype,"standalone",{get:function(){var e,t;return null!==(t=null===(e=this._options)||void 0===e?void 0:e.standalone)&&void 0!==t&&t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMaterial",{get:function(){return this._baseMaterial},enumerable:!1,configurable:!0}),e.prototype.getEffect=function(e,t){var r,n,i,o,s,a;return null!==(a=null!==(i=null===(n=null===(r=this._subMeshToDepthEffect.mm.get(e))||void 0===r?void 0:r.get(t))||void 0===n?void 0:n.depthEffect)&&void 0!==i?i:null===(s=null===(o=this._subMeshToDepthEffect.mm.get(null))||void 0===o?void 0:o.get(t))||void 0===s?void 0:s.depthEffect)&&void 0!==a?a:null},e.prototype.isReadyForSubMesh=function(e,t,r,n){var i,o;return this.standalone&&this._baseMaterial.isReadyForSubMesh(e.getMesh(),e,n),null!==(o=null===(i=this._makeEffect(e,t,r))||void 0===i?void 0:i.isReady())&&void 0!==o&&o},e.prototype.dispose=function(){this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver),this._onEffectCreatedObserver=null;for(var e=this._meshes.entries(),t=e.next();!0!==t.done;t=e.next()){var r=t.value,n=r[0],i=r[1];n.onDisposeObservable.remove(i)}},e.prototype._makeEffect=function(e,t,r){var o,s=null!==(o=this._subMeshToEffect.get(e))&&void 0!==o?o:this._subMeshToEffect.get(null);if(!s)return null;var a=this._subMeshToDepthEffect.get(e,r);a||(a={depthEffect:null,depthDefines:"",token:i.GUID.RandomId()},this._subMeshToDepthEffect.set(e,r,a));var l=t.join("\n");if(a.depthEffect&&l===a.depthDefines)return a.depthEffect;a.depthDefines=l;var c=s.vertexSourceCode,u=s.fragmentSourceCode,d=this._options&&this._options.remappedVariables?"#include<shadowMapVertexNormalBias>("+this._options.remappedVariables.join(",")+")":n.Effect.IncludesShadersStore.shadowMapVertexNormalBias,h=this._options&&this._options.remappedVariables?"#include<shadowMapVertexMetric>("+this._options.remappedVariables.join(",")+")":n.Effect.IncludesShadersStore.shadowMapVertexMetric,f=this._options&&this._options.remappedVariables?"#include<shadowMapFragmentSoftTransparentShadow>("+this._options.remappedVariables.join(",")+")":n.Effect.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow,p=n.Effect.IncludesShadersStore.shadowMapFragment;c=(c=-1!==(c=(c=c.replace(/void\s+?main/g,n.Effect.IncludesShadersStore.shadowMapVertexDeclaration+"\r\nvoid main")).replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g,d)).indexOf("#define SHADOWDEPTH_METRIC")?c.replace(/#define SHADOWDEPTH_METRIC/g,h):c.replace(/}\s*$/g,h+"\r\n}")).replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g,"");var m=u.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW")>=0||u.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG")>=0,g=-1!==u.indexOf("#define SHADOWDEPTH_FRAGMENT"),_="";m?u=u.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g,f):_=f+"\r\n",u=u.replace(/void\s+?main/g,n.Effect.IncludesShadersStore.shadowMapFragmentDeclaration+"\r\nvoid main"),g?u=u.replace(/#define SHADOWDEPTH_FRAGMENT/g,p):_+=p+"\r\n",_&&(u=u.replace(/}\s*$/g,_+"}")),u=u.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g,"");var v=s.getUniformNames().slice();return v.push("biasAndScaleSM","depthValuesSM","lightDataSM","softTransparentShadowSM"),a.depthEffect=this._scene.getEngine().createEffect({vertexSource:c,fragmentSource:u,vertexToken:a.token,fragmentToken:a.token},{attributes:s.getAttributesNames(),uniformsNames:v,uniformBuffersNames:s.getUniformBuffersNames(),samplers:s.getSamplers(),defines:l+"\n"+s.defines,indexParameters:s.getIndexParameters()},this._scene.getEngine()),a.depthEffect},e}()},"./Materials/standardMaterial.ts":
- /*!***************************************!*\
- !*** ./Materials/standardMaterial.ts ***!
- \***************************************/
- /*! exports provided: StandardMaterialDefines, StandardMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"StandardMaterialDefines",(function(){return T})),r.d(t,"StandardMaterial",(function(){return M}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),s=r(/*! ../scene */"./scene.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),u=r(/*! ./imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),d=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../Materials/materialDefines */"./Materials/materialDefines.ts"),f=r(/*! ./pushMaterial */"./Materials/pushMaterial.ts"),p=r(/*! ./materialHelper */"./Materials/materialHelper.ts"),m=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),g=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),_=r(/*! ./materialFlags */"./Materials/materialFlags.ts"),v=(r(/*! ../Shaders/default.fragment */"./Shaders/default.fragment.ts"),r(/*! ../Shaders/default.vertex */"./Shaders/default.vertex.ts"),r(/*! ../Engines/constants */"./Engines/constants.ts")),y=r(/*! ./effectFallbacks */"./Materials/effectFallbacks.ts"),b=r(/*! ./material.detailMapConfiguration */"./Materials/material.detailMapConfiguration.ts"),A={effect:null,subMesh:null},T=function(e){function t(){var t=e.call(this)||this;return t.MAINUV1=!1,t.MAINUV2=!1,t.DIFFUSE=!1,t.DIFFUSEDIRECTUV=0,t.DETAIL=!1,t.DETAILDIRECTUV=0,t.DETAIL_NORMALBLENDMETHOD=0,t.AMBIENT=!1,t.AMBIENTDIRECTUV=0,t.OPACITY=!1,t.OPACITYDIRECTUV=0,t.OPACITYRGB=!1,t.REFLECTION=!1,t.EMISSIVE=!1,t.EMISSIVEDIRECTUV=0,t.SPECULAR=!1,t.SPECULARDIRECTUV=0,t.BUMP=!1,t.BUMPDIRECTUV=0,t.PARALLAX=!1,t.PARALLAXOCCLUSION=!1,t.SPECULAROVERALPHA=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.ALPHAFROMDIFFUSE=!1,t.POINTSIZE=!1,t.FOG=!1,t.SPECULARTERM=!1,t.DIFFUSEFRESNEL=!1,t.OPACITYFRESNEL=!1,t.REFLECTIONFRESNEL=!1,t.REFRACTIONFRESNEL=!1,t.EMISSIVEFRESNEL=!1,t.FRESNEL=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.INSTANCES=!1,t.THIN_INSTANCES=!1,t.GLOSSINESS=!1,t.ROUGHNESS=!1,t.EMISSIVEASILLUMINATION=!1,t.LINKEMISSIVEWITHDIFFUSE=!1,t.REFLECTIONFRESNELFROMSPECULAR=!1,t.LIGHTMAP=!1,t.LIGHTMAPDIRECTUV=0,t.OBJECTSPACE_NORMALMAP=!1,t.USELIGHTMAPASSHADOWMAP=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.LOGARITHMICDEPTH=!1,t.REFRACTION=!1,t.REFRACTIONMAP_3D=!1,t.REFLECTIONOVERALPHA=!1,t.TWOSIDEDLIGHTING=!1,t.SHADOWFLOAT=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.NONUNIFORMSCALING=!1,t.PREMULTIPLYALPHA=!1,t.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,t.ALPHABLEND=!0,t.PREPASS=!1,t.SCENE_MRT_COUNT=0,t.RGBDLIGHTMAP=!1,t.RGBDREFLECTION=!1,t.RGBDREFRACTION=!1,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.MULTIVIEW=!1,t.IS_REFLECTION_LINEAR=!1,t.IS_REFRACTION_LINEAR=!1,t.EXPOSURE=!1,t.rebuild(),t}return Object(n.__extends)(t,e),t.prototype.setReflectionMode=function(e){for(var t=0,r=["REFLECTIONMAP_CUBIC","REFLECTIONMAP_EXPLICIT","REFLECTIONMAP_PLANAR","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_PROJECTION","REFLECTIONMAP_SKYBOX","REFLECTIONMAP_SPHERICAL","REFLECTIONMAP_EQUIRECTANGULAR","REFLECTIONMAP_EQUIRECTANGULAR_FIXED","REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"];t<r.length;t++){var n=r[t];this[n]=n===e}},t}(h.MaterialDefines),M=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i._diffuseTexture=null,i._ambientTexture=null,i._opacityTexture=null,i._reflectionTexture=null,i._emissiveTexture=null,i._specularTexture=null,i._bumpTexture=null,i._lightmapTexture=null,i._refractionTexture=null,i.ambientColor=new l.Color3(0,0,0),i.diffuseColor=new l.Color3(1,1,1),i.specularColor=new l.Color3(1,1,1),i.emissiveColor=new l.Color3(0,0,0),i.specularPower=64,i._useAlphaFromDiffuseTexture=!1,i._useEmissiveAsIllumination=!1,i._linkEmissiveWithDiffuse=!1,i._useSpecularOverAlpha=!1,i._useReflectionOverAlpha=!1,i._disableLighting=!1,i._useObjectSpaceNormalMap=!1,i._useParallax=!1,i._useParallaxOcclusion=!1,i.parallaxScaleBias=.05,i._roughness=0,i.indexOfRefraction=.98,i.invertRefractionY=!0,i.alphaCutOff=.4,i._useLightmapAsShadowmap=!1,i._useReflectionFresnelFromSpecular=!1,i._useGlossinessFromSpecularMapAlpha=!1,i._maxSimultaneousLights=4,i._invertNormalMapX=!1,i._invertNormalMapY=!1,i._twoSidedLighting=!1,i.detailMap=new b.DetailMapConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i._renderTargets=new o.SmartArray(16),i._worldViewProjectionMatrix=a.Matrix.Zero(),i._globalAmbientColor=new l.Color3(0,0,0),i._rebuildInParallel=!1,i._attachImageProcessingConfiguration(null),i.getRenderTargetTextures=function(){return i._renderTargets.reset(),t.ReflectionTextureEnabled&&i._reflectionTexture&&i._reflectionTexture.isRenderTarget&&i._renderTargets.push(i._reflectionTexture),t.RefractionTextureEnabled&&i._refractionTexture&&i._refractionTexture.isRenderTarget&&i._renderTargets.push(i._refractionTexture),i._renderTargets},i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e){var t=this;e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration=e||this.getScene().imageProcessingConfiguration,this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add((function(){t._markAllSubMeshesAsImageProcessingDirty()}))))},Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this._imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this._imageProcessingConfiguration.colorCurves},set:function(e){this._imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canRenderToMRT",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!!(t.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||!!(t.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"StandardMaterial"},Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported,this._markAllSubMeshesAsMiscDirty()},enumerable:!1,configurable:!0}),t.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled)},t.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest||null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha&&(null==this._transparencyMode||this._transparencyMode===d.Material.MATERIAL_ALPHATEST)},t.prototype._shouldUseAlphaFromDiffuseTexture=function(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==d.Material.MATERIAL_OPAQUE},t.prototype.getAlphaTestTexture=function(){return this._diffuseTexture},t.prototype.isReadyForSubMesh=function(e,r,n){if(void 0===n&&(n=!1),r.effect&&this.isFrozen&&r.effect._wasPreviouslyReady)return!0;r._materialDefines||(r._materialDefines=new T);var i=this.getScene(),o=r._materialDefines;if(this._isReadyForSubMesh(r))return!0;var s=i.getEngine();if(o._needNormals=p.MaterialHelper.PrepareDefinesForLights(i,e,o,!0,this._maxSimultaneousLights,this._disableLighting),p.MaterialHelper.PrepareDefinesForMultiview(i,o),p.MaterialHelper.PrepareDefinesForPrePass(i,o,this.canRenderToMRT),o._areTexturesDirty){if(o._needUVs=!1,o.MAINUV1=!1,o.MAINUV2=!1,i.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._diffuseTexture,o,"DIFFUSE")}else o.DIFFUSE=!1;if(this._ambientTexture&&t.AmbientTextureEnabled){if(!this._ambientTexture.isReadyOrNotBlocking())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture,o,"AMBIENT")}else o.AMBIENT=!1;if(this._opacityTexture&&t.OpacityTextureEnabled){if(!this._opacityTexture.isReadyOrNotBlocking())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture,o,"OPACITY"),o.OPACITYRGB=this._opacityTexture.getAlphaFromRGB}else o.OPACITY=!1;if(this._reflectionTexture&&t.ReflectionTextureEnabled){if(!this._reflectionTexture.isReadyOrNotBlocking())return!1;switch(o._needNormals=!0,o.REFLECTION=!0,o.ROUGHNESS=this._roughness>0,o.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,o.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===m.Texture.INVCUBIC_MODE,o.REFLECTIONMAP_3D=this._reflectionTexture.isCube,o.RGBDREFLECTION=this._reflectionTexture.isRGBD,this._reflectionTexture.coordinatesMode){case m.Texture.EXPLICIT_MODE:o.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case m.Texture.PLANAR_MODE:o.setReflectionMode("REFLECTIONMAP_PLANAR");break;case m.Texture.PROJECTION_MODE:o.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case m.Texture.SKYBOX_MODE:o.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case m.Texture.SPHERICAL_MODE:o.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case m.Texture.EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case m.Texture.FIXED_EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case m.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case m.Texture.CUBIC_MODE:case m.Texture.INVCUBIC_MODE:default:o.setReflectionMode("REFLECTIONMAP_CUBIC")}o.USE_LOCAL_REFLECTIONMAP_CUBIC=!!this._reflectionTexture.boundingBoxSize}else o.REFLECTION=!1;if(this._emissiveTexture&&t.EmissiveTextureEnabled){if(!this._emissiveTexture.isReadyOrNotBlocking())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture,o,"EMISSIVE")}else o.EMISSIVE=!1;if(this._lightmapTexture&&t.LightmapTextureEnabled){if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture,o,"LIGHTMAP"),o.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,o.RGBDLIGHTMAP=this._lightmapTexture.isRGBD}else o.LIGHTMAP=!1;if(this._specularTexture&&t.SpecularTextureEnabled){if(!this._specularTexture.isReadyOrNotBlocking())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._specularTexture,o,"SPECULAR"),o.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha}else o.SPECULAR=!1;if(i.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&t.BumpTextureEnabled){if(!this._bumpTexture.isReady())return!1;p.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture,o,"BUMP"),o.PARALLAX=this._useParallax,o.PARALLAXOCCLUSION=this._useParallaxOcclusion,o.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else o.BUMP=!1;if(this._refractionTexture&&t.RefractionTextureEnabled){if(!this._refractionTexture.isReadyOrNotBlocking())return!1;o._needUVs=!0,o.REFRACTION=!0,o.REFRACTIONMAP_3D=this._refractionTexture.isCube,o.RGBDREFRACTION=this._refractionTexture.isRGBD}else o.REFRACTION=!1;o.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else o.DIFFUSE=!1,o.AMBIENT=!1,o.OPACITY=!1,o.REFLECTION=!1,o.EMISSIVE=!1,o.LIGHTMAP=!1,o.BUMP=!1,o.REFRACTION=!1;o.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),o.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,o.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,o.SPECULAROVERALPHA=this._useSpecularOverAlpha,o.PREMULTIPLYALPHA=this.alphaMode===v.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===v.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,o.ALPHATEST_AFTERALLALPHACOMPUTATIONS=null!==this.transparencyMode,o.ALPHABLEND=null===this.transparencyMode||this.needAlphaBlendingForMesh(e)}if(!this.detailMap.isReadyForSubMesh(o,i))return!1;if(o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o),o.IS_REFLECTION_LINEAR=null!=this.reflectionTexture&&!this.reflectionTexture.gammaSpace,o.IS_REFRACTION_LINEAR=null!=this.refractionTexture&&!this.refractionTexture.gammaSpace}if(o._areFresnelDirty&&(t.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(o.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,o.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,o.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,o.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,o.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,o.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,o._needNormals=!0,o.FRESNEL=!0):o.FRESNEL=!1),p.MaterialHelper.PrepareDefinesForMisc(e,i,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,o),p.MaterialHelper.PrepareDefinesForAttributes(e,o,!0,!0,!0),p.MaterialHelper.PrepareDefinesForFrameBoundValues(i,s,o,n,null,r.getRenderingMesh().hasThinInstances),this.detailMap.prepareDefines(o,i),o.isDirty){var a=o._areLightsDisposed;o.markAsProcessed();var l=new y.EffectFallbacks;o.REFLECTION&&l.addFallback(0,"REFLECTION"),o.SPECULAR&&l.addFallback(0,"SPECULAR"),o.BUMP&&l.addFallback(0,"BUMP"),o.PARALLAX&&l.addFallback(1,"PARALLAX"),o.PARALLAXOCCLUSION&&l.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&l.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&l.addFallback(1,"FOG"),o.POINTSIZE&&l.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&l.addFallback(0,"LOGARITHMICDEPTH"),p.MaterialHelper.HandleFallbacksForShadows(o,l,this._maxSimultaneousLights),o.SPECULARTERM&&l.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&l.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&l.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&l.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&l.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&l.addFallback(4,"FRESNEL"),o.MULTIVIEW&&l.addFallback(0,"MULTIVIEW");var d=[c.VertexBuffer.PositionKind];o.NORMAL&&d.push(c.VertexBuffer.NormalKind),o.UV1&&d.push(c.VertexBuffer.UVKind),o.UV2&&d.push(c.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&d.push(c.VertexBuffer.ColorKind),p.MaterialHelper.PrepareAttributesForBones(d,e,o,l),p.MaterialHelper.PrepareAttributesForInstances(d,o),p.MaterialHelper.PrepareAttributesForMorphTargets(d,e,o);var h="default",f=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth"],g=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler"],_=["Material","Scene"];b.DetailMapConfiguration.AddUniforms(f),b.DetailMapConfiguration.AddSamplers(g),u.ImageProcessingConfiguration&&(u.ImageProcessingConfiguration.PrepareUniforms(f,o),u.ImageProcessingConfiguration.PrepareSamplers(g,o)),p.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:f,uniformBuffersNames:_,samplers:g,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var M={};this.customShaderNameResolve&&(h=this.customShaderNameResolve(h,f,_,g,o,d,M));var P=o.toString(),S=r.effect,E=i.getEngine().createEffect(h,{attributes:d,uniformsNames:f,uniformBuffersNames:_,samplers:g,defines:P,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS},processFinalCode:M.processFinalCode,multiTarget:o.PREPASS},s);if(E)if(this._onEffectCreatedObservable&&(A.effect=E,A.subMesh=r,this._onEffectCreatedObservable.notifyObservers(A)),this.allowShaderHotSwapping&&S&&!E.isReady()){if(E=S,this._rebuildInParallel=!0,o.markAsUnprocessed(),a)return o._areLightsDisposed=!0,!1}else this._rebuildInParallel=!1,i.resetCachedMaterial(),r.setEffect(E,o),this.buildUniformLayout()}return!(!r.effect||!r.effect.isReady()||(o._renderId=i.getRenderId(),r.effect._wasPreviouslyReady=!0,0))},t.prototype.buildUniformLayout=function(){var e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("reflectionMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("visibility",1),e.addUniform("vDiffuseColor",4),b.DetailMapConfiguration.PrepareUniformBuffer(e),e.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this._refractionTexture&&this._refractionTexture.isRenderTarget&&(this._activeEffect.setTexture("refraction2DSampler",null),t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,r,n){var i=this.getScene(),o=n._materialDefines;if(o){var a=n.effect;if(a){this._activeEffect=a,o.INSTANCES&&!o.THIN_INSTANCES||this.bindOnlyWorldMatrix(e),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var c=this._mustRebind(i,a,r.visibility);p.MaterialHelper.BindBonesParameters(r,a);var u=this._uniformBuffer;if(c){if(u.bindToEffect(a,"Material"),this.bindViewProjection(a),!u.useUbo||!this.isFrozen||!u.isSync){if(t.FresnelEnabled&&o.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(u.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),u.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&u.updateColor4("opacityParts",new l.Color3(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(u.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),u.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(u.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),u.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(u.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),u.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),i.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled&&(u.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),p.MaterialHelper.BindTextureMatrix(this._diffuseTexture,u,"diffuse"),this._diffuseTexture.hasAlpha&&a.setFloat("alphaCutOff",this.alphaCutOff)),this._ambientTexture&&t.AmbientTextureEnabled&&(u.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),p.MaterialHelper.BindTextureMatrix(this._ambientTexture,u,"ambient")),this._opacityTexture&&t.OpacityTextureEnabled&&(u.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),p.MaterialHelper.BindTextureMatrix(this._opacityTexture,u,"opacity")),this._reflectionTexture&&t.ReflectionTextureEnabled&&(u.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),u.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){var d=this._reflectionTexture;u.updateVector3("vReflectionPosition",d.boundingBoxPosition),u.updateVector3("vReflectionSize",d.boundingBoxSize)}if(this._emissiveTexture&&t.EmissiveTextureEnabled&&(u.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),p.MaterialHelper.BindTextureMatrix(this._emissiveTexture,u,"emissive")),this._lightmapTexture&&t.LightmapTextureEnabled&&(u.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),p.MaterialHelper.BindTextureMatrix(this._lightmapTexture,u,"lightmap")),this._specularTexture&&t.SpecularTextureEnabled&&(u.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),p.MaterialHelper.BindTextureMatrix(this._specularTexture,u,"specular")),this._bumpTexture&&i.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&(u.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),p.MaterialHelper.BindTextureMatrix(this._bumpTexture,u,"bump"),i._mirroredCameraPosition?u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&t.RefractionTextureEnabled){var h=1;this._refractionTexture.isCube||(u.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(h=this._refractionTexture.depth)),u.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,h,this.invertRefractionY?-1:1)}}this.pointsCloud&&u.updateFloat("pointSize",this.pointSize),o.SPECULARTERM&&u.updateColor4("vSpecularColor",this.specularColor,this.specularPower),u.updateColor3("vEmissiveColor",t.EmissiveTextureEnabled?this.emissiveColor:l.Color3.BlackReadOnly),u.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha)}u.updateFloat("visibility",r.visibility),i.texturesEnabled&&(this._diffuseTexture&&t.DiffuseTextureEnabled&&a.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&t.AmbientTextureEnabled&&a.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&t.OpacityTextureEnabled&&a.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?a.setTexture("reflectionCubeSampler",this._reflectionTexture):a.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&t.EmissiveTextureEnabled&&a.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&t.LightmapTextureEnabled&&a.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&t.SpecularTextureEnabled&&a.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&i.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&a.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&t.RefractionTextureEnabled)&&(h=1,this._refractionTexture.isCube?a.setTexture("refractionCubeSampler",this._refractionTexture):a.setTexture("refraction2DSampler",this._refractionTexture)),this.detailMap.bindForSubMesh(u,i,this.isFrozen),p.MaterialHelper.BindClipPlane(a,i),i.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),p.MaterialHelper.BindEyePosition(a,i),a.setColor3("vAmbientColor",this._globalAmbientColor)}!c&&this.isFrozen||(i.lightsEnabled&&!this._disableLighting&&p.MaterialHelper.BindLights(i,r,a,o,this._maxSimultaneousLights,this._rebuildInParallel),(i.fogEnabled&&r.applyFog&&i.fogMode!==s.Scene.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture)&&this.bindView(a),p.MaterialHelper.BindFogParameters(i,r,a),o.NUM_MORPH_INFLUENCERS&&p.MaterialHelper.BindMorphTargetParameters(r,a),this.useLogarithmicDepth&&p.MaterialHelper.BindLogDepth(o,a,i),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),u.update(),this._afterBind(r,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),this.detailMap.getAnimatables(e),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&t.push(this._diffuseTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._specularTexture&&t.push(this._specularTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this._refractionTexture&&t.push(this._refractionTexture),this.detailMap.getActiveTextures(t),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._diffuseTexture===t||this._ambientTexture===t||this._opacityTexture===t||this._reflectionTexture===t||this._emissiveTexture===t||this._specularTexture===t||this._bumpTexture===t||this._lightmapTexture===t||this._refractionTexture===t||this.detailMap.hasTexture(t)},t.prototype.dispose=function(t,r){var n,i,o,s,a,l,c,u,d;r&&(null===(n=this._diffuseTexture)||void 0===n||n.dispose(),null===(i=this._ambientTexture)||void 0===i||i.dispose(),null===(o=this._opacityTexture)||void 0===o||o.dispose(),null===(s=this._reflectionTexture)||void 0===s||s.dispose(),null===(a=this._emissiveTexture)||void 0===a||a.dispose(),null===(l=this._specularTexture)||void 0===l||l.dispose(),null===(c=this._bumpTexture)||void 0===c||c.dispose(),null===(u=this._lightmapTexture)||void 0===u||u.dispose(),null===(d=this._refractionTexture)||void 0===d||d.dispose()),this.detailMap.dispose(r),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,r)},t.prototype.clone=function(e){var r=this,n=i.SerializationHelper.Clone((function(){return new t(e,r.getScene())}),this);return n.name=e,n.id=e,n},t.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},t.Parse=function(e,r,n){return i.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n)},Object.defineProperty(t,"DiffuseTextureEnabled",{get:function(){return _.MaterialFlags.DiffuseTextureEnabled},set:function(e){_.MaterialFlags.DiffuseTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"DetailTextureEnabled",{get:function(){return _.MaterialFlags.DetailTextureEnabled},set:function(e){_.MaterialFlags.DetailTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"AmbientTextureEnabled",{get:function(){return _.MaterialFlags.AmbientTextureEnabled},set:function(e){_.MaterialFlags.AmbientTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"OpacityTextureEnabled",{get:function(){return _.MaterialFlags.OpacityTextureEnabled},set:function(e){_.MaterialFlags.OpacityTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ReflectionTextureEnabled",{get:function(){return _.MaterialFlags.ReflectionTextureEnabled},set:function(e){_.MaterialFlags.ReflectionTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EmissiveTextureEnabled",{get:function(){return _.MaterialFlags.EmissiveTextureEnabled},set:function(e){_.MaterialFlags.EmissiveTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SpecularTextureEnabled",{get:function(){return _.MaterialFlags.SpecularTextureEnabled},set:function(e){_.MaterialFlags.SpecularTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BumpTextureEnabled",{get:function(){return _.MaterialFlags.BumpTextureEnabled},set:function(e){_.MaterialFlags.BumpTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LightmapTextureEnabled",{get:function(){return _.MaterialFlags.LightmapTextureEnabled},set:function(e){_.MaterialFlags.LightmapTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RefractionTextureEnabled",{get:function(){return _.MaterialFlags.RefractionTextureEnabled},set:function(e){_.MaterialFlags.RefractionTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ColorGradingTextureEnabled",{get:function(){return _.MaterialFlags.ColorGradingTextureEnabled},set:function(e){_.MaterialFlags.ColorGradingTextureEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FresnelEnabled",{get:function(){return _.MaterialFlags.FresnelEnabled},set:function(e){_.MaterialFlags.FresnelEnabled=e},enumerable:!1,configurable:!0}),Object(n.__decorate)([Object(i.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"diffuseTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("ambientTexture")],t.prototype,"_ambientTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("opacityTexture")],t.prototype,"_opacityTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("reflectionTexture")],t.prototype,"_reflectionTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("emissiveTexture")],t.prototype,"_emissiveTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("specularTexture")],t.prototype,"_specularTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("bumpTexture")],t.prototype,"_bumpTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("lightmapTexture")],t.prototype,"_lightmapTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"lightmapTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("refractionTexture")],t.prototype,"_refractionTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("ambient")],t.prototype,"ambientColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("diffuse")],t.prototype,"diffuseColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("specular")],t.prototype,"specularColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("emissive")],t.prototype,"emissiveColor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"specularPower",void 0),Object(n.__decorate)([Object(i.serialize)("useAlphaFromDiffuseTexture")],t.prototype,"_useAlphaFromDiffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromDiffuseTexture",void 0),Object(n.__decorate)([Object(i.serialize)("useEmissiveAsIllumination")],t.prototype,"_useEmissiveAsIllumination",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useEmissiveAsIllumination",void 0),Object(n.__decorate)([Object(i.serialize)("linkEmissiveWithDiffuse")],t.prototype,"_linkEmissiveWithDiffuse",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkEmissiveWithDiffuse",void 0),Object(n.__decorate)([Object(i.serialize)("useSpecularOverAlpha")],t.prototype,"_useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)("useReflectionOverAlpha")],t.prototype,"_useReflectionOverAlpha",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useReflectionOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.__decorate)([Object(i.serialize)("useObjectSpaceNormalMap")],t.prototype,"_useObjectSpaceNormalMap",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),Object(n.__decorate)([Object(i.serialize)("useParallax")],t.prototype,"_useParallax",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),Object(n.__decorate)([Object(i.serialize)("useParallaxOcclusion")],t.prototype,"_useParallaxOcclusion",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"parallaxScaleBias",void 0),Object(n.__decorate)([Object(i.serialize)("roughness")],t.prototype,"_roughness",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"indexOfRefraction",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"invertRefractionY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"alphaCutOff",void 0),Object(n.__decorate)([Object(i.serialize)("useLightmapAsShadowmap")],t.prototype,"_useLightmapAsShadowmap",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("diffuseFresnelParameters")],t.prototype,"_diffuseFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"diffuseFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("opacityFresnelParameters")],t.prototype,"_opacityFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelAndMiscDirty")],t.prototype,"opacityFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("reflectionFresnelParameters")],t.prototype,"_reflectionFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"reflectionFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("refractionFresnelParameters")],t.prototype,"_refractionFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"refractionFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("emissiveFresnelParameters")],t.prototype,"_emissiveFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"emissiveFresnelParameters",void 0),Object(n.__decorate)([Object(i.serialize)("useReflectionFresnelFromSpecular")],t.prototype,"_useReflectionFresnelFromSpecular",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"useReflectionFresnelFromSpecular",void 0),Object(n.__decorate)([Object(i.serialize)("useGlossinessFromSpecularMapAlpha")],t.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useGlossinessFromSpecularMapAlpha",void 0),Object(n.__decorate)([Object(i.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)("invertNormalMapX")],t.prototype,"_invertNormalMapX",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.__decorate)([Object(i.serialize)("invertNormalMapY")],t.prototype,"_invertNormalMapY",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.__decorate)([Object(i.serialize)("twoSidedLighting")],t.prototype,"_twoSidedLighting",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useLogarithmicDepth",null),t}(f.PushMaterial);g._TypeStore.RegisteredTypes["BABYLON.StandardMaterial"]=M,s.Scene.DefaultMaterialFactory=function(e){return new M("default material",e)}},"./Materials/uniformBuffer.ts":
- /*!************************************!*\
- !*** ./Materials/uniformBuffer.ts ***!
- \************************************/
- /*! exports provided: UniformBuffer */function(e,t,r){"use strict";r.r(t),r.d(t,"UniformBuffer",(function(){return i}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=(r(/*! ../Engines/Extensions/engine.uniformBuffer */"./Engines/Extensions/engine.uniformBuffer.ts"),function(){function e(e,t,r){this._alreadyBound=!1,this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers,this._dynamic=r,this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformLocationPointer=0,this._needSync=!1,this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform)}return Object.defineProperty(e.prototype,"useUbo",{get:function(){return!this._noUBO},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSync",{get:function(){return!this._needSync},enumerable:!1,configurable:!0}),e.prototype.isDynamic=function(){return void 0!==this._dynamic},e.prototype.getData=function(){return this._bufferData},e.prototype.getBuffer=function(){return this._buffer},e.prototype._fillAlignment=function(e){var t;if(t=e<=2?e:4,this._uniformLocationPointer%t!=0){var r=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;for(var n=this._uniformLocationPointer-r,i=0;i<n;i++)this._data.push(0)}},e.prototype.addUniform=function(e,t){if(!this._noUBO&&void 0===this._uniformLocations[e]){var r;if(t instanceof Array)t=(r=t).length;else{t=t,r=[];for(var n=0;n<t;n++)r.push(0)}for(this._fillAlignment(t),this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t,n=0;n<t;n++)this._data.push(r[n]);this._needSync=!0}},e.prototype.addMatrix=function(e,t){this.addUniform(e,Array.prototype.slice.call(t.toArray()))},e.prototype.addFloat2=function(e,t,r){var n=[t,r];this.addUniform(e,n)},e.prototype.addFloat3=function(e,t,r,n){var i=[t,r,n];this.addUniform(e,i)},e.prototype.addColor3=function(e,t){var r=new Array;t.toArray(r),this.addUniform(e,r)},e.prototype.addColor4=function(e,t,r){var n=new Array;t.toArray(n),n.push(r),this.addUniform(e,n)},e.prototype.addVector3=function(e,t){var r=new Array;t.toArray(r),this.addUniform(e,r)},e.prototype.addMatrix3x3=function(e){this.addUniform(e,12)},e.prototype.addMatrix2x2=function(e){this.addUniform(e,8)},e.prototype.create=function(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)},e.prototype._rebuild=function(){!this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData):this._buffer=this._engine.createUniformBuffer(this._bufferData))},e.prototype.update=function(){this._buffer?(this._dynamic||this._needSync)&&(this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1):this.create()},e.prototype.updateUniform=function(e,t,r){var i=this._uniformLocations[e];if(void 0===i){if(this._buffer)return void n.Logger.Error("Cannot add an uniform after UBO has been created.");this.addUniform(e,r),i=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(s=0;s<r;s++)this._bufferData[i+s]=t[s];else{for(var o=!1,s=0;s<r;s++)16!==r&&this._bufferData[i+s]===t[s]||(o=!0,this._bufferData[i+s]=t[s]);this._needSync=this._needSync||o}},e.prototype._cacheMatrix=function(e,t){var r=this._valueCache[e],n=t.updateFlag;return(void 0===r||r!==n)&&(this._valueCache[e]=n,!0)},e.prototype._updateMatrix3x3ForUniform=function(t,r){for(var n=0;n<3;n++)e._tempBuffer[4*n]=r[3*n],e._tempBuffer[4*n+1]=r[3*n+1],e._tempBuffer[4*n+2]=r[3*n+2],e._tempBuffer[4*n+3]=0;this.updateUniform(t,e._tempBuffer,12)},e.prototype._updateMatrix3x3ForEffect=function(e,t){this._currentEffect.setMatrix3x3(e,t)},e.prototype._updateMatrix2x2ForEffect=function(e,t){this._currentEffect.setMatrix2x2(e,t)},e.prototype._updateMatrix2x2ForUniform=function(t,r){for(var n=0;n<2;n++)e._tempBuffer[4*n]=r[2*n],e._tempBuffer[4*n+1]=r[2*n+1],e._tempBuffer[4*n+2]=0,e._tempBuffer[4*n+3]=0;this.updateUniform(t,e._tempBuffer,8)},e.prototype._updateFloatForEffect=function(e,t){this._currentEffect.setFloat(e,t)},e.prototype._updateFloatForUniform=function(t,r){e._tempBuffer[0]=r,this.updateUniform(t,e._tempBuffer,1)},e.prototype._updateFloat2ForEffect=function(e,t,r,n){void 0===n&&(n=""),this._currentEffect.setFloat2(e+n,t,r)},e.prototype._updateFloat2ForUniform=function(t,r,n){e._tempBuffer[0]=r,e._tempBuffer[1]=n,this.updateUniform(t,e._tempBuffer,2)},e.prototype._updateFloat3ForEffect=function(e,t,r,n,i){void 0===i&&(i=""),this._currentEffect.setFloat3(e+i,t,r,n)},e.prototype._updateFloat3ForUniform=function(t,r,n,i){e._tempBuffer[0]=r,e._tempBuffer[1]=n,e._tempBuffer[2]=i,this.updateUniform(t,e._tempBuffer,3)},e.prototype._updateFloat4ForEffect=function(e,t,r,n,i,o){void 0===o&&(o=""),this._currentEffect.setFloat4(e+o,t,r,n,i)},e.prototype._updateFloat4ForUniform=function(t,r,n,i,o){e._tempBuffer[0]=r,e._tempBuffer[1]=n,e._tempBuffer[2]=i,e._tempBuffer[3]=o,this.updateUniform(t,e._tempBuffer,4)},e.prototype._updateMatrixForEffect=function(e,t){this._currentEffect.setMatrix(e,t)},e.prototype._updateMatrixForUniform=function(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.toArray(),16)},e.prototype._updateVector3ForEffect=function(e,t){this._currentEffect.setVector3(e,t)},e.prototype._updateVector3ForUniform=function(t,r){r.toArray(e._tempBuffer),this.updateUniform(t,e._tempBuffer,3)},e.prototype._updateVector4ForEffect=function(e,t){this._currentEffect.setVector4(e,t)},e.prototype._updateVector4ForUniform=function(t,r){r.toArray(e._tempBuffer),this.updateUniform(t,e._tempBuffer,4)},e.prototype._updateColor3ForEffect=function(e,t,r){void 0===r&&(r=""),this._currentEffect.setColor3(e+r,t)},e.prototype._updateColor3ForUniform=function(t,r){r.toArray(e._tempBuffer),this.updateUniform(t,e._tempBuffer,3)},e.prototype._updateColor4ForEffect=function(e,t,r,n){void 0===n&&(n=""),this._currentEffect.setColor4(e+n,t,r)},e.prototype._updateColor4ForUniform=function(t,r,n){r.toArray(e._tempBuffer),e._tempBuffer[3]=n,this.updateUniform(t,e._tempBuffer,4)},e.prototype.setTexture=function(e,t){this._currentEffect.setTexture(e,t)},e.prototype.updateUniformDirectly=function(e,t){this.updateUniform(e,t,t.length),this.update()},e.prototype.bindToEffect=function(e,t){this._currentEffect=e,!this._noUBO&&this._buffer&&(this._alreadyBound=!0,e.bindUniformBuffer(this._buffer,t))},e.prototype.dispose=function(){if(!this._noUBO){var e=this._engine._uniformBuffers,t=e.indexOf(this);-1!==t&&(e[t]=e[e.length-1],e.pop()),this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}},e._MAX_UNIFORM_SIZE=256,e._tempBuffer=new Float32Array(e._MAX_UNIFORM_SIZE),e}())},"./Maths/index.ts":
- /*!************************!*\
- !*** ./Maths/index.ts ***!
- \************************/
- /*! exports provided: Scalar, Space, Axis, Color3, Color4, TmpColors, ToGammaSpace, ToLinearSpace, Epsilon, Frustum, Orientation, BezierCurve, Angle, Arc2, Path2, Path3D, Curve3, Plane, Size, Vector2, Vector3, Vector4, Quaternion, Matrix, TmpVectors, PositionNormalVertex, PositionNormalTextureVertex, Viewport, SphericalHarmonics, SphericalPolynomial */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./math.scalar */"./Maths/math.scalar.ts");r.d(t,"Scalar",(function(){return n.Scalar}));var i=r(/*! ./math */"./Maths/math.ts");r.d(t,"Space",(function(){return i.Space})),r.d(t,"Axis",(function(){return i.Axis})),r.d(t,"Color3",(function(){return i.Color3})),r.d(t,"Color4",(function(){return i.Color4})),r.d(t,"TmpColors",(function(){return i.TmpColors})),r.d(t,"ToGammaSpace",(function(){return i.ToGammaSpace})),r.d(t,"ToLinearSpace",(function(){return i.ToLinearSpace})),r.d(t,"Epsilon",(function(){return i.Epsilon})),r.d(t,"Frustum",(function(){return i.Frustum})),r.d(t,"Orientation",(function(){return i.Orientation})),r.d(t,"BezierCurve",(function(){return i.BezierCurve})),r.d(t,"Angle",(function(){return i.Angle})),r.d(t,"Arc2",(function(){return i.Arc2})),r.d(t,"Path2",(function(){return i.Path2})),r.d(t,"Path3D",(function(){return i.Path3D})),r.d(t,"Curve3",(function(){return i.Curve3})),r.d(t,"Plane",(function(){return i.Plane})),r.d(t,"Size",(function(){return i.Size})),r.d(t,"Vector2",(function(){return i.Vector2})),r.d(t,"Vector3",(function(){return i.Vector3})),r.d(t,"Vector4",(function(){return i.Vector4})),r.d(t,"Quaternion",(function(){return i.Quaternion})),r.d(t,"Matrix",(function(){return i.Matrix})),r.d(t,"TmpVectors",(function(){return i.TmpVectors})),r.d(t,"PositionNormalVertex",(function(){return i.PositionNormalVertex})),r.d(t,"PositionNormalTextureVertex",(function(){return i.PositionNormalTextureVertex})),r.d(t,"Viewport",(function(){return i.Viewport}));var o=r(/*! ./sphericalPolynomial */"./Maths/sphericalPolynomial.ts");r.d(t,"SphericalHarmonics",(function(){return o.SphericalHarmonics})),r.d(t,"SphericalPolynomial",(function(){return o.SphericalPolynomial}))},"./Maths/math.axis.ts":
- /*!****************************!*\
- !*** ./Maths/math.axis.ts ***!
- \****************************/
- /*! exports provided: Space, Axis */function(e,t,r){"use strict";r.r(t),r.d(t,"Space",(function(){return n})),r.d(t,"Axis",(function(){return o}));var n,i=r(/*! ./math.vector */"./Maths/math.vector.ts");!function(e){e[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE"}(n||(n={}));var o=function(){function e(){}return e.X=new i.Vector3(1,0,0),e.Y=new i.Vector3(0,1,0),e.Z=new i.Vector3(0,0,1),e}()},"./Maths/math.color.ts":
- /*!*****************************!*\
- !*** ./Maths/math.color.ts ***!
- \*****************************/
- /*! exports provided: Color3, Color4, TmpColors */function(e,t,r){"use strict";r.r(t),r.d(t,"Color3",(function(){return a})),r.d(t,"Color4",(function(){return l})),r.d(t,"TmpColors",(function(){return c}));var n=r(/*! ./math.scalar */"./Maths/math.scalar.ts"),i=r(/*! ./math.constants */"./Maths/math.constants.ts"),o=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=function(){function e(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this.r=e,this.g=t,this.b=r}return e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},e.prototype.getClassName=function(){return"Color3"},e.prototype.getHashCode=function(){var e=255*this.r|0;return e=397*(e=397*e^(255*this.g|0))^(255*this.b|0)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this},e.prototype.fromArray=function(t,r){return void 0===r&&(r=0),e.FromArrayToRef(t,r,this),this},e.prototype.toColor4=function(e){return void 0===e&&(e=1),new l(this.r,this.g,this.b,e)},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toLuminance=function(){return.3*this.r+.59*this.g+.11*this.b},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,this},e.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b},e.prototype.equalsFloats=function(e,t,r){return this.r===e&&this.g===t&&this.b===r},e.prototype.scale=function(t){return new e(this.r*t,this.g*t,this.b*t)},e.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,this},e.prototype.clampToRef=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=1),r.r=n.Scalar.Clamp(this.r,e,t),r.g=n.Scalar.Clamp(this.g,e,t),r.b=n.Scalar.Clamp(this.b,e,t),this},e.prototype.add=function(t){return new e(this.r+t.r,this.g+t.g,this.b+t.b)},e.prototype.addToRef=function(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,this},e.prototype.subtract=function(t){return new e(this.r-t.r,this.g-t.g,this.b-t.b)},e.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,this},e.prototype.clone=function(){return new e(this.r,this.g,this.b)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},e.prototype.copyFromFloats=function(e,t,r){return this.r=e,this.g=t,this.b=r,this},e.prototype.set=function(e,t,r){return this.copyFromFloats(e,t,r)},e.prototype.toHexString=function(){var e=255*this.r|0,t=255*this.g|0,r=255*this.b|0;return"#"+n.Scalar.ToHex(e)+n.Scalar.ToHex(t)+n.Scalar.ToHex(r)},e.prototype.toLinearSpace=function(){var t=new e;return this.toLinearSpaceToRef(t),t},e.prototype.toHSV=function(){var t=new e;return this.toHSVToRef(t),t},e.prototype.toHSVToRef=function(e){var t=this.r,r=this.g,n=this.b,i=Math.max(t,r,n),o=Math.min(t,r,n),s=0,a=0,l=i,c=i-o;0!==i&&(a=c/i),i!=o&&(i==t?(s=(r-n)/c,r<n&&(s+=6)):i==r?s=(n-t)/c+2:i==n&&(s=(t-r)/c+4),s*=60),e.r=s,e.g=a,e.b=l},e.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,i.ToLinearSpace),e.g=Math.pow(this.g,i.ToLinearSpace),e.b=Math.pow(this.b,i.ToLinearSpace),this},e.prototype.toGammaSpace=function(){var t=new e;return this.toGammaSpaceToRef(t),t},e.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,i.ToGammaSpace),e.g=Math.pow(this.g,i.ToGammaSpace),e.b=Math.pow(this.b,i.ToGammaSpace),this},e.HSVtoRGBToRef=function(e,t,r,n){var i=r*t,o=e/60,s=i*(1-Math.abs(o%2-1)),a=0,l=0,c=0;o>=0&&o<=1?(a=i,l=s):o>=1&&o<=2?(a=s,l=i):o>=2&&o<=3?(l=i,c=s):o>=3&&o<=4?(l=s,c=i):o>=4&&o<=5?(a=s,c=i):o>=5&&o<=6&&(a=i,c=s);var u=r-i;n.set(a+u,l+u,c+u)},e.FromHexString=function(t){if("#"!==t.substring(0,1)||7!==t.length)return new e(0,0,0);var r=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16);return e.FromInts(r,n,i)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1],t[r+2])},e.FromArrayToRef=function(e,t,r){void 0===t&&(t=0),r.r=e[t],r.g=e[t+1],r.b=e[t+2]},e.FromInts=function(t,r,n){return new e(t/255,r/255,n/255)},e.Lerp=function(t,r,n){var i=new e(0,0,0);return e.LerpToRef(t,r,n,i),i},e.LerpToRef=function(e,t,r,n){n.r=e.r+(t.r-e.r)*r,n.g=e.g+(t.g-e.g)*r,n.b=e.b+(t.b-e.b)*r},e.Red=function(){return new e(1,0,0)},e.Green=function(){return new e(0,1,0)},e.Blue=function(){return new e(0,0,1)},e.Black=function(){return new e(0,0,0)},Object.defineProperty(e,"BlackReadOnly",{get:function(){return e._BlackReadOnly},enumerable:!1,configurable:!0}),e.White=function(){return new e(1,1,1)},e.Purple=function(){return new e(.5,0,.5)},e.Magenta=function(){return new e(1,0,1)},e.Yellow=function(){return new e(1,1,0)},e.Gray=function(){return new e(.5,.5,.5)},e.Teal=function(){return new e(0,1,1)},e.Random=function(){return new e(Math.random(),Math.random(),Math.random())},e._BlackReadOnly=e.Black(),e}(),l=function(){function e(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n}return e.prototype.addInPlace=function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this},e.prototype.fromArray=function(t,r){return void 0===r&&(r=0),e.FromArrayToRef(t,r,this),this},e.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a},e.prototype.add=function(t){return new e(this.r+t.r,this.g+t.g,this.b+t.b,this.a+t.a)},e.prototype.subtract=function(t){return new e(this.r-t.r,this.g-t.g,this.b-t.b,this.a-t.a)},e.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,this},e.prototype.scale=function(t){return new e(this.r*t,this.g*t,this.b*t,this.a*t)},e.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,this},e.prototype.clampToRef=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=1),r.r=n.Scalar.Clamp(this.r,e,t),r.g=n.Scalar.Clamp(this.g,e,t),r.b=n.Scalar.Clamp(this.b,e,t),r.a=n.Scalar.Clamp(this.a,e,t),this},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b,this.a*t.a)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t},e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},e.prototype.getClassName=function(){return"Color4"},e.prototype.getHashCode=function(){var e=255*this.r|0;return e=397*(e=397*(e=397*e^(255*this.g|0))^(255*this.b|0))^(255*this.a|0)},e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.a)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},e.prototype.copyFromFloats=function(e,t,r,n){return this.r=e,this.g=t,this.b=r,this.a=n,this},e.prototype.set=function(e,t,r,n){return this.copyFromFloats(e,t,r,n)},e.prototype.toHexString=function(e){void 0===e&&(e=!1);var t=255*this.r|0,r=255*this.g|0,i=255*this.b|0;if(e)return"#"+n.Scalar.ToHex(t)+n.Scalar.ToHex(r)+n.Scalar.ToHex(i);var o=255*this.a|0;return"#"+n.Scalar.ToHex(t)+n.Scalar.ToHex(r)+n.Scalar.ToHex(i)+n.Scalar.ToHex(o)},e.prototype.toLinearSpace=function(){var t=new e;return this.toLinearSpaceToRef(t),t},e.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,i.ToLinearSpace),e.g=Math.pow(this.g,i.ToLinearSpace),e.b=Math.pow(this.b,i.ToLinearSpace),e.a=this.a,this},e.prototype.toGammaSpace=function(){var t=new e;return this.toGammaSpaceToRef(t),t},e.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,i.ToGammaSpace),e.g=Math.pow(this.g,i.ToGammaSpace),e.b=Math.pow(this.b,i.ToGammaSpace),e.a=this.a,this},e.FromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length)return new e(0,0,0,0);var r=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16),o=parseInt(t.substring(7,9),16);return e.FromInts(r,n,i,o)},e.Lerp=function(t,r,n){var i=new e(0,0,0,0);return e.LerpToRef(t,r,n,i),i},e.LerpToRef=function(e,t,r,n){n.r=e.r+(t.r-e.r)*r,n.g=e.g+(t.g-e.g)*r,n.b=e.b+(t.b-e.b)*r,n.a=e.a+(t.a-e.a)*r},e.FromColor3=function(t,r){return void 0===r&&(r=1),new e(t.r,t.g,t.b,r)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1],t[r+2],t[r+3])},e.FromArrayToRef=function(e,t,r){void 0===t&&(t=0),r.r=e[t],r.g=e[t+1],r.b=e[t+2],r.a=e[t+3]},e.FromInts=function(t,r,n,i){return new e(t/255,r/255,n/255,i/255)},e.CheckColors4=function(e,t){if(e.length===3*t){for(var r=[],n=0;n<e.length;n+=3){var i=n/3*4;r[i]=e[n],r[i+1]=e[n+1],r[i+2]=e[n+2],r[i+3]=1}return r}return e},e}(),c=function(){function e(){}return e.Color3=o.ArrayTools.BuildArray(3,a.Black),e.Color4=o.ArrayTools.BuildArray(3,(function(){return new l(0,0,0,0)})),e}();s._TypeStore.RegisteredTypes["BABYLON.Color3"]=a,s._TypeStore.RegisteredTypes["BABYLON.Color4"]=l},"./Maths/math.constants.ts":
- /*!*********************************!*\
- !*** ./Maths/math.constants.ts ***!
- \*********************************/
- /*! exports provided: ToGammaSpace, ToLinearSpace, Epsilon */function(e,t,r){"use strict";r.r(t),r.d(t,"ToGammaSpace",(function(){return n})),r.d(t,"ToLinearSpace",(function(){return i})),r.d(t,"Epsilon",(function(){return o}));var n=1/2.2,i=2.2,o=.001},"./Maths/math.frustum.ts":
- /*!*******************************!*\
- !*** ./Maths/math.frustum.ts ***!
- \*******************************/
- /*! exports provided: Frustum */function(e,t,r){"use strict";r.r(t),r.d(t,"Frustum",(function(){return i}));var n=r(/*! ./math.plane */"./Maths/math.plane.ts"),i=function(){function e(){}return e.GetPlanes=function(t){for(var r=[],i=0;i<6;i++)r.push(new n.Plane(0,0,0,0));return e.GetPlanesToRef(t,r),r},e.GetNearPlaneToRef=function(e,t){var r=e.m;t.normal.x=r[3]+r[2],t.normal.y=r[7]+r[6],t.normal.z=r[11]+r[10],t.d=r[15]+r[14],t.normalize()},e.GetFarPlaneToRef=function(e,t){var r=e.m;t.normal.x=r[3]-r[2],t.normal.y=r[7]-r[6],t.normal.z=r[11]-r[10],t.d=r[15]-r[14],t.normalize()},e.GetLeftPlaneToRef=function(e,t){var r=e.m;t.normal.x=r[3]+r[0],t.normal.y=r[7]+r[4],t.normal.z=r[11]+r[8],t.d=r[15]+r[12],t.normalize()},e.GetRightPlaneToRef=function(e,t){var r=e.m;t.normal.x=r[3]-r[0],t.normal.y=r[7]-r[4],t.normal.z=r[11]-r[8],t.d=r[15]-r[12],t.normalize()},e.GetTopPlaneToRef=function(e,t){var r=e.m;t.normal.x=r[3]-r[1],t.normal.y=r[7]-r[5],t.normal.z=r[11]-r[9],t.d=r[15]-r[13],t.normalize()},e.GetBottomPlaneToRef=function(e,t){var r=e.m;t.normal.x=r[3]+r[1],t.normal.y=r[7]+r[5],t.normal.z=r[11]+r[9],t.d=r[15]+r[13],t.normalize()},e.GetPlanesToRef=function(t,r){e.GetNearPlaneToRef(t,r[0]),e.GetFarPlaneToRef(t,r[1]),e.GetLeftPlaneToRef(t,r[2]),e.GetRightPlaneToRef(t,r[3]),e.GetTopPlaneToRef(t,r[4]),e.GetBottomPlaneToRef(t,r[5])},e}()},"./Maths/math.functions.ts":
- /*!*********************************!*\
- !*** ./Maths/math.functions.ts ***!
- \*********************************/
- /*! exports provided: extractMinAndMaxIndexed, extractMinAndMax */function(e,t,r){"use strict";r.r(t),r.d(t,"extractMinAndMaxIndexed",(function(){return i})),r.d(t,"extractMinAndMax",(function(){return o}));var n=r(/*! ./math.vector */"./Maths/math.vector.ts");function i(e,t,r,i,o){void 0===o&&(o=null);for(var s=new n.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new n.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=r;l<r+i;l++){var c=3*t[l],u=e[c],d=e[c+1],h=e[c+2];s.minimizeInPlaceFromFloats(u,d,h),a.maximizeInPlaceFromFloats(u,d,h)}return o&&(s.x-=s.x*o.x+o.y,s.y-=s.y*o.x+o.y,s.z-=s.z*o.x+o.y,a.x+=a.x*o.x+o.y,a.y+=a.y*o.x+o.y,a.z+=a.z*o.x+o.y),{minimum:s,maximum:a}}function o(e,t,r,i,o){void 0===i&&(i=null);var s=new n.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new n.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);o||(o=3);for(var l=t,c=t*o;l<t+r;l++,c+=o){var u=e[c],d=e[c+1],h=e[c+2];s.minimizeInPlaceFromFloats(u,d,h),a.maximizeInPlaceFromFloats(u,d,h)}return i&&(s.x-=s.x*i.x+i.y,s.y-=s.y*i.x+i.y,s.z-=s.z*i.x+i.y,a.x+=a.x*i.x+i.y,a.y+=a.y*i.x+i.y,a.z+=a.z*i.x+i.y),{minimum:s,maximum:a}}},"./Maths/math.path.ts":
- /*!****************************!*\
- !*** ./Maths/math.path.ts ***!
- \****************************/
- /*! exports provided: Orientation, BezierCurve, Angle, Arc2, Path2, Path3D, Curve3 */function(e,t,r){"use strict";r.r(t),r.d(t,"Orientation",(function(){return n})),r.d(t,"BezierCurve",(function(){return a})),r.d(t,"Angle",(function(){return l})),r.d(t,"Arc2",(function(){return c})),r.d(t,"Path2",(function(){return u})),r.d(t,"Path3D",(function(){return d})),r.d(t,"Curve3",(function(){return h}));var n,i=r(/*! ./math.scalar */"./Maths/math.scalar.ts"),o=r(/*! ./math.vector */"./Maths/math.vector.ts"),s=r(/*! ./math.constants */"./Maths/math.constants.ts");!function(e){e[e.CW=0]="CW",e[e.CCW=1]="CCW"}(n||(n={}));var a=function(){function e(){}return e.Interpolate=function(e,t,r,n,i){for(var o=1-3*n+3*t,s=3*n-6*t,a=3*t,l=e,c=0;c<5;c++){var u=l*l;l-=1/(3*o*u+2*s*l+a)*(o*(u*l)+s*u+a*l-e),l=Math.min(1,Math.max(0,l))}return 3*Math.pow(1-l,2)*l*r+3*(1-l)*Math.pow(l,2)*i+Math.pow(l,3)},e}(),l=function(){function e(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}return e.prototype.degrees=function(){return 180*this._radians/Math.PI},e.prototype.radians=function(){return this._radians},e.BetweenTwoPoints=function(t,r){var n=r.subtract(t);return new e(Math.atan2(n.y,n.x))},e.FromRadians=function(t){return new e(t)},e.FromDegrees=function(t){return new e(t*Math.PI/180)},e}(),c=function(e,t,r){this.startPoint=e,this.midPoint=t,this.endPoint=r;var i=Math.pow(t.x,2)+Math.pow(t.y,2),s=(Math.pow(e.x,2)+Math.pow(e.y,2)-i)/2,a=(i-Math.pow(r.x,2)-Math.pow(r.y,2))/2,c=(e.x-t.x)*(t.y-r.y)-(t.x-r.x)*(e.y-t.y);this.centerPoint=new o.Vector2((s*(t.y-r.y)-a*(e.y-t.y))/c,((e.x-t.x)*a-(t.x-r.x)*s)/c),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=l.BetweenTwoPoints(this.centerPoint,this.startPoint);var u=this.startAngle.degrees(),d=l.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),h=l.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();d-u>180&&(d-=360),d-u<-180&&(d+=360),h-d>180&&(h-=360),h-d<-180&&(h+=360),this.orientation=d-u<0?n.CW:n.CCW,this.angle=l.FromDegrees(this.orientation===n.CW?u-h:h-u)},u=function(){function e(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new o.Vector2(e,t))}return e.prototype.addLineTo=function(e,t){if(this.closed)return this;var r=new o.Vector2(e,t),n=this._points[this._points.length-1];return this._points.push(r),this._length+=r.subtract(n).length(),this},e.prototype.addArcTo=function(e,t,r,i,s){if(void 0===s&&(s=36),this.closed)return this;var a=this._points[this._points.length-1],l=new o.Vector2(e,t),u=new o.Vector2(r,i),d=new c(a,l,u),h=d.angle.radians()/s;d.orientation===n.CW&&(h*=-1);for(var f=d.startAngle.radians()+h,p=0;p<s;p++){var m=Math.cos(f)*d.radius+d.centerPoint.x,g=Math.sin(f)*d.radius+d.centerPoint.y;this.addLineTo(m,g),f+=h}return this},e.prototype.close=function(){return this.closed=!0,this},e.prototype.length=function(){var e=this._length;if(this.closed){var t=this._points[this._points.length-1];e+=this._points[0].subtract(t).length()}return e},e.prototype.getPoints=function(){return this._points},e.prototype.getPointAtLengthPosition=function(e){if(e<0||e>1)return o.Vector2.Zero();for(var t=e*this.length(),r=0,n=0;n<this._points.length;n++){var i=(n+1)%this._points.length,s=this._points[n],a=this._points[i].subtract(s),l=a.length()+r;if(t>=r&&t<=l){var c=a.normalize(),u=t-r;return new o.Vector2(s.x+c.x*u,s.y+c.y*u)}r=l}return o.Vector2.Zero()},e.StartingAt=function(t,r){return new e(t,r)},e}(),d=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===n&&(n=!1),this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:o.Vector3.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:o.Matrix.Identity()};for(var i=0;i<e.length;i++)this._curve[i]=e[i].clone();this._raw=r||!1,this._alignTangentsWithPath=n,this._compute(t,n)}return e.prototype.getCurve=function(){return this._curve},e.prototype.getPoints=function(){return this._curve},e.prototype.length=function(){return this._distances[this._distances.length-1]},e.prototype.getTangents=function(){return this._tangents},e.prototype.getNormals=function(){return this._normals},e.prototype.getBinormals=function(){return this._binormals},e.prototype.getDistances=function(){return this._distances},e.prototype.getPointAt=function(e){return this._updatePointAtData(e).point},e.prototype.getTangentAt=function(e,t){return void 0===t&&(t=!1),this._updatePointAtData(e,t),t?o.Vector3.TransformCoordinates(o.Vector3.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]},e.prototype.getNormalAt=function(e,t){return void 0===t&&(t=!1),this._updatePointAtData(e,t),t?o.Vector3.TransformCoordinates(o.Vector3.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]},e.prototype.getBinormalAt=function(e,t){return void 0===t&&(t=!1),this._updatePointAtData(e,t),t?o.Vector3.TransformCoordinates(o.Vector3.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]},e.prototype.getDistanceAt=function(e){return this.length()*e},e.prototype.getPreviousPointIndexAt=function(e){return this._updatePointAtData(e),this._pointAtData.previousPointArrayIndex},e.prototype.getSubPositionAt=function(e){return this._updatePointAtData(e),this._pointAtData.subPosition},e.prototype.getClosestPositionTo=function(e){for(var t=Number.MAX_VALUE,r=0,n=0;n<this._curve.length-1;n++){var i=this._curve[n+0],s=this._curve[n+1].subtract(i).normalize(),a=this._distances[n+1]-this._distances[n+0],l=Math.min(Math.max(o.Vector3.Dot(s,e.subtract(i).normalize()),0)*o.Vector3.Distance(i,e)/a,1),c=o.Vector3.Distance(i.add(s.scale(l*a)),e);c<t&&(t=c,r=(this._distances[n+0]+a*l)/this.length())}return r},e.prototype.slice=function(t,r){if(void 0===t&&(t=0),void 0===r&&(r=1),t<0&&(t=1- -1*t%1),r<0&&(r=1- -1*r%1),t>r){var n=t;t=r,r=n}var i=this.getCurve(),o=this.getPointAt(t),s=this.getPreviousPointIndexAt(t),a=this.getPointAt(r),l=this.getPreviousPointIndexAt(r)+1,c=[];return 0!==t&&(s++,c.push(o)),c.push.apply(c,i.slice(s,l)),1===r&&1!==t||c.push(a),new e(c,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)},e.prototype.update=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=!1);for(var n=0;n<e.length;n++)this._curve[n].x=e[n].x,this._curve[n].y=e[n].y,this._curve[n].z=e[n].z;return this._compute(t,r),this},e.prototype._compute=function(e,t){void 0===t&&(t=!1);var r=this._curve.length;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[r-1]=this._curve[r-1].subtract(this._curve[r-2]),this._raw||this._tangents[r-1].normalize();var n,i,s,a,l,c=this._tangents[0],u=this._normalVector(c,e);this._normals[0]=u,this._raw||this._normals[0].normalize(),this._binormals[0]=o.Vector3.Cross(c,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(var d=1;d<r;d++)n=this._getLastNonNullVector(d),d<r-1&&(i=this._getFirstNonNullVector(d),this._tangents[d]=t?i:n.add(i),this._tangents[d].normalize()),this._distances[d]=this._distances[d-1]+this._curve[d].subtract(this._curve[d-1]).length(),s=this._tangents[d],l=this._binormals[d-1],this._normals[d]=o.Vector3.Cross(l,s),this._raw||(0===this._normals[d].length()?(a=this._normals[d-1],this._normals[d]=a.clone()):this._normals[d].normalize()),this._binormals[d]=o.Vector3.Cross(s,this._normals[d]),this._raw||this._binormals[d].normalize();this._pointAtData.id=NaN},e.prototype._getFirstNonNullVector=function(e){for(var t=1,r=this._curve[e+t].subtract(this._curve[e]);0===r.length()&&e+t+1<this._curve.length;)t++,r=this._curve[e+t].subtract(this._curve[e]);return r},e.prototype._getLastNonNullVector=function(e){for(var t=1,r=this._curve[e].subtract(this._curve[e-t]);0===r.length()&&e>t+1;)t++,r=this._curve[e].subtract(this._curve[e-t]);return r},e.prototype._normalVector=function(e,t){var r,n,a=e.length();return 0===a&&(a=1),null==t?(n=i.Scalar.WithinEpsilon(Math.abs(e.y)/a,1,s.Epsilon)?i.Scalar.WithinEpsilon(Math.abs(e.x)/a,1,s.Epsilon)?i.Scalar.WithinEpsilon(Math.abs(e.z)/a,1,s.Epsilon)?o.Vector3.Zero():new o.Vector3(0,0,1):new o.Vector3(1,0,0):new o.Vector3(0,-1,0),r=o.Vector3.Cross(e,n)):(r=o.Vector3.Cross(e,t),o.Vector3.CrossToRef(r,e,r)),r.normalize(),r},e.prototype._updatePointAtData=function(e,t){if(void 0===t&&(t=!1),this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;var r=this.getPoints();if(e<=0)return this._setPointAtData(0,0,r[0],0,t);if(e>=1)return this._setPointAtData(1,1,r[r.length-1],r.length-1,t);for(var n,i=r[0],s=0,a=e*this.length(),l=1;l<r.length;l++){n=r[l];var c=o.Vector3.Distance(i,n);if((s+=c)===a)return this._setPointAtData(e,1,n,l,t);if(s>a){var u=(s-a)/c,d=i.subtract(n),h=n.add(d.scaleInPlace(u));return this._setPointAtData(e,1-u,h,l-1,t)}i=n}return this._pointAtData},e.prototype._setPointAtData=function(e,t,r,n,i){return this._pointAtData.point=r,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=n,this._pointAtData.interpolateReady=i,i&&this._updateInterpolationMatrix(),this._pointAtData},e.prototype._updateInterpolationMatrix=function(){this._pointAtData.interpolationMatrix=o.Matrix.Identity();var e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){var t=e+1,r=this._tangents[e].clone(),n=this._normals[e].clone(),i=this._binormals[e].clone(),s=this._tangents[t].clone(),a=this._normals[t].clone(),l=this._binormals[t].clone(),c=o.Quaternion.RotationQuaternionFromAxis(n,i,r),u=o.Quaternion.RotationQuaternionFromAxis(a,l,s);o.Quaternion.Slerp(c,u,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}},e}(),h=function(){function e(e){this._length=0,this._points=e,this._length=this._computeLength(e)}return e.CreateQuadraticBezier=function(t,r,n,i){i=i>2?i:3;for(var s=new Array,a=function(e,t,r,n){return(1-e)*(1-e)*t+2*e*(1-e)*r+e*e*n},l=0;l<=i;l++)s.push(new o.Vector3(a(l/i,t.x,r.x,n.x),a(l/i,t.y,r.y,n.y),a(l/i,t.z,r.z,n.z)));return new e(s)},e.CreateCubicBezier=function(t,r,n,i,s){s=s>3?s:4;for(var a=new Array,l=function(e,t,r,n,i){return(1-e)*(1-e)*(1-e)*t+3*e*(1-e)*(1-e)*r+3*e*e*(1-e)*n+e*e*e*i},c=0;c<=s;c++)a.push(new o.Vector3(l(c/s,t.x,r.x,n.x,i.x),l(c/s,t.y,r.y,n.y,i.y),l(c/s,t.z,r.z,n.z,i.z)));return new e(a)},e.CreateHermiteSpline=function(t,r,n,i,s){for(var a=new Array,l=1/s,c=0;c<=s;c++)a.push(o.Vector3.Hermite(t,r,n,i,c*l));return new e(a)},e.CreateCatmullRomSpline=function(t,r,n){var i=new Array,s=1/r,a=0;if(n){for(var l=t.length,c=0;c<l;c++){a=0;for(var u=0;u<r;u++)i.push(o.Vector3.CatmullRom(t[c%l],t[(c+1)%l],t[(c+2)%l],t[(c+3)%l],a)),a+=s}i.push(i[0])}else{var d=new Array;for(d.push(t[0].clone()),Array.prototype.push.apply(d,t),d.push(t[t.length-1].clone()),c=0;c<d.length-3;c++)for(a=0,u=0;u<r;u++)i.push(o.Vector3.CatmullRom(d[c],d[c+1],d[c+2],d[c+3],a)),a+=s;c--,i.push(o.Vector3.CatmullRom(d[c],d[c+1],d[c+2],d[c+3],a))}return new e(i)},e.prototype.getPoints=function(){return this._points},e.prototype.length=function(){return this._length},e.prototype.continue=function(t){for(var r=this._points[this._points.length-1],n=this._points.slice(),i=t.getPoints(),o=1;o<i.length;o++)n.push(i[o].subtract(i[0]).add(r));return new e(n)},e.prototype._computeLength=function(e){for(var t=0,r=1;r<e.length;r++)t+=e[r].subtract(e[r-1]).length();return t},e}()},"./Maths/math.plane.ts":
- /*!*****************************!*\
- !*** ./Maths/math.plane.ts ***!
- \*****************************/
- /*! exports provided: Plane */function(e,t,r){"use strict";r.r(t),r.d(t,"Plane",(function(){return i}));var n=r(/*! ./math.vector */"./Maths/math.vector.ts"),i=function(){function e(e,t,r,i){this.normal=new n.Vector3(e,t,r),this.d=i}return e.prototype.asArray=function(){return[this.normal.x,this.normal.y,this.normal.z,this.d]},e.prototype.clone=function(){return new e(this.normal.x,this.normal.y,this.normal.z,this.d)},e.prototype.getClassName=function(){return"Plane"},e.prototype.getHashCode=function(){var e=this.normal.getHashCode();return e=397*e^(0|this.d)},e.prototype.normalize=function(){var e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z),t=0;return 0!==e&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this},e.prototype.transform=function(t){var r=e._TmpMatrix;t.invertToRef(r);var n=r.m,i=this.normal.x,o=this.normal.y,s=this.normal.z,a=this.d;return new e(i*n[0]+o*n[1]+s*n[2]+a*n[3],i*n[4]+o*n[5]+s*n[6]+a*n[7],i*n[8]+o*n[9]+s*n[10]+a*n[11],i*n[12]+o*n[13]+s*n[14]+a*n[15])},e.prototype.dotCoordinate=function(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d},e.prototype.copyFromPoints=function(e,t,r){var n,i=t.x-e.x,o=t.y-e.y,s=t.z-e.z,a=r.x-e.x,l=r.y-e.y,c=r.z-e.z,u=o*c-s*l,d=s*a-i*c,h=i*l-o*a,f=Math.sqrt(u*u+d*d+h*h);return n=0!==f?1/f:0,this.normal.x=u*n,this.normal.y=d*n,this.normal.z=h*n,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this},e.prototype.isFrontFacingTo=function(e,t){return n.Vector3.Dot(this.normal,e)<=t},e.prototype.signedDistanceTo=function(e){return n.Vector3.Dot(e,this.normal)+this.d},e.FromArray=function(t){return new e(t[0],t[1],t[2],t[3])},e.FromPoints=function(t,r,n){var i=new e(0,0,0,0);return i.copyFromPoints(t,r,n),i},e.FromPositionAndNormal=function(t,r){var n=new e(0,0,0,0);return r.normalize(),n.normal=r,n.d=-(r.x*t.x+r.y*t.y+r.z*t.z),n},e.SignedDistanceToPlaneFromPositionAndNormal=function(e,t,r){var i=-(t.x*e.x+t.y*e.y+t.z*e.z);return n.Vector3.Dot(r,t)+i},e._TmpMatrix=n.Matrix.Identity(),e}()},"./Maths/math.scalar.ts":
- /*!******************************!*\
- !*** ./Maths/math.scalar.ts ***!
- \******************************/
- /*! exports provided: Scalar */function(e,t,r){"use strict";r.r(t),r.d(t,"Scalar",(function(){return n}));var n=function(){function e(){}return e.WithinEpsilon=function(e,t,r){void 0===r&&(r=1401298e-51);var n=e-t;return-r<=n&&n<=r},e.ToHex=function(e){var t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},e.Sign=function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},e.Clamp=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),Math.min(r,Math.max(t,e))},e.Log2=function(e){return Math.log(e)*Math.LOG2E},e.Repeat=function(e,t){return e-Math.floor(e/t)*t},e.Normalize=function(e,t,r){return(e-t)/(r-t)},e.Denormalize=function(e,t,r){return e*(r-t)+t},e.DeltaAngle=function(t,r){var n=e.Repeat(r-t,360);return n>180&&(n-=360),n},e.PingPong=function(t,r){var n=e.Repeat(t,2*r);return r-Math.abs(n-r)},e.SmoothStep=function(t,r,n){var i=e.Clamp(n);return r*(i=-2*i*i*i+3*i*i)+t*(1-i)},e.MoveTowards=function(t,r,n){return Math.abs(r-t)<=n?r:t+e.Sign(r-t)*n},e.MoveTowardsAngle=function(t,r,n){var i=e.DeltaAngle(t,r),o=0;return-n<i&&i<n?o=r:(r=t+i,o=e.MoveTowards(t,r,n)),o},e.Lerp=function(e,t,r){return e+(t-e)*r},e.LerpAngle=function(t,r,n){var i=e.Repeat(r-t,360);return i>180&&(i-=360),t+i*e.Clamp(n)},e.InverseLerp=function(t,r,n){return t!=r?e.Clamp((n-t)/(r-t)):0},e.Hermite=function(e,t,r,n,i){var o=i*i,s=i*o;return e*(2*s-3*o+1)+r*(-2*s+3*o)+t*(s-2*o+i)+n*(s-o)},e.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},e.RangeToPercent=function(e,t,r){return(e-t)/(r-t)},e.PercentToRange=function(e,t,r){return(r-t)*e+t},e.NormalizeRadians=function(t){return t-=e.TwoPi*Math.floor((t+Math.PI)/e.TwoPi)},e.TwoPi=2*Math.PI,e}()},"./Maths/math.size.ts":
- /*!****************************!*\
- !*** ./Maths/math.size.ts ***!
- \****************************/
- /*! exports provided: Size */function(e,t,r){"use strict";r.r(t),r.d(t,"Size",(function(){return n}));var n=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.toString=function(){return"{W: "+this.width+", H: "+this.height+"}"},e.prototype.getClassName=function(){return"Size"},e.prototype.getHashCode=function(){var e=0|this.width;return e=397*e^(0|this.height)},e.prototype.copyFrom=function(e){this.width=e.width,this.height=e.height},e.prototype.copyFromFloats=function(e,t){return this.width=e,this.height=t,this},e.prototype.set=function(e,t){return this.copyFromFloats(e,t)},e.prototype.multiplyByFloats=function(t,r){return new e(this.width*t,this.height*r)},e.prototype.clone=function(){return new e(this.width,this.height)},e.prototype.equals=function(e){return!!e&&this.width===e.width&&this.height===e.height},Object.defineProperty(e.prototype,"surface",{get:function(){return this.width*this.height},enumerable:!1,configurable:!0}),e.Zero=function(){return new e(0,0)},e.prototype.add=function(t){return new e(this.width+t.width,this.height+t.height)},e.prototype.subtract=function(t){return new e(this.width-t.width,this.height-t.height)},e.Lerp=function(t,r,n){return new e(t.width+(r.width-t.width)*n,t.height+(r.height-t.height)*n)},e}()},"./Maths/math.ts":
- /*!***********************!*\
- !*** ./Maths/math.ts ***!
- \***********************/
- /*! exports provided: Space, Axis, Color3, Color4, TmpColors, ToGammaSpace, ToLinearSpace, Epsilon, Frustum, Orientation, BezierCurve, Angle, Arc2, Path2, Path3D, Curve3, Plane, Size, Vector2, Vector3, Vector4, Quaternion, Matrix, TmpVectors, PositionNormalVertex, PositionNormalTextureVertex, Viewport */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./math.axis */"./Maths/math.axis.ts");r.d(t,"Space",(function(){return n.Space})),r.d(t,"Axis",(function(){return n.Axis}));var i=r(/*! ./math.color */"./Maths/math.color.ts");r.d(t,"Color3",(function(){return i.Color3})),r.d(t,"Color4",(function(){return i.Color4})),r.d(t,"TmpColors",(function(){return i.TmpColors}));var o=r(/*! ./math.constants */"./Maths/math.constants.ts");r.d(t,"ToGammaSpace",(function(){return o.ToGammaSpace})),r.d(t,"ToLinearSpace",(function(){return o.ToLinearSpace})),r.d(t,"Epsilon",(function(){return o.Epsilon}));var s=r(/*! ./math.frustum */"./Maths/math.frustum.ts");r.d(t,"Frustum",(function(){return s.Frustum}));var a=r(/*! ./math.path */"./Maths/math.path.ts");r.d(t,"Orientation",(function(){return a.Orientation})),r.d(t,"BezierCurve",(function(){return a.BezierCurve})),r.d(t,"Angle",(function(){return a.Angle})),r.d(t,"Arc2",(function(){return a.Arc2})),r.d(t,"Path2",(function(){return a.Path2})),r.d(t,"Path3D",(function(){return a.Path3D})),r.d(t,"Curve3",(function(){return a.Curve3}));var l=r(/*! ./math.plane */"./Maths/math.plane.ts");r.d(t,"Plane",(function(){return l.Plane}));var c=r(/*! ./math.size */"./Maths/math.size.ts");r.d(t,"Size",(function(){return c.Size}));var u=r(/*! ./math.vector */"./Maths/math.vector.ts");r.d(t,"Vector2",(function(){return u.Vector2})),r.d(t,"Vector3",(function(){return u.Vector3})),r.d(t,"Vector4",(function(){return u.Vector4})),r.d(t,"Quaternion",(function(){return u.Quaternion})),r.d(t,"Matrix",(function(){return u.Matrix})),r.d(t,"TmpVectors",(function(){return u.TmpVectors}));var d=r(/*! ./math.vertexFormat */"./Maths/math.vertexFormat.ts");r.d(t,"PositionNormalVertex",(function(){return d.PositionNormalVertex})),r.d(t,"PositionNormalTextureVertex",(function(){return d.PositionNormalTextureVertex}));var h=r(/*! ./math.viewport */"./Maths/math.viewport.ts");r.d(t,"Viewport",(function(){return h.Viewport}))},"./Maths/math.vector.ts":
- /*!******************************!*\
- !*** ./Maths/math.vector.ts ***!
- \******************************/
- /*! exports provided: Vector2, Vector3, Vector4, Quaternion, Matrix, TmpVectors */function(e,t,r){"use strict";r.r(t),r.d(t,"Vector2",(function(){return l})),r.d(t,"Vector3",(function(){return c})),r.d(t,"Vector4",(function(){return u})),r.d(t,"Quaternion",(function(){return d})),r.d(t,"Matrix",(function(){return h})),r.d(t,"TmpVectors",(function(){return p}));var n=r(/*! ./math.scalar */"./Maths/math.scalar.ts"),i=r(/*! ./math.constants */"./Maths/math.constants.ts"),o=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=r(/*! ../Engines/performanceConfigurator */"./Engines/performanceConfigurator.ts"),l=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=e,this.y=t}return e.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+"}"},e.prototype.getClassName=function(){return"Vector2"},e.prototype.getHashCode=function(){var e=0|this.x;return e=397*e^(0|this.y)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,this},e.prototype.fromArray=function(t,r){return void 0===r&&(r=0),e.FromArrayToRef(t,r,this),this},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.copyFromFloats=function(e,t){return this.x=e,this.y=t,this},e.prototype.set=function(e,t){return this.copyFromFloats(e,t)},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,this},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.addVector3=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,this},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this},e.prototype.multiply=function(t){return new e(this.x*t.x,this.y*t.y)},e.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,this},e.prototype.multiplyByFloats=function(t,r){return new e(this.x*t,this.y*r)},e.prototype.divide=function(t){return new e(this.x/t.x,this.y/t.y)},e.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,this},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.negate=function(){return new e(-this.x,-this.y)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this},e.prototype.scale=function(t){var r=new e(0,0);return this.scaleToRef(t,r),r},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,this},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this.x,e.x,t)&&n.Scalar.WithinEpsilon(this.y,e.y,t)},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y))},e.prototype.fract=function(){return new e(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.length();return 0===e||(this.x/=e,this.y/=e),this},e.prototype.clone=function(){return new e(this.x,this.y)},e.Zero=function(){return new e(0,0)},e.One=function(){return new e(1,1)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1])},e.FromArrayToRef=function(e,t,r){r.x=e[t],r.y=e[t+1]},e.CatmullRom=function(t,r,n,i,o){var s=o*o,a=o*s;return new e(.5*(2*r.x+(-t.x+n.x)*o+(2*t.x-5*r.x+4*n.x-i.x)*s+(-t.x+3*r.x-3*n.x+i.x)*a),.5*(2*r.y+(-t.y+n.y)*o+(2*t.y-5*r.y+4*n.y-i.y)*s+(-t.y+3*r.y-3*n.y+i.y)*a))},e.Clamp=function(t,r,n){var i=t.x;i=(i=i>n.x?n.x:i)<r.x?r.x:i;var o=t.y;return new e(i,o=(o=o>n.y?n.y:o)<r.y?r.y:o)},e.Hermite=function(t,r,n,i,o){var s=o*o,a=o*s,l=2*a-3*s+1,c=-2*a+3*s,u=a-2*s+o,d=a-s;return new e(t.x*l+n.x*c+r.x*u+i.x*d,t.y*l+n.y*c+r.y*u+i.y*d)},e.Lerp=function(t,r,n){return new e(t.x+(r.x-t.x)*n,t.y+(r.y-t.y)*n)},e.Dot=function(e,t){return e.x*t.x+e.y*t.y},e.Normalize=function(e){var t=e.clone();return t.normalize(),t},e.Minimize=function(t,r){return new e(t.x<r.x?t.x:r.x,t.y<r.y?t.y:r.y)},e.Maximize=function(t,r){return new e(t.x>r.x?t.x:r.x,t.y>r.y?t.y:r.y)},e.Transform=function(t,r){var n=e.Zero();return e.TransformToRef(t,r,n),n},e.TransformToRef=function(e,t,r){var n=t.m,i=e.x*n[0]+e.y*n[4]+n[12],o=e.x*n[1]+e.y*n[5]+n[13];r.x=i,r.y=o},e.PointInTriangle=function(e,t,r,n){var i=.5*(-r.y*n.x+t.y*(-r.x+n.x)+t.x*(r.y-n.y)+r.x*n.y),o=i<0?-1:1,s=(t.y*n.x-t.x*n.y+(n.y-t.y)*e.x+(t.x-n.x)*e.y)*o,a=(t.x*r.y-t.y*r.x+(t.y-r.y)*e.x+(r.x-t.x)*e.y)*o;return s>0&&a>0&&s+a<2*i*o},e.Distance=function(t,r){return Math.sqrt(e.DistanceSquared(t,r))},e.DistanceSquared=function(e,t){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n},e.Center=function(e,t){var r=e.add(t);return r.scaleInPlace(.5),r},e.DistanceOfPointFromSegment=function(t,r,n){var i=e.DistanceSquared(r,n);if(0===i)return e.Distance(t,r);var o=n.subtract(r),s=Math.max(0,Math.min(1,e.Dot(t.subtract(r),o)/i)),a=r.add(o.multiplyByFloats(s,s));return e.Distance(t,a)},e}(),c=function(){function e(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this._isDirty=!0,this._x=e,this._y=t,this._z=r}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+"}"},e.prototype.getClassName=function(){return"Vector3"},e.prototype.getHashCode=function(){var e=0|this._x;return e=397*(e=397*e^(0|this._y))^(0|this._z)},e.prototype.asArray=function(){var e=[];return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this},e.prototype.fromArray=function(t,r){return void 0===r&&(r=0),e.FromArrayToRef(t,r,this),this},e.prototype.toQuaternion=function(){return d.RotationYawPitchRoll(this._y,this._x,this._z)},e.prototype.addInPlace=function(e){return this.addInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.addInPlaceFromFloats=function(e,t,r){return this.x+=e,this.y+=t,this.z+=r,this},e.prototype.add=function(t){return new e(this._x+t._x,this._y+t._y,this._z+t._z)},e.prototype.addToRef=function(e,t){return t.copyFromFloats(this._x+e._x,this._y+e._y,this._z+e._z)},e.prototype.subtractInPlace=function(e){return this.x-=e._x,this.y-=e._y,this.z-=e._z,this},e.prototype.subtract=function(t){return new e(this._x-t._x,this._y-t._y,this._z-t._z)},e.prototype.subtractToRef=function(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)},e.prototype.subtractFromFloats=function(t,r,n){return new e(this._x-t,this._y-r,this._z-n)},e.prototype.subtractFromFloatsToRef=function(e,t,r,n){return n.copyFromFloats(this._x-e,this._y-t,this._z-r)},e.prototype.negate=function(){return new e(-this._x,-this._y,-this._z)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this._x,-1*this._y,-1*this._z)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.prototype.scale=function(t){return new e(this._x*t,this._y*t,this._z*t)},e.prototype.scaleToRef=function(e,t){return t.copyFromFloats(this._x*e,this._y*e,this._z*e)},e.prototype.scaleAndAddToRef=function(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)},e.prototype.projectOnPlane=function(t,r){var n=e.Zero();return this.projectOnPlaneToRef(t,r,n),n},e.prototype.projectOnPlaneToRef=function(t,r,n){var i=t.normal,o=t.d,s=f.Vector3[0];this.subtractToRef(r,s),s.normalize();var a=e.Dot(s,i),l=-(e.Dot(r,i)+o)/a,c=s.scaleInPlace(l);r.addToRef(c,n)},e.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this._x,e._x,t)&&n.Scalar.WithinEpsilon(this._y,e._y,t)&&n.Scalar.WithinEpsilon(this._z,e._z,t)},e.prototype.equalsToFloats=function(e,t,r){return this._x===e&&this._y===t&&this._z===r},e.prototype.multiplyInPlace=function(e){return this.x*=e._x,this.y*=e._y,this.z*=e._z,this},e.prototype.multiply=function(e){return this.multiplyByFloats(e._x,e._y,e._z)},e.prototype.multiplyToRef=function(e,t){return t.copyFromFloats(this._x*e._x,this._y*e._y,this._z*e._z)},e.prototype.multiplyByFloats=function(t,r,n){return new e(this._x*t,this._y*r,this._z*n)},e.prototype.divide=function(t){return new e(this._x/t._x,this._y/t._y,this._z/t._z)},e.prototype.divideToRef=function(e,t){return t.copyFromFloats(this._x/e._x,this._y/e._y,this._z/e._z)},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.minimizeInPlace=function(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.maximizeInPlace=function(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.minimizeInPlaceFromFloats=function(e,t,r){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),r<this._z&&(this.z=r),this},e.prototype.maximizeInPlaceFromFloats=function(e,t,r){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),r>this._z&&(this.z=r),this},e.prototype.isNonUniformWithinEpsilon=function(e){var t=Math.abs(this._x),r=Math.abs(this._y);if(!n.Scalar.WithinEpsilon(t,r,e))return!0;var i=Math.abs(this._z);return!n.Scalar.WithinEpsilon(t,i,e)||!n.Scalar.WithinEpsilon(r,i,e)},Object.defineProperty(e.prototype,"isNonUniform",{get:function(){var e=Math.abs(this._x);return e!==Math.abs(this._y)||e!==Math.abs(this._z)},enumerable:!1,configurable:!0}),e.prototype.floor=function(){return new e(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},e.prototype.fract=function(){return new e(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},e.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},e.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},e.prototype.normalize=function(){return this.normalizeFromLength(this.length())},e.prototype.reorderInPlace=function(e){var t=this;return"xyz"===(e=e.toLowerCase())||(f.Vector3[0].copyFrom(this),["x","y","z"].forEach((function(r,n){t[r]=f.Vector3[0][e[n]]}))),this},e.prototype.rotateByQuaternionToRef=function(t,r){return t.toRotationMatrix(f.Matrix[0]),e.TransformCoordinatesToRef(this,f.Matrix[0],r),r},e.prototype.rotateByQuaternionAroundPointToRef=function(e,t,r){return this.subtractToRef(t,f.Vector3[0]),f.Vector3[0].rotateByQuaternionToRef(e,f.Vector3[0]),t.addToRef(f.Vector3[0],r),r},e.prototype.cross=function(t){return e.Cross(this,t)},e.prototype.normalizeFromLength=function(e){return 0===e||1===e?this:this.scaleInPlace(1/e)},e.prototype.normalizeToNew=function(){var t=new e(0,0,0);return this.normalizeToRef(t),t},e.prototype.normalizeToRef=function(e){var t=this.length();return 0===t||1===t?e.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/t,e)},e.prototype.clone=function(){return new e(this._x,this._y,this._z)},e.prototype.copyFrom=function(e){return this.copyFromFloats(e._x,e._y,e._z)},e.prototype.copyFromFloats=function(e,t,r){return this.x=e,this.y=t,this.z=r,this},e.prototype.set=function(e,t,r){return this.copyFromFloats(e,t,r)},e.prototype.setAll=function(e){return this.x=this.y=this.z=e,this},e.GetClipFactor=function(t,r,n,i){var o=e.Dot(t,n)-i;return o/(o-(e.Dot(r,n)-i))},e.GetAngleBetweenVectors=function(t,r,n){var i=t.normalizeToRef(f.Vector3[1]),o=r.normalizeToRef(f.Vector3[2]),s=e.Dot(i,o),a=f.Vector3[3];return e.CrossToRef(i,o,a),e.Dot(a,n)>0?Math.acos(s):-Math.acos(s)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1],t[r+2])},e.FromFloatArray=function(t,r){return e.FromArray(t,r)},e.FromArrayToRef=function(e,t,r){r.x=e[t],r.y=e[t+1],r.z=e[t+2]},e.FromFloatArrayToRef=function(t,r,n){return e.FromArrayToRef(t,r,n)},e.FromFloatsToRef=function(e,t,r,n){n.copyFromFloats(e,t,r)},e.Zero=function(){return new e(0,0,0)},e.One=function(){return new e(1,1,1)},e.Up=function(){return new e(0,1,0)},Object.defineProperty(e,"UpReadOnly",{get:function(){return e._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ZeroReadOnly",{get:function(){return e._ZeroReadOnly},enumerable:!1,configurable:!0}),e.Down=function(){return new e(0,-1,0)},e.Forward=function(t){return void 0===t&&(t=!1),new e(0,0,t?-1:1)},e.Backward=function(t){return void 0===t&&(t=!1),new e(0,0,t?1:-1)},e.Right=function(){return new e(1,0,0)},e.Left=function(){return new e(-1,0,0)},e.TransformCoordinates=function(t,r){var n=e.Zero();return e.TransformCoordinatesToRef(t,r,n),n},e.TransformCoordinatesToRef=function(t,r,n){e.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,r,n)},e.TransformCoordinatesFromFloatsToRef=function(e,t,r,n,i){var o=n.m,s=e*o[0]+t*o[4]+r*o[8]+o[12],a=e*o[1]+t*o[5]+r*o[9]+o[13],l=e*o[2]+t*o[6]+r*o[10]+o[14],c=1/(e*o[3]+t*o[7]+r*o[11]+o[15]);i.x=s*c,i.y=a*c,i.z=l*c},e.TransformNormal=function(t,r){var n=e.Zero();return e.TransformNormalToRef(t,r,n),n},e.TransformNormalToRef=function(e,t,r){this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,r)},e.TransformNormalFromFloatsToRef=function(e,t,r,n,i){var o=n.m;i.x=e*o[0]+t*o[4]+r*o[8],i.y=e*o[1]+t*o[5]+r*o[9],i.z=e*o[2]+t*o[6]+r*o[10]},e.CatmullRom=function(t,r,n,i,o){var s=o*o,a=o*s;return new e(.5*(2*r._x+(-t._x+n._x)*o+(2*t._x-5*r._x+4*n._x-i._x)*s+(-t._x+3*r._x-3*n._x+i._x)*a),.5*(2*r._y+(-t._y+n._y)*o+(2*t._y-5*r._y+4*n._y-i._y)*s+(-t._y+3*r._y-3*n._y+i._y)*a),.5*(2*r._z+(-t._z+n._z)*o+(2*t._z-5*r._z+4*n._z-i._z)*s+(-t._z+3*r._z-3*n._z+i._z)*a))},e.Clamp=function(t,r,n){var i=new e;return e.ClampToRef(t,r,n,i),i},e.ClampToRef=function(e,t,r,n){var i=e._x;i=(i=i>r._x?r._x:i)<t._x?t._x:i;var o=e._y;o=(o=o>r._y?r._y:o)<t._y?t._y:o;var s=e._z;s=(s=s>r._z?r._z:s)<t._z?t._z:s,n.copyFromFloats(i,o,s)},e.CheckExtends=function(e,t,r){t.minimizeInPlace(e),r.maximizeInPlace(e)},e.Hermite=function(t,r,n,i,o){var s=o*o,a=o*s,l=2*a-3*s+1,c=-2*a+3*s,u=a-2*s+o,d=a-s;return new e(t._x*l+n._x*c+r._x*u+i._x*d,t._y*l+n._y*c+r._y*u+i._y*d,t._z*l+n._z*c+r._z*u+i._z*d)},e.Lerp=function(t,r,n){var i=new e(0,0,0);return e.LerpToRef(t,r,n,i),i},e.LerpToRef=function(e,t,r,n){n.x=e._x+(t._x-e._x)*r,n.y=e._y+(t._y-e._y)*r,n.z=e._z+(t._z-e._z)*r},e.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z},e.Cross=function(t,r){var n=e.Zero();return e.CrossToRef(t,r,n),n},e.CrossToRef=function(e,t,r){var n=e._y*t._z-e._z*t._y,i=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;r.copyFromFloats(n,i,o)},e.Normalize=function(t){var r=e.Zero();return e.NormalizeToRef(t,r),r},e.NormalizeToRef=function(e,t){e.normalizeToRef(t)},e.Project=function(t,r,n,i){var o=i.width,s=i.height,a=i.x,l=i.y,c=f.Matrix[1];h.FromValuesToRef(o/2,0,0,0,0,-s/2,0,0,0,0,.5,0,a+o/2,s/2+l,.5,1,c);var u=f.Matrix[0];return r.multiplyToRef(n,u),u.multiplyToRef(c,u),e.TransformCoordinates(t,u)},e._UnprojectFromInvertedMatrixToRef=function(t,r,i){e.TransformCoordinatesToRef(t,r,i);var o=r.m,s=t._x*o[3]+t._y*o[7]+t._z*o[11]+o[15];n.Scalar.WithinEpsilon(s,1)&&i.scaleInPlace(1/s)},e.UnprojectFromTransform=function(t,r,n,i,o){var s=f.Matrix[0];i.multiplyToRef(o,s),s.invert(),t.x=t._x/r*2-1,t.y=-(t._y/n*2-1);var a=new e;return e._UnprojectFromInvertedMatrixToRef(t,s,a),a},e.Unproject=function(t,r,n,i,o,s){var a=e.Zero();return e.UnprojectToRef(t,r,n,i,o,s,a),a},e.UnprojectToRef=function(t,r,n,i,o,s,a){e.UnprojectFloatsToRef(t._x,t._y,t._z,r,n,i,o,s,a)},e.UnprojectFloatsToRef=function(t,r,n,i,o,s,a,l,c){var u=f.Matrix[0];s.multiplyToRef(a,u),u.multiplyToRef(l,u),u.invert();var d=f.Vector3[0];d.x=t/i*2-1,d.y=-(r/o*2-1),d.z=2*n-1,e._UnprojectFromInvertedMatrixToRef(d,u,c)},e.Minimize=function(e,t){var r=e.clone();return r.minimizeInPlace(t),r},e.Maximize=function(e,t){var r=e.clone();return r.maximizeInPlace(t),r},e.Distance=function(t,r){return Math.sqrt(e.DistanceSquared(t,r))},e.DistanceSquared=function(e,t){var r=e._x-t._x,n=e._y-t._y,i=e._z-t._z;return r*r+n*n+i*i},e.Center=function(e,t){var r=e.add(t);return r.scaleInPlace(.5),r},e.RotationFromAxis=function(t,r,n){var i=e.Zero();return e.RotationFromAxisToRef(t,r,n,i),i},e.RotationFromAxisToRef=function(e,t,r,n){var i=f.Quaternion[0];d.RotationQuaternionFromAxisToRef(e,t,r,i),i.toEulerAnglesToRef(n)},e._UpReadOnly=e.Up(),e._ZeroReadOnly=e.Zero(),e}(),u=function(){function e(e,t,r,n){this.x=e,this.y=t,this.z=r,this.w=n}return e.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},e.prototype.getClassName=function(){return"Vector4"},e.prototype.getHashCode=function(){var e=0|this.x;return e=397*(e=397*(e=397*e^(0|this.y))^(0|this.z))^(0|this.w)},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,this},e.prototype.fromArray=function(t,r){return void 0===r&&(r=0),e.FromArrayToRef(t,r,this),this},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)},e.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t.z=this.z+e.z,t.w=this.w+e.w,this},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},e.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t.z=this.z-e.z,t.w=this.w-e.w,this},e.prototype.subtractFromFloats=function(t,r,n,i){return new e(this.x-t,this.y-r,this.z-n,this.w-i)},e.prototype.subtractFromFloatsToRef=function(e,t,r,n,i){return i.x=this.x-e,i.y=this.y-t,i.z=this.z-r,i.w=this.w-n,this},e.prototype.negate=function(){return new e(-this.x,-this.y,-this.z,-this.w)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y,-1*this.z,-1*this.w)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},e.prototype.scale=function(t){return new e(this.x*t,this.y*t,this.z*t,this.w*t)},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t.w=this.w*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,t.z+=this.z*e,t.w+=this.w*e,this},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this.x,e.x,t)&&n.Scalar.WithinEpsilon(this.y,e.y,t)&&n.Scalar.WithinEpsilon(this.z,e.z,t)&&n.Scalar.WithinEpsilon(this.w,e.w,t)},e.prototype.equalsToFloats=function(e,t,r,n){return this.x===e&&this.y===t&&this.z===r&&this.w===n},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},e.prototype.multiply=function(t){return new e(this.x*t.x,this.y*t.y,this.z*t.z,this.w*t.w)},e.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t.z=this.z*e.z,t.w=this.w*e.w,this},e.prototype.multiplyByFloats=function(t,r,n,i){return new e(this.x*t,this.y*r,this.z*n,this.w*i)},e.prototype.divide=function(t){return new e(this.x/t.x,this.y/t.y,this.z/t.z,this.w/t.w)},e.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t.z=this.z/e.z,t.w=this.w/e.w,this},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.minimizeInPlace=function(e){return e.x<this.x&&(this.x=e.x),e.y<this.y&&(this.y=e.y),e.z<this.z&&(this.z=e.z),e.w<this.w&&(this.w=e.w),this},e.prototype.maximizeInPlace=function(e){return e.x>this.x&&(this.x=e.x),e.y>this.y&&(this.y=e.y),e.z>this.z&&(this.z=e.z),e.w>this.w&&(this.w=e.w),this},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},e.prototype.fract=function(){return new e(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.prototype.normalize=function(){var e=this.length();return 0===e?this:this.scaleInPlace(1/e)},e.prototype.toVector3=function(){return new c(this.x,this.y,this.z)},e.prototype.clone=function(){return new e(this.x,this.y,this.z,this.w)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},e.prototype.copyFromFloats=function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},e.prototype.set=function(e,t,r,n){return this.copyFromFloats(e,t,r,n)},e.prototype.setAll=function(e){return this.x=this.y=this.z=this.w=e,this},e.FromArray=function(t,r){return r||(r=0),new e(t[r],t[r+1],t[r+2],t[r+3])},e.FromArrayToRef=function(e,t,r){r.x=e[t],r.y=e[t+1],r.z=e[t+2],r.w=e[t+3]},e.FromFloatArrayToRef=function(t,r,n){e.FromArrayToRef(t,r,n)},e.FromFloatsToRef=function(e,t,r,n,i){i.x=e,i.y=t,i.z=r,i.w=n},e.Zero=function(){return new e(0,0,0,0)},e.One=function(){return new e(1,1,1,1)},e.Normalize=function(t){var r=e.Zero();return e.NormalizeToRef(t,r),r},e.NormalizeToRef=function(e,t){t.copyFrom(e),t.normalize()},e.Minimize=function(e,t){var r=e.clone();return r.minimizeInPlace(t),r},e.Maximize=function(e,t){var r=e.clone();return r.maximizeInPlace(t),r},e.Distance=function(t,r){return Math.sqrt(e.DistanceSquared(t,r))},e.DistanceSquared=function(e,t){var r=e.x-t.x,n=e.y-t.y,i=e.z-t.z,o=e.w-t.w;return r*r+n*n+i*i+o*o},e.Center=function(e,t){var r=e.add(t);return r.scaleInPlace(.5),r},e.TransformNormal=function(t,r){var n=e.Zero();return e.TransformNormalToRef(t,r,n),n},e.TransformNormalToRef=function(e,t,r){var n=t.m,i=e.x*n[0]+e.y*n[4]+e.z*n[8],o=e.x*n[1]+e.y*n[5]+e.z*n[9],s=e.x*n[2]+e.y*n[6]+e.z*n[10];r.x=i,r.y=o,r.z=s,r.w=e.w},e.TransformNormalFromFloatsToRef=function(e,t,r,n,i,o){var s=i.m;o.x=e*s[0]+t*s[4]+r*s[8],o.y=e*s[1]+t*s[5]+r*s[9],o.z=e*s[2]+t*s[6]+r*s[10],o.w=n},e.FromVector3=function(t,r){return void 0===r&&(r=0),new e(t._x,t._y,t._z,r)},e}(),d=function(){function e(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),this._isDirty=!0,this._x=e,this._y=t,this._z=r,this._w=n}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"w",{get:function(){return this._w},set:function(e){this._w=e,this._isDirty=!0},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+" W:"+this._w+"}"},e.prototype.getClassName=function(){return"Quaternion"},e.prototype.getHashCode=function(){var e=0|this._x;return e=397*(e=397*(e=397*e^(0|this._y))^(0|this._z))^(0|this._w)},e.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},e.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this._x,e._x,t)&&n.Scalar.WithinEpsilon(this._y,e._y,t)&&n.Scalar.WithinEpsilon(this._z,e._z,t)&&n.Scalar.WithinEpsilon(this._w,e._w,t)},e.prototype.clone=function(){return new e(this._x,this._y,this._z,this._w)},e.prototype.copyFrom=function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this.w=e._w,this},e.prototype.copyFromFloats=function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},e.prototype.set=function(e,t,r,n){return this.copyFromFloats(e,t,r,n)},e.prototype.add=function(t){return new e(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)},e.prototype.addInPlace=function(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this},e.prototype.subtract=function(t){return new e(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)},e.prototype.scale=function(t){return new e(this._x*t,this._y*t,this._z*t,this._w*t)},e.prototype.scaleToRef=function(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,this},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,this},e.prototype.multiply=function(t){var r=new e(0,0,0,1);return this.multiplyToRef(t,r),r},e.prototype.multiplyToRef=function(e,t){var r=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,n=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,i=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(r,n,i,o),this},e.prototype.multiplyInPlace=function(e){return this.multiplyToRef(e,this),this},e.prototype.conjugateToRef=function(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),this},e.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.prototype.conjugate=function(){return new e(-this._x,-this._y,-this._z,this._w)},e.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},e.prototype.normalize=function(){var e=this.length();if(0===e)return this;var t=1/e;return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.prototype.toEulerAngles=function(e){void 0===e&&(e="YZX");var t=c.Zero();return this.toEulerAnglesToRef(t),t},e.prototype.toEulerAnglesToRef=function(e){var t=this._z,r=this._x,n=this._y,i=this._w,o=i*i,s=t*t,a=r*r,l=n*n,c=n*t-r*i;return c<-.4999999?(e.y=2*Math.atan2(n,i),e.x=Math.PI/2,e.z=0):c>.4999999?(e.y=2*Math.atan2(n,i),e.x=-Math.PI/2,e.z=0):(e.z=Math.atan2(2*(r*n+t*i),-s-a+l+o),e.x=Math.asin(-2*(t*n-r*i)),e.y=Math.atan2(2*(t*r+n*i),s-a-l+o)),this},e.prototype.toRotationMatrix=function(e){return h.FromQuaternionToRef(this,e),this},e.prototype.fromRotationMatrix=function(t){return e.FromRotationMatrixToRef(t,this),this},e.FromRotationMatrix=function(t){var r=new e;return e.FromRotationMatrixToRef(t,r),r},e.FromRotationMatrixToRef=function(e,t){var r,n=e.m,i=n[0],o=n[4],s=n[8],a=n[1],l=n[5],c=n[9],u=n[2],d=n[6],h=n[10],f=i+l+h;f>0?(r=.5/Math.sqrt(f+1),t.w=.25/r,t.x=(d-c)*r,t.y=(s-u)*r,t.z=(a-o)*r):i>l&&i>h?(r=2*Math.sqrt(1+i-l-h),t.w=(d-c)/r,t.x=.25*r,t.y=(o+a)/r,t.z=(s+u)/r):l>h?(r=2*Math.sqrt(1+l-i-h),t.w=(s-u)/r,t.x=(o+a)/r,t.y=.25*r,t.z=(c+d)/r):(r=2*Math.sqrt(1+h-i-l),t.w=(a-o)/r,t.x=(s+u)/r,t.y=(c+d)/r,t.z=.25*r)},e.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w},e.AreClose=function(t,r){return e.Dot(t,r)>=0},e.Zero=function(){return new e(0,0,0,0)},e.Inverse=function(t){return new e(-t._x,-t._y,-t._z,t._w)},e.InverseToRef=function(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t},e.Identity=function(){return new e(0,0,0,1)},e.IsIdentity=function(e){return e&&0===e._x&&0===e._y&&0===e._z&&1===e._w},e.RotationAxis=function(t,r){return e.RotationAxisToRef(t,r,new e)},e.RotationAxisToRef=function(e,t,r){var n=Math.sin(t/2);return e.normalize(),r.w=Math.cos(t/2),r.x=e._x*n,r.y=e._y*n,r.z=e._z*n,r},e.FromArray=function(t,r){return r||(r=0),new e(t[r],t[r+1],t[r+2],t[r+3])},e.FromArrayToRef=function(e,t,r){r.x=e[t],r.y=e[t+1],r.z=e[t+2],r.w=e[t+3]},e.FromEulerAngles=function(t,r,n){var i=new e;return e.RotationYawPitchRollToRef(r,t,n,i),i},e.FromEulerAnglesToRef=function(t,r,n,i){return e.RotationYawPitchRollToRef(r,t,n,i),i},e.FromEulerVector=function(t){var r=new e;return e.RotationYawPitchRollToRef(t._y,t._x,t._z,r),r},e.FromEulerVectorToRef=function(t,r){return e.RotationYawPitchRollToRef(t._y,t._x,t._z,r),r},e.RotationYawPitchRoll=function(t,r,n){var i=new e;return e.RotationYawPitchRollToRef(t,r,n,i),i},e.RotationYawPitchRollToRef=function(e,t,r,n){var i=.5*r,o=.5*t,s=.5*e,a=Math.sin(i),l=Math.cos(i),c=Math.sin(o),u=Math.cos(o),d=Math.sin(s),h=Math.cos(s);n.x=h*c*l+d*u*a,n.y=d*u*l-h*c*a,n.z=h*u*a-d*c*l,n.w=h*u*l+d*c*a},e.RotationAlphaBetaGamma=function(t,r,n){var i=new e;return e.RotationAlphaBetaGammaToRef(t,r,n,i),i},e.RotationAlphaBetaGammaToRef=function(e,t,r,n){var i=.5*(r+e),o=.5*(r-e),s=.5*t;n.x=Math.cos(o)*Math.sin(s),n.y=Math.sin(o)*Math.sin(s),n.z=Math.sin(i)*Math.cos(s),n.w=Math.cos(i)*Math.cos(s)},e.RotationQuaternionFromAxis=function(t,r,n){var i=new e(0,0,0,0);return e.RotationQuaternionFromAxisToRef(t,r,n,i),i},e.RotationQuaternionFromAxisToRef=function(t,r,n,i){var o=f.Matrix[0];h.FromXYZAxesToRef(t.normalize(),r.normalize(),n.normalize(),o),e.FromRotationMatrixToRef(o,i)},e.Slerp=function(t,r,n){var i=e.Identity();return e.SlerpToRef(t,r,n,i),i},e.SlerpToRef=function(e,t,r,n){var i,o,s=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,a=!1;if(s<0&&(a=!0,s=-s),s>.999999)o=1-r,i=a?-r:r;else{var l=Math.acos(s),c=1/Math.sin(l);o=Math.sin((1-r)*l)*c,i=a?-Math.sin(r*l)*c:Math.sin(r*l)*c}n.x=o*e._x+i*t._x,n.y=o*e._y+i*t._y,n.z=o*e._z+i*t._z,n.w=o*e._w+i*t._w},e.Hermite=function(t,r,n,i,o){var s=o*o,a=o*s,l=2*a-3*s+1,c=-2*a+3*s,u=a-2*s+o,d=a-s;return new e(t._x*l+n._x*c+r._x*u+i._x*d,t._y*l+n._y*c+r._y*u+i._y*d,t._z*l+n._z*c+r._z*u+i._z*d,t._w*l+n._w*c+r._w*u+i._w*d)},e}(),h=function(){function e(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,a.PerformanceConfigurator.MatrixTrackPrecisionChange&&a.PerformanceConfigurator.MatrixTrackedMatrices.push(this),this._m=new a.PerformanceConfigurator.MatrixCurrentType(16),this._updateIdentityStatus(!1)}return Object.defineProperty(e,"Use64Bits",{get:function(){return a.PerformanceConfigurator.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),e.prototype._markAsUpdated=function(){this.updateFlag=e._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},e.prototype._updateIdentityStatus=function(t,r,n,i){void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!0),this.updateFlag=e._updateFlagSeed++,this._isIdentity=t,this._isIdentity3x2=t||n,this._isIdentityDirty=!this._isIdentity&&r,this._isIdentity3x2Dirty=!this._isIdentity3x2&&i},e.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var e=this._m;this._isIdentity=1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]}return this._isIdentity},e.prototype.isIdentityAs3x2=function(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]||0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2},e.prototype.determinant=function(){if(!0===this._isIdentity)return 1;var e=this._m,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],f=e[12],p=e[13],m=e[14],g=e[15],_=d*g-m*h,v=u*g-p*h,y=u*m-p*d,b=c*g-f*h,A=c*m-d*f,T=c*p-f*u;return t*+(s*_-a*v+l*y)+r*-(o*_-a*b+l*A)+n*+(o*v-s*b+l*T)+i*-(o*y-s*A+a*T)},e.prototype.toArray=function(){return this._m},e.prototype.asArray=function(){return this._m},e.prototype.invert=function(){return this.invertToRef(this),this},e.prototype.reset=function(){return e.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},e.prototype.add=function(t){var r=new e;return this.addToRef(t,r),r},e.prototype.addToRef=function(e,t){for(var r=this._m,n=t._m,i=e.m,o=0;o<16;o++)n[o]=r[o]+i[o];return t._markAsUpdated(),this},e.prototype.addToSelf=function(e){for(var t=this._m,r=e.m,n=0;n<16;n++)t[n]+=r[n];return this._markAsUpdated(),this},e.prototype.invertToRef=function(t){if(!0===this._isIdentity)return e.IdentityToRef(t),this;var r=this._m,n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],c=r[6],u=r[7],d=r[8],h=r[9],f=r[10],p=r[11],m=r[12],g=r[13],_=r[14],v=r[15],y=f*v-_*p,b=h*v-g*p,A=h*_-g*f,T=d*v-m*p,M=d*_-f*m,P=d*g-m*h,S=+(l*y-c*b+u*A),E=-(a*y-c*T+u*M),C=+(a*b-l*T+u*P),x=-(a*A-l*M+c*P),R=n*S+i*E+o*C+s*x;if(0===R)return t.copyFrom(this),this;var O=1/R,I=c*v-_*u,D=l*v-g*u,B=l*_-g*c,N=a*v-m*u,L=a*_-m*c,w=a*g-m*l,F=c*p-f*u,V=l*p-h*u,k=l*f-h*c,U=a*p-d*u,z=a*f-d*c,G=a*h-d*l,j=-(i*y-o*b+s*A),H=+(n*y-o*T+s*M),W=-(n*b-i*T+s*P),X=+(n*A-i*M+o*P),Y=+(i*I-o*D+s*B),Q=-(n*I-o*N+s*L),K=+(n*D-i*N+s*w),q=-(n*B-i*L+o*w),Z=-(i*F-o*V+s*k),J=+(n*F-o*U+s*z),$=-(n*V-i*U+s*G),ee=+(n*k-i*z+o*G);return e.FromValuesToRef(S*O,j*O,Y*O,Z*O,E*O,H*O,Q*O,J*O,C*O,W*O,K*O,$*O,x*O,X*O,q*O,ee*O,t),this},e.prototype.addAtIndex=function(e,t){return this._m[e]+=t,this._markAsUpdated(),this},e.prototype.multiplyAtIndex=function(e,t){return this._m[e]*=t,this._markAsUpdated(),this},e.prototype.setTranslationFromFloats=function(e,t,r){return this._m[12]=e,this._m[13]=t,this._m[14]=r,this._markAsUpdated(),this},e.prototype.addTranslationFromFloats=function(e,t,r){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=r,this._markAsUpdated(),this},e.prototype.setTranslation=function(e){return this.setTranslationFromFloats(e._x,e._y,e._z)},e.prototype.getTranslation=function(){return new c(this._m[12],this._m[13],this._m[14])},e.prototype.getTranslationToRef=function(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],this},e.prototype.removeRotationAndScaling=function(){var t=this.m;return e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]),this},e.prototype.multiply=function(t){var r=new e;return this.multiplyToRef(t,r),r},e.prototype.copyFrom=function(e){e.copyToArray(this._m);var t=e;return this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this},e.prototype.copyToArray=function(e,t){void 0===t&&(t=0);var r=this._m;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],this},e.prototype.multiplyToRef=function(e,t){return this._isIdentity?(t.copyFrom(e),this):e._isIdentity?(t.copyFrom(this),this):(this.multiplyToArray(e,t._m,0),t._markAsUpdated(),this)},e.prototype.multiplyToArray=function(e,t,r){var n=this._m,i=e.m,o=n[0],s=n[1],a=n[2],l=n[3],c=n[4],u=n[5],d=n[6],h=n[7],f=n[8],p=n[9],m=n[10],g=n[11],_=n[12],v=n[13],y=n[14],b=n[15],A=i[0],T=i[1],M=i[2],P=i[3],S=i[4],E=i[5],C=i[6],x=i[7],R=i[8],O=i[9],I=i[10],D=i[11],B=i[12],N=i[13],L=i[14],w=i[15];return t[r]=o*A+s*S+a*R+l*B,t[r+1]=o*T+s*E+a*O+l*N,t[r+2]=o*M+s*C+a*I+l*L,t[r+3]=o*P+s*x+a*D+l*w,t[r+4]=c*A+u*S+d*R+h*B,t[r+5]=c*T+u*E+d*O+h*N,t[r+6]=c*M+u*C+d*I+h*L,t[r+7]=c*P+u*x+d*D+h*w,t[r+8]=f*A+p*S+m*R+g*B,t[r+9]=f*T+p*E+m*O+g*N,t[r+10]=f*M+p*C+m*I+g*L,t[r+11]=f*P+p*x+m*D+g*w,t[r+12]=_*A+v*S+y*R+b*B,t[r+13]=_*T+v*E+y*O+b*N,t[r+14]=_*M+v*C+y*I+b*L,t[r+15]=_*P+v*x+y*D+b*w,this},e.prototype.equals=function(e){var t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;var r=this.m,n=t.m;return r[0]===n[0]&&r[1]===n[1]&&r[2]===n[2]&&r[3]===n[3]&&r[4]===n[4]&&r[5]===n[5]&&r[6]===n[6]&&r[7]===n[7]&&r[8]===n[8]&&r[9]===n[9]&&r[10]===n[10]&&r[11]===n[11]&&r[12]===n[12]&&r[13]===n[13]&&r[14]===n[14]&&r[15]===n[15]},e.prototype.clone=function(){var t=new e;return t.copyFrom(this),t},e.prototype.getClassName=function(){return"Matrix"},e.prototype.getHashCode=function(){for(var e=0|this._m[0],t=1;t<16;t++)e=397*e^(0|this._m[t]);return e},e.prototype.decompose=function(t,r,n){if(this._isIdentity)return n&&n.setAll(0),t&&t.setAll(1),r&&r.copyFromFloats(0,0,0,1),!0;var i=this._m;if(n&&n.copyFromFloats(i[12],i[13],i[14]),(t=t||f.Vector3[0]).x=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]),t.y=Math.sqrt(i[4]*i[4]+i[5]*i[5]+i[6]*i[6]),t.z=Math.sqrt(i[8]*i[8]+i[9]*i[9]+i[10]*i[10]),this.determinant()<=0&&(t.y*=-1),0===t._x||0===t._y||0===t._z)return r&&r.copyFromFloats(0,0,0,1),!1;if(r){var o=1/t._x,s=1/t._y,a=1/t._z;e.FromValuesToRef(i[0]*o,i[1]*o,i[2]*o,0,i[4]*s,i[5]*s,i[6]*s,0,i[8]*a,i[9]*a,i[10]*a,0,0,0,0,1,f.Matrix[0]),d.FromRotationMatrixToRef(f.Matrix[0],r)}return!0},e.prototype.getRow=function(e){if(e<0||e>3)return null;var t=4*e;return new u(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])},e.prototype.setRow=function(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)},e.prototype.transpose=function(){return e.Transpose(this)},e.prototype.transposeToRef=function(t){return e.TransposeToRef(this,t),this},e.prototype.setRowFromFloats=function(e,t,r,n,i){if(e<0||e>3)return this;var o=4*e;return this._m[o+0]=t,this._m[o+1]=r,this._m[o+2]=n,this._m[o+3]=i,this._markAsUpdated(),this},e.prototype.scale=function(t){var r=new e;return this.scaleToRef(t,r),r},e.prototype.scaleToRef=function(e,t){for(var r=0;r<16;r++)t._m[r]=this._m[r]*e;return t._markAsUpdated(),this},e.prototype.scaleAndAddToRef=function(e,t){for(var r=0;r<16;r++)t._m[r]+=this._m[r]*e;return t._markAsUpdated(),this},e.prototype.toNormalMatrix=function(t){var r=f.Matrix[0];this.invertToRef(r),r.transposeToRef(t);var n=t._m;e.FromValuesToRef(n[0],n[1],n[2],0,n[4],n[5],n[6],0,n[8],n[9],n[10],0,0,0,0,1,t)},e.prototype.getRotationMatrix=function(){var t=new e;return this.getRotationMatrixToRef(t),t},e.prototype.getRotationMatrixToRef=function(t){var r=f.Vector3[0];if(!this.decompose(r))return e.IdentityToRef(t),this;var n=this._m,i=1/r._x,o=1/r._y,s=1/r._z;return e.FromValuesToRef(n[0]*i,n[1]*i,n[2]*i,0,n[4]*o,n[5]*o,n[6]*o,0,n[8]*s,n[9]*s,n[10]*s,0,0,0,0,1,t),this},e.prototype.toggleModelMatrixHandInPlace=function(){var e=this._m;e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this._markAsUpdated()},e.prototype.toggleProjectionMatrixHandInPlace=function(){var e=this._m;e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this._markAsUpdated()},e.FromArray=function(t,r){void 0===r&&(r=0);var n=new e;return e.FromArrayToRef(t,r,n),n},e.FromArrayToRef=function(e,t,r){for(var n=0;n<16;n++)r._m[n]=e[n+t];r._markAsUpdated()},e.FromFloat32ArrayToRefScaled=function(e,t,r,n){for(var i=0;i<16;i++)n._m[i]=e[i+t]*r;n._markAsUpdated()},Object.defineProperty(e,"IdentityReadOnly",{get:function(){return e._identityReadOnly},enumerable:!1,configurable:!0}),e.FromValuesToRef=function(e,t,r,n,i,o,s,a,l,c,u,d,h,f,p,m,g){var _=g._m;_[0]=e,_[1]=t,_[2]=r,_[3]=n,_[4]=i,_[5]=o,_[6]=s,_[7]=a,_[8]=l,_[9]=c,_[10]=u,_[11]=d,_[12]=h,_[13]=f,_[14]=p,_[15]=m,g._markAsUpdated()},e.FromValues=function(t,r,n,i,o,s,a,l,c,u,d,h,f,p,m,g){var _=new e,v=_._m;return v[0]=t,v[1]=r,v[2]=n,v[3]=i,v[4]=o,v[5]=s,v[6]=a,v[7]=l,v[8]=c,v[9]=u,v[10]=d,v[11]=h,v[12]=f,v[13]=p,v[14]=m,v[15]=g,_._markAsUpdated(),_},e.Compose=function(t,r,n){var i=new e;return e.ComposeToRef(t,r,n,i),i},e.ComposeToRef=function(e,t,r,n){var i=n._m,o=t._x,s=t._y,a=t._z,l=t._w,c=o+o,u=s+s,d=a+a,h=o*c,f=o*u,p=o*d,m=s*u,g=s*d,_=a*d,v=l*c,y=l*u,b=l*d,A=e._x,T=e._y,M=e._z;i[0]=(1-(m+_))*A,i[1]=(f+b)*A,i[2]=(p-y)*A,i[3]=0,i[4]=(f-b)*T,i[5]=(1-(h+_))*T,i[6]=(g+v)*T,i[7]=0,i[8]=(p+y)*M,i[9]=(g-v)*M,i[10]=(1-(h+m))*M,i[11]=0,i[12]=r._x,i[13]=r._y,i[14]=r._z,i[15]=1,n._markAsUpdated()},e.Identity=function(){var t=e.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t},e.IdentityToRef=function(t){e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0)},e.Zero=function(){var t=e.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t},e.RotationX=function(t){var r=new e;return e.RotationXToRef(t,r),r},e.Invert=function(t){var r=new e;return t.invertToRef(r),r},e.RotationXToRef=function(t,r){var n=Math.sin(t),i=Math.cos(t);e.FromValuesToRef(1,0,0,0,0,i,n,0,0,-n,i,0,0,0,0,1,r),r._updateIdentityStatus(1===i&&0===n)},e.RotationY=function(t){var r=new e;return e.RotationYToRef(t,r),r},e.RotationYToRef=function(t,r){var n=Math.sin(t),i=Math.cos(t);e.FromValuesToRef(i,0,-n,0,0,1,0,0,n,0,i,0,0,0,0,1,r),r._updateIdentityStatus(1===i&&0===n)},e.RotationZ=function(t){var r=new e;return e.RotationZToRef(t,r),r},e.RotationZToRef=function(t,r){var n=Math.sin(t),i=Math.cos(t);e.FromValuesToRef(i,n,0,0,-n,i,0,0,0,0,1,0,0,0,0,1,r),r._updateIdentityStatus(1===i&&0===n)},e.RotationAxis=function(t,r){var n=new e;return e.RotationAxisToRef(t,r,n),n},e.RotationAxisToRef=function(e,t,r){var n=Math.sin(-t),i=Math.cos(-t),o=1-i;e.normalize();var s=r._m;s[0]=e._x*e._x*o+i,s[1]=e._x*e._y*o-e._z*n,s[2]=e._x*e._z*o+e._y*n,s[3]=0,s[4]=e._y*e._x*o+e._z*n,s[5]=e._y*e._y*o+i,s[6]=e._y*e._z*o-e._x*n,s[7]=0,s[8]=e._z*e._x*o-e._y*n,s[9]=e._z*e._y*o+e._x*n,s[10]=e._z*e._z*o+i,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,r._markAsUpdated()},e.RotationAlignToRef=function(e,t,r){var n=c.Cross(t,e),i=c.Dot(t,e),o=1/(1+i),s=r._m;s[0]=n._x*n._x*o+i,s[1]=n._y*n._x*o-n._z,s[2]=n._z*n._x*o+n._y,s[3]=0,s[4]=n._x*n._y*o+n._z,s[5]=n._y*n._y*o+i,s[6]=n._z*n._y*o-n._x,s[7]=0,s[8]=n._x*n._z*o-n._y,s[9]=n._y*n._z*o+n._x,s[10]=n._z*n._z*o+i,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,r._markAsUpdated()},e.RotationYawPitchRoll=function(t,r,n){var i=new e;return e.RotationYawPitchRollToRef(t,r,n,i),i},e.RotationYawPitchRollToRef=function(e,t,r,n){d.RotationYawPitchRollToRef(e,t,r,f.Quaternion[0]),f.Quaternion[0].toRotationMatrix(n)},e.Scaling=function(t,r,n){var i=new e;return e.ScalingToRef(t,r,n,i),i},e.ScalingToRef=function(t,r,n,i){e.FromValuesToRef(t,0,0,0,0,r,0,0,0,0,n,0,0,0,0,1,i),i._updateIdentityStatus(1===t&&1===r&&1===n)},e.Translation=function(t,r,n){var i=new e;return e.TranslationToRef(t,r,n,i),i},e.TranslationToRef=function(t,r,n,i){e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,r,n,1,i),i._updateIdentityStatus(0===t&&0===r&&0===n)},e.Lerp=function(t,r,n){var i=new e;return e.LerpToRef(t,r,n,i),i},e.LerpToRef=function(e,t,r,n){for(var i=n._m,o=e.m,s=t.m,a=0;a<16;a++)i[a]=o[a]*(1-r)+s[a]*r;n._markAsUpdated()},e.DecomposeLerp=function(t,r,n){var i=new e;return e.DecomposeLerpToRef(t,r,n,i),i},e.DecomposeLerpToRef=function(t,r,n,i){var o=f.Vector3[0],s=f.Quaternion[0],a=f.Vector3[1];t.decompose(o,s,a);var l=f.Vector3[2],u=f.Quaternion[1],h=f.Vector3[3];r.decompose(l,u,h);var p=f.Vector3[4];c.LerpToRef(o,l,n,p);var m=f.Quaternion[2];d.SlerpToRef(s,u,n,m);var g=f.Vector3[5];c.LerpToRef(a,h,n,g),e.ComposeToRef(p,m,g,i)},e.LookAtLH=function(t,r,n){var i=new e;return e.LookAtLHToRef(t,r,n,i),i},e.LookAtLHToRef=function(t,r,n,i){var o=f.Vector3[0],s=f.Vector3[1],a=f.Vector3[2];r.subtractToRef(t,a),a.normalize(),c.CrossToRef(n,a,o);var l=o.lengthSquared();0===l?o.x=1:o.normalizeFromLength(Math.sqrt(l)),c.CrossToRef(a,o,s),s.normalize();var u=-c.Dot(o,t),d=-c.Dot(s,t),h=-c.Dot(a,t);e.FromValuesToRef(o._x,s._x,a._x,0,o._y,s._y,a._y,0,o._z,s._z,a._z,0,u,d,h,1,i)},e.LookAtRH=function(t,r,n){var i=new e;return e.LookAtRHToRef(t,r,n,i),i},e.LookAtRHToRef=function(t,r,n,i){var o=f.Vector3[0],s=f.Vector3[1],a=f.Vector3[2];t.subtractToRef(r,a),a.normalize(),c.CrossToRef(n,a,o);var l=o.lengthSquared();0===l?o.x=1:o.normalizeFromLength(Math.sqrt(l)),c.CrossToRef(a,o,s),s.normalize();var u=-c.Dot(o,t),d=-c.Dot(s,t),h=-c.Dot(a,t);e.FromValuesToRef(o._x,s._x,a._x,0,o._y,s._y,a._y,0,o._z,s._z,a._z,0,u,d,h,1,i)},e.OrthoLH=function(t,r,n,i){var o=new e;return e.OrthoLHToRef(t,r,n,i,o),o},e.OrthoLHToRef=function(t,r,n,i,o){var s=2/t,a=2/r,l=2/(i-n),c=-(i+n)/(i-n);e.FromValuesToRef(s,0,0,0,0,a,0,0,0,0,l,0,0,0,c,1,o),o._updateIdentityStatus(1===s&&1===a&&1===l&&0===c)},e.OrthoOffCenterLH=function(t,r,n,i,o,s){var a=new e;return e.OrthoOffCenterLHToRef(t,r,n,i,o,s,a),a},e.OrthoOffCenterLHToRef=function(t,r,n,i,o,s,a){var l=2/(r-t),c=2/(i-n),u=2/(s-o),d=-(s+o)/(s-o),h=(t+r)/(t-r),f=(i+n)/(n-i);e.FromValuesToRef(l,0,0,0,0,c,0,0,0,0,u,0,h,f,d,1,a),a._markAsUpdated()},e.OrthoOffCenterRH=function(t,r,n,i,o,s){var a=new e;return e.OrthoOffCenterRHToRef(t,r,n,i,o,s,a),a},e.OrthoOffCenterRHToRef=function(t,r,n,i,o,s,a){e.OrthoOffCenterLHToRef(t,r,n,i,o,s,a),a._m[10]*=-1},e.PerspectiveLH=function(t,r,n,i){var o=new e,s=2*n/t,a=2*n/r,l=(i+n)/(i-n),c=-2*i*n/(i-n);return e.FromValuesToRef(s,0,0,0,0,a,0,0,0,0,l,1,0,0,c,0,o),o._updateIdentityStatus(!1),o},e.PerspectiveFovLH=function(t,r,n,i){var o=new e;return e.PerspectiveFovLHToRef(t,r,n,i,o),o},e.PerspectiveFovLHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=n,l=i,c=1/Math.tan(.5*t),u=s?c/r:c,d=s?c:c*r,h=(l+a)/(l-a),f=-2*l*a/(l-a);e.FromValuesToRef(u,0,0,0,0,d,0,0,0,0,h,1,0,0,f,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovReverseLHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=1/Math.tan(.5*t),l=s?a/r:a,c=s?a:a*r;e.FromValuesToRef(l,0,0,0,0,c,0,0,0,0,-n,1,0,0,1,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovRH=function(t,r,n,i){var o=new e;return e.PerspectiveFovRHToRef(t,r,n,i,o),o},e.PerspectiveFovRHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=n,l=i,c=1/Math.tan(.5*t),u=s?c/r:c,d=s?c:c*r,h=-(l+a)/(l-a),f=-2*l*a/(l-a);e.FromValuesToRef(u,0,0,0,0,d,0,0,0,0,h,-1,0,0,f,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovReverseRHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=1/Math.tan(.5*t),l=s?a/r:a,c=s?a:a*r;e.FromValuesToRef(l,0,0,0,0,c,0,0,0,0,-n,-1,0,0,-1,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovWebVRToRef=function(e,t,r,n,i){void 0===i&&(i=!1);var o=i?-1:1,s=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),l=Math.tan(e.leftDegrees*Math.PI/180),c=Math.tan(e.rightDegrees*Math.PI/180),u=2/(l+c),d=2/(s+a),h=n._m;h[0]=u,h[1]=h[2]=h[3]=h[4]=0,h[5]=d,h[6]=h[7]=0,h[8]=(l-c)*u*.5,h[9]=-(s-a)*d*.5,h[10]=-r/(t-r),h[11]=1*o,h[12]=h[13]=h[15]=0,h[14]=-2*r*t/(r-t),n._markAsUpdated()},e.GetFinalMatrix=function(t,r,n,i,o,s){var a=t.width,l=t.height,c=t.x,u=t.y,d=e.FromValues(a/2,0,0,0,0,-l/2,0,0,0,0,s-o,0,c+a/2,l/2+u,o,1),h=f.Matrix[0];return r.multiplyToRef(n,h),h.multiplyToRef(i,h),h.multiply(d)},e.GetAsMatrix2x2=function(e){var t=e.m,r=[t[0],t[1],t[4],t[5]];return a.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)},e.GetAsMatrix3x3=function(e){var t=e.m,r=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return a.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)},e.Transpose=function(t){var r=new e;return e.TransposeToRef(t,r),r},e.TransposeToRef=function(e,t){var r=t._m,n=e.m;r[0]=n[0],r[1]=n[4],r[2]=n[8],r[3]=n[12],r[4]=n[1],r[5]=n[5],r[6]=n[9],r[7]=n[13],r[8]=n[2],r[9]=n[6],r[10]=n[10],r[11]=n[14],r[12]=n[3],r[13]=n[7],r[14]=n[11],r[15]=n[15],t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty)},e.Reflection=function(t){var r=new e;return e.ReflectionToRef(t,r),r},e.ReflectionToRef=function(t,r){t.normalize();var n=t.normal.x,i=t.normal.y,o=t.normal.z,s=-2*n,a=-2*i,l=-2*o;e.FromValuesToRef(s*n+1,a*n,l*n,0,s*i,a*i+1,l*i,0,s*o,a*o,l*o+1,0,s*t.d,a*t.d,l*t.d,1,r)},e.FromXYZAxesToRef=function(t,r,n,i){e.FromValuesToRef(t._x,t._y,t._z,0,r._x,r._y,r._z,0,n._x,n._y,n._z,0,0,0,0,1,i)},e.FromQuaternionToRef=function(e,t){var r=e._x*e._x,n=e._y*e._y,i=e._z*e._z,o=e._x*e._y,s=e._z*e._w,a=e._z*e._x,l=e._y*e._w,c=e._y*e._z,u=e._x*e._w;t._m[0]=1-2*(n+i),t._m[1]=2*(o+s),t._m[2]=2*(a-l),t._m[3]=0,t._m[4]=2*(o-s),t._m[5]=1-2*(i+r),t._m[6]=2*(c+u),t._m[7]=0,t._m[8]=2*(a+l),t._m[9]=2*(c-u),t._m[10]=1-2*(n+r),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t._markAsUpdated()},e._updateFlagSeed=0,e._identityReadOnly=e.Identity(),e}(),f=function(){function e(){}return e.Vector3=o.ArrayTools.BuildArray(6,c.Zero),e.Matrix=o.ArrayTools.BuildArray(2,h.Identity),e.Quaternion=o.ArrayTools.BuildArray(3,d.Zero),e}(),p=function(){function e(){}return e.Vector2=o.ArrayTools.BuildArray(3,l.Zero),e.Vector3=o.ArrayTools.BuildArray(13,c.Zero),e.Vector4=o.ArrayTools.BuildArray(3,u.Zero),e.Quaternion=o.ArrayTools.BuildArray(2,d.Zero),e.Matrix=o.ArrayTools.BuildArray(8,h.Identity),e}();s._TypeStore.RegisteredTypes["BABYLON.Vector2"]=l,s._TypeStore.RegisteredTypes["BABYLON.Vector3"]=c,s._TypeStore.RegisteredTypes["BABYLON.Vector4"]=u,s._TypeStore.RegisteredTypes["BABYLON.Matrix"]=h},"./Maths/math.vertexFormat.ts":
- /*!************************************!*\
- !*** ./Maths/math.vertexFormat.ts ***!
- \************************************/
- /*! exports provided: PositionNormalVertex, PositionNormalTextureVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"PositionNormalVertex",(function(){return i})),r.d(t,"PositionNormalTextureVertex",(function(){return o}));var n=r(/*! ./math.vector */"./Maths/math.vector.ts"),i=function(){function e(e,t){void 0===e&&(e=n.Vector3.Zero()),void 0===t&&(t=n.Vector3.Up()),this.position=e,this.normal=t}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone())},e}(),o=function(){function e(e,t,r){void 0===e&&(e=n.Vector3.Zero()),void 0===t&&(t=n.Vector3.Up()),void 0===r&&(r=n.Vector2.Zero()),this.position=e,this.normal=t,this.uv=r}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone(),this.uv.clone())},e}()},"./Maths/math.viewport.ts":
- /*!********************************!*\
- !*** ./Maths/math.viewport.ts ***!
- \********************************/
- /*! exports provided: Viewport */function(e,t,r){"use strict";r.r(t),r.d(t,"Viewport",(function(){return n}));var n=function(){function e(e,t,r,n){this.x=e,this.y=t,this.width=r,this.height=n}return e.prototype.toGlobal=function(t,r){return new e(this.x*t,this.y*r,this.width*t,this.height*r)},e.prototype.toGlobalToRef=function(e,t,r){return r.x=this.x*e,r.y=this.y*t,r.width=this.width*e,r.height=this.height*t,this},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e}()},"./Maths/sphericalPolynomial.ts":
- /*!**************************************!*\
- !*** ./Maths/sphericalPolynomial.ts ***!
- \**************************************/
- /*! exports provided: SphericalHarmonics, SphericalPolynomial */function(e,t,r){"use strict";r.r(t),r.d(t,"SphericalHarmonics",(function(){return l})),r.d(t,"SphericalPolynomial",(function(){return c}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],o=[function(e){return 1},function(e){return e.y},function(e){return e.z},function(e){return e.x},function(e){return e.x*e.y},function(e){return e.y*e.z},function(e){return 3*e.z*e.z-1},function(e){return e.x*e.z},function(e){return e.x*e.x-e.y*e.y}],s=function(e,t){return i[e]*o[e](t)},a=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4],l=function(){function e(){this.preScaled=!1,this.l00=n.Vector3.Zero(),this.l1_1=n.Vector3.Zero(),this.l10=n.Vector3.Zero(),this.l11=n.Vector3.Zero(),this.l2_2=n.Vector3.Zero(),this.l2_1=n.Vector3.Zero(),this.l20=n.Vector3.Zero(),this.l21=n.Vector3.Zero(),this.l22=n.Vector3.Zero()}return e.prototype.addLight=function(e,t,r){var i=new n.Vector3(t.r,t.g,t.b).scale(r);this.l00=this.l00.add(i.scale(s(0,e))),this.l1_1=this.l1_1.add(i.scale(s(1,e))),this.l10=this.l10.add(i.scale(s(2,e))),this.l11=this.l11.add(i.scale(s(3,e))),this.l2_2=this.l2_2.add(i.scale(s(4,e))),this.l2_1=this.l2_1.add(i.scale(s(5,e))),this.l20=this.l20.add(i.scale(s(6,e))),this.l21=this.l21.add(i.scale(s(7,e))),this.l22=this.l22.add(i.scale(s(8,e)))},e.prototype.scaleInPlace=function(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)},e.prototype.convertIncidentRadianceToIrradiance=function(){this.l00.scaleInPlace(a[0]),this.l1_1.scaleInPlace(a[1]),this.l10.scaleInPlace(a[2]),this.l11.scaleInPlace(a[3]),this.l2_2.scaleInPlace(a[4]),this.l2_1.scaleInPlace(a[5]),this.l20.scaleInPlace(a[6]),this.l21.scaleInPlace(a[7]),this.l22.scaleInPlace(a[8])},e.prototype.convertIrradianceToLambertianRadiance=function(){this.scaleInPlace(1/Math.PI)},e.prototype.preScaleForRendering=function(){this.preScaled=!0,this.l00.scaleInPlace(i[0]),this.l1_1.scaleInPlace(i[1]),this.l10.scaleInPlace(i[2]),this.l11.scaleInPlace(i[3]),this.l2_2.scaleInPlace(i[4]),this.l2_1.scaleInPlace(i[5]),this.l20.scaleInPlace(i[6]),this.l21.scaleInPlace(i[7]),this.l22.scaleInPlace(i[8])},e.FromArray=function(t){var r=new e;return n.Vector3.FromArrayToRef(t[0],0,r.l00),n.Vector3.FromArrayToRef(t[1],0,r.l1_1),n.Vector3.FromArrayToRef(t[2],0,r.l10),n.Vector3.FromArrayToRef(t[3],0,r.l11),n.Vector3.FromArrayToRef(t[4],0,r.l2_2),n.Vector3.FromArrayToRef(t[5],0,r.l2_1),n.Vector3.FromArrayToRef(t[6],0,r.l20),n.Vector3.FromArrayToRef(t[7],0,r.l21),n.Vector3.FromArrayToRef(t[8],0,r.l22),r},e.FromPolynomial=function(t){var r=new e;return r.l00=t.xx.scale(.376127).add(t.yy.scale(.376127)).add(t.zz.scale(.376126)),r.l1_1=t.y.scale(.977204),r.l10=t.z.scale(.977204),r.l11=t.x.scale(.977204),r.l2_2=t.xy.scale(1.16538),r.l2_1=t.yz.scale(1.16538),r.l20=t.zz.scale(1.34567).subtract(t.xx.scale(.672834)).subtract(t.yy.scale(.672834)),r.l21=t.zx.scale(1.16538),r.l22=t.xx.scale(1.16538).subtract(t.yy.scale(1.16538)),r.l1_1.scaleInPlace(-1),r.l11.scaleInPlace(-1),r.l2_1.scaleInPlace(-1),r.l21.scaleInPlace(-1),r.scaleInPlace(Math.PI),r},e}(),c=function(){function e(){this.x=n.Vector3.Zero(),this.y=n.Vector3.Zero(),this.z=n.Vector3.Zero(),this.xx=n.Vector3.Zero(),this.yy=n.Vector3.Zero(),this.zz=n.Vector3.Zero(),this.xy=n.Vector3.Zero(),this.yz=n.Vector3.Zero(),this.zx=n.Vector3.Zero()}return Object.defineProperty(e.prototype,"preScaledHarmonics",{get:function(){return this._harmonics||(this._harmonics=l.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics},enumerable:!1,configurable:!0}),e.prototype.addAmbient=function(e){var t=new n.Vector3(e.r,e.g,e.b);this.xx=this.xx.add(t),this.yy=this.yy.add(t),this.zz=this.zz.add(t)},e.prototype.scaleInPlace=function(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)},e.FromHarmonics=function(t){var r=new e;return r._harmonics=t,r.x=t.l11.scale(1.02333).scale(-1),r.y=t.l1_1.scale(1.02333).scale(-1),r.z=t.l10.scale(1.02333),r.xx=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).add(t.l22.scale(.429043)),r.yy=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).subtract(t.l22.scale(.429043)),r.zz=t.l00.scale(.886277).add(t.l20.scale(.495417)),r.yz=t.l2_1.scale(.858086).scale(-1),r.zx=t.l21.scale(.858086).scale(-1),r.xy=t.l2_2.scale(.858086),r.scaleInPlace(1/Math.PI),r},e.FromArray=function(t){var r=new e;return n.Vector3.FromArrayToRef(t[0],0,r.x),n.Vector3.FromArrayToRef(t[1],0,r.y),n.Vector3.FromArrayToRef(t[2],0,r.z),n.Vector3.FromArrayToRef(t[3],0,r.xx),n.Vector3.FromArrayToRef(t[4],0,r.yy),n.Vector3.FromArrayToRef(t[5],0,r.zz),n.Vector3.FromArrayToRef(t[6],0,r.yz),n.Vector3.FromArrayToRef(t[7],0,r.zx),n.Vector3.FromArrayToRef(t[8],0,r.xy),r},e}()},"./Meshes/Builders/boxBuilder.ts":
- /*!***************************************!*\
- !*** ./Meshes/Builders/boxBuilder.ts ***!
- \***************************************/
- /*! exports provided: BoxBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"BoxBuilder",(function(){return a}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");s.VertexData.CreateBox=function(e){var t,r=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],o=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],a=[],l=e.width||e.size||1,c=e.height||e.size||1,u=e.depth||e.size||1,d=e.wrap||!1,h=void 0===e.topBaseAt?1:e.topBaseAt,f=void 0===e.bottomBaseAt?0:e.bottomBaseAt,p=[2,0,3,1][h=(h+4)%4],m=[2,0,1,3][f=(f+4)%4],g=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(d){r=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],g=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];for(var _=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],v=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]],y=[17,18,19,16],b=[22,23,20,21];p>0;)_.unshift(_.pop()),y.unshift(y.pop()),p--;for(;m>0;)v.unshift(v.pop()),b.unshift(b.pop()),m--;_=_.flat(),v=v.flat(),g=g.concat(_).concat(v),r.push(y[0],y[2],y[3],y[0],y[1],y[2]),r.push(b[0],b[2],b[3],b[0],b[1],b[2])}var A=[l/2,c/2,u/2];t=g.reduce((function(e,t,r){return e.concat(t*A[r%3])}),[]);for(var T=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,M=e.faceUV||new Array(6),P=e.faceColors,S=[],E=0;E<6;E++)void 0===M[E]&&(M[E]=new n.Vector4(0,0,1,1)),P&&void 0===P[E]&&(P[E]=new i.Color4(1,1,1,1));for(var C=0;C<6;C++)if(a.push(M[C].z,M[C].w),a.push(M[C].x,M[C].w),a.push(M[C].x,M[C].y),a.push(M[C].z,M[C].y),P)for(var x=0;x<4;x++)S.push(P[C].r,P[C].g,P[C].b,P[C].a);s.VertexData._ComputeSides(T,t,r,o,a,e.frontUVs,e.backUVs);var R=new s.VertexData;if(R.indices=r,R.positions=t,R.normals=o,R.uvs=a,P){var O=T===s.VertexData.DOUBLESIDE?S.concat(S):S;R.colors=O}return R},o.Mesh.CreateBox=function(e,t,r,n,i){void 0===r&&(r=null);var o={size:t,sideOrientation:i,updatable:n};return a.CreateBox(e,o,r)};var a=function(){function e(){}return e.CreateBox=function(e,t,r){void 0===r&&(r=null);var n=new o.Mesh(e,r);return t.sideOrientation=o.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,s.VertexData.CreateBox(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/cylinderBuilder.ts":
- /*!********************************************!*\
- !*** ./Meshes/Builders/cylinderBuilder.ts ***!
- \********************************************/
- /*! exports provided: CylinderBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"CylinderBuilder",(function(){return c}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../../scene */"./scene.ts"),l=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts");s.VertexData.CreateCylinder=function(e){var t=e.height||2,r=0===e.diameterTop?0:e.diameterTop||e.diameter||1,a=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;r=r||1e-5,a=a||1e-5;var c,u=e.tessellation||24,d=e.subdivisions||1,h=!!e.hasRings,f=!!e.enclose,p=0===e.cap?0:e.cap||o.Mesh.CAP_ALL,m=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,g=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,_=e.faceUV||new Array(3),v=e.faceColors,y=2+(1+(1!==m&&f?2:0))*(h?d:1);for(c=0;c<y;c++)v&&void 0===v[c]&&(v[c]=new i.Color4(1,1,1,1));for(c=0;c<y;c++)_&&void 0===_[c]&&(_[c]=new n.Vector4(0,0,1,1));var b,A,T,M,P,S,E=new Array,C=new Array,x=new Array,R=new Array,O=new Array,I=2*Math.PI*m/u,D=(a-r)/2/t,B=n.Vector3.Zero(),N=n.Vector3.Zero(),L=n.Vector3.Zero(),w=n.Vector3.Zero(),F=n.Vector3.Zero(),V=l.Axis.Y,k=1,U=1,z=0,G=0;for(M=0;M<=d;M++)for(T=((A=M/d)*(r-a)+a)/2,k=h&&0!==M&&M!==d?2:1,S=0;S<k;S++){for(h&&(U+=S),f&&(U+=2*S),P=0;P<=u;P++)b=P*I,B.x=Math.cos(-b)*T,B.y=-t/2+A*t,B.z=Math.sin(-b)*T,0===r&&M===d?(N.x=x[x.length-3*(u+1)],N.y=x[x.length-3*(u+1)+1],N.z=x[x.length-3*(u+1)+2]):(N.x=B.x,N.z=B.z,N.y=Math.sqrt(N.x*N.x+N.z*N.z)*D,N.normalize()),0===P&&(L.copyFrom(B),w.copyFrom(N)),C.push(B.x,B.y,B.z),x.push(N.x,N.y,N.z),G=h?z!==U?_[U].y:_[U].w:_[U].y+(_[U].w-_[U].y)*A,R.push(_[U].x+(_[U].z-_[U].x)*P/u,G),v&&O.push(v[U].r,v[U].g,v[U].b,v[U].a);1!==m&&f&&(C.push(B.x,B.y,B.z),C.push(0,B.y,0),C.push(0,B.y,0),C.push(L.x,L.y,L.z),n.Vector3.CrossToRef(V,N,F),F.normalize(),x.push(F.x,F.y,F.z,F.x,F.y,F.z),n.Vector3.CrossToRef(w,V,F),F.normalize(),x.push(F.x,F.y,F.z,F.x,F.y,F.z),G=h?z!==U?_[U+1].y:_[U+1].w:_[U+1].y+(_[U+1].w-_[U+1].y)*A,R.push(_[U+1].x,G),R.push(_[U+1].z,G),G=h?z!==U?_[U+2].y:_[U+2].w:_[U+2].y+(_[U+2].w-_[U+2].y)*A,R.push(_[U+2].x,G),R.push(_[U+2].z,G),v&&(O.push(v[U+1].r,v[U+1].g,v[U+1].b,v[U+1].a),O.push(v[U+1].r,v[U+1].g,v[U+1].b,v[U+1].a),O.push(v[U+2].r,v[U+2].g,v[U+2].b,v[U+2].a),O.push(v[U+2].r,v[U+2].g,v[U+2].b,v[U+2].a))),z!==U&&(z=U)}var j=1!==m&&f?u+4:u;for(M=0,U=0;U<d;U++){var H=0,W=0,X=0,Y=0;for(P=0;P<u;P++)H=M*(j+1)+P,W=(M+1)*(j+1)+P,X=M*(j+1)+(P+1),Y=(M+1)*(j+1)+(P+1),E.push(H,W,X),E.push(Y,X,W);1!==m&&f&&(E.push(H+2,W+2,X+2),E.push(Y+2,X+2,W+2),E.push(H+4,W+4,X+4),E.push(Y+4,X+4,W+4)),M=h?M+2:M+1}var Q=function(e){var i=e?r/2:a/2;if(0!==i){var o,s,l,c=e?_[y-1]:_[0],d=null;v&&(d=e?v[y-1]:v[0]);var h=C.length/3,f=e?t/2:-t/2,p=new n.Vector3(0,f,0);C.push(p.x,p.y,p.z),x.push(0,e?1:-1,0),R.push(c.x+.5*(c.z-c.x),c.y+.5*(c.w-c.y)),d&&O.push(d.r,d.g,d.b,d.a);var g=new n.Vector2(.5,.5);for(l=0;l<=u;l++){o=2*Math.PI*l*m/u;var b=Math.cos(-o),A=Math.sin(-o);s=new n.Vector3(b*i,f,A*i);var T=new n.Vector2(b*g.x+.5,A*g.y+.5);C.push(s.x,s.y,s.z),x.push(0,e?1:-1,0),R.push(c.x+(c.z-c.x)*T.x,c.y+(c.w-c.y)*T.y),d&&O.push(d.r,d.g,d.b,d.a)}for(l=0;l<u;l++)e?(E.push(h),E.push(h+(l+2)),E.push(h+(l+1))):(E.push(h),E.push(h+(l+1)),E.push(h+(l+2)))}};p!==o.Mesh.CAP_START&&p!==o.Mesh.CAP_ALL||Q(!1),p!==o.Mesh.CAP_END&&p!==o.Mesh.CAP_ALL||Q(!0),s.VertexData._ComputeSides(g,C,E,x,R,e.frontUVs,e.backUVs);var K=new s.VertexData;return K.indices=E,K.positions=C,K.normals=x,K.uvs=R,v&&(K.colors=O),K},o.Mesh.CreateCylinder=function(e,t,r,n,i,s,l,u,d){void 0!==l&&l instanceof a.Scene||(void 0!==l&&(d=u||o.Mesh.DEFAULTSIDE,u=l),l=s,s=1);var h={height:t,diameterTop:r,diameterBottom:n,tessellation:i,subdivisions:s,sideOrientation:d,updatable:u};return c.CreateCylinder(e,h,l)};var c=function(){function e(){}return e.CreateCylinder=function(e,t,r){var n=new o.Mesh(e,r);return t.sideOrientation=o.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,s.VertexData.CreateCylinder(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/decalBuilder.ts":
- /*!*****************************************!*\
- !*** ./Meshes/Builders/decalBuilder.ts ***!
- \*****************************************/
- /*! exports provided: DecalBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"DecalBuilder",(function(){return l}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../buffer */"./Meshes/buffer.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../../Maths/math.vertexFormat */"./Maths/math.vertexFormat.ts");i.Mesh.CreateDecal=function(e,t,r,n,i,o){var s={position:r,normal:n,size:i,angle:o};return l.CreateDecal(e,t,s)};var l=function(){function e(){}return e.CreateDecal=function(e,t,r){var l=t.getIndices(),c=t.getVerticesData(o.VertexBuffer.PositionKind),u=t.getVerticesData(o.VertexBuffer.NormalKind),d=r.position||n.Vector3.Zero(),h=r.normal||n.Vector3.Up(),f=r.size||n.Vector3.One(),p=r.angle||0;if(!h){var m=new n.Vector3(0,0,1),g=t.getScene().activeCamera,_=n.Vector3.TransformCoordinates(m,g.getWorldMatrix());h=g.globalPosition.subtract(_)}var v=-Math.atan2(h.z,h.x)-Math.PI/2,y=Math.sqrt(h.x*h.x+h.z*h.z),b=Math.atan2(h.y,y),A=n.Matrix.RotationYawPitchRoll(v,b,p).multiply(n.Matrix.Translation(d.x,d.y,d.z)),T=n.Matrix.Invert(A),M=t.getWorldMatrix().multiply(T),P=new s.VertexData;P.indices=[],P.positions=[],P.normals=[],P.uvs=[];for(var S=0,E=function(e){var t=new a.PositionNormalVertex;if(!l||!c||!u)return t;var r=l[e];return t.position=new n.Vector3(c[3*r],c[3*r+1],c[3*r+2]),t.position=n.Vector3.TransformCoordinates(t.position,M),t.normal=new n.Vector3(u[3*r],u[3*r+1],u[3*r+2]),t.normal=n.Vector3.TransformNormal(t.normal,M),t},C=function(e,t){if(0===e.length)return e;for(var r=.5*Math.abs(n.Vector3.Dot(f,t)),i=function(e,i){var o=n.Vector3.GetClipFactor(e.position,i.position,t,r);return new a.PositionNormalVertex(n.Vector3.Lerp(e.position,i.position,o),n.Vector3.Lerp(e.normal,i.normal,o))},o=new Array,s=0;s<e.length;s+=3){var l,c,u,d=null,h=null,p=null,m=null;switch(((l=n.Vector3.Dot(e[s].position,t)-r>0)?1:0)+((c=n.Vector3.Dot(e[s+1].position,t)-r>0)?1:0)+((u=n.Vector3.Dot(e[s+2].position,t)-r>0)?1:0)){case 0:o.push(e[s]),o.push(e[s+1]),o.push(e[s+2]);break;case 1:if(l&&(d=e[s+1],h=e[s+2],p=i(e[s],d),m=i(e[s],h)),c){d=e[s],h=e[s+2],p=i(e[s+1],d),m=i(e[s+1],h),o.push(p),o.push(h.clone()),o.push(d.clone()),o.push(h.clone()),o.push(p.clone()),o.push(m);break}u&&(d=e[s],h=e[s+1],p=i(e[s+2],d),m=i(e[s+2],h)),d&&h&&p&&m&&(o.push(d.clone()),o.push(h.clone()),o.push(p),o.push(m),o.push(p.clone()),o.push(h.clone()));break;case 2:l||(h=i(d=e[s].clone(),e[s+1]),p=i(d,e[s+2]),o.push(d),o.push(h),o.push(p)),c||(h=i(d=e[s+1].clone(),e[s+2]),p=i(d,e[s]),o.push(d),o.push(h),o.push(p)),u||(h=i(d=e[s+2].clone(),e[s]),p=i(d,e[s+1]),o.push(d),o.push(h),o.push(p))}}return o},x=0;x<l.length;x+=3){var R=new Array;if(R.push(E(x)),R.push(E(x+1)),R.push(E(x+2)),R=C(R,new n.Vector3(1,0,0)),R=C(R,new n.Vector3(-1,0,0)),R=C(R,new n.Vector3(0,1,0)),R=C(R,new n.Vector3(0,-1,0)),R=C(R,new n.Vector3(0,0,1)),0!==(R=C(R,new n.Vector3(0,0,-1))).length)for(var O=0;O<R.length;O++){var I=R[O];P.indices.push(S),I.position.toArray(P.positions,3*S),I.normal.toArray(P.normals,3*S),P.uvs.push(.5+I.position.x/f.x),P.uvs.push(.5+I.position.y/f.y),S++}}var D=new i.Mesh(e,t.getScene());return P.applyToMesh(D),D.position=d.clone(),D.rotation=new n.Vector3(b,v,p),D},e}()},"./Meshes/Builders/discBuilder.ts":
- /*!****************************************!*\
- !*** ./Meshes/Builders/discBuilder.ts ***!
- \****************************************/
- /*! exports provided: DiscBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"DiscBuilder",(function(){return o}));var n=r(/*! ../mesh */"./Meshes/mesh.ts"),i=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");i.VertexData.CreateDisc=function(e){var t=new Array,r=new Array,n=new Array,o=new Array,s=e.radius||.5,a=e.tessellation||64,l=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,c=0===e.sideOrientation?0:e.sideOrientation||i.VertexData.DEFAULTSIDE;t.push(0,0,0),o.push(.5,.5);for(var u=2*Math.PI*l,d=u/a,h=0;h<u;h+=d){var f=Math.cos(h),p=Math.sin(h),m=(f+1)/2,g=(1-p)/2;t.push(s*f,s*p,0),o.push(m,g)}1===l&&(t.push(t[3],t[4],t[5]),o.push(o[2],o[3]));for(var _=t.length/3,v=1;v<_-1;v++)r.push(v+1,0,v);i.VertexData.ComputeNormals(t,r,n),i.VertexData._ComputeSides(c,t,r,n,o,e.frontUVs,e.backUVs);var y=new i.VertexData;return y.indices=r,y.positions=t,y.normals=n,y.uvs=o,y},n.Mesh.CreateDisc=function(e,t,r,n,i,s){void 0===n&&(n=null);var a={radius:t,tessellation:r,sideOrientation:s,updatable:i};return o.CreateDisc(e,a,n)};var o=function(){function e(){}return e.CreateDisc=function(e,t,r){void 0===r&&(r=null);var o=new n.Mesh(e,r);return t.sideOrientation=n.Mesh._GetDefaultSideOrientation(t.sideOrientation),o._originalBuilderSideOrientation=t.sideOrientation,i.VertexData.CreateDisc(t).applyToMesh(o,t.updatable),o},e}()},"./Meshes/Builders/groundBuilder.ts":
- /*!******************************************!*\
- !*** ./Meshes/Builders/groundBuilder.ts ***!
- \******************************************/
- /*! exports provided: GroundBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"GroundBuilder",(function(){return h}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../groundMesh */"./Meshes/groundMesh.ts"),l=r(/*! ../../Misc/tools */"./Misc/tools.ts"),c=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../../Maths/math.constants */"./Maths/math.constants.ts"),d=r(/*! ../../Misc/canvasGenerator */"./Misc/canvasGenerator.ts");s.VertexData.CreateGround=function(e){var t,r,i=[],o=[],a=[],l=[],c=e.width||1,u=e.height||1,d=e.subdivisionsX||e.subdivisions||1,h=e.subdivisionsY||e.subdivisions||1;for(t=0;t<=h;t++)for(r=0;r<=d;r++){var f=new n.Vector3(r*c/d-c/2,0,(h-t)*u/h-u/2),p=new n.Vector3(0,1,0);o.push(f.x,f.y,f.z),a.push(p.x,p.y,p.z),l.push(r/d,1-t/h)}for(t=0;t<h;t++)for(r=0;r<d;r++)i.push(r+1+(t+1)*(d+1)),i.push(r+1+t*(d+1)),i.push(r+t*(d+1)),i.push(r+(t+1)*(d+1)),i.push(r+1+(t+1)*(d+1)),i.push(r+t*(d+1));var m=new s.VertexData;return m.indices=i,m.positions=o,m.normals=a,m.uvs=l,m},s.VertexData.CreateTiledGround=function(e){var t,r,i,o,a=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,l=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,c=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,u=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,d=e.subdivisions||{w:1,h:1},h=e.precision||{w:1,h:1},f=new Array,p=new Array,m=new Array,g=new Array;d.h=d.h<1?1:d.h,d.w=d.w<1?1:d.w,h.w=h.w<1?1:h.w,h.h=h.h<1?1:h.h;var _=(c-a)/d.w,v=(u-l)/d.h;function y(e,i,o,s){var a=p.length/3,l=h.w+1;for(t=0;t<h.h;t++)for(r=0;r<h.w;r++){var c=[a+r+t*l,a+(r+1)+t*l,a+(r+1)+(t+1)*l,a+r+(t+1)*l];f.push(c[1]),f.push(c[2]),f.push(c[3]),f.push(c[0]),f.push(c[1]),f.push(c[3])}var u=n.Vector3.Zero(),d=new n.Vector3(0,1,0);for(t=0;t<=h.h;t++)for(u.z=t*(s-i)/h.h+i,r=0;r<=h.w;r++)u.x=r*(o-e)/h.w+e,u.y=0,p.push(u.x,u.y,u.z),m.push(d.x,d.y,d.z),g.push(r/h.w,t/h.h)}for(i=0;i<d.h;i++)for(o=0;o<d.w;o++)y(a+o*_,l+i*v,a+(o+1)*_,l+(i+1)*v);var b=new s.VertexData;return b.indices=f,b.positions=p,b.normals=m,b.uvs=g,b},s.VertexData.CreateGroundFromHeightMap=function(e){var t,r,o=[],a=[],l=[],c=[],d=e.colorFilter||new i.Color3(.3,.59,.11),h=e.alphaFilter||0,f=!1;if(e.minHeight>e.maxHeight){f=!0;var p=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=p}for(t=0;t<=e.subdivisions;t++)for(r=0;r<=e.subdivisions;r++){var m=new n.Vector3(r*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),g=4*(((m.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(m.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth),_=e.buffer[g]/255,v=e.buffer[g+1]/255,y=e.buffer[g+2]/255,b=e.buffer[g+3]/255;f&&(_=1-_,v=1-v,y=1-y);var A=_*d.r+v*d.g+y*d.b;m.y=b>=h?e.minHeight+(e.maxHeight-e.minHeight)*A:e.minHeight-u.Epsilon,a.push(m.x,m.y,m.z),l.push(0,0,0),c.push(r/e.subdivisions,1-t/e.subdivisions)}for(t=0;t<e.subdivisions;t++)for(r=0;r<e.subdivisions;r++){var T=r+1+(t+1)*(e.subdivisions+1),M=r+1+t*(e.subdivisions+1),P=r+t*(e.subdivisions+1),S=r+(t+1)*(e.subdivisions+1),E=a[3*T+1]>=e.minHeight,C=a[3*M+1]>=e.minHeight,x=a[3*P+1]>=e.minHeight;E&&C&&x&&(o.push(T),o.push(M),o.push(P)),a[3*S+1]>=e.minHeight&&E&&x&&(o.push(S),o.push(T),o.push(P))}s.VertexData.ComputeNormals(a,o,l);var R=new s.VertexData;return R.indices=o,R.positions=a,R.normals=l,R.uvs=c,R},o.Mesh.CreateGround=function(e,t,r,n,i,o){var s={width:t,height:r,subdivisions:n,updatable:o};return h.CreateGround(e,s,i)},o.Mesh.CreateTiledGround=function(e,t,r,n,i,o,s,a,l){var c={xmin:t,zmin:r,xmax:n,zmax:i,subdivisions:o,precision:s,updatable:l};return h.CreateTiledGround(e,c,a)},o.Mesh.CreateGroundFromHeightMap=function(e,t,r,n,i,o,s,a,l,c,u){var d={width:r,height:n,subdivisions:i,minHeight:o,maxHeight:s,updatable:l,onReady:c,alphaFilter:u};return h.CreateGroundFromHeightMap(e,t,d,a)};var h=function(){function e(){}return e.CreateGround=function(e,t,r){var n=new a.GroundMesh(e,r);return n._setReady(!1),n._subdivisionsX=t.subdivisionsX||t.subdivisions||1,n._subdivisionsY=t.subdivisionsY||t.subdivisions||1,n._width=t.width||1,n._height=t.height||1,n._maxX=n._width/2,n._maxZ=n._height/2,n._minX=-n._maxX,n._minZ=-n._maxZ,s.VertexData.CreateGround(t).applyToMesh(n,t.updatable),n._setReady(!0),n},e.CreateTiledGround=function(e,t,r){void 0===r&&(r=null);var n=new o.Mesh(e,r);return s.VertexData.CreateTiledGround(t).applyToMesh(n,t.updatable),n},e.CreateGroundFromHeightMap=function(e,t,r,n){void 0===n&&(n=null);var o=r.width||10,u=r.height||10,h=r.subdivisions||1,f=r.minHeight||0,p=r.maxHeight||1,m=r.colorFilter||new i.Color3(.3,.59,.11),g=r.alphaFilter||0,_=r.updatable,v=r.onReady;n=n||c.EngineStore.LastCreatedScene;var y=new a.GroundMesh(e,n);return y._subdivisionsX=h,y._subdivisionsY=h,y._width=o,y._height=u,y._maxX=y._width/2,y._maxZ=y._height/2,y._minX=-y._maxX,y._minZ=-y._maxZ,y._setReady(!1),l.Tools.LoadImage(t,(function(e){var t=e.width,r=e.height,i=d.CanvasGenerator.CreateCanvas(t,r).getContext("2d");if(!i)throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");if(!n.isDisposed){i.drawImage(e,0,0);var a=i.getImageData(0,0,t,r).data;s.VertexData.CreateGroundFromHeightMap({width:o,height:u,subdivisions:h,minHeight:f,maxHeight:p,colorFilter:m,buffer:a,bufferWidth:t,bufferHeight:r,alphaFilter:g}).applyToMesh(y,_),v&&v(y),y._setReady(!0)}}),(function(){}),n.offlineProvider),y},e}()},"./Meshes/Builders/hemisphereBuilder.ts":
- /*!**********************************************!*\
- !*** ./Meshes/Builders/hemisphereBuilder.ts ***!
- \**********************************************/
- /*! exports provided: HemisphereBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"HemisphereBuilder",(function(){return o}));var n=r(/*! ../mesh */"./Meshes/mesh.ts"),i=r(/*! ../Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts");n.Mesh.CreateHemisphere=function(e,t,r,n){var i={segments:t,diameter:r};return o.CreateHemisphere(e,i,n)};var o=function(){function e(){}return e.CreateHemisphere=function(e,t,r){t.diameter||(t.diameter=1),t.segments||(t.segments=16);var o=i.SphereBuilder.CreateSphere("",{slice:.5,diameter:t.diameter,segments:t.segments},r),s=n.Mesh.CreateDisc("",t.diameter/2,3*t.segments+(4-t.segments),r);s.rotation.x=-Math.PI/2,s.parent=o;var a=n.Mesh.MergeMeshes([s,o],!0);return a.name=e,a},e}()},"./Meshes/Builders/icoSphereBuilder.ts":
- /*!*********************************************!*\
- !*** ./Meshes/Builders/icoSphereBuilder.ts ***!
- \*********************************************/
- /*! exports provided: IcoSphereBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"IcoSphereBuilder",(function(){return s}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateIcoSphere=function(e){var t,r=e.sideOrientation||o.VertexData.DEFAULTSIDE,i=e.radius||1,s=void 0===e.flat||e.flat,a=e.subdivisions||4,l=e.radiusX||i,c=e.radiusY||i,u=e.radiusZ||i,d=(1+Math.sqrt(5))/2,h=[-1,d,-0,1,d,0,-1,-d,0,1,-d,0,0,-1,-d,0,1,-d,0,-1,d,0,1,d,d,0,1,d,0,-1,-d,0,1,-d,0,-1],f=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],p=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],m=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],g=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],_=new Array,v=new Array,y=new Array,b=new Array,A=0,T=new Array(3),M=new Array(3);for(t=0;t<3;t++)T[t]=n.Vector3.Zero(),M[t]=n.Vector2.Zero();for(var P=0;P<20;P++){for(t=0;t<3;t++){var S=f[3*P+t];T[t].copyFromFloats(h[3*p[S]],h[3*p[S]+1],h[3*p[S]+2]),T[t].normalize().scaleInPlace(i),M[t].copyFromFloats(m[2*S]*(138/1024)+60/1024+g[P]*(-40/1024),m[2*S+1]*(239/1024)+26/1024+g[P]*(20/1024))}for(var E=function(e,t,r,i){var o,d=n.Vector3.Lerp(T[0],T[2],t/a),h=n.Vector3.Lerp(T[1],T[2],t/a),f=a===t?T[2]:n.Vector3.Lerp(d,h,e/(a-t));if(f.normalize(),s){var p=n.Vector3.Lerp(T[0],T[2],i/a),m=n.Vector3.Lerp(T[1],T[2],i/a);o=n.Vector3.Lerp(p,m,r/(a-i))}else o=new n.Vector3(f.x,f.y,f.z);o.x/=l,o.y/=c,o.z/=u,o.normalize();var g=n.Vector2.Lerp(M[0],M[2],t/a),P=n.Vector2.Lerp(M[1],M[2],t/a),S=a===t?M[2]:n.Vector2.Lerp(g,P,e/(a-t));v.push(f.x*l,f.y*c,f.z*u),y.push(o.x,o.y,o.z),b.push(S.x,S.y),_.push(A),A++},C=0;C<a;C++)for(var x=0;x+C<a;x++)E(x,C,x+1/3,C+1/3),E(x+1,C,x+1/3,C+1/3),E(x,C+1,x+1/3,C+1/3),x+C+1<a&&(E(x+1,C,x+2/3,C+2/3),E(x+1,C+1,x+2/3,C+2/3),E(x,C+1,x+2/3,C+2/3))}o.VertexData._ComputeSides(r,v,_,y,b,e.frontUVs,e.backUVs);var R=new o.VertexData;return R.indices=_,R.positions=v,R.normals=y,R.uvs=b,R},i.Mesh.CreateIcoSphere=function(e,t,r){return s.CreateIcoSphere(e,t,r)};var s=function(){function e(){}return e.CreateIcoSphere=function(e,t,r){void 0===r&&(r=null);var n=new i.Mesh(e,r);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,o.VertexData.CreateIcoSphere(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/index.ts":
- /*!**********************************!*\
- !*** ./Meshes/Builders/index.ts ***!
- \**********************************/
- /*! exports provided: BoxBuilder, TiledBoxBuilder, DiscBuilder, RibbonBuilder, SphereBuilder, HemisphereBuilder, CylinderBuilder, TorusBuilder, TorusKnotBuilder, LinesBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, PlaneBuilder, TiledPlaneBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./boxBuilder */"./Meshes/Builders/boxBuilder.ts");r.d(t,"BoxBuilder",(function(){return n.BoxBuilder}));var i=r(/*! ./tiledBoxBuilder */"./Meshes/Builders/tiledBoxBuilder.ts");r.d(t,"TiledBoxBuilder",(function(){return i.TiledBoxBuilder}));var o=r(/*! ./discBuilder */"./Meshes/Builders/discBuilder.ts");r.d(t,"DiscBuilder",(function(){return o.DiscBuilder}));var s=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts");r.d(t,"RibbonBuilder",(function(){return s.RibbonBuilder}));var a=r(/*! ./sphereBuilder */"./Meshes/Builders/sphereBuilder.ts");r.d(t,"SphereBuilder",(function(){return a.SphereBuilder}));var l=r(/*! ./hemisphereBuilder */"./Meshes/Builders/hemisphereBuilder.ts");r.d(t,"HemisphereBuilder",(function(){return l.HemisphereBuilder}));var c=r(/*! ./cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts");r.d(t,"CylinderBuilder",(function(){return c.CylinderBuilder}));var u=r(/*! ./torusBuilder */"./Meshes/Builders/torusBuilder.ts");r.d(t,"TorusBuilder",(function(){return u.TorusBuilder}));var d=r(/*! ./torusKnotBuilder */"./Meshes/Builders/torusKnotBuilder.ts");r.d(t,"TorusKnotBuilder",(function(){return d.TorusKnotBuilder}));var h=r(/*! ./linesBuilder */"./Meshes/Builders/linesBuilder.ts");r.d(t,"LinesBuilder",(function(){return h.LinesBuilder}));var f=r(/*! ./polygonBuilder */"./Meshes/Builders/polygonBuilder.ts");r.d(t,"PolygonBuilder",(function(){return f.PolygonBuilder}));var p=r(/*! ./shapeBuilder */"./Meshes/Builders/shapeBuilder.ts");r.d(t,"ShapeBuilder",(function(){return p.ShapeBuilder}));var m=r(/*! ./latheBuilder */"./Meshes/Builders/latheBuilder.ts");r.d(t,"LatheBuilder",(function(){return m.LatheBuilder}));var g=r(/*! ./planeBuilder */"./Meshes/Builders/planeBuilder.ts");r.d(t,"PlaneBuilder",(function(){return g.PlaneBuilder}));var _=r(/*! ./tiledPlaneBuilder */"./Meshes/Builders/tiledPlaneBuilder.ts");r.d(t,"TiledPlaneBuilder",(function(){return _.TiledPlaneBuilder}));var v=r(/*! ./groundBuilder */"./Meshes/Builders/groundBuilder.ts");r.d(t,"GroundBuilder",(function(){return v.GroundBuilder}));var y=r(/*! ./tubeBuilder */"./Meshes/Builders/tubeBuilder.ts");r.d(t,"TubeBuilder",(function(){return y.TubeBuilder}));var b=r(/*! ./polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts");r.d(t,"PolyhedronBuilder",(function(){return b.PolyhedronBuilder}));var A=r(/*! ./icoSphereBuilder */"./Meshes/Builders/icoSphereBuilder.ts");r.d(t,"IcoSphereBuilder",(function(){return A.IcoSphereBuilder}));var T=r(/*! ./decalBuilder */"./Meshes/Builders/decalBuilder.ts");r.d(t,"DecalBuilder",(function(){return T.DecalBuilder}))},"./Meshes/Builders/latheBuilder.ts":
- /*!*****************************************!*\
- !*** ./Meshes/Builders/latheBuilder.ts ***!
- \*****************************************/
- /*! exports provided: LatheBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"LatheBuilder",(function(){return s}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts");i.Mesh.CreateLathe=function(e,t,r,n,i,o,a){var l={shape:t,radius:r,tessellation:n,sideOrientation:a,updatable:o};return s.CreateLathe(e,l,i)};var s=function(){function e(){}return e.CreateLathe=function(e,t,r){void 0===r&&(r=null);var s,a=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,l=void 0===t.closed||t.closed,c=t.shape,u=t.radius||1,d=t.tessellation||64,h=t.clip||0,f=t.updatable,p=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),m=t.cap||i.Mesh.NO_CAP,g=2*Math.PI,_=new Array,v=t.invertUV||!1,y=0,b=0,A=g/d*a,T=new Array;for(y=0;y<=d-h;y++){for(T=[],m!=i.Mesh.CAP_START&&m!=i.Mesh.CAP_ALL||(T.push(new n.Vector3(0,c[0].y,0)),T.push(new n.Vector3(Math.cos(y*A)*c[0].x*u,c[0].y,Math.sin(y*A)*c[0].x*u))),b=0;b<c.length;b++)s=new n.Vector3(Math.cos(y*A)*c[b].x*u,c[b].y,Math.sin(y*A)*c[b].x*u),T.push(s);m!=i.Mesh.CAP_END&&m!=i.Mesh.CAP_ALL||(T.push(new n.Vector3(Math.cos(y*A)*c[c.length-1].x*u,c[c.length-1].y,Math.sin(y*A)*c[c.length-1].x*u)),T.push(new n.Vector3(0,c[c.length-1].y,0))),_.push(T)}return o.RibbonBuilder.CreateRibbon(e,{pathArray:_,closeArray:l,sideOrientation:p,updatable:f,invertUV:v,frontUVs:t.frontUVs,backUVs:t.backUVs},r)},e}()},"./Meshes/Builders/linesBuilder.ts":
- /*!*****************************************!*\
- !*** ./Meshes/Builders/linesBuilder.ts ***!
- \*****************************************/
- /*! exports provided: LinesBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"LinesBuilder",(function(){return l}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),s=r(/*! ../../Meshes/linesMesh */"./Meshes/linesMesh.ts"),a=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts");o.VertexData.CreateLineSystem=function(e){for(var t=[],r=[],n=e.lines,i=e.colors,s=[],a=0,l=0;l<n.length;l++)for(var c=n[l],u=0;u<c.length;u++){if(r.push(c[u].x,c[u].y,c[u].z),i){var d=i[l];s.push(d[u].r,d[u].g,d[u].b,d[u].a)}u>0&&(t.push(a-1),t.push(a)),a++}var h=new o.VertexData;return h.indices=t,h.positions=r,i&&(h.colors=s),h},o.VertexData.CreateDashedLines=function(e){var t,r,i=e.dashSize||3,s=e.gapSize||1,a=e.dashNb||200,l=e.points,c=new Array,u=new Array,d=n.Vector3.Zero(),h=0,f=0,p=0,m=0,g=0;for(g=0;g<l.length-1;g++)l[g+1].subtractToRef(l[g],d),h+=d.length();for(r=i*(t=h/a)/(i+s),g=0;g<l.length-1;g++){l[g+1].subtractToRef(l[g],d),f=Math.floor(d.length()/t),d.normalize();for(var _=0;_<f;_++)p=t*_,c.push(l[g].x+p*d.x,l[g].y+p*d.y,l[g].z+p*d.z),c.push(l[g].x+(p+r)*d.x,l[g].y+(p+r)*d.y,l[g].z+(p+r)*d.z),u.push(m,m+1),m+=2}var v=new o.VertexData;return v.positions=c,v.indices=u,v},i.Mesh.CreateLines=function(e,t,r,n,i){void 0===r&&(r=null),void 0===n&&(n=!1),void 0===i&&(i=null);var o={points:t,updatable:n,instance:i};return l.CreateLines(e,o,r)},i.Mesh.CreateDashedLines=function(e,t,r,n,i,o,s,a){void 0===o&&(o=null);var c={points:t,dashSize:r,gapSize:n,dashNb:i,updatable:s,instance:a};return l.CreateDashedLines(e,c,o)};var l=function(){function e(){}return e.CreateLineSystem=function(e,t,r){var n=t.instance,i=t.lines,l=t.colors;if(n){var c,u,d=n.getVerticesData(a.VertexBuffer.PositionKind);l&&(c=n.getVerticesData(a.VertexBuffer.ColorKind));for(var h=0,f=0,p=0;p<i.length;p++)for(var m=i[p],g=0;g<m.length;g++)d[h]=m[g].x,d[h+1]=m[g].y,d[h+2]=m[g].z,l&&c&&(u=l[p],c[f]=u[g].r,c[f+1]=u[g].g,c[f+2]=u[g].b,c[f+3]=u[g].a,f+=4),h+=3;return n.updateVerticesData(a.VertexBuffer.PositionKind,d,!1,!1),l&&c&&n.updateVerticesData(a.VertexBuffer.ColorKind,c,!1,!1),n}var _=!!l,v=new s.LinesMesh(e,r,null,void 0,void 0,_,t.useVertexAlpha);return o.VertexData.CreateLineSystem(t).applyToMesh(v,t.updatable),v},e.CreateLines=function(t,r,n){void 0===n&&(n=null);var i=r.colors?[r.colors]:null;return e.CreateLineSystem(t,{lines:[r.points],updatable:r.updatable,instance:r.instance,colors:i,useVertexAlpha:r.useVertexAlpha},n)},e.CreateDashedLines=function(e,t,r){void 0===r&&(r=null);var a=t.points,l=t.instance,c=t.gapSize||1,u=t.dashSize||3;if(l)return l.updateMeshPositions((function(e){var t,r,i=n.Vector3.Zero(),o=e.length/6,s=0,c=0,u=0,d=0,h=0,f=0;for(h=0;h<a.length-1;h++)a[h+1].subtractToRef(a[h],i),s+=i.length();t=s/o;var p=l._creationDataStorage.dashSize;for(r=p*t/(p+l._creationDataStorage.gapSize),h=0;h<a.length-1;h++)for(a[h+1].subtractToRef(a[h],i),c=Math.floor(i.length()/t),i.normalize(),f=0;f<c&&d<e.length;)u=t*f,e[d]=a[h].x+u*i.x,e[d+1]=a[h].y+u*i.y,e[d+2]=a[h].z+u*i.z,e[d+3]=a[h].x+(u+r)*i.x,e[d+4]=a[h].y+(u+r)*i.y,e[d+5]=a[h].z+(u+r)*i.z,d+=6,f++;for(;d<e.length;)e[d]=a[h].x,e[d+1]=a[h].y,e[d+2]=a[h].z,d+=3}),!1),l;var d=new s.LinesMesh(e,r,null,void 0,void 0,void 0,t.useVertexAlpha);return o.VertexData.CreateDashedLines(t).applyToMesh(d,t.updatable),d._creationDataStorage=new i._CreationDataStorage,d._creationDataStorage.dashSize=u,d._creationDataStorage.gapSize=c,d},e}()},"./Meshes/Builders/planeBuilder.ts":
- /*!*****************************************!*\
- !*** ./Meshes/Builders/planeBuilder.ts ***!
- \*****************************************/
- /*! exports provided: PlaneBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"PlaneBuilder",(function(){return o}));var n=r(/*! ../mesh */"./Meshes/mesh.ts"),i=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");i.VertexData.CreatePlane=function(e){var t=[],r=[],n=[],o=[],s=e.width||e.size||1,a=e.height||e.size||1,l=0===e.sideOrientation?0:e.sideOrientation||i.VertexData.DEFAULTSIDE,c=s/2,u=a/2;r.push(-c,-u,0),n.push(0,0,-1),o.push(0,0),r.push(c,-u,0),n.push(0,0,-1),o.push(1,0),r.push(c,u,0),n.push(0,0,-1),o.push(1,1),r.push(-c,u,0),n.push(0,0,-1),o.push(0,1),t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),i.VertexData._ComputeSides(l,r,t,n,o,e.frontUVs,e.backUVs);var d=new i.VertexData;return d.indices=t,d.positions=r,d.normals=n,d.uvs=o,d},n.Mesh.CreatePlane=function(e,t,r,n,i){var s={size:t,width:t,height:t,sideOrientation:i,updatable:n};return o.CreatePlane(e,s,r)};var o=function(){function e(){}return e.CreatePlane=function(e,t,r){void 0===r&&(r=null);var o=new n.Mesh(e,r);return t.sideOrientation=n.Mesh._GetDefaultSideOrientation(t.sideOrientation),o._originalBuilderSideOrientation=t.sideOrientation,i.VertexData.CreatePlane(t).applyToMesh(o,t.updatable),t.sourcePlane&&(o.translate(t.sourcePlane.normal,-t.sourcePlane.d),o.setDirection(t.sourcePlane.normal.scale(-1))),o},e}()},"./Meshes/Builders/polygonBuilder.ts":
- /*!*******************************************!*\
- !*** ./Meshes/Builders/polygonBuilder.ts ***!
- \*******************************************/
- /*! exports provided: PolygonBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"PolygonBuilder",(function(){return u}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../polygonMesh */"./Meshes/polygonMesh.ts"),l=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts");s.VertexData.CreatePolygon=function(e,t,r,o,a,c,u){for(var d=r||new Array(3),h=o,f=[],p=u||!1,m=0;m<3;m++)void 0===d[m]&&(d[m]=new n.Vector4(0,0,1,1)),h&&void 0===h[m]&&(h[m]=new i.Color4(1,1,1,1));var g=e.getVerticesData(l.VertexBuffer.PositionKind),_=e.getVerticesData(l.VertexBuffer.NormalKind),v=e.getVerticesData(l.VertexBuffer.UVKind),y=e.getIndices(),b=g.length/9,A=0,T=0,M=0,P=0,S=[0];if(p)for(var E=b;E<g.length/3;E+=4)T=g[3*(E+2)]-g[3*E],M=g[3*(E+2)+2]-g[3*E+2],P+=Math.sqrt(T*T+M*M),S.push(P);E=0;for(var C=0,x=0;x<_.length;x+=3)Math.abs(_[x+1])<.001&&(C=1),Math.abs(_[x+1]-1)<.001&&(C=0),Math.abs(_[x+1]+1)<.001&&(C=2),E=x/3,1===C?(A=E-b,v[2*E]=A%4<1.5?p?d[C].x+(d[C].z-d[C].x)*S[Math.floor(A/4)]/P:d[C].x:p?d[C].x+(d[C].z-d[C].x)*S[Math.floor(A/4)+1]/P:d[C].z,v[2*E+1]=A%2==0?d[C].w:d[C].y):(v[2*E]=(1-v[2*E])*d[C].x+v[2*E]*d[C].z,v[2*E+1]=(1-v[2*E+1])*d[C].y+v[2*E+1]*d[C].w),h&&f.push(h[C].r,h[C].g,h[C].b,h[C].a);s.VertexData._ComputeSides(t,g,y,_,v,a,c);var R=new s.VertexData;if(R.indices=y,R.positions=g,R.normals=_,R.uvs=v,h){var O=t===s.VertexData.DOUBLESIDE?f.concat(f):f;R.colors=O}return R},o.Mesh.CreatePolygon=function(e,t,r,n,i,o,s){void 0===s&&(s=earcut);var a={shape:t,holes:n,updatable:i,sideOrientation:o};return u.CreatePolygon(e,a,r,s)},o.Mesh.ExtrudePolygon=function(e,t,r,n,i,o,s,a){void 0===a&&(a=earcut);var l={shape:t,holes:i,depth:r,updatable:o,sideOrientation:s};return u.ExtrudePolygon(e,l,n,a)};var u=function(){function e(){}return e.CreatePolygon=function(e,t,r,i){void 0===r&&(r=null),void 0===i&&(i=earcut),t.sideOrientation=o.Mesh._GetDefaultSideOrientation(t.sideOrientation);for(var l=t.shape,u=t.holes||[],d=t.depth||0,h=[],f=[],p=0;p<l.length;p++)h[p]=new n.Vector2(l[p].x,l[p].z);h[0].equalsWithEpsilon(h[h.length-1],1e-8)&&h.pop();for(var m=new a.PolygonMeshBuilder(e,h,r||c.EngineStore.LastCreatedScene,i),g=0;g<u.length;g++){f=[];for(var _=0;_<u[g].length;_++)f.push(new n.Vector2(u[g][_].x,u[g][_].z));m.addHole(f)}var v=m.build(t.updatable,d);return v._originalBuilderSideOrientation=t.sideOrientation,s.VertexData.CreatePolygon(v,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs,t.wrap).applyToMesh(v,t.updatable),v},e.ExtrudePolygon=function(t,r,n,i){return void 0===n&&(n=null),void 0===i&&(i=earcut),e.CreatePolygon(t,r,n,i)},e}()},"./Meshes/Builders/polyhedronBuilder.ts":
- /*!**********************************************!*\
- !*** ./Meshes/Builders/polyhedronBuilder.ts ***!
- \**********************************************/
- /*! exports provided: PolyhedronBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"PolyhedronBuilder",(function(){return a}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");s.VertexData.CreatePolyhedron=function(e){var t=[];t[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},t[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},t[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},t[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},t[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},t[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},t[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},t[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},t[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},t[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},t[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},t[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},t[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},t[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},t[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};var r,o,a,l,c,u,d=e.type&&(e.type<0||e.type>=t.length)?0:e.type||0,h=e.size,f=e.sizeX||h||1,p=e.sizeY||h||1,m=e.sizeZ||h||1,g=e.custom||t[d],_=g.face.length,v=e.faceUV||new Array(_),y=e.faceColors,b=void 0===e.flat||e.flat,A=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,T=new Array,M=new Array,P=new Array,S=new Array,E=new Array,C=0,x=0,R=new Array,O=0,I=0;if(b)for(I=0;I<_;I++)y&&void 0===y[I]&&(y[I]=new i.Color4(1,1,1,1)),v&&void 0===v[I]&&(v[I]=new n.Vector4(0,0,1,1));if(b)for(I=0;I<_;I++){var D=g.face[I].length;for(a=2*Math.PI/D,l=.5*Math.tan(a/2),c=.5,O=0;O<D;O++)T.push(g.vertex[g.face[I][O]][0]*f,g.vertex[g.face[I][O]][1]*p,g.vertex[g.face[I][O]][2]*m),R.push(C),C++,r=v[I].x+(v[I].z-v[I].x)*(.5+l),o=v[I].y+(v[I].w-v[I].y)*(c-.5),S.push(r,o),u=l*Math.cos(a)-c*Math.sin(a),c=l*Math.sin(a)+c*Math.cos(a),l=u,y&&E.push(y[I].r,y[I].g,y[I].b,y[I].a);for(O=0;O<D-2;O++)M.push(R[0+x],R[O+2+x],R[O+1+x]);x+=D}else{for(O=0;O<g.vertex.length;O++)T.push(g.vertex[O][0]*f,g.vertex[O][1]*p,g.vertex[O][2]*m),S.push(0,0);for(I=0;I<_;I++)for(O=0;O<g.face[I].length-2;O++)M.push(g.face[I][0],g.face[I][O+2],g.face[I][O+1])}s.VertexData.ComputeNormals(T,M,P),s.VertexData._ComputeSides(A,T,M,P,S,e.frontUVs,e.backUVs);var B=new s.VertexData;return B.positions=T,B.indices=M,B.normals=P,B.uvs=S,y&&b&&(B.colors=E),B},o.Mesh.CreatePolyhedron=function(e,t,r){return a.CreatePolyhedron(e,t,r)};var a=function(){function e(){}return e.CreatePolyhedron=function(e,t,r){void 0===r&&(r=null);var n=new o.Mesh(e,r);return t.sideOrientation=o.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,s.VertexData.CreatePolyhedron(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/ribbonBuilder.ts":
- /*!******************************************!*\
- !*** ./Meshes/Builders/ribbonBuilder.ts ***!
- \******************************************/
- /*! exports provided: RibbonBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"RibbonBuilder",(function(){return l}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../buffer */"./Meshes/buffer.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../../Culling/boundingInfo */"./Culling/boundingInfo.ts");s.VertexData.CreateRibbon=function(e){var t=e.pathArray,r=e.closeArray||!1,n=e.closePath||!1,i=e.invertUV||!1,a=Math.floor(t[0].length/2),l=e.offset||a;l=l>a?a:Math.floor(l);var c,u,d,h,f=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,p=e.uvs,m=e.colors,g=[],_=[],v=[],y=[],b=[],A=[],T=[],M=[],P=[],S=[];if(t.length<2){var E=[],C=[];for(d=0;d<t[0].length-l;d++)E.push(t[0][d]),C.push(t[0][d+l]);t=[E,C]}var x,R,O,I,D,B=0,N=n?1:0;for(c=t[0].length,u=0;u<t.length;u++){for(T[u]=0,b[u]=[0],c=c<(R=(x=t[u]).length)?c:R,h=0;h<R;)g.push(x[h].x,x[h].y,x[h].z),h>0&&(O=x[h].subtract(x[h-1]).length()+T[u],b[u].push(O),T[u]=O),h++;n&&(h--,g.push(x[0].x,x[0].y,x[0].z),O=x[h].subtract(x[0]).length()+T[u],b[u].push(O),T[u]=O),P[u]=R+N,S[u]=B,B+=R+N}var L,w,F=null,V=null;for(d=0;d<c+N;d++){for(M[d]=0,A[d]=[0],u=0;u<t.length-1;u++)I=t[u],D=t[u+1],d===c?(F=I[0],V=D[0]):(F=I[d],V=D[d]),O=V.subtract(F).length()+M[d],A[d].push(O),M[d]=O;r&&V&&F&&(I=t[u],D=t[0],d===c&&(V=D[0]),O=V.subtract(F).length()+M[d],M[d]=O)}if(p)for(u=0;u<p.length;u++)y.push(p[u].x,p[u].y);else for(u=0;u<t.length;u++)for(d=0;d<c+N;d++)L=0!=T[u]?b[u][d]/T[u]:0,w=0!=M[d]?A[d][u]/M[d]:0,i?y.push(w,L):y.push(L,w);for(var k=0,U=P[u=0]-1,z=P[u+1]-1,G=U<z?U:z,j=S[1]-S[0],H=r?P.length:P.length-1;k<=G&&u<H;)_.push(k,k+j,k+1),_.push(k+j+1,k+1,k+j),(k+=1)===G&&(++u==P.length-1?(j=S[0]-S[u],U=P[u]-1,z=P[0]-1):(j=S[u+1]-S[u],U=P[u]-1,z=P[u+1]-1),k=S[u],G=U<z?U+k:z+k);if(s.VertexData.ComputeNormals(g,_,v),n){var W=0,X=0;for(u=0;u<t.length;u++)W=3*S[u],X=u+1<t.length?3*(S[u+1]-1):v.length-3,v[W]=.5*(v[W]+v[X]),v[W+1]=.5*(v[W+1]+v[X+1]),v[W+2]=.5*(v[W+2]+v[X+2]),v[X]=v[W],v[X+1]=v[W+1],v[X+2]=v[W+2]}s.VertexData._ComputeSides(f,g,_,v,y,e.frontUVs,e.backUVs);var Y=null;if(m){Y=new Float32Array(4*m.length);for(var Q=0;Q<m.length;Q++)Y[4*Q]=m[Q].r,Y[4*Q+1]=m[Q].g,Y[4*Q+2]=m[Q].b,Y[4*Q+3]=m[Q].a}var K=new s.VertexData,q=new Float32Array(g),Z=new Float32Array(v),J=new Float32Array(y);return K.indices=_,K.positions=q,K.normals=Z,K.uvs=J,Y&&K.set(Y,o.VertexBuffer.ColorKind),n&&(K._idx=S),K},i.Mesh.CreateRibbon=function(e,t,r,n,i,o,s,a,c){return void 0===r&&(r=!1),void 0===s&&(s=!1),l.CreateRibbon(e,{pathArray:t,closeArray:r,closePath:n,offset:i,updatable:s,sideOrientation:a,instance:c},o)};var l=function(){function e(){}return e.CreateRibbon=function(e,t,r){void 0===r&&(r=null);var l=t.pathArray,c=t.closeArray,u=t.closePath,d=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),h=t.instance,f=t.updatable;if(h){var p=n.TmpVectors.Vector3[0].setAll(Number.MAX_VALUE),m=n.TmpVectors.Vector3[1].setAll(-Number.MAX_VALUE),g=h.getVerticesData(o.VertexBuffer.PositionKind);if(function(e){for(var t=l[0].length,r=h,n=0,o=r._originalBuilderSideOrientation===i.Mesh.DOUBLESIDE?2:1,s=1;s<=o;++s)for(var a=0;a<l.length;++a){var c=l[a],u=c.length;t=t<u?t:u;for(var d=0;d<t;++d){var f=c[d];e[n]=f.x,e[n+1]=f.y,e[n+2]=f.z,p.minimizeInPlaceFromFloats(f.x,f.y,f.z),m.maximizeInPlaceFromFloats(f.x,f.y,f.z),n+=3}r._creationDataStorage&&r._creationDataStorage.closePath&&(f=c[0],e[n]=f.x,e[n+1]=f.y,e[n+2]=f.z,n+=3)}}(g),h._boundingInfo?h._boundingInfo.reConstruct(p,m,h._worldMatrix):h._boundingInfo=new a.BoundingInfo(p,m,h._worldMatrix),h.updateVerticesData(o.VertexBuffer.PositionKind,g,!1,!1),t.colors){for(var _=h.getVerticesData(o.VertexBuffer.ColorKind),v=0,y=0;v<t.colors.length;v++,y+=4){var b=t.colors[v];_[y]=b.r,_[y+1]=b.g,_[y+2]=b.b,_[y+3]=b.a}h.updateVerticesData(o.VertexBuffer.ColorKind,_,!1,!1)}if(t.uvs){for(var A=h.getVerticesData(o.VertexBuffer.UVKind),T=0;T<t.uvs.length;T++)A[2*T]=t.uvs[T].x,A[2*T+1]=t.uvs[T].y;h.updateVerticesData(o.VertexBuffer.UVKind,A,!1,!1)}if(!h.areNormalsFrozen||h.isFacetDataEnabled){var M=h.getIndices(),P=h.getVerticesData(o.VertexBuffer.NormalKind),S=h.isFacetDataEnabled?h.getFacetDataParameters():null;if(s.VertexData.ComputeNormals(g,M,P,S),h._creationDataStorage&&h._creationDataStorage.closePath)for(var E=0,C=0,x=0;x<l.length;x++)E=3*h._creationDataStorage.idx[x],C=x+1<l.length?3*(h._creationDataStorage.idx[x+1]-1):P.length-3,P[E]=.5*(P[E]+P[C]),P[E+1]=.5*(P[E+1]+P[C+1]),P[E+2]=.5*(P[E+2]+P[C+2]),P[C]=P[E],P[C+1]=P[E+1],P[C+2]=P[E+2];h.areNormalsFrozen||h.updateVerticesData(o.VertexBuffer.NormalKind,P,!1,!1)}return h}var R=new i.Mesh(e,r);R._originalBuilderSideOrientation=d,R._creationDataStorage=new i._CreationDataStorage;var O=s.VertexData.CreateRibbon(t);return u&&(R._creationDataStorage.idx=O._idx),R._creationDataStorage.closePath=u,R._creationDataStorage.closeArray=c,O.applyToMesh(R,f),R},e}()},"./Meshes/Builders/shapeBuilder.ts":
- /*!*****************************************!*\
- !*** ./Meshes/Builders/shapeBuilder.ts ***!
- \*****************************************/
- /*! exports provided: ShapeBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"ShapeBuilder",(function(){return a}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts"),s=r(/*! ../../Maths/math.path */"./Maths/math.path.ts");i.Mesh.ExtrudeShape=function(e,t,r,n,o,s,l,c,u,d){void 0===l&&(l=null);var h={shape:t,path:r,scale:n,rotation:o,cap:0===s?0:s||i.Mesh.NO_CAP,sideOrientation:u,instance:d,updatable:c};return a.ExtrudeShape(e,h,l)},i.Mesh.ExtrudeShapeCustom=function(e,t,r,n,o,s,l,c,u,d,h,f){var p={shape:t,path:r,scaleFunction:n,rotationFunction:o,ribbonCloseArray:s,ribbonClosePath:l,cap:0===c?0:c||i.Mesh.NO_CAP,sideOrientation:h,instance:f,updatable:d};return a.ExtrudeShapeCustom(e,p,u)};var a=function(){function e(){}return e.ExtrudeShape=function(t,r,n){void 0===n&&(n=null);var o=r.path,s=r.shape,a=r.scale||1,l=r.rotation||0,c=0===r.cap?0:r.cap||i.Mesh.NO_CAP,u=r.updatable,d=i.Mesh._GetDefaultSideOrientation(r.sideOrientation),h=r.instance||null,f=r.invertUV||!1;return e._ExtrudeShapeGeneric(t,s,o,a,l,null,null,!1,!1,c,!1,n,!!u,d,h,f,r.frontUVs||null,r.backUVs||null)},e.ExtrudeShapeCustom=function(t,r,n){void 0===n&&(n=null);var o=r.path,s=r.shape,a=r.scaleFunction||function(){return 1},l=r.rotationFunction||function(){return 0},c=r.ribbonCloseArray||!1,u=r.ribbonClosePath||!1,d=0===r.cap?0:r.cap||i.Mesh.NO_CAP,h=r.updatable,f=i.Mesh._GetDefaultSideOrientation(r.sideOrientation),p=r.instance,m=r.invertUV||!1;return e._ExtrudeShapeGeneric(t,s,o,null,null,a,l,c,u,d,!0,n,!!h,f,p||null,m,r.frontUVs||null,r.backUVs||null)},e._ExtrudeShapeGeneric=function(e,t,r,a,l,c,u,d,h,f,p,m,g,_,v,y,b,A){var T,M,P=function(e,t,r,o,s,a,l,c,u,d){for(var h=r.getTangents(),f=r.getNormals(),p=r.getBinormals(),m=r.getDistances(),g=0,_=d&&c?c:function(){return null!==a?a:0},v=d&&l?l:function(){return null!==s?s:1},y=u===i.Mesh.NO_CAP||u===i.Mesh.CAP_END?0:2,b=n.TmpVectors.Matrix[0],A=0;A<t.length;A++){for(var T=new Array,M=_(A,m[A]),P=v(A,m[A]),S=0;S<e.length;S++){n.Matrix.RotationAxisToRef(h[A],g,b);var E=h[A].scale(e[S].z).add(f[A].scale(e[S].x)).add(p[A].scale(e[S].y)),C=T[S]?T[S]:n.Vector3.Zero();n.Vector3.TransformCoordinatesToRef(E,b,C),C.scaleInPlace(P).addInPlace(t[A]),T[S]=C}o[y]=T,g+=M,y++}var x=function(e){var t,r=Array(),i=n.Vector3.Zero();for(t=0;t<e.length;t++)i.addInPlace(e[t]);for(i.scaleInPlace(1/e.length),t=0;t<e.length;t++)r.push(i);return r};switch(u){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:o[0]=x(o[2]),o[1]=o[2];break;case i.Mesh.CAP_END:o[y]=o[y-1],o[y+1]=x(o[y-1]);break;case i.Mesh.CAP_ALL:o[0]=x(o[2]),o[1]=o[2],o[y]=o[y-1],o[y+1]=x(o[y-1])}return o};if(v){var S=v._creationDataStorage;return T=S.path3D.update(r),M=P(t,r,S.path3D,S.pathArray,a,l,c,u,S.cap,p),v=i.Mesh.CreateRibbon("",M,!1,!1,0,m||void 0,!1,0,v)}M=P(t,r,T=new s.Path3D(r),new Array,a,l,c,u,f=f<0||f>3?0:f,p);var E=o.RibbonBuilder.CreateRibbon(e,{pathArray:M,closeArray:d,closePath:h,updatable:g,sideOrientation:_,invertUV:y,frontUVs:b||void 0,backUVs:A||void 0},m);return E._creationDataStorage.pathArray=M,E._creationDataStorage.path3D=T,E._creationDataStorage.cap=f,E},e}()},"./Meshes/Builders/sphereBuilder.ts":
- /*!******************************************!*\
- !*** ./Meshes/Builders/sphereBuilder.ts ***!
- \******************************************/
- /*! exports provided: SphereBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"SphereBuilder",(function(){return s}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateSphere=function(e){for(var t=e.segments||32,r=e.diameterX||e.diameter||1,i=e.diameterY||e.diameter||1,s=e.diameterZ||e.diameter||1,a=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,l=e.slice&&e.slice<=0?1:e.slice||1,c=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,u=new n.Vector3(r/2,i/2,s/2),d=2+t,h=2*d,f=[],p=[],m=[],g=[],_=0;_<=d;_++){for(var v=_/d,y=v*Math.PI*l,b=0;b<=h;b++){var A=b/h,T=A*Math.PI*2*a,M=n.Matrix.RotationZ(-y),P=n.Matrix.RotationY(T),S=n.Vector3.TransformCoordinates(n.Vector3.Up(),M),E=n.Vector3.TransformCoordinates(S,P),C=E.multiply(u),x=E.divide(u).normalize();p.push(C.x,C.y,C.z),m.push(x.x,x.y,x.z),g.push(A,v)}if(_>0)for(var R=p.length/3,O=R-2*(h+1);O+h+2<R;O++)f.push(O),f.push(O+1),f.push(O+h+1),f.push(O+h+1),f.push(O+1),f.push(O+h+2)}o.VertexData._ComputeSides(c,p,f,m,g,e.frontUVs,e.backUVs);var I=new o.VertexData;return I.indices=f,I.positions=p,I.normals=m,I.uvs=g,I},i.Mesh.CreateSphere=function(e,t,r,n,i,o){var a={segments:t,diameterX:r,diameterY:r,diameterZ:r,sideOrientation:o,updatable:i};return s.CreateSphere(e,a,n)};var s=function(){function e(){}return e.CreateSphere=function(e,t,r){void 0===r&&(r=null);var n=new i.Mesh(e,r);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,o.VertexData.CreateSphere(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/tiledBoxBuilder.ts":
- /*!********************************************!*\
- !*** ./Meshes/Builders/tiledBoxBuilder.ts ***!
- \********************************************/
- /*! exports provided: TiledBoxBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"TiledBoxBuilder",(function(){return a}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");s.VertexData.CreateTiledBox=function(e){for(var t=e.faceUV||new Array(6),r=e.faceColors,a=e.pattern||o.Mesh.NO_FLIP,l=e.width||e.size||1,c=e.height||e.size||1,u=e.depth||e.size||1,d=e.tileWidth||e.tileSize||1,h=e.tileHeight||e.tileSize||1,f=e.alignHorizontal||0,p=e.alignVertical||0,m=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,g=0;g<6;g++)void 0===t[g]&&(t[g]=new n.Vector4(0,0,1,1)),r&&void 0===r[g]&&(r[g]=new i.Color4(1,1,1,1));var _=l/2,v=c/2,y=u/2,b=[];for(g=0;g<2;g++)b[g]=s.VertexData.CreateTiledPlane({pattern:a,tileWidth:d,tileHeight:h,width:l,height:c,alignVertical:p,alignHorizontal:f,sideOrientation:m});for(g=2;g<4;g++)b[g]=s.VertexData.CreateTiledPlane({pattern:a,tileWidth:d,tileHeight:h,width:u,height:c,alignVertical:p,alignHorizontal:f,sideOrientation:m});var A=p;for(p===o.Mesh.BOTTOM?A=o.Mesh.TOP:p===o.Mesh.TOP&&(A=o.Mesh.BOTTOM),g=4;g<6;g++)b[g]=s.VertexData.CreateTiledPlane({pattern:a,tileWidth:d,tileHeight:h,width:l,height:u,alignVertical:A,alignHorizontal:f,sideOrientation:m});var T=[],M=[],P=[],S=[],E=[],C=[],x=[],R=[],O=0,I=0,D=0;for(g=0;g<6;g++){O=b[g].positions.length,C[g]=[],x[g]=[];for(var B=0;B<O/3;B++)C[g].push(new n.Vector3(b[g].positions[3*B],b[g].positions[3*B+1],b[g].positions[3*B+2])),x[g].push(new n.Vector3(b[g].normals[3*B],b[g].normals[3*B+1],b[g].normals[3*B+2]));I=b[g].uvs.length,R[g]=[];for(var N=0;N<I;N+=2)R[g][N]=t[g].x+(t[g].z-t[g].x)*b[g].uvs[N],R[g][N+1]=t[g].y+(t[g].w-t[g].y)*b[g].uvs[N+1];if(P=P.concat(R[g]),S=S.concat(b[g].indices.map((function(e){return e+D}))),D+=C[g].length,r)for(var L=0;L<4;L++)E.push(r[g].r,r[g].g,r[g].b,r[g].a)}var w=new n.Vector3(0,0,y),F=n.Matrix.RotationY(Math.PI);T=C[0].map((function(e){return n.Vector3.TransformNormal(e,F).add(w)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[]),M=x[0].map((function(e){return n.Vector3.TransformNormal(e,F)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[]),T=T.concat(C[1].map((function(e){return e.subtract(w)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[])),M=M.concat(x[1].map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[]));var V=new n.Vector3(_,0,0),k=n.Matrix.RotationY(-Math.PI/2);T=T.concat(C[2].map((function(e){return n.Vector3.TransformNormal(e,k).add(V)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[])),M=M.concat(x[2].map((function(e){return n.Vector3.TransformNormal(e,k)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[]));var U=n.Matrix.RotationY(Math.PI/2);T=T.concat(C[3].map((function(e){return n.Vector3.TransformNormal(e,U).subtract(V)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[])),M=M.concat(x[3].map((function(e){return n.Vector3.TransformNormal(e,U)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[]));var z=new n.Vector3(0,v,0),G=n.Matrix.RotationX(Math.PI/2);T=T.concat(C[4].map((function(e){return n.Vector3.TransformNormal(e,G).add(z)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[])),M=M.concat(x[4].map((function(e){return n.Vector3.TransformNormal(e,G)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[]));var j=n.Matrix.RotationX(-Math.PI/2);T=T.concat(C[5].map((function(e){return n.Vector3.TransformNormal(e,j).subtract(z)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[])),M=M.concat(x[5].map((function(e){return n.Vector3.TransformNormal(e,j)})).map((function(e){return[e.x,e.y,e.z]})).reduce((function(e,t){return e.concat(t)}),[])),s.VertexData._ComputeSides(m,T,S,M,P);var H=new s.VertexData;if(H.indices=S,H.positions=T,H.normals=M,H.uvs=P,r){var W=m===s.VertexData.DOUBLESIDE?E.concat(E):E;H.colors=W}return H};var a=function(){function e(){}return e.CreateTiledBox=function(e,t,r){void 0===r&&(r=null);var n=new o.Mesh(e,r);return t.sideOrientation=o.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,s.VertexData.CreateTiledBox(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/tiledPlaneBuilder.ts":
- /*!**********************************************!*\
- !*** ./Meshes/Builders/tiledPlaneBuilder.ts ***!
- \**********************************************/
- /*! exports provided: TiledPlaneBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"TiledPlaneBuilder",(function(){return o}));var n=r(/*! ../mesh */"./Meshes/mesh.ts"),i=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");i.VertexData.CreateTiledPlane=function(e){var t=e.pattern||n.Mesh.NO_FLIP,r=e.tileWidth||e.tileSize||1,o=e.tileHeight||e.tileSize||1,s=e.alignHorizontal||0,a=e.alignVertical||0,l=e.width||e.size||1,c=Math.floor(l/r),u=l-c*r,d=e.height||e.size||1,h=Math.floor(d/o),f=d-h*o,p=r*c/2,m=o*h/2,g=0,_=0,v=0,y=0,b=0,A=0;if(u>0||f>0){switch(v=-p,y=-m,b=p,A=m,s){case n.Mesh.CENTER:v-=u/=2,b+=u;break;case n.Mesh.LEFT:b+=u,g=-u/2;break;case n.Mesh.RIGHT:v-=u,g=u/2}switch(a){case n.Mesh.CENTER:y-=f/=2,A+=f;break;case n.Mesh.BOTTOM:A+=f,_=-f/2;break;case n.Mesh.TOP:y-=f,_=f/2}}var T=[],M=[],P=[];P[0]=[0,0,1,0,1,1,0,1],P[1]=[0,0,1,0,1,1,0,1],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(P[1]=[1,1,0,1,0,0,1,0]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(P[1]=[1,0,0,0,0,1,1,1]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(P[1]=[0,1,1,1,1,0,0,0]);for(var S=[],E=[],C=[],x=0,R=0;R<h;R++)for(var O=0;O<c;O++)T.push(O*r-p+g,R*o-m+_,0),T.push((O+1)*r-p+g,R*o-m+_,0),T.push((O+1)*r-p+g,(R+1)*o-m+_,0),T.push(O*r-p+g,(R+1)*o-m+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),S=t===n.Mesh.FLIP_TILE||t===n.Mesh.ROTATE_TILE||t===n.Mesh.FLIP_N_ROTATE_TILE?S.concat(P[(O%2+R%2)%2]):t===n.Mesh.FLIP_ROW||t===n.Mesh.ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_ROW?S.concat(P[R%2]):S.concat(P[0]),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),x+=4;if(u>0||f>0){var I,D,B,N,L=f>0&&(a===n.Mesh.CENTER||a===n.Mesh.TOP),w=f>0&&(a===n.Mesh.CENTER||a===n.Mesh.BOTTOM),F=u>0&&(s===n.Mesh.CENTER||s===n.Mesh.RIGHT),V=u>0&&(s===n.Mesh.CENTER||s===n.Mesh.LEFT),k=[];if(L&&F&&(T.push(v+g,y+_,0),T.push(-p+g,y+_,0),T.push(-p+g,y+f+_,0),T.push(v+g,y+f+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,k=[I=1-u/r,D=1-f/o,B=1,D,B,N=1,I,N],t===n.Mesh.ROTATE_ROW&&(k=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),t===n.Mesh.FLIP_ROW&&(k=[1-I,D,1-B,D,1-B,N,1-I,N]),t===n.Mesh.FLIP_N_ROTATE_ROW&&(k=[I,1-D,B,1-D,B,1-N,I,1-N]),S=S.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&V&&(T.push(p+g,y+_,0),T.push(b+g,y+_,0),T.push(b+g,y+f+_,0),T.push(p+g,y+f+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,k=[I=0,D=1-f/o,B=u/r,D,B,N=1,I,N],(t===n.Mesh.ROTATE_ROW||t===n.Mesh.ROTATE_TILE&&c%2==0)&&(k=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),(t===n.Mesh.FLIP_ROW||t===n.Mesh.FLIP_TILE&&c%2==0)&&(k=[1-I,D,1-B,D,1-B,N,1-I,N]),(t===n.Mesh.FLIP_N_ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_TILE&&c%2==0)&&(k=[I,1-D,B,1-D,B,1-N,I,1-N]),S=S.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w&&F&&(T.push(v+g,m+_,0),T.push(-p+g,m+_,0),T.push(-p+g,A+_,0),T.push(v+g,A+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,k=[I=1-u/r,D=0,B=1,D,B,N=f/o,I,N],(t===n.Mesh.ROTATE_ROW&&h%2==1||t===n.Mesh.ROTATE_TILE&&h%1==0)&&(k=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),(t===n.Mesh.FLIP_ROW&&h%2==1||t===n.Mesh.FLIP_TILE&&h%2==0)&&(k=[1-I,D,1-B,D,1-B,N,1-I,N]),(t===n.Mesh.FLIP_N_ROTATE_ROW&&h%2==1||t===n.Mesh.FLIP_N_ROTATE_TILE&&h%2==0)&&(k=[I,1-D,B,1-D,B,1-N,I,1-N]),S=S.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w&&V&&(T.push(p+g,m+_,0),T.push(b+g,m+_,0),T.push(b+g,A+_,0),T.push(p+g,A+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,k=[I=0,D=0,B=u/r,D,B,N=f/o,I,N],(t===n.Mesh.ROTATE_ROW&&h%2==1||t===n.Mesh.ROTATE_TILE&&(h+c)%2==1)&&(k=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),(t===n.Mesh.FLIP_ROW&&h%2==1||t===n.Mesh.FLIP_TILE&&(h+c)%2==1)&&(k=[1-I,D,1-B,D,1-B,N,1-I,N]),(t===n.Mesh.FLIP_N_ROTATE_ROW&&h%2==1||t===n.Mesh.FLIP_N_ROTATE_TILE&&(h+c)%2==1)&&(k=[I,1-D,B,1-D,B,1-N,I,1-N]),S=S.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L){var U=[];for(I=0,D=1-f/o,B=1,N=1,U[0]=[I,D,B,D,B,N,I,N],U[1]=[I,D,B,D,B,N,I,N],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(U[1]=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(U[1]=[1-I,D,1-B,D,1-B,N,1-I,N]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(U[1]=[I,1-D,B,1-D,B,1-N,I,1-N]),O=0;O<c;O++)T.push(O*r-p+g,y+_,0),T.push((O+1)*r-p+g,y+_,0),T.push((O+1)*r-p+g,y+f+_,0),T.push(O*r-p+g,y+f+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,S=t===n.Mesh.FLIP_TILE||t===n.Mesh.ROTATE_TILE||t===n.Mesh.FLIP_N_ROTATE_TILE?S.concat(U[(O+1)%2]):t===n.Mesh.FLIP_ROW||t===n.Mesh.ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_ROW?S.concat(U[1]):S.concat(U[0]),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(w){var z=[];for(I=0,D=0,B=1,N=f/o,z[0]=[I,D,B,D,B,N,I,N],z[1]=[I,D,B,D,B,N,I,N],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(z[1]=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(z[1]=[1-I,D,1-B,D,1-B,N,1-I,N]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(z[1]=[I,1-D,B,1-D,B,1-N,I,1-N]),O=0;O<c;O++)T.push(O*r-p+g,A-f+_,0),T.push((O+1)*r-p+g,A-f+_,0),T.push((O+1)*r-p+g,A+_,0),T.push(O*r-p+g,A+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,S=t===n.Mesh.FLIP_TILE||t===n.Mesh.ROTATE_TILE||t===n.Mesh.FLIP_N_ROTATE_TILE?S.concat(z[(O+h)%2]):t===n.Mesh.FLIP_ROW||t===n.Mesh.ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_ROW?S.concat(z[h%2]):S.concat(z[0]),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(F){var G=[];for(I=1-u/r,D=0,B=1,N=1,G[0]=[I,D,B,D,B,N,I,N],G[1]=[I,D,B,D,B,N,I,N],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(G[1]=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(G[1]=[1-I,D,1-B,D,1-B,N,1-I,N]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(G[1]=[I,1-D,B,1-D,B,1-N,I,1-N]),R=0;R<h;R++)T.push(v+g,R*o-m+_,0),T.push(v+u+g,R*o-m+_,0),T.push(v+u+g,(R+1)*o-m+_,0),T.push(v+g,(R+1)*o-m+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,S=t===n.Mesh.FLIP_TILE||t===n.Mesh.ROTATE_TILE||t===n.Mesh.FLIP_N_ROTATE_TILE?S.concat(G[(R+1)%2]):t===n.Mesh.FLIP_ROW||t===n.Mesh.ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_ROW?S.concat(G[R%2]):S.concat(G[0]),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(V){var j=[];for(I=0,D=0,B=u/o,N=1,j[0]=[I,D,B,D,B,N,I,N],j[1]=[I,D,B,D,B,N,I,N],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(j[1]=[1-I,1-D,1-B,1-D,1-B,1-N,1-I,1-N]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(j[1]=[1-I,D,1-B,D,1-B,N,1-I,N]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(j[1]=[I,1-D,B,1-D,B,1-N,I,1-N]),R=0;R<h;R++)T.push(b-u+g,R*o-m+_,0),T.push(b+g,R*o-m+_,0),T.push(b+g,(R+1)*o-m+_,0),T.push(b-u+g,(R+1)*o-m+_,0),C.push(x,x+1,x+3,x+1,x+2,x+3),x+=4,S=t===n.Mesh.FLIP_TILE||t===n.Mesh.ROTATE_TILE||t===n.Mesh.FLIP_N_ROTATE_TILE?S.concat(j[(R+c)%2]):t===n.Mesh.FLIP_ROW||t===n.Mesh.ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_ROW?S.concat(j[R%2]):S.concat(j[0]),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}var H=0===e.sideOrientation?0:e.sideOrientation||i.VertexData.DEFAULTSIDE;i.VertexData._ComputeSides(H,T,C,M,S,e.frontUVs,e.backUVs);var W=new i.VertexData;W.indices=C,W.positions=T,W.normals=M,W.uvs=S;var X=H===i.VertexData.DOUBLESIDE?E.concat(E):E;return W.colors=X,W};var o=function(){function e(){}return e.CreateTiledPlane=function(e,t,r){void 0===r&&(r=null);var o=new n.Mesh(e,r);return t.sideOrientation=n.Mesh._GetDefaultSideOrientation(t.sideOrientation),o._originalBuilderSideOrientation=t.sideOrientation,i.VertexData.CreateTiledPlane(t).applyToMesh(o,t.updatable),o},e}()},"./Meshes/Builders/torusBuilder.ts":
- /*!*****************************************!*\
- !*** ./Meshes/Builders/torusBuilder.ts ***!
- \*****************************************/
- /*! exports provided: TorusBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"TorusBuilder",(function(){return s}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateTorus=function(e){for(var t=[],r=[],i=[],s=[],a=e.diameter||1,l=e.thickness||.5,c=e.tessellation||16,u=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,d=c+1,h=0;h<=c;h++)for(var f=h/c,p=h*Math.PI*2/c-Math.PI/2,m=n.Matrix.Translation(a/2,0,0).multiply(n.Matrix.RotationY(p)),g=0;g<=c;g++){var _=1-g/c,v=g*Math.PI*2/c+Math.PI,y=Math.cos(v),b=Math.sin(v),A=new n.Vector3(y,b,0),T=A.scale(l/2),M=new n.Vector2(f,_);T=n.Vector3.TransformCoordinates(T,m),A=n.Vector3.TransformNormal(A,m),r.push(T.x,T.y,T.z),i.push(A.x,A.y,A.z),s.push(M.x,M.y);var P=(h+1)%d,S=(g+1)%d;t.push(h*d+g),t.push(h*d+S),t.push(P*d+g),t.push(h*d+S),t.push(P*d+S),t.push(P*d+g)}o.VertexData._ComputeSides(u,r,t,i,s,e.frontUVs,e.backUVs);var E=new o.VertexData;return E.indices=t,E.positions=r,E.normals=i,E.uvs=s,E},i.Mesh.CreateTorus=function(e,t,r,n,i,o,a){var l={diameter:t,thickness:r,tessellation:n,sideOrientation:a,updatable:o};return s.CreateTorus(e,l,i)};var s=function(){function e(){}return e.CreateTorus=function(e,t,r){var n=new i.Mesh(e,r);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,o.VertexData.CreateTorus(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/torusKnotBuilder.ts":
- /*!*********************************************!*\
- !*** ./Meshes/Builders/torusKnotBuilder.ts ***!
- \*********************************************/
- /*! exports provided: TorusKnotBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"TorusKnotBuilder",(function(){return s}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateTorusKnot=function(e){var t,r,i=new Array,s=new Array,a=new Array,l=new Array,c=e.radius||2,u=e.tube||.5,d=e.radialSegments||32,h=e.tubularSegments||32,f=e.p||2,p=e.q||3,m=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,g=function(e){var t=Math.cos(e),r=Math.sin(e),i=p/f*e,o=Math.cos(i),s=c*(2+o)*.5*t,a=c*(2+o)*r*.5,l=c*Math.sin(i)*.5;return new n.Vector3(s,a,l)};for(t=0;t<=d;t++){var _=t%d/d*2*f*Math.PI,v=g(_),y=g(_+.01),b=y.subtract(v),A=y.add(v),T=n.Vector3.Cross(b,A);for(A=n.Vector3.Cross(T,b),T.normalize(),A.normalize(),r=0;r<h;r++){var M=r%h/h*2*Math.PI,P=-u*Math.cos(M),S=u*Math.sin(M);s.push(v.x+P*A.x+S*T.x),s.push(v.y+P*A.y+S*T.y),s.push(v.z+P*A.z+S*T.z),l.push(t/d),l.push(r/h)}}for(t=0;t<d;t++)for(r=0;r<h;r++){var E=(r+1)%h,C=t*h+r,x=(t+1)*h+r,R=(t+1)*h+E,O=t*h+E;i.push(O),i.push(x),i.push(C),i.push(O),i.push(R),i.push(x)}o.VertexData.ComputeNormals(s,i,a),o.VertexData._ComputeSides(m,s,i,a,l,e.frontUVs,e.backUVs);var I=new o.VertexData;return I.indices=i,I.positions=s,I.normals=a,I.uvs=l,I},i.Mesh.CreateTorusKnot=function(e,t,r,n,i,o,a,l,c,u){var d={radius:t,tube:r,radialSegments:n,tubularSegments:i,p:o,q:a,sideOrientation:u,updatable:c};return s.CreateTorusKnot(e,d,l)};var s=function(){function e(){}return e.CreateTorusKnot=function(e,t,r){var n=new i.Mesh(e,r);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,o.VertexData.CreateTorusKnot(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/tubeBuilder.ts":
- /*!****************************************!*\
- !*** ./Meshes/Builders/tubeBuilder.ts ***!
- \****************************************/
- /*! exports provided: TubeBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"TubeBuilder",(function(){return a}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts"),s=r(/*! ../../Maths/math.path */"./Maths/math.path.ts");i.Mesh.CreateTube=function(e,t,r,n,i,o,s,l,c,u){var d={path:t,radius:r,tessellation:n,radiusFunction:i,arc:1,cap:o,updatable:l,sideOrientation:c,instance:u};return a.CreateTube(e,d,s)};var a=function(){function e(){}return e.CreateTube=function(e,t,r){void 0===r&&(r=null);var a=t.path,l=t.instance,c=1;void 0!==t.radius?c=t.radius:l&&(c=l._creationDataStorage.radius);var u=t.tessellation||64,d=t.radiusFunction||null,h=t.cap||i.Mesh.NO_CAP,f=t.invertUV||!1,p=t.updatable,m=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;var g,_,v=function(e,t,r,o,s,a,l,c){for(var u,d,h,f,p=t.getTangents(),m=t.getNormals(),g=t.getDistances(),_=2*Math.PI/s*c,v=a||function(){return o},y=n.TmpVectors.Matrix[0],b=l===i.Mesh.NO_CAP||l===i.Mesh.CAP_END?0:2,A=0;A<e.length;A++){d=v(A,g[A]),u=Array(),h=m[A];for(var T=0;T<s;T++)n.Matrix.RotationAxisToRef(p[A],_*T,y),f=u[T]?u[T]:n.Vector3.Zero(),n.Vector3.TransformCoordinatesToRef(h,y,f),f.scaleInPlace(d).addInPlace(e[A]),u[T]=f;r[b]=u,b++}var M=function(t,r){for(var n=Array(),i=0;i<t;i++)n.push(e[r]);return n};switch(l){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:r[0]=M(s,0),r[1]=r[2].slice(0);break;case i.Mesh.CAP_END:r[b]=r[b-1].slice(0),r[b+1]=M(s,e.length-1);break;case i.Mesh.CAP_ALL:r[0]=M(s,0),r[1]=r[2].slice(0),r[b]=r[b-1].slice(0),r[b+1]=M(s,e.length-1)}return r};if(l){var y=l._creationDataStorage,b=t.arc||y.arc;return _=v(a,g=y.path3D.update(a),y.pathArray,c,y.tessellation,d,y.cap,b),l=o.RibbonBuilder.CreateRibbon("",{pathArray:_,instance:l}),y.path3D=g,y.pathArray=_,y.arc=b,y.radius=c,l}_=v(a,g=new s.Path3D(a),new Array,c,u,d,h=h<0||h>3?0:h,t.arc);var A=o.RibbonBuilder.CreateRibbon(e,{pathArray:_,closePath:!0,closeArray:!1,updatable:p,sideOrientation:m,invertUV:f,frontUVs:t.frontUVs,backUVs:t.backUVs},r);return A._creationDataStorage.pathArray=_,A._creationDataStorage.path3D=g,A._creationDataStorage.tessellation=u,A._creationDataStorage.cap=h,A._creationDataStorage.arc=t.arc,A._creationDataStorage.radius=c,A},e}()},"./Meshes/Compression/dracoCompression.ts":
- /*!************************************************!*\
- !*** ./Meshes/Compression/dracoCompression.ts ***!
- \************************************************/
- /*! exports provided: DracoCompression */function(e,t,r){"use strict";r.r(t),r.d(t,"DracoCompression",(function(){return c}));var n=r(/*! ../../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../../Misc/workerPool */"./Misc/workerPool.ts"),o=r(/*! ../../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts");function s(e,t,r,n,i){var o=new e.DecoderBuffer;o.Init(t,t.byteLength);var s,a,l=new e.Decoder;try{var c=l.GetEncodedGeometryType(o);switch(c){case e.TRIANGULAR_MESH:s=new e.Mesh,a=l.DecodeBufferToMesh(o,s);break;case e.POINT_CLOUD:s=new e.PointCloud,a=l.DecodeBufferToPointCloud(o,s);break;default:throw new Error("Invalid geometry type "+c)}if(!a.ok()||!s.ptr)throw new Error(a.error_msg());var u=s.num_points();if(c===e.TRIANGULAR_MESH){var d=s.num_faces(),h=new e.DracoInt32Array;try{for(var f=new Uint32Array(3*d),p=0;p<d;p++){l.GetFaceFromMesh(s,p,h);var m=3*p;f[m+0]=h.GetValue(0),f[m+1]=h.GetValue(1),f[m+2]=h.GetValue(2)}n(f)}finally{e.destroy(h)}}var g=function(t,r){var n=new e.DracoFloat32Array;try{l.GetAttributeFloatForAllPoints(s,r,n);var o=r.num_components();if(o)if("color"===t&&3===o){for(var a=new Float32Array(4*u),c=0,d=0;c<a.length;c+=4,d+=o)a[c+0]=n.GetValue(d+0),a[c+1]=n.GetValue(d+1),a[c+2]=n.GetValue(d+2),a[c+3]=1;i(t,a)}else{for(a=new Float32Array(u*o),c=0;c<a.length;c++)a[c]=n.GetValue(c);i(t,a)}}finally{e.destroy(n)}};if(r)for(var _ in r){var v=r[_];g(_,l.GetAttributeByUniqueId(s,v))}else{var y={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"};for(var _ in y)-1!==(v=l.GetAttributeId(s,e[y[_]]))&&g(_,l.GetAttribute(s,v))}}finally{s&&e.destroy(s),e.destroy(l),e.destroy(o)}}function a(){var e;onmessage=function(t){var r=t.data;switch(r.id){case"init":var n=r.decoder;n.url&&(importScripts(n.url),e=DracoDecoderModule({wasmBinary:n.wasmBinary})),postMessage("done");break;case"decodeMesh":if(!e)throw new Error("Draco decoder module is not available");e.then((function(e){s(e,r.dataView,r.attributes,(function(e){postMessage({id:"indices",value:e},[e.buffer])}),(function(e,t){postMessage({id:e,value:t},[t.buffer])})),postMessage("done")}))}}}function l(e){return"object"!=typeof document||"string"!=typeof e?e:n.Tools.GetAbsoluteUrl(e)}var c=function(){function e(t){void 0===t&&(t=e.DefaultNumWorkers);var r=e.Configuration.decoder,o=r.wasmUrl&&r.wasmBinaryUrl&&"object"==typeof WebAssembly?{url:r.wasmUrl,wasmBinaryPromise:n.Tools.LoadFileAsync(l(r.wasmBinaryUrl))}:{url:r.fallbackUrl,wasmBinaryPromise:Promise.resolve(void 0)};t&&"function"==typeof Worker?this._workerPoolPromise=o.wasmBinaryPromise.then((function(e){for(var r=s+"("+a+")()",n=URL.createObjectURL(new Blob([r],{type:"application/javascript"})),c=new Array(t),u=0;u<c.length;u++)c[u]=new Promise((function(t,r){var i=new Worker(n),s=function(e){i.removeEventListener("error",s),i.removeEventListener("message",a),r(e)},a=function(e){"done"===e.data&&(i.removeEventListener("error",s),i.removeEventListener("message",a),t(i))};i.addEventListener("error",s),i.addEventListener("message",a),i.postMessage({id:"init",decoder:{url:l(o.url),wasmBinary:e}})}));return Promise.all(c).then((function(e){return new i.WorkerPool(e)}))})):this._decoderModulePromise=o.wasmBinaryPromise.then((function(e){if(!o.url)throw new Error("Draco decoder module is not available");return n.Tools.LoadScriptAsync(o.url).then((function(){return t=e,new Promise((function(e){DracoDecoderModule({wasmBinary:t}).then((function(t){e({module:t})}))}));var t}))}))}return Object.defineProperty(e,"DecoderAvailable",{get:function(){var t=e.Configuration.decoder;return!!(t.wasmUrl&&t.wasmBinaryUrl&&"object"==typeof WebAssembly||t.fallbackUrl)},enumerable:!1,configurable:!0}),e.GetDefaultNumWorkers=function(){return"object"==typeof navigator&&navigator.hardwareConcurrency?Math.min(Math.floor(.5*navigator.hardwareConcurrency),4):1},Object.defineProperty(e,"Default",{get:function(){return e._Default||(e._Default=new e),e._Default},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._workerPoolPromise&&this._workerPoolPromise.then((function(e){e.dispose()})),delete this._workerPoolPromise,delete this._decoderModulePromise},e.prototype.whenReadyAsync=function(){return this._workerPoolPromise?this._workerPoolPromise.then((function(){})):this._decoderModulePromise?this._decoderModulePromise.then((function(){})):Promise.resolve()},e.prototype.decodeMeshAsync=function(e,t){var r=e instanceof ArrayBuffer?new Uint8Array(e):e;if(this._workerPoolPromise)return this._workerPoolPromise.then((function(e){return new Promise((function(n,i){e.push((function(e,s){var a=new o.VertexData,l=function(t){e.removeEventListener("error",l),e.removeEventListener("message",c),i(t),s()},c=function(t){"done"===t.data?(e.removeEventListener("error",l),e.removeEventListener("message",c),n(a),s()):"indices"===t.data.id?a.indices=t.data.value:a.set(t.data.value,t.data.id)};e.addEventListener("error",l),e.addEventListener("message",c);var u=new Uint8Array(r.byteLength);u.set(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)),e.postMessage({id:"decodeMesh",dataView:u,attributes:t},[u.buffer])}))}))}));if(this._decoderModulePromise)return this._decoderModulePromise.then((function(e){var n=new o.VertexData;return s(e.module,r,t,(function(e){n.indices=e}),(function(e,t){n.set(t,e)})),n}));throw new Error("Draco decoder module is not available")},e.Configuration={decoder:{wasmUrl:"https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js",wasmBinaryUrl:"https://preview.babylonjs.com/draco_decoder_gltf.wasm",fallbackUrl:"https://preview.babylonjs.com/draco_decoder_gltf.js"}},e.DefaultNumWorkers=e.GetDefaultNumWorkers(),e._Default=null,e}()},"./Meshes/Compression/index.ts":
- /*!*************************************!*\
- !*** ./Meshes/Compression/index.ts ***!
- \*************************************/
- /*! exports provided: DracoCompression */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./dracoCompression */"./Meshes/Compression/dracoCompression.ts");r.d(t,"DracoCompression",(function(){return n.DracoCompression}))},"./Meshes/WebGL/webGLDataBuffer.ts":
- /*!*****************************************!*\
- !*** ./Meshes/WebGL/webGLDataBuffer.ts ***!
- \*****************************************/
- /*! exports provided: WebGLDataBuffer */function(e,t,r){"use strict";r.r(t),r.d(t,"WebGLDataBuffer",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(t){var r=e.call(this)||this;return r._buffer=t,r}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"underlyingResource",{get:function(){return this._buffer},enumerable:!1,configurable:!0}),t}(r(/*! ../dataBuffer */"./Meshes/dataBuffer.ts").DataBuffer)},"./Meshes/abstractMesh.ts":
- /*!********************************!*\
- !*** ./Meshes/abstractMesh.ts ***!
- \********************************/
- /*! exports provided: AbstractMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"AbstractMesh",(function(){return T}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/tools */"./Misc/tools.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Engines/engine */"./Engines/engine.ts"),l=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),u=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),d=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),h=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),f=r(/*! ../Engines/constants */"./Engines/constants.ts"),p=r(/*! ../Collisions/meshCollisionData */"./Collisions/meshCollisionData.ts"),m=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),g=r(/*! ../Maths/math.functions */"./Maths/math.functions.ts"),_=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),v=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),y=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),b=function(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=s.Vector3.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1},A=function(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new b,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1},T=function(e){function t(r,n){void 0===n&&(n=null);var i=e.call(this,r,n,!1)||this;return i._internalAbstractMeshDataInfo=new A,i.cullingStrategy=t.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,i.onCollideObservable=new o.Observable,i.onCollisionPositionChangeObservable=new o.Observable,i.onMaterialChangedObservable=new o.Observable,i.definedFacingForward=!0,i._occlusionQuery=null,i._renderingGroup=null,i.alphaIndex=Number.MAX_VALUE,i.isVisible=!0,i.isPickable=!0,i.showSubMeshesBoundingBox=!1,i.isBlocker=!1,i.enablePointerMoveEvents=!1,i.renderingGroupId=0,i._material=null,i.outlineColor=_.Color3.Red(),i.outlineWidth=.02,i.overlayColor=_.Color3.Red(),i.overlayAlpha=.5,i.useOctreeForRenderingSelection=!0,i.useOctreeForPicking=!0,i.useOctreeForCollisions=!0,i.alwaysSelectAsActiveMesh=!1,i.doNotSyncBoundingInfo=!1,i.actionManager=null,i._meshCollisionData=new p._MeshCollisionData,i.ellipsoid=new s.Vector3(.5,1,.5),i.ellipsoidOffset=new s.Vector3(0,0,0),i.edgesWidth=1,i.edgesColor=new _.Color4(1,0,0,1),i._edgesRenderer=null,i._masterMesh=null,i._boundingInfo=null,i._renderId=0,i._intersectionsInProgress=new Array,i._unIndexed=!1,i._lightSources=new Array,i._waitingData={lods:null,actions:null,freezeWorldMatrix:null},i._bonesTransformMatrices=null,i._transformMatrixTexture=null,i.onRebuildObservable=new o.Observable,i._onCollisionPositionChange=function(e,t,r){void 0===r&&(r=null),t.subtractToRef(i._meshCollisionData._oldPositionForCollisions,i._meshCollisionData._diffPositionForCollisions),i._meshCollisionData._diffPositionForCollisions.length()>a.Engine.CollisionsEpsilon&&i.position.addInPlace(i._meshCollisionData._diffPositionForCollisions),r&&i.onCollideObservable.notifyObservers(r),i.onCollisionPositionChangeObservable.notifyObservers(i.position)},i.getScene().addMesh(i),i._resyncLightSources(),i}return Object(n.__extends)(t,e),Object.defineProperty(t,"BILLBOARDMODE_NONE",{get:function(){return u.TransformNode.BILLBOARDMODE_NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_X",{get:function(){return u.TransformNode.BILLBOARDMODE_X},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Y",{get:function(){return u.TransformNode.BILLBOARDMODE_Y},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Z",{get:function(){return u.TransformNode.BILLBOARDMODE_Z},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_ALL",{get:function(){return u.TransformNode.BILLBOARDMODE_ALL},enumerable:!1,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_USE_POSITION",{get:function(){return u.TransformNode.BILLBOARDMODE_USE_POSITION},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"facetNb",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetNb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"partitioningSubdivisions",{get:function(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions},set:function(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"partitioningBBoxRatio",{get:function(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio},set:function(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mustDepthSortFacets",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort},set:function(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"facetDepthSortFrom",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom},set:function(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFacetDataEnabled",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled},enumerable:!1,configurable:!0}),t.prototype._updateNonUniformScalingState=function(t){return!!e.prototype._updateNonUniformScalingState.call(this,t)&&(this._markSubMeshesAsMiscDirty(),!0)},Object.defineProperty(t.prototype,"onCollide",{set:function(e){this._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._meshCollisionData._onCollideObserver),this._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCollisionPositionChange",{set:function(e){this._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._meshCollisionData._onCollisionPositionChangeObserver),this._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._internalAbstractMeshDataInfo._visibility},set:function(e){this._internalAbstractMeshDataInfo._visibility!==e&&(this._internalAbstractMeshDataInfo._visibility=e,this._markSubMeshesAsMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},set:function(e){this._material!==e&&(this._material&&this._material.meshMap&&(this._material.meshMap[this.uniqueId]=void 0),this._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&this._unBindEffect())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._internalAbstractMeshDataInfo._receiveShadows},set:function(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasVertexAlpha",{get:function(){return this._internalAbstractMeshDataInfo._hasVertexAlpha},set:function(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useVertexColors",{get:function(){return this._internalAbstractMeshDataInfo._useVertexColors},set:function(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders},set:function(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"numBoneInfluencers",{get:function(){return this._internalAbstractMeshDataInfo._numBoneInfluencers},set:function(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyFog",{get:function(){return this._internalAbstractMeshDataInfo._applyFog},set:function(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerMask",{get:function(){return this._internalAbstractMeshDataInfo._layerMask},set:function(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._meshCollisionData._collisionMask},set:function(e){this._meshCollisionData._collisionMask=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionGroup",{get:function(){return this._meshCollisionData._collisionGroup},set:function(e){this._meshCollisionData._collisionGroup=isNaN(e)?-1:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surroundingMeshes",{get:function(){return this._meshCollisionData._surroundingMeshes},set:function(e){this._meshCollisionData._surroundingMeshes=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightSources",{get:function(){return this._lightSources},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_positions",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._internalAbstractMeshDataInfo._skeleton},set:function(e){var t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"AbstractMesh"},t.prototype.toString=function(e){var t="Name: "+this.name+", isInstance: "+("InstancedMesh"!==this.getClassName()?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);var r=this._internalAbstractMeshDataInfo._skeleton;return r&&(t+=", skeleton: "+r.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t},t.prototype._getEffectiveParent=function(){return this._masterMesh&&this.billboardMode!==u.TransformNode.BILLBOARDMODE_NONE?this._masterMesh:e.prototype._getEffectiveParent.call(this)},t.prototype._getActionManagerForTrigger=function(e,t){if(void 0===t&&(t=!0),this.actionManager&&(t||this.actionManager.isRecursive)){if(!e)return this.actionManager;if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}return this.parent?this.parent._getActionManagerForTrigger(e,!1):null},t.prototype._rebuild=function(){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery&&(this._occlusionQuery=null),this.subMeshes)for(var e=0,t=this.subMeshes;e<t.length;e++)t[e]._rebuild()},t.prototype._resyncLightSources=function(){this._lightSources.length=0;for(var e=0,t=this.getScene().lights;e<t.length;e++){var r=t[e];r.isEnabled()&&r.canAffectMesh(this)&&this._lightSources.push(r)}this._markSubMeshesAsLightDirty()},t.prototype._resyncLightSource=function(e){var t=e.isEnabled()&&e.canAffectMesh(this),r=this._lightSources.indexOf(e),n=!1;if(-1===r){if(!t)return;this._lightSources.push(e)}else{if(t)return;n=!0,this._lightSources.splice(r,1)}this._markSubMeshesAsLightDirty(n)},t.prototype._unBindEffect=function(){for(var e=0,t=this.subMeshes;e<t.length;e++)t[e].setEffect(null)},t.prototype._removeLightSource=function(e,t){var r=this._lightSources.indexOf(e);-1!==r&&(this._lightSources.splice(r,1),this._markSubMeshesAsLightDirty(t))},t.prototype._markSubMeshesAsDirty=function(e){if(this.subMeshes)for(var t=0,r=this.subMeshes;t<r.length;t++){var n=r[t];n._materialDefines&&e(n._materialDefines)}},t.prototype._markSubMeshesAsLightDirty=function(e){void 0===e&&(e=!1),this._markSubMeshesAsDirty((function(t){return t.markAsLightDirty(e)}))},t.prototype._markSubMeshesAsAttributesDirty=function(){this._markSubMeshesAsDirty((function(e){return e.markAsAttributesDirty()}))},t.prototype._markSubMeshesAsMiscDirty=function(){this._markSubMeshesAsDirty((function(e){return e.markAsMiscDirty()}))},Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isBlocked",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.getLOD=function(e){return this},t.prototype.getTotalVertices=function(){return 0},t.prototype.getTotalIndices=function(){return 0},t.prototype.getIndices=function(){return null},t.prototype.getVerticesData=function(e){return null},t.prototype.setVerticesData=function(e,t,r,n){return this},t.prototype.updateVerticesData=function(e,t,r,n){return this},t.prototype.setIndices=function(e,t){return this},t.prototype.isVerticesDataPresent=function(e){return!1},t.prototype.getBoundingInfo=function(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfo||this._updateBoundingInfo(),this._boundingInfo)},t.prototype.normalizeToUnitCube=function(t,r,n){return void 0===t&&(t=!0),void 0===r&&(r=!1),e.prototype.normalizeToUnitCube.call(this,t,r,n)},t.prototype.setBoundingInfo=function(e){return this._boundingInfo=e,this},Object.defineProperty(t.prototype,"useBones",{get:function(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(l.VertexBuffer.MatricesIndicesKind)&&this.isVerticesDataPresent(l.VertexBuffer.MatricesWeightsKind)},enumerable:!1,configurable:!0}),t.prototype._preActivate=function(){},t.prototype._preActivateForIntermediateRendering=function(e){},t.prototype._activate=function(e,t){return this._renderId=e,!0},t.prototype._postActivate=function(){},t.prototype._freeze=function(){},t.prototype._unFreeze=function(){},t.prototype.getWorldMatrix=function(){return this._masterMesh&&this.billboardMode===u.TransformNode.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():e.prototype.getWorldMatrix.call(this)},t.prototype._getWorldMatrixDeterminant=function(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():e.prototype._getWorldMatrixDeterminant.call(this)},Object.defineProperty(t.prototype,"isAnInstance",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasInstances",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasThinInstances",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.movePOV=function(e,t,r){return this.position.addInPlace(this.calcMovePOV(e,t,r)),this},t.prototype.calcMovePOV=function(e,t,r){var n=new s.Matrix;(this.rotationQuaternion?this.rotationQuaternion:s.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(n);var i=s.Vector3.Zero(),o=this.definedFacingForward?-1:1;return s.Vector3.TransformCoordinatesFromFloatsToRef(e*o,t,r*o,n,i),i},t.prototype.rotatePOV=function(e,t,r){return this.rotation.addInPlace(this.calcRotatePOV(e,t,r)),this},t.prototype.calcRotatePOV=function(e,t,r){var n=this.definedFacingForward?1:-1;return new s.Vector3(e*n,t,r*n)},t.prototype.refreshBoundingInfo=function(e){return void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked||this._refreshBoundingInfo(this._getPositionData(e),null),this},t.prototype._refreshBoundingInfo=function(e,t){if(e){var r=Object(g.extractMinAndMax)(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(r.minimum,r.maximum):this._boundingInfo=new h.BoundingInfo(r.minimum,r.maximum)}if(this.subMeshes)for(var n=0;n<this.subMeshes.length;n++)this.subMeshes[n].refreshBoundingInfo(e);this._updateBoundingInfo()},t.prototype._getPositionData=function(e){var t=this.getVerticesData(l.VertexBuffer.PositionKind);if(t&&e&&this.skeleton){t=i.Tools.Slice(t),this._generatePointsArray();var r=this.getVerticesData(l.VertexBuffer.MatricesIndicesKind),n=this.getVerticesData(l.VertexBuffer.MatricesWeightsKind);if(n&&r){var o=this.numBoneInfluencers>4,a=o?this.getVerticesData(l.VertexBuffer.MatricesIndicesExtraKind):null,c=o?this.getVerticesData(l.VertexBuffer.MatricesWeightsExtraKind):null;this.skeleton.prepare();for(var u=this.skeleton.getTransformMatrices(this),d=s.TmpVectors.Vector3[0],h=s.TmpVectors.Matrix[0],f=s.TmpVectors.Matrix[1],p=0,m=0;m<t.length;m+=3,p+=4){var g,_;for(h.reset(),g=0;g<4;g++)(_=n[p+g])>0&&(s.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*r[p+g]),_,f),h.addToSelf(f));if(o)for(g=0;g<4;g++)(_=c[p+g])>0&&(s.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*a[p+g]),_,f),h.addToSelf(f));s.Vector3.TransformCoordinatesFromFloatsToRef(t[m],t[m+1],t[m+2],h,d),d.toArray(t,m),this._positions&&this._positions[m/3].copyFrom(d)}}}return t},t.prototype._updateBoundingInfo=function(){var e=this._effectiveMesh;return this._boundingInfo?this._boundingInfo.update(e.worldMatrixFromCache):this._boundingInfo=new h.BoundingInfo(this.absolutePosition,this.absolutePosition,e.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(e.worldMatrixFromCache),this},t.prototype._updateSubMeshesBoundingInfo=function(e){if(!this.subMeshes)return this;for(var t=this.subMeshes.length,r=0;r<t;r++){var n=this.subMeshes[r];(t>1||!n.IsGlobal)&&n.updateBoundingInfo(e)}return this},t.prototype._afterComputeWorldMatrix=function(){this.doNotSyncBoundingInfo||this._updateBoundingInfo()},Object.defineProperty(t.prototype,"_effectiveMesh",{get:function(){return this.skeleton&&this.skeleton.overrideMesh||this},enumerable:!1,configurable:!0}),t.prototype.isInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isInFrustum(e,this.cullingStrategy)},t.prototype.isCompletelyInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isCompletelyInFrustum(e)},t.prototype.intersectsMesh=function(e,t,r){if(void 0===t&&(t=!1),!this._boundingInfo||!e._boundingInfo)return!1;if(this._boundingInfo.intersects(e._boundingInfo,t))return!0;if(r)for(var n=0,i=this.getChildMeshes();n<i.length;n++)if(i[n].intersectsMesh(e,t,!0))return!0;return!1},t.prototype.intersectsPoint=function(e){return!!this._boundingInfo&&this._boundingInfo.intersectsPoint(e)},Object.defineProperty(t.prototype,"checkCollisions",{get:function(){return this._meshCollisionData._checkCollisions},set:function(e){this._meshCollisionData._checkCollisions=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collider",{get:function(){return this._meshCollisionData._collider},enumerable:!1,configurable:!0}),t.prototype.moveWithCollisions=function(e){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._meshCollisionData._oldPositionForCollisions);var t=this.getScene().collisionCoordinator;return this._meshCollisionData._collider||(this._meshCollisionData._collider=t.createCollider()),this._meshCollisionData._collider._radius=this.ellipsoid,t.getNewPosition(this._meshCollisionData._oldPositionForCollisions,e,this._meshCollisionData._collider,3,this,this._onCollisionPositionChange,this.uniqueId),this},t.prototype._collideForSubMesh=function(e,t,r){if(this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];for(var n=e.verticesStart,i=e.verticesStart+e.verticesCount,o=n;o<i;o++)e._lastColliderWorldVertices.push(s.Vector3.TransformCoordinates(this._positions[o],t))}return r._collide(e._trianglePlanes,e._lastColliderWorldVertices,this.getIndices(),e.indexStart,e.indexStart+e.indexCount,e.verticesStart,!!e.getMaterial(),this),this},t.prototype._processCollisionsForSubMeshes=function(e,t){for(var r=this._scene.getCollidingSubMeshCandidates(this,e),n=r.length,i=0;i<n;i++){var o=r.data[i];n>1&&!o._checkCollision(e)||this._collideForSubMesh(o,t,e)}return this},t.prototype._checkCollision=function(e){if(!this._boundingInfo||!this._boundingInfo._checkCollision(e))return this;var t=s.TmpVectors.Matrix[0],r=s.TmpVectors.Matrix[1];return s.Matrix.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,r),this._processCollisionsForSubMeshes(e,r),this},t.prototype._generatePointsArray=function(){return!1},t.prototype.intersects=function(e,t,r,n){void 0===n&&(n=!1);var i=new d.PickingInfo,o="InstancedLinesMesh"===this.getClassName()||"LinesMesh"===this.getClassName()?this.intersectionThreshold:0,a=this._boundingInfo;if(!(this.subMeshes&&a&&e.intersectsSphere(a.boundingSphere,o)&&e.intersectsBox(a.boundingBox,o)))return i;if(n)return i.hit=!0,i.pickedMesh=this,i.distance=s.Vector3.Distance(e.origin,a.boundingSphere.center),i.subMeshId=0,i;if(!this._generatePointsArray())return i;for(var l=null,c=this._scene.getIntersectingSubMeshCandidates(this,e),u=c.length,h=0;h<u;h++){var f=c.data[h];if(!(u>1)||f.canIntersects(e)){var p=f.intersects(e,this._positions,this.getIndices(),t,r);if(p&&(t||!l||p.distance<l.distance)&&((l=p).subMeshId=h,t))break}}if(l){var m=this.skeleton&&this.skeleton.overrideMesh?this.skeleton.overrideMesh.getWorldMatrix():this.getWorldMatrix(),g=s.TmpVectors.Vector3[0],_=s.TmpVectors.Vector3[1];s.Vector3.TransformCoordinatesToRef(e.origin,m,g),e.direction.scaleToRef(l.distance,_);var v=s.Vector3.TransformNormal(_,m).addInPlace(g);return i.hit=!0,i.distance=s.Vector3.Distance(g,v),i.pickedPoint=v,i.pickedMesh=this,i.bu=l.bu||0,i.bv=l.bv||0,i.subMeshFaceId=l.faceId,i.faceId=l.faceId+c.data[l.subMeshId].indexStart/(-1!==this.getClassName().indexOf("LinesMesh")?2:3),i.subMeshId=l.subMeshId,i}return i},t.prototype.clone=function(e,t,r){return null},t.prototype.releaseSubMeshes=function(){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose();else this.subMeshes=new Array;return this},t.prototype.dispose=function(t,r){var n,i=this;for(void 0===r&&(r=!1),this._scene.useMaterialMeshMap&&this._material&&this._material.meshMap&&(this._material.meshMap[this.uniqueId]=void 0),this.getScene().freeActiveMeshes(),this.getScene().freeRenderingGroups(),void 0!==this.actionManager&&null!==this.actionManager&&(this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),n=0;n<this._intersectionsInProgress.length;n++){var o=this._intersectionsInProgress[n],s=o._intersectionsInProgress.indexOf(this);o._intersectionsInProgress.splice(s,1)}this._intersectionsInProgress=[],this.getScene().lights.forEach((function(e){var t=e.includedOnlyMeshes.indexOf(i);-1!==t&&e.includedOnlyMeshes.splice(t,1),-1!==(t=e.excludedMeshes.indexOf(i))&&e.excludedMeshes.splice(t,1);var r=e.getShadowGenerator();if(r){var n=r.getShadowMap();n&&n.renderList&&-1!==(t=n.renderList.indexOf(i))&&n.renderList.splice(t,1)}})),"InstancedMesh"===this.getClassName()&&"InstancedLinesMesh"===this.getClassName()||this.releaseSubMeshes();var a=this.getScene().getEngine();if(this._occlusionQuery&&(this.isOcclusionQueryInProgress=!1,a.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),a.wipeCaches(),this.getScene().removeMesh(this),r&&this.material&&("MultiMaterial"===this.material.getClassName()?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!t)for(n=0;n<this.getScene().particleSystems.length;n++)this.getScene().particleSystems[n].emitter===this&&(this.getScene().particleSystems[n].dispose(),n--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),e.prototype.dispose.call(this,t,r)},t.prototype.addChild=function(e){return e.setParent(this),this},t.prototype.removeChild=function(e){return e.setParent(null),this},t.prototype._initFacetData=function(){var e=this._internalAbstractMeshDataInfo._facetData;e.facetNormals||(e.facetNormals=new Array),e.facetPositions||(e.facetPositions=new Array),e.facetPartitioning||(e.facetPartitioning=new Array),e.facetNb=this.getIndices().length/3|0,e.partitioningSubdivisions=e.partitioningSubdivisions?e.partitioningSubdivisions:10,e.partitioningBBoxRatio=e.partitioningBBoxRatio?e.partitioningBBoxRatio:1.01;for(var t=0;t<e.facetNb;t++)e.facetNormals[t]=s.Vector3.Zero(),e.facetPositions[t]=s.Vector3.Zero();return e.facetDataEnabled=!0,this},t.prototype.updateFacetData=function(){var e=this._internalAbstractMeshDataInfo._facetData;e.facetDataEnabled||this._initFacetData();var t=this.getVerticesData(l.VertexBuffer.PositionKind),r=this.getIndices(),n=this.getVerticesData(l.VertexBuffer.NormalKind),i=this.getBoundingInfo();if(e.facetDepthSort&&!e.facetDepthSortEnabled){if(e.facetDepthSortEnabled=!0,r instanceof Uint16Array)e.depthSortedIndices=new Uint16Array(r);else if(r instanceof Uint32Array)e.depthSortedIndices=new Uint32Array(r);else{for(var o=!1,a=0;a<r.length;a++)if(r[a]>65535){o=!0;break}e.depthSortedIndices=o?new Uint32Array(r):new Uint16Array(r)}if(e.facetDepthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){var u=this.getScene().activeCamera;e.facetDepthSortFrom=u?u.position:s.Vector3.Zero()}e.depthSortedFacets=[];for(var d=0;d<e.facetNb;d++){var h={ind:3*d,sqDistance:0};e.depthSortedFacets.push(h)}e.invertedMatrix=s.Matrix.Identity(),e.facetDepthSortOrigin=s.Vector3.Zero()}e.bbSize.x=i.maximum.x-i.minimum.x>v.Epsilon?i.maximum.x-i.minimum.x:v.Epsilon,e.bbSize.y=i.maximum.y-i.minimum.y>v.Epsilon?i.maximum.y-i.minimum.y:v.Epsilon,e.bbSize.z=i.maximum.z-i.minimum.z>v.Epsilon?i.maximum.z-i.minimum.z:v.Epsilon;var f=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(f=f>e.bbSize.z?f:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/f),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/f),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/f),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=i,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),s.Vector3.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,c.VertexData.ComputeNormals(t,r,n,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);var p=e.depthSortedIndices.length/3|0;for(d=0;d<p;d++){var m=e.depthSortedFacets[d].ind;e.depthSortedIndices[3*d]=r[m],e.depthSortedIndices[3*d+1]=r[m+1],e.depthSortedIndices[3*d+2]=r[m+2]}this.updateIndices(e.depthSortedIndices,void 0,!0)}return this},t.prototype.getFacetLocalNormals=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetNormals||this.updateFacetData(),e.facetNormals},t.prototype.getFacetLocalPositions=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetPositions||this.updateFacetData(),e.facetPositions},t.prototype.getFacetLocalPartitioning=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetPartitioning||this.updateFacetData(),e.facetPartitioning},t.prototype.getFacetPosition=function(e){var t=s.Vector3.Zero();return this.getFacetPositionToRef(e,t),t},t.prototype.getFacetPositionToRef=function(e,t){var r=this.getFacetLocalPositions()[e],n=this.getWorldMatrix();return s.Vector3.TransformCoordinatesToRef(r,n,t),this},t.prototype.getFacetNormal=function(e){var t=s.Vector3.Zero();return this.getFacetNormalToRef(e,t),t},t.prototype.getFacetNormalToRef=function(e,t){var r=this.getFacetLocalNormals()[e];return s.Vector3.TransformNormalToRef(r,this.getWorldMatrix(),t),this},t.prototype.getFacetsAtLocalCoordinates=function(e,t,r){var n=this.getBoundingInfo(),i=this._internalAbstractMeshDataInfo._facetData,o=Math.floor((e-n.minimum.x*i.partitioningBBoxRatio)*i.subDiv.X*i.partitioningBBoxRatio/i.bbSize.x),s=Math.floor((t-n.minimum.y*i.partitioningBBoxRatio)*i.subDiv.Y*i.partitioningBBoxRatio/i.bbSize.y),a=Math.floor((r-n.minimum.z*i.partitioningBBoxRatio)*i.subDiv.Z*i.partitioningBBoxRatio/i.bbSize.z);return o<0||o>i.subDiv.max||s<0||s>i.subDiv.max||a<0||a>i.subDiv.max?null:i.facetPartitioning[o+i.subDiv.max*s+i.subDiv.max*i.subDiv.max*a]},t.prototype.getClosestFacetAtCoordinates=function(e,t,r,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=!0);var a=this.getWorldMatrix(),l=s.TmpVectors.Matrix[5];a.invertToRef(l);var c=s.TmpVectors.Vector3[8];s.Vector3.TransformCoordinatesFromFloatsToRef(e,t,r,l,c);var u=this.getClosestFacetAtLocalCoordinates(c.x,c.y,c.z,n,i,o);return n&&s.Vector3.TransformCoordinatesFromFloatsToRef(n.x,n.y,n.z,a,n),u},t.prototype.getClosestFacetAtLocalCoordinates=function(e,t,r,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=!0);var s=null,a=0,l=0,c=0,u=0,d=0,h=0,f=0,p=0,m=this.getFacetLocalPositions(),g=this.getFacetLocalNormals(),_=this.getFacetsAtLocalCoordinates(e,t,r);if(!_)return null;for(var v,y,b,A=Number.MAX_VALUE,T=A,M=0;M<_.length;M++)y=g[v=_[M]],u=(e-(b=m[v]).x)*y.x+(t-b.y)*y.y+(r-b.z)*y.z,(!i||i&&o&&u>=0||i&&!o&&u<=0)&&(u=y.x*b.x+y.y*b.y+y.z*b.z,d=-(y.x*e+y.y*t+y.z*r-u)/(y.x*y.x+y.y*y.y+y.z*y.z),(T=(a=(h=e+y.x*d)-e)*a+(l=(f=t+y.y*d)-t)*l+(c=(p=r+y.z*d)-r)*c)<A&&(A=T,s=v,n&&(n.x=h,n.y=f,n.z=p)));return s},t.prototype.getFacetDataParameters=function(){return this._internalAbstractMeshDataInfo._facetData.facetParameters},t.prototype.disableFacetData=function(){var e=this._internalAbstractMeshDataInfo._facetData;return e.facetDataEnabled&&(e.facetDataEnabled=!1,e.facetPositions=new Array,e.facetNormals=new Array,e.facetPartitioning=new Array,e.facetParameters=null,e.depthSortedIndices=new Uint32Array(0)),this},t.prototype.updateIndices=function(e,t,r){return void 0===r&&(r=!1),this},t.prototype.createNormals=function(e){var t,r=this.getVerticesData(l.VertexBuffer.PositionKind),n=this.getIndices();return t=this.isVerticesDataPresent(l.VertexBuffer.NormalKind)?this.getVerticesData(l.VertexBuffer.NormalKind):[],c.VertexData.ComputeNormals(r,n,t,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(l.VertexBuffer.NormalKind,t,e),this},t.prototype.alignWithNormal=function(e,t){t||(t=y.Axis.Y);var r=s.TmpVectors.Vector3[0],n=s.TmpVectors.Vector3[1];return s.Vector3.CrossToRef(t,e,n),s.Vector3.CrossToRef(e,n,r),this.rotationQuaternion?s.Quaternion.RotationQuaternionFromAxisToRef(r,e,n,this.rotationQuaternion):s.Vector3.RotationFromAxisToRef(r,e,n,this.rotation),this},t.prototype._checkOcclusionQuery=function(){return!1},t.prototype.disableEdgesRendering=function(){throw m._DevTools.WarnImport("EdgesRenderer")},t.prototype.enableEdgesRendering=function(e,t){throw m._DevTools.WarnImport("EdgesRenderer")},t.prototype.getConnectedParticleSystems=function(){var e=this;return this._scene.particleSystems.filter((function(t){return t.emitter===e}))},t.OCCLUSION_TYPE_NONE=0,t.OCCLUSION_TYPE_OPTIMISTIC=1,t.OCCLUSION_TYPE_STRICT=2,t.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,t.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,t.CULLINGSTRATEGY_STANDARD=f.Constants.MESHES_CULLINGSTRATEGY_STANDARD,t.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=f.Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,t.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=f.Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION,t.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=f.Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY,t}(u.TransformNode)},"./Meshes/buffer.ts":
- /*!**************************!*\
- !*** ./Meshes/buffer.ts ***!
- \**************************/
- /*! exports provided: Buffer, VertexBuffer */function(e,t,r){"use strict";r.r(t),r.d(t,"Buffer",(function(){return n})),r.d(t,"VertexBuffer",(function(){return i}));var n=function(){function e(e,t,r,n,i,o,s,a){void 0===n&&(n=0),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===s&&(s=!1),e.getScene?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=r,this._instanced=o,this._divisor=a||1,this._data=t,this.byteStride=s?n:n*Float32Array.BYTES_PER_ELEMENT,i||this.create()}return e.prototype.createVertexBuffer=function(e,t,r,n,o,s,a){void 0===s&&(s=!1);var l=s?t:t*Float32Array.BYTES_PER_ELEMENT,c=n?s?n:n*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new i(this._engine,this,e,this._updatable,!0,c,void 0===o?this._instanced:o,l,r,void 0,void 0,!0,this._divisor||a)},e.prototype.isUpdatable=function(){return this._updatable},e.prototype.getData=function(){return this._data},e.prototype.getBuffer=function(){return this._buffer},e.prototype.getStrideSize=function(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT},e.prototype.create=function(e){void 0===e&&(e=null),!e&&this._buffer||(e=e||this._data)&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e),this._data=e):this._buffer=this._engine.createVertexBuffer(e))},e.prototype._rebuild=function(){this._buffer=null,this.create(this._data)},e.prototype.update=function(e){this.create(e)},e.prototype.updateDirectly=function(e,t,r,n){void 0===n&&(n=!1),this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,n?t:t*Float32Array.BYTES_PER_ELEMENT,r?r*this.byteStride:void 0),this._data=null)},e.prototype.dispose=function(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)},e}(),i=function(){function e(t,r,i,o,s,a,l,c,u,d,h,f,p){if(void 0===h&&(h=!1),void 0===f&&(f=!1),void 0===p&&(p=1),r instanceof n?(this._buffer=r,this._ownsBuffer=!1):(this._buffer=new n(t,r,o,a,s,l,f),this._ownsBuffer=!0),this._kind=i,null==d){var m=this.getData();this.type=e.FLOAT,m instanceof Int8Array?this.type=e.BYTE:m instanceof Uint8Array?this.type=e.UNSIGNED_BYTE:m instanceof Int16Array?this.type=e.SHORT:m instanceof Uint16Array?this.type=e.UNSIGNED_SHORT:m instanceof Int32Array?this.type=e.INT:m instanceof Uint32Array&&(this.type=e.UNSIGNED_INT)}else this.type=d;var g=e.GetTypeByteLength(this.type);f?(this._size=u||(a?a/g:e.DeduceStride(i)),this.byteStride=a||this._buffer.byteStride||this._size*g,this.byteOffset=c||0):(this._size=u||a||e.DeduceStride(i),this.byteStride=a?a*g:this._buffer.byteStride||this._size*g,this.byteOffset=(c||0)*g),this.normalized=h,this._instanced=void 0!==l&&l,this._instanceDivisor=l?p:0}return Object.defineProperty(e.prototype,"instanceDivisor",{get:function(){return this._instanceDivisor},set:function(e){this._instanceDivisor=e,this._instanced=0!=e},enumerable:!1,configurable:!0}),e.prototype._rebuild=function(){this._buffer&&this._buffer._rebuild()},e.prototype.getKind=function(){return this._kind},e.prototype.isUpdatable=function(){return this._buffer.isUpdatable()},e.prototype.getData=function(){return this._buffer.getData()},e.prototype.getBuffer=function(){return this._buffer.getBuffer()},e.prototype.getStrideSize=function(){return this.byteStride/e.GetTypeByteLength(this.type)},e.prototype.getOffset=function(){return this.byteOffset/e.GetTypeByteLength(this.type)},e.prototype.getSize=function(){return this._size},e.prototype.getIsInstanced=function(){return this._instanced},e.prototype.getInstanceDivisor=function(){return this._instanceDivisor},e.prototype.create=function(e){this._buffer.create(e)},e.prototype.update=function(e){this._buffer.update(e)},e.prototype.updateDirectly=function(e,t,r){void 0===r&&(r=!1),this._buffer.updateDirectly(e,t,void 0,r)},e.prototype.dispose=function(){this._ownsBuffer&&this._buffer.dispose()},e.prototype.forEach=function(t,r){e.ForEach(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,t,this.normalized,r)},e.DeduceStride=function(t){switch(t){case e.UVKind:case e.UV2Kind:case e.UV3Kind:case e.UV4Kind:case e.UV5Kind:case e.UV6Kind:return 2;case e.NormalKind:case e.PositionKind:return 3;case e.ColorKind:case e.MatricesIndicesKind:case e.MatricesIndicesExtraKind:case e.MatricesWeightsKind:case e.MatricesWeightsExtraKind:case e.TangentKind:return 4;default:throw new Error("Invalid kind '"+t+"'")}},e.GetTypeByteLength=function(t){switch(t){case e.BYTE:case e.UNSIGNED_BYTE:return 1;case e.SHORT:case e.UNSIGNED_SHORT:return 2;case e.INT:case e.UNSIGNED_INT:case e.FLOAT:return 4;default:throw new Error("Invalid type '"+t+"'")}},e.ForEach=function(t,r,n,i,o,s,a,l){if(t instanceof Array)for(var c=r/4,u=n/4,d=0;d<s;d+=i){for(var h=0;h<i;h++)l(t[c+h],d+h);c+=u}else{var f=t instanceof ArrayBuffer?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),p=e.GetTypeByteLength(o);for(d=0;d<s;d+=i){var m=r;for(h=0;h<i;h++)l(e._GetFloatValue(f,o,m,a),d+h),m+=p;r+=n}}},e._GetFloatValue=function(t,r,n,i){switch(r){case e.BYTE:var o=t.getInt8(n);return i&&(o=Math.max(o/127,-1)),o;case e.UNSIGNED_BYTE:return o=t.getUint8(n),i&&(o/=255),o;case e.SHORT:return o=t.getInt16(n,!0),i&&(o=Math.max(o/32767,-1)),o;case e.UNSIGNED_SHORT:return o=t.getUint16(n,!0),i&&(o/=65535),o;case e.INT:return t.getInt32(n,!0);case e.UNSIGNED_INT:return t.getUint32(n,!0);case e.FLOAT:return t.getFloat32(n,!0);default:throw new Error("Invalid component type "+r)}},e.BYTE=5120,e.UNSIGNED_BYTE=5121,e.SHORT=5122,e.UNSIGNED_SHORT=5123,e.INT=5124,e.UNSIGNED_INT=5125,e.FLOAT=5126,e.PositionKind="position",e.NormalKind="normal",e.TangentKind="tangent",e.UVKind="uv",e.UV2Kind="uv2",e.UV3Kind="uv3",e.UV4Kind="uv4",e.UV5Kind="uv5",e.UV6Kind="uv6",e.ColorKind="color",e.MatricesIndicesKind="matricesIndices",e.MatricesWeightsKind="matricesWeights",e.MatricesIndicesExtraKind="matricesIndicesExtra",e.MatricesWeightsExtraKind="matricesWeightsExtra",e}()},"./Meshes/csg.ts":
- /*!***********************!*\
- !*** ./Meshes/csg.ts ***!
- \***********************/
- /*! exports provided: CSG */function(e,t,r){"use strict";r.r(t),r.d(t,"CSG",(function(){return f}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=0,c=function(){function e(e,t,r,n){this.pos=e,this.normal=t,this.uv=r,this.vertColor=n}return e.prototype.clone=function(){var t,r;return new e(this.pos.clone(),this.normal.clone(),null===(t=this.uv)||void 0===t?void 0:t.clone(),null===(r=this.vertColor)||void 0===r?void 0:r.clone())},e.prototype.flip=function(){this.normal=this.normal.scale(-1)},e.prototype.interpolate=function(t,r){return new e(n.Vector3.Lerp(this.pos,t.pos,r),n.Vector3.Lerp(this.normal,t.normal,r),this.uv&&t.uv?n.Vector2.Lerp(this.uv,t.uv,r):void 0,this.vertColor&&t.vertColor?a.Color4.Lerp(this.vertColor,t.vertColor,r):void 0)},e}(),u=function(){function e(e,t){this.normal=e,this.w=t}return e.FromPoints=function(t,r,i){var o=i.subtract(t),s=r.subtract(t);if(0===o.lengthSquared()||0===s.lengthSquared())return null;var a=n.Vector3.Normalize(n.Vector3.Cross(o,s));return new e(a,n.Vector3.Dot(a,t))},e.prototype.clone=function(){return new e(this.normal.clone(),this.w)},e.prototype.flip=function(){this.normal.scaleInPlace(-1),this.w=-this.w},e.prototype.splitPolygon=function(t,r,i,o,s){var a,l,c=0,u=[];for(a=0;a<t.vertices.length;a++){var h=(l=n.Vector3.Dot(this.normal,t.vertices[a].pos)-this.w)<-e.EPSILON?2:l>e.EPSILON?1:0;c|=h,u.push(h)}switch(c){case 0:(n.Vector3.Dot(this.normal,t.plane.normal)>0?r:i).push(t);break;case 1:o.push(t);break;case 2:s.push(t);break;case 3:var f,p=[],m=[];for(a=0;a<t.vertices.length;a++){var g=(a+1)%t.vertices.length,_=u[a],v=u[g],y=t.vertices[a],b=t.vertices[g];if(2!==_&&p.push(y),1!==_&&m.push(2!==_?y.clone():y),3==(_|v)){l=(this.w-n.Vector3.Dot(this.normal,y.pos))/n.Vector3.Dot(this.normal,b.pos.subtract(y.pos));var A=y.interpolate(b,l);p.push(A),m.push(A.clone())}}p.length>=3&&(f=new d(p,t.shared)).plane&&o.push(f),m.length>=3&&(f=new d(m,t.shared)).plane&&s.push(f)}},e.EPSILON=1e-5,e}(),d=function(){function e(e,t){this.vertices=e,this.shared=t,this.plane=u.FromPoints(e[0].pos,e[1].pos,e[2].pos)}return e.prototype.clone=function(){return new e(this.vertices.map((function(e){return e.clone()})),this.shared)},e.prototype.flip=function(){this.vertices.reverse().map((function(e){e.flip()})),this.plane.flip()},e}(),h=function(){function e(e){this.plane=null,this.front=null,this.back=null,this.polygons=new Array,e&&this.build(e)}return e.prototype.clone=function(){var t=new e;return t.plane=this.plane&&this.plane.clone(),t.front=this.front&&this.front.clone(),t.back=this.back&&this.back.clone(),t.polygons=this.polygons.map((function(e){return e.clone()})),t},e.prototype.invert=function(){for(var e=0;e<this.polygons.length;e++)this.polygons[e].flip();this.plane&&this.plane.flip(),this.front&&this.front.invert(),this.back&&this.back.invert();var t=this.front;this.front=this.back,this.back=t},e.prototype.clipPolygons=function(e){if(!this.plane)return e.slice();for(var t=new Array,r=new Array,n=0;n<e.length;n++)this.plane.splitPolygon(e[n],t,r,t,r);return this.front&&(t=this.front.clipPolygons(t)),r=this.back?this.back.clipPolygons(r):[],t.concat(r)},e.prototype.clipTo=function(e){this.polygons=e.clipPolygons(this.polygons),this.front&&this.front.clipTo(e),this.back&&this.back.clipTo(e)},e.prototype.allPolygons=function(){var e=this.polygons.slice();return this.front&&(e=e.concat(this.front.allPolygons())),this.back&&(e=e.concat(this.back.allPolygons())),e},e.prototype.build=function(t){if(t.length){this.plane||(this.plane=t[0].plane.clone());for(var r=new Array,n=new Array,i=0;i<t.length;i++)this.plane.splitPolygon(t[i],this.polygons,this.polygons,r,n);r.length&&(this.front||(this.front=new e),this.front.build(r)),n.length&&(this.back||(this.back=new e),this.back.build(n))}},e}(),f=function(){function e(){this.polygons=new Array}return e.FromMesh=function(t){var r,o,u,h,f,p,m,g,_,v=void 0,y=void 0,b=new Array,A=null;if(!(t instanceof s.Mesh))throw"BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";t.computeWorldMatrix(!0),p=t.getWorldMatrix(),m=t.position.clone(),g=t.rotation.clone(),t.rotationQuaternion&&(A=t.rotationQuaternion.clone()),_=t.scaling.clone();for(var T=t.getIndices(),M=t.getVerticesData(i.VertexBuffer.PositionKind),P=t.getVerticesData(i.VertexBuffer.NormalKind),S=t.getVerticesData(i.VertexBuffer.UVKind),E=t.getVerticesData(i.VertexBuffer.ColorKind),C=t.subMeshes,x=0,R=C.length;x<R;x++)for(var O=C[x].indexStart,I=C[x].indexCount+C[x].indexStart;O<I;O+=3){f=[];for(var D=0;D<3;D++){var B=new n.Vector3(P[3*T[O+D]],P[3*T[O+D]+1],P[3*T[O+D]+2]);S&&(v=new n.Vector2(S[2*T[O+D]],S[2*T[O+D]+1])),E&&(y=new a.Color4(E[4*T[O+D]],E[4*T[O+D]+1],E[4*T[O+D]+2],E[4*T[O+D]+3]));var N=new n.Vector3(M[3*T[O+D]],M[3*T[O+D]+1],M[3*T[O+D]+2]);u=n.Vector3.TransformCoordinates(N,p),o=n.Vector3.TransformNormal(B,p),r=new c(u,o,v,y),f.push(r)}(h=new d(f,{subMeshId:x,meshId:l,materialIndex:C[x].materialIndex})).plane&&b.push(h)}var L=e.FromPolygons(b);return L.matrix=p,L.position=m,L.rotation=g,L.scaling=_,L.rotationQuaternion=A,l++,L},e.FromPolygons=function(t){var r=new e;return r.polygons=t,r},e.prototype.clone=function(){var t=new e;return t.polygons=this.polygons.map((function(e){return e.clone()})),t.copyTransformAttributes(this),t},e.prototype.union=function(t){var r=new h(this.clone().polygons),n=new h(t.clone().polygons);return r.clipTo(n),n.clipTo(r),n.invert(),n.clipTo(r),n.invert(),r.build(n.allPolygons()),e.FromPolygons(r.allPolygons()).copyTransformAttributes(this)},e.prototype.unionInPlace=function(e){var t=new h(this.polygons),r=new h(e.polygons);t.clipTo(r),r.clipTo(t),r.invert(),r.clipTo(t),r.invert(),t.build(r.allPolygons()),this.polygons=t.allPolygons()},e.prototype.subtract=function(t){var r=new h(this.clone().polygons),n=new h(t.clone().polygons);return r.invert(),r.clipTo(n),n.clipTo(r),n.invert(),n.clipTo(r),n.invert(),r.build(n.allPolygons()),r.invert(),e.FromPolygons(r.allPolygons()).copyTransformAttributes(this)},e.prototype.subtractInPlace=function(e){var t=new h(this.polygons),r=new h(e.polygons);t.invert(),t.clipTo(r),r.clipTo(t),r.invert(),r.clipTo(t),r.invert(),t.build(r.allPolygons()),t.invert(),this.polygons=t.allPolygons()},e.prototype.intersect=function(t){var r=new h(this.clone().polygons),n=new h(t.clone().polygons);return r.invert(),n.clipTo(r),n.invert(),r.clipTo(n),n.clipTo(r),r.build(n.allPolygons()),r.invert(),e.FromPolygons(r.allPolygons()).copyTransformAttributes(this)},e.prototype.intersectInPlace=function(e){var t=new h(this.polygons),r=new h(e.polygons);t.invert(),r.clipTo(t),r.invert(),t.clipTo(r),r.clipTo(t),t.build(r.allPolygons()),t.invert(),this.polygons=t.allPolygons()},e.prototype.inverse=function(){var e=this.clone();return e.inverseInPlace(),e},e.prototype.inverseInPlace=function(){this.polygons.map((function(e){e.flip()}))},e.prototype.copyTransformAttributes=function(e){return this.matrix=e.matrix,this.position=e.position,this.rotation=e.rotation,this.scaling=e.scaling,this.rotationQuaternion=e.rotationQuaternion,this},e.prototype.buildMeshGeometry=function(e,t,r){var l=this.matrix.clone();l.invert();var c,u,d,h=new s.Mesh(e,t),f=[],p=[],m=[],g=null,_=null,v=n.Vector3.Zero(),y=n.Vector3.Zero(),b=n.Vector2.Zero(),A=new a.Color4(0,0,0,0),T=this.polygons,M=[0,0,0],P={},S=0,E={};r&&T.sort((function(e,t){return e.shared.meshId===t.shared.meshId?e.shared.subMeshId-t.shared.subMeshId:e.shared.meshId-t.shared.meshId}));for(var C=0,x=T.length;C<x;C++){E[(c=T[C]).shared.meshId]||(E[c.shared.meshId]={}),E[c.shared.meshId][c.shared.subMeshId]||(E[c.shared.meshId][c.shared.subMeshId]={indexStart:1/0,indexEnd:-1/0,materialIndex:c.shared.materialIndex}),d=E[c.shared.meshId][c.shared.subMeshId];for(var R=2,O=c.vertices.length;R<O;R++){M[0]=0,M[1]=R-1,M[2]=R;for(var I=0;I<3;I++){v.copyFrom(c.vertices[M[I]].pos),y.copyFrom(c.vertices[M[I]].normal),c.vertices[M[I]].uv&&(g||(g=[]),b.copyFrom(c.vertices[M[I]].uv)),c.vertices[M[I]].vertColor&&(_||(_=[]),A.copyFrom(c.vertices[M[I]].vertColor));var D=n.Vector3.TransformCoordinates(v,l),B=n.Vector3.TransformNormal(y,l);u=P[D.x+","+D.y+","+D.z];var N=!1;g&&g[2*u]!==b.x&&g[2*u+1]!==b.y&&(N=!0);var L=!1;_&&_[4*u]!==A.r&&_[4*u+1]!==A.g&&_[4*u+2]!==A.b&&_[4*u+3]!==A.a&&(L=!0),(void 0===u||m[3*u]!==B.x||m[3*u+1]!==B.y||m[3*u+2]!==B.z||N||L)&&(f.push(D.x,D.y,D.z),g&&g.push(b.x,b.y),m.push(y.x,y.y,y.z),_&&_.push(A.r,A.g,A.b,A.a),u=P[D.x+","+D.y+","+D.z]=f.length/3-1),p.push(u),d.indexStart=Math.min(S,d.indexStart),d.indexEnd=Math.max(S,d.indexEnd),S++}}}if(h.setVerticesData(i.VertexBuffer.PositionKind,f),h.setVerticesData(i.VertexBuffer.NormalKind,m),g&&h.setVerticesData(i.VertexBuffer.UVKind,g),_&&h.setVerticesData(i.VertexBuffer.ColorKind,_),h.setIndices(p,null),r){var w,F=0;for(var V in h.subMeshes=new Array,E){for(var k in w=-1,E[V])d=E[V][k],o.SubMesh.CreateFromIndices(d.materialIndex+F,d.indexStart,d.indexEnd-d.indexStart+1,h),w=Math.max(d.materialIndex,w);F+=++w}}return h},e.prototype.toMesh=function(e,t,r,n){void 0===t&&(t=null);var i=this.buildMeshGeometry(e,r,n);return i.material=t,i.position.copyFrom(this.position),i.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(i.rotationQuaternion=this.rotationQuaternion.clone()),i.scaling.copyFrom(this.scaling),i.computeWorldMatrix(!0),i},e}()},"./Meshes/dataBuffer.ts":
- /*!******************************!*\
- !*** ./Meshes/dataBuffer.ts ***!
- \******************************/
- /*! exports provided: DataBuffer */function(e,t,r){"use strict";r.r(t),r.d(t,"DataBuffer",(function(){return n}));var n=function(){function e(){this.references=0,this.capacity=0,this.is32Bits=!1}return Object.defineProperty(e.prototype,"underlyingResource",{get:function(){return null},enumerable:!1,configurable:!0}),e}()},"./Meshes/geometry.ts":
- /*!****************************!*\
- !*** ./Meshes/geometry.ts ***!
- \****************************/
- /*! exports provided: Geometry */function(e,t,r){"use strict";r.r(t),r.d(t,"Geometry",(function(){return p}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),l=r(/*! ../Loading/sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts"),c=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),d=r(/*! ../Misc/tools */"./Misc/tools.ts"),h=r(/*! ../Misc/tags */"./Misc/tags.ts"),f=r(/*! ../Maths/math.functions */"./Maths/math.functions.ts"),p=function(){function e(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i=null),this.delayLoadState=u.Constants.DELAYLOADSTATE_NONE,this._totalVertices=0,this._isDisposed=!1,this._indexBufferIsUpdatable=!1,this.useBoundingInfoFromGeometry=!1,this.id=e,this.uniqueId=t.getUniqueId(),this._engine=t.getEngine(),this._meshes=[],this._scene=t,this._vertexBuffers={},this._indices=[],this._updatable=n,r?this.setAllVerticesData(r,n):(this._totalVertices=0,this._indices=[]),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),i&&(this.applyToMesh(i),i.computeWorldMatrix(!0))}return Object.defineProperty(e.prototype,"boundingBias",{get:function(){return this._boundingBias},set:function(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)},enumerable:!1,configurable:!0}),e.CreateGeometryForMesh=function(t){var r=new e(e.RandomId(),t.getScene());return r.applyToMesh(t),r},Object.defineProperty(e.prototype,"meshes",{get:function(){return this._meshes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extend",{get:function(){return this._extend},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEngine=function(){return this._engine},e.prototype.isReady=function(){return this.delayLoadState===u.Constants.DELAYLOADSTATE_LOADED||this.delayLoadState===u.Constants.DELAYLOADSTATE_NONE},Object.defineProperty(e.prototype,"doNotSerialize",{get:function(){for(var e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0},enumerable:!1,configurable:!0}),e.prototype._rebuild=function(){for(var e in this._vertexArrayObjects&&(this._vertexArrayObjects={}),0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices)),this._vertexBuffers)this._vertexBuffers[e]._rebuild()},e.prototype.setAllVerticesData=function(e,t){e.applyToGeometry(this,t),this.notifyUpdate()},e.prototype.setVerticesData=function(e,t,r,n){void 0===r&&(r=!1);var i=new s.VertexBuffer(this._engine,t,e,r,0===this._meshes.length,n);this.setVerticesBuffer(i)},e.prototype.removeVerticesData=function(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e])},e.prototype.setVerticesBuffer=function(e,t){void 0===t&&(t=null);var r=e.getKind();if(this._vertexBuffers[r]&&this._vertexBuffers[r].dispose(),this._vertexBuffers[r]=e,r===s.VertexBuffer.PositionKind){var n=e.getData();null!=t?this._totalVertices=t:null!=n&&(this._totalVertices=n.length/(e.byteStride/4)),this._updateExtend(n),this._resetPointsArrayCache();for(var i=this._meshes,o=i.length,a=0;a<o;a++){var l=i[a];l._boundingInfo=new c.BoundingInfo(this._extend.minimum,this._extend.maximum),l._createGlobalSubMesh(!1),l.computeWorldMatrix(!0)}}this.notifyUpdate(r),this._vertexArrayObjects&&(this._disposeVertexArrayObjects(),this._vertexArrayObjects={})},e.prototype.updateVerticesDataDirectly=function(e,t,r,n){void 0===n&&(n=!1);var i=this.getVertexBuffer(e);i&&(i.updateDirectly(t,r,n),this.notifyUpdate(e))},e.prototype.updateVerticesData=function(e,t,r){void 0===r&&(r=!1);var n=this.getVertexBuffer(e);n&&(n.update(t),e===s.VertexBuffer.PositionKind&&this._updateBoundingInfo(r,t),this.notifyUpdate(e))},e.prototype._updateBoundingInfo=function(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e)for(var r=0,n=this._meshes;r<n.length;r++){var i=n[r];i._boundingInfo?i._boundingInfo.reConstruct(this._extend.minimum,this._extend.maximum):i._boundingInfo=new c.BoundingInfo(this._extend.minimum,this._extend.maximum);for(var o=0,s=i.subMeshes;o<s.length;o++)s[o].refreshBoundingInfo()}},e.prototype._bind=function(e,t){if(e){void 0===t&&(t=this._indexBuffer);var r=this.getVertexBuffers();r&&(t==this._indexBuffer&&this._vertexArrayObjects?(this._vertexArrayObjects[e.key]||(this._vertexArrayObjects[e.key]=this._engine.recordVertexArrayObject(r,t,e)),this._engine.bindVertexArrayObject(this._vertexArrayObjects[e.key],t)):this._engine.bindBuffers(r,t,e))}},e.prototype.getTotalVertices=function(){return this.isReady()?this._totalVertices:0},e.prototype.getVerticesData=function(e,t,r){var n=this.getVertexBuffer(e);if(!n)return null;var i=n.getData();if(!i)return null;var o=n.getSize()*s.VertexBuffer.GetTypeByteLength(n.type),a=this._totalVertices*n.getSize();if(n.type!==s.VertexBuffer.FLOAT||n.byteStride!==o){var l=[];return n.forEach(a,(function(e){return l.push(e)})),l}if(!(i instanceof Array||i instanceof Float32Array)||0!==n.byteOffset||i.length!==a){if(i instanceof Array){var c=n.byteOffset/4;return d.Tools.Slice(i,c,c+a)}if(i instanceof ArrayBuffer)return new Float32Array(i,n.byteOffset,a);if(c=i.byteOffset+n.byteOffset,r||t&&1!==this._meshes.length){var u=new Float32Array(a),h=new Float32Array(i.buffer,c,a);return u.set(h),u}return new Float32Array(i.buffer,c,a)}return r||t&&1!==this._meshes.length?d.Tools.Slice(i):i},e.prototype.isVertexBufferUpdatable=function(e){var t=this._vertexBuffers[e];return!!t&&t.isUpdatable()},e.prototype.getVertexBuffer=function(e){return this.isReady()?this._vertexBuffers[e]:null},e.prototype.getVertexBuffers=function(){return this.isReady()?this._vertexBuffers:null},e.prototype.isVerticesDataPresent=function(e){return this._vertexBuffers?void 0!==this._vertexBuffers[e]:!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)},e.prototype.getVerticesDataKinds=function(){var e,t=[];if(!this._vertexBuffers&&this._delayInfo)for(e in this._delayInfo)t.push(e);else for(e in this._vertexBuffers)t.push(e);return t},e.prototype.updateIndices=function(e,t,r){if(void 0===r&&(r=!1),this._indexBuffer)if(this._indexBufferIsUpdatable){var n=e.length!==this._indices.length;if(r||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),n)for(var i=0,o=this._meshes;i<o.length;i++)o[i]._createGlobalSubMesh(!0)}else this.setIndices(e,null,!0)},e.prototype.setIndices=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=!1),this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._disposeVertexArrayObjects(),this._indices=e,this._indexBufferIsUpdatable=r,0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,r)),null!=t&&(this._totalVertices=t);for(var n=0,i=this._meshes;n<i.length;n++)i[n]._createGlobalSubMesh(!0);this.notifyUpdate()},e.prototype.getTotalIndices=function(){return this.isReady()?this._indices.length:0},e.prototype.getIndices=function(e,t){if(!this.isReady())return null;var r=this._indices;if(t||e&&1!==this._meshes.length){for(var n=r.length,i=[],o=0;o<n;o++)i.push(r[o]);return i}return r},e.prototype.getIndexBuffer=function(){return this.isReady()?this._indexBuffer:null},e.prototype._releaseVertexArrayObject=function(e){void 0===e&&(e=null),e&&this._vertexArrayObjects&&this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])},e.prototype.releaseForMesh=function(e,t){var r=this._meshes,n=r.indexOf(e);-1!==n&&(r.splice(n,1),e._geometry=null,0===r.length&&t&&this.dispose())},e.prototype.applyToMesh=function(e){if(e._geometry!==this){var t=e._geometry;t&&t.releaseForMesh(e);var r=this._meshes;e._geometry=this,this._scene.pushGeometry(this),r.push(e),this.isReady()?this._applyToMesh(e):e._boundingInfo=this._boundingInfo}},e.prototype._updateExtend=function(e){void 0===e&&(e=null),this.useBoundingInfoFromGeometry&&this._boundingInfo?this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()}:(e||(e=this.getVerticesData(s.VertexBuffer.PositionKind)),this._extend=Object(f.extractMinAndMax)(e,0,this._totalVertices,this.boundingBias,3))},e.prototype._applyToMesh=function(e){var t=this._meshes.length;for(var r in this._vertexBuffers){1===t&&this._vertexBuffers[r].create();var n=this._vertexBuffers[r].getBuffer();n&&(n.references=t),r===s.VertexBuffer.PositionKind&&(this._extend||this._updateExtend(),e._boundingInfo=new c.BoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(!1),e._updateBoundingInfo())}1===t&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices)),this._indexBuffer&&(this._indexBuffer.references=t),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()},e.prototype.notifyUpdate=function(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e);for(var t=0,r=this._meshes;t<r.length;t++)r[t]._markSubMeshesAsAttributesDirty()},e.prototype.load=function(e,t){this.delayLoadState!==u.Constants.DELAYLOADSTATE_LOADING&&(this.isReady()?t&&t():(this.delayLoadState=u.Constants.DELAYLOADSTATE_LOADING,this._queueLoad(e,t)))},e.prototype._queueLoad=function(e,t){var r=this;this.delayLoadingFile&&(e._addPendingData(this),e._loadFile(this.delayLoadingFile,(function(n){if(r._delayLoadingFunction){r._delayLoadingFunction(JSON.parse(n),r),r.delayLoadState=u.Constants.DELAYLOADSTATE_LOADED,r._delayInfo=[],e._removePendingData(r);for(var i=r._meshes,o=i.length,s=0;s<o;s++)r._applyToMesh(i[s]);t&&t()}}),void 0,!0))},e.prototype.toLeftHanded=function(){var e=this.getIndices(!1);if(null!=e&&e.length>0){for(var t=0;t<e.length;t+=3){var r=e[t+0];e[t+0]=e[t+2],e[t+2]=r}this.setIndices(e)}var n=this.getVerticesData(s.VertexBuffer.PositionKind,!1);if(null!=n&&n.length>0){for(t=0;t<n.length;t+=3)n[t+2]=-n[t+2];this.setVerticesData(s.VertexBuffer.PositionKind,n,!1)}var i=this.getVerticesData(s.VertexBuffer.NormalKind,!1);if(null!=i&&i.length>0){for(t=0;t<i.length;t+=3)i[t+2]=-i[t+2];this.setVerticesData(s.VertexBuffer.NormalKind,i,!1)}},e.prototype._resetPointsArrayCache=function(){this._positions=null},e.prototype._generatePointsArray=function(){if(this._positions)return!0;var e=this.getVerticesData(s.VertexBuffer.PositionKind);if(!e||0===e.length)return!1;this._positions=[];for(var t=0;t<e.length;t+=3)this._positions.push(n.Vector3.FromArray(e,t));return!0},e.prototype.isDisposed=function(){return this._isDisposed},e.prototype._disposeVertexArrayObjects=function(){if(this._vertexArrayObjects){for(var e in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e]);this._vertexArrayObjects={}}},e.prototype.dispose=function(){var e,t=this._meshes,r=t.length;for(e=0;e<r;e++)this.releaseForMesh(t[e]);for(var n in this._meshes=[],this._disposeVertexArrayObjects(),this._vertexBuffers)this._vertexBuffers[n].dispose();this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=u.Constants.DELAYLOADSTATE_NONE,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._isDisposed=!0},e.prototype.copy=function(t){var r=new o.VertexData;r.indices=[];var n=this.getIndices();if(n)for(var i=0;i<n.length;i++)r.indices.push(n[i]);var s,a=!1,l=!1;for(s in this._vertexBuffers){var u=this.getVerticesData(s);if(u&&(u instanceof Float32Array?r.set(new Float32Array(u),s):r.set(u.slice(0),s),!l)){var d=this.getVertexBuffer(s);d&&(l=!(a=d.isUpdatable()))}}var h=new e(t,this._scene,r,a);for(s in h.delayLoadState=this.delayLoadState,h.delayLoadingFile=this.delayLoadingFile,h._delayLoadingFunction=this._delayLoadingFunction,this._delayInfo)h._delayInfo=h._delayInfo||[],h._delayInfo.push(s);return h._boundingInfo=new c.BoundingInfo(this._extend.minimum,this._extend.maximum),h},e.prototype.serialize=function(){var e={};return e.id=this.id,e.updatable=this._updatable,h.Tags&&h.Tags.HasTags(this)&&(e.tags=h.Tags.GetTags(this)),e},e.prototype.toNumberArray=function(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)},e.prototype.serializeVerticeData=function(){var e=this.serialize();return this.isVerticesDataPresent(s.VertexBuffer.PositionKind)&&(e.positions=this.toNumberArray(this.getVerticesData(s.VertexBuffer.PositionKind)),this.isVertexBufferUpdatable(s.VertexBuffer.PositionKind)&&(e.positions._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.NormalKind)&&(e.normals=this.toNumberArray(this.getVerticesData(s.VertexBuffer.NormalKind)),this.isVertexBufferUpdatable(s.VertexBuffer.NormalKind)&&(e.normals._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.TangentKind)&&(e.tangets=this.toNumberArray(this.getVerticesData(s.VertexBuffer.TangentKind)),this.isVertexBufferUpdatable(s.VertexBuffer.TangentKind)&&(e.tangets._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.UVKind)&&(e.uvs=this.toNumberArray(this.getVerticesData(s.VertexBuffer.UVKind)),this.isVertexBufferUpdatable(s.VertexBuffer.UVKind)&&(e.uvs._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.UV2Kind)&&(e.uv2s=this.toNumberArray(this.getVerticesData(s.VertexBuffer.UV2Kind)),this.isVertexBufferUpdatable(s.VertexBuffer.UV2Kind)&&(e.uv2s._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.UV3Kind)&&(e.uv3s=this.toNumberArray(this.getVerticesData(s.VertexBuffer.UV3Kind)),this.isVertexBufferUpdatable(s.VertexBuffer.UV3Kind)&&(e.uv3s._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.UV4Kind)&&(e.uv4s=this.toNumberArray(this.getVerticesData(s.VertexBuffer.UV4Kind)),this.isVertexBufferUpdatable(s.VertexBuffer.UV4Kind)&&(e.uv4s._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.UV5Kind)&&(e.uv5s=this.toNumberArray(this.getVerticesData(s.VertexBuffer.UV5Kind)),this.isVertexBufferUpdatable(s.VertexBuffer.UV5Kind)&&(e.uv5s._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.UV6Kind)&&(e.uv6s=this.toNumberArray(this.getVerticesData(s.VertexBuffer.UV6Kind)),this.isVertexBufferUpdatable(s.VertexBuffer.UV6Kind)&&(e.uv6s._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.ColorKind)&&(e.colors=this.toNumberArray(this.getVerticesData(s.VertexBuffer.ColorKind)),this.isVertexBufferUpdatable(s.VertexBuffer.ColorKind)&&(e.colors._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndices=this.toNumberArray(this.getVerticesData(s.VertexBuffer.MatricesIndicesKind)),e.matricesIndices._isExpanded=!0,this.isVertexBufferUpdatable(s.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndices._updatable=!0)),this.isVerticesDataPresent(s.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeights=this.toNumberArray(this.getVerticesData(s.VertexBuffer.MatricesWeightsKind)),this.isVertexBufferUpdatable(s.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeights._updatable=!0)),e.indices=this.toNumberArray(this.getIndices()),e},e.ExtractFromMesh=function(e,t){var r=e._geometry;return r?r.copy(t):null},e.RandomId=function(){return d.Tools.RandomId()},e._ImportGeometry=function(t,r){var n=r.getScene(),o=t.geometryId;if(o){var l=n.getGeometryByID(o);l&&l.applyToMesh(r)}else if(t instanceof ArrayBuffer){var c=r._binaryInfo;if(c.positionsAttrDesc&&c.positionsAttrDesc.count>0){var u=new Float32Array(t,c.positionsAttrDesc.offset,c.positionsAttrDesc.count);r.setVerticesData(s.VertexBuffer.PositionKind,u,!1)}if(c.normalsAttrDesc&&c.normalsAttrDesc.count>0){var d=new Float32Array(t,c.normalsAttrDesc.offset,c.normalsAttrDesc.count);r.setVerticesData(s.VertexBuffer.NormalKind,d,!1)}if(c.tangetsAttrDesc&&c.tangetsAttrDesc.count>0){var h=new Float32Array(t,c.tangetsAttrDesc.offset,c.tangetsAttrDesc.count);r.setVerticesData(s.VertexBuffer.TangentKind,h,!1)}if(c.uvsAttrDesc&&c.uvsAttrDesc.count>0){var f=new Float32Array(t,c.uvsAttrDesc.offset,c.uvsAttrDesc.count);r.setVerticesData(s.VertexBuffer.UVKind,f,!1)}if(c.uvs2AttrDesc&&c.uvs2AttrDesc.count>0){var p=new Float32Array(t,c.uvs2AttrDesc.offset,c.uvs2AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV2Kind,p,!1)}if(c.uvs3AttrDesc&&c.uvs3AttrDesc.count>0){var m=new Float32Array(t,c.uvs3AttrDesc.offset,c.uvs3AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV3Kind,m,!1)}if(c.uvs4AttrDesc&&c.uvs4AttrDesc.count>0){var g=new Float32Array(t,c.uvs4AttrDesc.offset,c.uvs4AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV4Kind,g,!1)}if(c.uvs5AttrDesc&&c.uvs5AttrDesc.count>0){var _=new Float32Array(t,c.uvs5AttrDesc.offset,c.uvs5AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV5Kind,_,!1)}if(c.uvs6AttrDesc&&c.uvs6AttrDesc.count>0){var v=new Float32Array(t,c.uvs6AttrDesc.offset,c.uvs6AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV6Kind,v,!1)}if(c.colorsAttrDesc&&c.colorsAttrDesc.count>0){var y=new Float32Array(t,c.colorsAttrDesc.offset,c.colorsAttrDesc.count);r.setVerticesData(s.VertexBuffer.ColorKind,y,!1,c.colorsAttrDesc.stride)}if(c.matricesIndicesAttrDesc&&c.matricesIndicesAttrDesc.count>0){for(var b=new Int32Array(t,c.matricesIndicesAttrDesc.offset,c.matricesIndicesAttrDesc.count),A=[],T=0;T<b.length;T++){var M=b[T];A.push(255&M),A.push((65280&M)>>8),A.push((16711680&M)>>16),A.push(M>>24)}r.setVerticesData(s.VertexBuffer.MatricesIndicesKind,A,!1)}if(c.matricesWeightsAttrDesc&&c.matricesWeightsAttrDesc.count>0){var P=new Float32Array(t,c.matricesWeightsAttrDesc.offset,c.matricesWeightsAttrDesc.count);r.setVerticesData(s.VertexBuffer.MatricesWeightsKind,P,!1)}if(c.indicesAttrDesc&&c.indicesAttrDesc.count>0){var S=new Int32Array(t,c.indicesAttrDesc.offset,c.indicesAttrDesc.count);r.setIndices(S,null)}if(c.subMeshesAttrDesc&&c.subMeshesAttrDesc.count>0){var E=new Int32Array(t,c.subMeshesAttrDesc.offset,5*c.subMeshesAttrDesc.count);for(r.subMeshes=[],T=0;T<c.subMeshesAttrDesc.count;T++){var C=E[5*T+0],x=E[5*T+1],R=E[5*T+2],O=E[5*T+3],I=E[5*T+4];a.SubMesh.AddToMesh(C,x,R,O,I,r)}}}else if(t.positions&&t.normals&&t.indices){if(r.setVerticesData(s.VertexBuffer.PositionKind,t.positions,t.positions._updatable),r.setVerticesData(s.VertexBuffer.NormalKind,t.normals,t.normals._updatable),t.tangents&&r.setVerticesData(s.VertexBuffer.TangentKind,t.tangents,t.tangents._updatable),t.uvs&&r.setVerticesData(s.VertexBuffer.UVKind,t.uvs,t.uvs._updatable),t.uvs2&&r.setVerticesData(s.VertexBuffer.UV2Kind,t.uvs2,t.uvs2._updatable),t.uvs3&&r.setVerticesData(s.VertexBuffer.UV3Kind,t.uvs3,t.uvs3._updatable),t.uvs4&&r.setVerticesData(s.VertexBuffer.UV4Kind,t.uvs4,t.uvs4._updatable),t.uvs5&&r.setVerticesData(s.VertexBuffer.UV5Kind,t.uvs5,t.uvs5._updatable),t.uvs6&&r.setVerticesData(s.VertexBuffer.UV6Kind,t.uvs6,t.uvs6._updatable),t.colors&&r.setVerticesData(s.VertexBuffer.ColorKind,i.Color4.CheckColors4(t.colors,t.positions.length/3),t.colors._updatable),t.matricesIndices)if(t.matricesIndices._isExpanded)delete t.matricesIndices._isExpanded,r.setVerticesData(s.VertexBuffer.MatricesIndicesKind,t.matricesIndices,t.matricesIndices._updatable);else{for(A=[],T=0;T<t.matricesIndices.length;T++){var D=t.matricesIndices[T];A.push(255&D),A.push((65280&D)>>8),A.push((16711680&D)>>16),A.push(D>>24)}r.setVerticesData(s.VertexBuffer.MatricesIndicesKind,A,t.matricesIndices._updatable)}if(t.matricesIndicesExtra)if(t.matricesIndicesExtra._isExpanded)delete t.matricesIndices._isExpanded,r.setVerticesData(s.VertexBuffer.MatricesIndicesExtraKind,t.matricesIndicesExtra,t.matricesIndicesExtra._updatable);else{for(A=[],T=0;T<t.matricesIndicesExtra.length;T++)D=t.matricesIndicesExtra[T],A.push(255&D),A.push((65280&D)>>8),A.push((16711680&D)>>16),A.push(D>>24);r.setVerticesData(s.VertexBuffer.MatricesIndicesExtraKind,A,t.matricesIndicesExtra._updatable)}t.matricesWeights&&(e._CleanMatricesWeights(t,r),r.setVerticesData(s.VertexBuffer.MatricesWeightsKind,t.matricesWeights,t.matricesWeights._updatable)),t.matricesWeightsExtra&&r.setVerticesData(s.VertexBuffer.MatricesWeightsExtraKind,t.matricesWeightsExtra,t.matricesWeights._updatable),r.setIndices(t.indices,null)}if(t.subMeshes){r.subMeshes=[];for(var B=0;B<t.subMeshes.length;B++){var N=t.subMeshes[B];a.SubMesh.AddToMesh(N.materialIndex,N.verticesStart,N.verticesCount,N.indexStart,N.indexCount,r)}}r._shouldGenerateFlatShading&&(r.convertToFlatShadedMesh(),delete r._shouldGenerateFlatShading),r.computeWorldMatrix(!0),n.onMeshImportedObservable.notifyObservers(r)},e._CleanMatricesWeights=function(e,t){if(l.SceneLoaderFlags.CleanBoneMatrixWeights){var r=0;if(e.skeletonId>-1){var n=t.getScene().getLastSkeletonByID(e.skeletonId);if(n){r=n.bones.length;for(var i=t.getVerticesData(s.VertexBuffer.MatricesIndicesKind),o=t.getVerticesData(s.VertexBuffer.MatricesIndicesExtraKind),a=e.matricesWeights,c=e.matricesWeightsExtra,u=e.numBoneInfluencer,d=a.length,h=0;h<d;h+=4){for(var f=0,p=-1,m=0;m<4;m++)f+=g=a[h+m],g<.001&&p<0&&(p=m);if(c)for(m=0;m<4;m++){var g;f+=g=c[h+m],g<.001&&p<0&&(p=m+4)}if((p<0||p>u-1)&&(p=u-1),f>.001){var _=1/f;for(m=0;m<4;m++)a[h+m]*=_;if(c)for(m=0;m<4;m++)c[h+m]*=_}else p>=4?(c[h+p-4]=1-f,o[h+p-4]=r):(a[h+p]=1-f,i[h+p]=r)}t.setVerticesData(s.VertexBuffer.MatricesIndicesKind,i),e.matricesWeightsExtra&&t.setVerticesData(s.VertexBuffer.MatricesIndicesExtraKind,o)}}}},e.Parse=function(t,r,i){if(r.getGeometryByID(t.id))return null;var a=new e(t.id,r,void 0,t.updatable);return h.Tags&&h.Tags.AddTagsTo(a,t.tags),t.delayLoadingFile?(a.delayLoadState=u.Constants.DELAYLOADSTATE_NOTLOADED,a.delayLoadingFile=i+t.delayLoadingFile,a._boundingInfo=new c.BoundingInfo(n.Vector3.FromArray(t.boundingBoxMinimum),n.Vector3.FromArray(t.boundingBoxMaximum)),a._delayInfo=[],t.hasUVs&&a._delayInfo.push(s.VertexBuffer.UVKind),t.hasUVs2&&a._delayInfo.push(s.VertexBuffer.UV2Kind),t.hasUVs3&&a._delayInfo.push(s.VertexBuffer.UV3Kind),t.hasUVs4&&a._delayInfo.push(s.VertexBuffer.UV4Kind),t.hasUVs5&&a._delayInfo.push(s.VertexBuffer.UV5Kind),t.hasUVs6&&a._delayInfo.push(s.VertexBuffer.UV6Kind),t.hasColors&&a._delayInfo.push(s.VertexBuffer.ColorKind),t.hasMatricesIndices&&a._delayInfo.push(s.VertexBuffer.MatricesIndicesKind),t.hasMatricesWeights&&a._delayInfo.push(s.VertexBuffer.MatricesWeightsKind),a._delayLoadingFunction=o.VertexData.ImportVertexData):o.VertexData.ImportVertexData(t,a),r.pushGeometry(a,!0),a},e}()},"./Meshes/groundMesh.ts":
- /*!******************************!*\
- !*** ./Meshes/groundMesh.ts ***!
- \******************************/
- /*! exports provided: GroundMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"GroundMesh",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts");s.Mesh._GroundMeshParser=function(e,t){return a.Parse(e,t)};var a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.generateOctree=!1,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"GroundMesh"},Object.defineProperty(t.prototype,"subdivisions",{get:function(){return Math.min(this._subdivisionsX,this._subdivisionsY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subdivisionsX",{get:function(){return this._subdivisionsX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subdivisionsY",{get:function(){return this._subdivisionsY},enumerable:!1,configurable:!0}),t.prototype.optimize=function(e,t){void 0===t&&(t=32),this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e),this.createOrUpdateSubmeshesOctree&&this.createOrUpdateSubmeshesOctree(t)},t.prototype.getHeightAtCoordinates=function(e,t){var r=this.getWorldMatrix(),n=i.TmpVectors.Matrix[5];r.invertToRef(n);var o=i.TmpVectors.Vector3[8];if(i.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,n,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());var s=this._getFacetAt(e,t),a=-(s.x*e+s.z*t+s.w)/s.y;return i.Vector3.TransformCoordinatesFromFloatsToRef(0,a,0,r,o),o.y},t.prototype.getNormalAtCoordinates=function(e,t){var r=new i.Vector3(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,r),r},t.prototype.getNormalAtCoordinatesToRef=function(e,t,r){var n=this.getWorldMatrix(),o=i.TmpVectors.Matrix[5];n.invertToRef(o);var s=i.TmpVectors.Vector3[8];if(i.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,o,s),e=s.x,t=s.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());var a=this._getFacetAt(e,t);return i.Vector3.TransformNormalFromFloatsToRef(a.x,a.y,a.z,n,r),this},t.prototype.updateCoordinateHeights=function(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this},t.prototype._getFacetAt=function(e,t){var r=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),n=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),i=this._heightQuads[n*this._subdivisionsX+r];return t<i.slope.x*e+i.slope.y?i.facet1:i.facet2},t.prototype._initHeightQuads=function(){var e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=new Array;for(var r=0;r<t;r++)for(var n=0;n<e;n++){var o={slope:i.Vector2.Zero(),facet1:new i.Vector4(0,0,0,0),facet2:new i.Vector4(0,0,0,0)};this._heightQuads[r*e+n]=o}return this},t.prototype._computeHeightQuads=function(){var e=this.getVerticesData(o.VertexBuffer.PositionKind);if(!e)return this;for(var t=i.TmpVectors.Vector3[3],r=i.TmpVectors.Vector3[2],n=i.TmpVectors.Vector3[1],s=i.TmpVectors.Vector3[0],a=i.TmpVectors.Vector3[4],l=i.TmpVectors.Vector3[5],c=i.TmpVectors.Vector3[6],u=i.TmpVectors.Vector3[7],d=i.TmpVectors.Vector3[8],h=0,f=0,p=0,m=0,g=0,_=0,v=0,y=this._subdivisionsX,b=this._subdivisionsY,A=0;A<b;A++)for(var T=0;T<y;T++){h=3*T,f=A*(y+1)*3,p=(A+1)*(y+1)*3,t.x=e[f+h],t.y=e[f+h+1],t.z=e[f+h+2],r.x=e[f+h+3],r.y=e[f+h+4],r.z=e[f+h+5],n.x=e[p+h],n.y=e[p+h+1],n.z=e[p+h+2],s.x=e[p+h+3],s.y=e[p+h+4],s.z=e[p+h+5],m=(s.z-t.z)/(s.x-t.x),g=t.z-m*t.x,r.subtractToRef(t,a),n.subtractToRef(t,l),s.subtractToRef(t,c),i.Vector3.CrossToRef(c,l,u),i.Vector3.CrossToRef(a,c,d),u.normalize(),d.normalize(),_=-(u.x*t.x+u.y*t.y+u.z*t.z),v=-(d.x*r.x+d.y*r.y+d.z*r.z);var M=this._heightQuads[A*y+T];M.slope.copyFromFloats(m,g),M.facet1.copyFromFloats(u.x,u.y,u.z,_),M.facet2.copyFromFloats(d.x,d.y,d.z,v)}return this},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),t.subdivisionsX=this._subdivisionsX,t.subdivisionsY=this._subdivisionsY,t.minX=this._minX,t.maxX=this._maxX,t.minZ=this._minZ,t.maxZ=this._maxZ,t.width=this._width,t.height=this._height},t.Parse=function(e,r){var n=new t(e.name,r);return n._subdivisionsX=e.subdivisionsX||1,n._subdivisionsY=e.subdivisionsY||1,n._minX=e.minX,n._maxX=e.maxX,n._minZ=e.minZ,n._maxZ=e.maxZ,n._width=e.width,n._height=e.height,n},t}(s.Mesh)},"./Meshes/index.ts":
- /*!*************************!*\
- !*** ./Meshes/index.ts ***!
- \*************************/
- /*! exports provided: AbstractMesh, Buffer, VertexBuffer, DracoCompression, CSG, Geometry, GroundMesh, TrailMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, QuadraticErrorSimplification, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, SubMesh, MeshLODLevel, TransformNode, BoxBuilder, TiledBoxBuilder, DiscBuilder, RibbonBuilder, SphereBuilder, HemisphereBuilder, CylinderBuilder, TorusBuilder, TorusKnotBuilder, LinesBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, PlaneBuilder, TiledPlaneBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, DataBuffer, WebGLDataBuffer */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./abstractMesh */"./Meshes/abstractMesh.ts");r.d(t,"AbstractMesh",(function(){return n.AbstractMesh}));var i=r(/*! ./buffer */"./Meshes/buffer.ts");r.d(t,"Buffer",(function(){return i.Buffer})),r.d(t,"VertexBuffer",(function(){return i.VertexBuffer}));var o=r(/*! ./Compression/index */"./Meshes/Compression/index.ts");r.d(t,"DracoCompression",(function(){return o.DracoCompression}));var s=r(/*! ./csg */"./Meshes/csg.ts");r.d(t,"CSG",(function(){return s.CSG}));var a=r(/*! ./geometry */"./Meshes/geometry.ts");r.d(t,"Geometry",(function(){return a.Geometry}));var l=r(/*! ./groundMesh */"./Meshes/groundMesh.ts");r.d(t,"GroundMesh",(function(){return l.GroundMesh}));var c=r(/*! ./trailMesh */"./Meshes/trailMesh.ts");r.d(t,"TrailMesh",(function(){return c.TrailMesh}));var u=r(/*! ./instancedMesh */"./Meshes/instancedMesh.ts");r.d(t,"InstancedMesh",(function(){return u.InstancedMesh}));var d=r(/*! ./linesMesh */"./Meshes/linesMesh.ts");r.d(t,"LinesMesh",(function(){return d.LinesMesh})),r.d(t,"InstancedLinesMesh",(function(){return d.InstancedLinesMesh}));var h=r(/*! ./mesh */"./Meshes/mesh.ts");r.d(t,"_CreationDataStorage",(function(){return h._CreationDataStorage})),r.d(t,"_InstancesBatch",(function(){return h._InstancesBatch})),r.d(t,"Mesh",(function(){return h.Mesh}));var f=r(/*! ./mesh.vertexData */"./Meshes/mesh.vertexData.ts");r.d(t,"VertexData",(function(){return f.VertexData}));var p=r(/*! ./meshBuilder */"./Meshes/meshBuilder.ts");r.d(t,"MeshBuilder",(function(){return p.MeshBuilder}));var m=r(/*! ./meshSimplification */"./Meshes/meshSimplification.ts");r.d(t,"SimplificationSettings",(function(){return m.SimplificationSettings})),r.d(t,"SimplificationQueue",(function(){return m.SimplificationQueue})),r.d(t,"SimplificationType",(function(){return m.SimplificationType})),r.d(t,"QuadraticErrorSimplification",(function(){return m.QuadraticErrorSimplification}));var g=r(/*! ./meshSimplificationSceneComponent */"./Meshes/meshSimplificationSceneComponent.ts");r.d(t,"SimplicationQueueSceneComponent",(function(){return g.SimplicationQueueSceneComponent}));var _=r(/*! ./polygonMesh */"./Meshes/polygonMesh.ts");r.d(t,"Polygon",(function(){return _.Polygon})),r.d(t,"PolygonMeshBuilder",(function(){return _.PolygonMeshBuilder}));var v=r(/*! ./subMesh */"./Meshes/subMesh.ts");r.d(t,"SubMesh",(function(){return v.SubMesh}));var y=r(/*! ./meshLODLevel */"./Meshes/meshLODLevel.ts");r.d(t,"MeshLODLevel",(function(){return y.MeshLODLevel}));var b=r(/*! ./transformNode */"./Meshes/transformNode.ts");r.d(t,"TransformNode",(function(){return b.TransformNode}));var A=r(/*! ./Builders/index */"./Meshes/Builders/index.ts");r.d(t,"BoxBuilder",(function(){return A.BoxBuilder})),r.d(t,"TiledBoxBuilder",(function(){return A.TiledBoxBuilder})),r.d(t,"DiscBuilder",(function(){return A.DiscBuilder})),r.d(t,"RibbonBuilder",(function(){return A.RibbonBuilder})),r.d(t,"SphereBuilder",(function(){return A.SphereBuilder})),r.d(t,"HemisphereBuilder",(function(){return A.HemisphereBuilder})),r.d(t,"CylinderBuilder",(function(){return A.CylinderBuilder})),r.d(t,"TorusBuilder",(function(){return A.TorusBuilder})),r.d(t,"TorusKnotBuilder",(function(){return A.TorusKnotBuilder})),r.d(t,"LinesBuilder",(function(){return A.LinesBuilder})),r.d(t,"PolygonBuilder",(function(){return A.PolygonBuilder})),r.d(t,"ShapeBuilder",(function(){return A.ShapeBuilder})),r.d(t,"LatheBuilder",(function(){return A.LatheBuilder})),r.d(t,"PlaneBuilder",(function(){return A.PlaneBuilder})),r.d(t,"TiledPlaneBuilder",(function(){return A.TiledPlaneBuilder})),r.d(t,"GroundBuilder",(function(){return A.GroundBuilder})),r.d(t,"TubeBuilder",(function(){return A.TubeBuilder})),r.d(t,"PolyhedronBuilder",(function(){return A.PolyhedronBuilder})),r.d(t,"IcoSphereBuilder",(function(){return A.IcoSphereBuilder})),r.d(t,"DecalBuilder",(function(){return A.DecalBuilder}));var T=r(/*! ./dataBuffer */"./Meshes/dataBuffer.ts");r.d(t,"DataBuffer",(function(){return T.DataBuffer}));var M=r(/*! ./WebGL/webGLDataBuffer */"./Meshes/WebGL/webGLDataBuffer.ts");r.d(t,"WebGLDataBuffer",(function(){return M.WebGLDataBuffer})),r(/*! ./thinInstanceMesh */"./Meshes/thinInstanceMesh.ts")},"./Meshes/instancedMesh.ts":
- /*!*********************************!*\
- !*** ./Meshes/instancedMesh.ts ***!
- \*********************************/
- /*! exports provided: InstancedMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"InstancedMesh",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),c=r(/*! ./transformNode */"./Meshes/transformNode.ts"),u=r(/*! ./buffer */"./Meshes/buffer.ts");a.Mesh._instancedMeshFactory=function(e,t){var r=new d(e,t);if(t.instancedBuffers)for(var n in r.instancedBuffers={},t.instancedBuffers)r.instancedBuffers[n]=t.instancedBuffers[n];return r};var d=function(e){function t(t,r){var n=e.call(this,t,r.getScene())||this;n._indexInSourceMeshInstanceArray=-1,r.addInstance(n),n._sourceMesh=r,n._unIndexed=r._unIndexed,n.position.copyFrom(r.position),n.rotation.copyFrom(r.rotation),n.scaling.copyFrom(r.scaling),r.rotationQuaternion&&(n.rotationQuaternion=r.rotationQuaternion.clone()),n.animations=Array.from(r.animations);for(var i=0,o=r.getAnimationRanges();i<o.length;i++){var s=o[i];null!=s&&n.createAnimationRange(s.name,s.from,s.to)}return n.infiniteDistance=r.infiniteDistance,n.setPivotMatrix(r.getPivotMatrix()),n.refreshBoundingInfo(),n._syncSubMeshes(),n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"InstancedMesh"},Object.defineProperty(t.prototype,"lightSources",{get:function(){return this._sourceMesh._lightSources},enumerable:!1,configurable:!0}),t.prototype._resyncLightSources=function(){},t.prototype._resyncLightSource=function(e){},t.prototype._removeLightSource=function(e,t){},Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._sourceMesh.receiveShadows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._sourceMesh.material},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._sourceMesh.visibility},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._sourceMesh.skeleton},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._sourceMesh.renderingGroupId},set:function(e){this._sourceMesh&&e!==this._sourceMesh.renderingGroupId&&o.Logger.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")},enumerable:!1,configurable:!0}),t.prototype.getTotalVertices=function(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0},t.prototype.getTotalIndices=function(){return this._sourceMesh.getTotalIndices()},Object.defineProperty(t.prototype,"sourceMesh",{get:function(){return this._sourceMesh},enumerable:!1,configurable:!0}),t.prototype.createInstance=function(e){return this._sourceMesh.createInstance(e)},t.prototype.isReady=function(e){return void 0===e&&(e=!1),this._sourceMesh.isReady(e,!0)},t.prototype.getVerticesData=function(e,t){return this._sourceMesh.getVerticesData(e,t)},t.prototype.setVerticesData=function(e,t,r,n){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,r,n),this.sourceMesh},t.prototype.updateVerticesData=function(e,t,r,n){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,r,n),this.sourceMesh},t.prototype.setIndices=function(e,t){return void 0===t&&(t=null),this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh},t.prototype.isVerticesDataPresent=function(e){return this._sourceMesh.isVerticesDataPresent(e)},t.prototype.getIndices=function(){return this._sourceMesh.getIndices()},Object.defineProperty(t.prototype,"_positions",{get:function(){return this._sourceMesh._positions},enumerable:!1,configurable:!0}),t.prototype.refreshBoundingInfo=function(e){if(void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked)return this;var t=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getPositionData(e),t),this},t.prototype._preActivate=function(){return this._currentLOD&&this._currentLOD._preActivate(),this},t.prototype._activate=function(e,t){if(this._sourceMesh.subMeshes||o.Logger.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>0!=this._getWorldMatrixDeterminant()>0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1},t.prototype._postActivate=function(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)},t.prototype.getWorldMatrix=function(){if(this._currentLOD&&this._currentLOD.billboardMode!==c.TransformNode.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){var t=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,i.TmpVectors.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),i.TmpVectors.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(i.TmpVectors.Vector3[7]),this._currentLOD._masterMesh=t,i.TmpVectors.Matrix[0]}return e.prototype.getWorldMatrix.call(this)},Object.defineProperty(t.prototype,"isAnInstance",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.getLOD=function(e){if(!e)return this;var t=this.getBoundingInfo();return this._currentLOD=this.sourceMesh.getLOD(e,t.boundingSphere),this._currentLOD===this.sourceMesh?this.sourceMesh:this._currentLOD},t.prototype._preActivateForIntermediateRendering=function(e){return this.sourceMesh._preActivateForIntermediateRendering(e)},t.prototype._syncSubMeshes=function(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(var e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this},t.prototype._generatePointsArray=function(){return this._sourceMesh._generatePointsArray()},t.prototype.clone=function(e,t,r){void 0===t&&(t=null);var n=this._sourceMesh.createInstance(e);if(l.DeepCopier.DeepCopy(this,n,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances"],[]),this.refreshBoundingInfo(),t&&(n.parent=t),!r)for(var i=0;i<this.getScene().meshes.length;i++){var o=this.getScene().meshes[i];o.parent===this&&o.clone(o.name,n)}return n.computeWorldMatrix(!0),n},t.prototype.dispose=function(t,r){void 0===r&&(r=!1),this._sourceMesh.removeInstance(this),e.prototype.dispose.call(this,t,r)},t}(s.AbstractMesh);a.Mesh.prototype.edgesShareWithInstances=!1,a.Mesh.prototype.registerInstancedBuffer=function(e,t){if(this.removeVerticesData(e),!this.instancedBuffers){this.instancedBuffers={};for(var r=0,n=this.instances;r<n.length;r++)n[r].instancedBuffers={};this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{}}}this.instancedBuffers[e]=null,this._userInstancedBuffersStorage.strides[e]=t,this._userInstancedBuffersStorage.sizes[e]=32*t,this._userInstancedBuffersStorage.data[e]=new Float32Array(this._userInstancedBuffersStorage.sizes[e]),this._userInstancedBuffersStorage.vertexBuffers[e]=new u.VertexBuffer(this.getEngine(),this._userInstancedBuffersStorage.data[e],e,!0,!1,t,!0),this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[e]);for(var i=0,o=this.instances;i<o.length;i++)o[i].instancedBuffers[e]=null},a.Mesh.prototype._processInstancedBuffers=function(e,t){var r=e.length;for(var n in this.instancedBuffers){for(var i=this._userInstancedBuffersStorage.sizes[n],o=this._userInstancedBuffersStorage.strides[n],s=(r+1)*o;i<s;)i*=2;this._userInstancedBuffersStorage.data[n].length!=i&&(this._userInstancedBuffersStorage.data[n]=new Float32Array(i),this._userInstancedBuffersStorage.sizes[n]=i,this._userInstancedBuffersStorage.vertexBuffers[n]&&(this._userInstancedBuffersStorage.vertexBuffers[n].dispose(),this._userInstancedBuffersStorage.vertexBuffers[n]=null));var a=this._userInstancedBuffersStorage.data[n],l=0;t&&((d=this.instancedBuffers[n]).toArray?d.toArray(a,l):d.copyToArray(a,l),l+=o);for(var c=0;c<r;c++){var d;(d=e[c].instancedBuffers[n]).toArray?d.toArray(a,l):d.copyToArray(a,l),l+=o}this._userInstancedBuffersStorage.vertexBuffers[n]?this._userInstancedBuffersStorage.vertexBuffers[n].updateDirectly(a,0):(this._userInstancedBuffersStorage.vertexBuffers[n]=new u.VertexBuffer(this.getEngine(),this._userInstancedBuffersStorage.data[n],n,!0,!1,o,!0),this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[n]))}},a.Mesh.prototype._disposeInstanceSpecificData=function(){for(this._instanceDataStorage.instancesBuffer&&(this._instanceDataStorage.instancesBuffer.dispose(),this._instanceDataStorage.instancesBuffer=null);this.instances.length;)this.instances[0].dispose();for(var e in this.instancedBuffers)this._userInstancedBuffersStorage.vertexBuffers[e]&&this._userInstancedBuffersStorage.vertexBuffers[e].dispose();this.instancedBuffers={}}},"./Meshes/linesMesh.ts":
- /*!*****************************!*\
- !*** ./Meshes/linesMesh.ts ***!
- \*****************************/
- /*! exports provided: LinesMesh, InstancedLinesMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"LinesMesh",(function(){return d})),r.d(t,"InstancedLinesMesh",(function(){return h}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Meshes/instancedMesh */"./Meshes/instancedMesh.ts"),l=r(/*! ../Materials/material */"./Materials/material.ts"),c=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts"),u=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),d=(r(/*! ../Shaders/color.fragment */"./Shaders/color.fragment.ts"),r(/*! ../Shaders/color.vertex */"./Shaders/color.vertex.ts"),function(e){function t(t,r,n,s,a,l,u){void 0===r&&(r=null),void 0===n&&(n=null),void 0===s&&(s=null);var d=e.call(this,t,r,n,s,a)||this;d.useVertexColor=l,d.useVertexAlpha=u,d.color=new i.Color3(1,1,1),d.alpha=1,s&&(d.color=s.color.clone(),d.alpha=s.alpha,d.useVertexColor=s.useVertexColor,d.useVertexAlpha=s.useVertexAlpha),d.intersectionThreshold=.1;var h={attributes:[o.VertexBuffer.PositionKind,"world0","world1","world2","world3"],uniforms:["vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","world","viewProjection"],needAlphaBlending:!0,defines:[]};return!1===u&&(h.needAlphaBlending=!1),l?(h.defines.push("#define VERTEXCOLOR"),h.attributes.push(o.VertexBuffer.ColorKind)):(h.uniforms.push("color"),d.color4=new i.Color4),d._colorShader=new c.ShaderMaterial("colorShader",d.getScene(),"color",h),d}return Object(n.__extends)(t,e),t.prototype._addClipPlaneDefine=function(e){var t="#define "+e;-1===this._colorShader.options.defines.indexOf(t)&&this._colorShader.options.defines.push(t)},t.prototype._removeClipPlaneDefine=function(e){var t="#define "+e,r=this._colorShader.options.defines.indexOf(t);-1!==r&&this._colorShader.options.defines.splice(r,1)},t.prototype.isReady=function(){var t=this.getScene();return t.clipPlane?this._addClipPlaneDefine("CLIPPLANE"):this._removeClipPlaneDefine("CLIPPLANE"),t.clipPlane2?this._addClipPlaneDefine("CLIPPLANE2"):this._removeClipPlaneDefine("CLIPPLANE2"),t.clipPlane3?this._addClipPlaneDefine("CLIPPLANE3"):this._removeClipPlaneDefine("CLIPPLANE3"),t.clipPlane4?this._addClipPlaneDefine("CLIPPLANE4"):this._removeClipPlaneDefine("CLIPPLANE4"),t.clipPlane5?this._addClipPlaneDefine("CLIPPLANE5"):this._removeClipPlaneDefine("CLIPPLANE5"),t.clipPlane6?this._addClipPlaneDefine("CLIPPLANE6"):this._removeClipPlaneDefine("CLIPPLANE6"),!!this._colorShader.isReady()&&e.prototype.isReady.call(this)},t.prototype.getClassName=function(){return"LinesMesh"},Object.defineProperty(t.prototype,"material",{get:function(){return this._colorShader},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkCollisions",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype._bind=function(e,t,r){if(!this._geometry)return this;var n=this._colorShader.getEffect(),i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(this._geometry._bind(n,i),!this.useVertexColor){var o=this.color,s=o.r,a=o.g,l=o.b;this.color4.set(s,a,l,this.alpha),this._colorShader.setColor4("color",this.color4)}return u.MaterialHelper.BindClipPlane(n,this.getScene()),this},t.prototype._draw=function(e,t,r){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;var n=this.getScene().getEngine();return this._unIndexed?n.drawArraysType(l.Material.LineListDrawMode,e.verticesStart,e.verticesCount,r):n.drawElementsType(l.Material.LineListDrawMode,e.indexStart,e.indexCount,r),this},t.prototype.dispose=function(t){this._colorShader.dispose(!1,!1,!0),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e,r,n){return void 0===r&&(r=null),new t(e,this.getScene(),r,this,n)},t.prototype.createInstance=function(e){return new h(e,this)},t}(s.Mesh)),h=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.intersectionThreshold=r.intersectionThreshold,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"InstancedLinesMesh"},t}(a.InstancedMesh)},"./Meshes/mesh.ts":
- /*!************************!*\
- !*** ./Meshes/mesh.ts ***!
- \************************/
- /*! exports provided: _CreationDataStorage, _InstancesBatch, Mesh */function(e,t,r){"use strict";r.r(t),r.d(t,"_CreationDataStorage",(function(){return x})),r.d(t,"_InstancesBatch",(function(){return O})),r.d(t,"Mesh",(function(){return B}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),a=r(/*! ../Misc/tags */"./Misc/tags.ts"),l=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),u=r(/*! ../node */"./node.ts"),d=r(/*! ./buffer */"./Meshes/buffer.ts"),h=r(/*! ./mesh.vertexData */"./Meshes/mesh.vertexData.ts"),f=r(/*! ./geometry */"./Meshes/geometry.ts"),p=r(/*! ./abstractMesh */"./Meshes/abstractMesh.ts"),m=r(/*! ./subMesh */"./Meshes/subMesh.ts"),g=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),_=r(/*! ../Materials/material */"./Materials/material.ts"),v=r(/*! ../Materials/multiMaterial */"./Materials/multiMaterial.ts"),y=r(/*! ../Loading/sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts"),b=r(/*! ../Engines/constants */"./Engines/constants.ts"),A=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),T=r(/*! ../Misc/logger */"./Misc/logger.ts"),M=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),P=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),S=r(/*! ../sceneComponent */"./sceneComponent.ts"),E=r(/*! ./meshLODLevel */"./Meshes/meshLODLevel.ts"),C=r(/*! ../Misc/canvasGenerator */"./Misc/canvasGenerator.ts"),x=function(){},R=function(){this.visibleInstances={},this.batchCache=new O,this.instancesBufferSize=2048},O=function(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=new Array,this.hardwareInstancedRendering=new Array},I=function(){this.instancesCount=0,this.matrixBuffer=null,this.matrixBufferSize=512,this.boundingVectors=[]},D=function(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._morphTargetManager=null},B=function(e){function t(r,n,i,o,l,c){void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),void 0===c&&(c=!0);var u=e.call(this,r,n)||this;if(u._internalMeshDataInfo=new D,u.delayLoadState=b.Constants.DELAYLOADSTATE_NONE,u.instances=new Array,u._creationDataStorage=null,u._geometry=null,u._instanceDataStorage=new R,u._thinInstanceDataStorage=new I,u._effectiveMaterial=null,u._shouldGenerateFlatShading=!1,u._originalBuilderSideOrientation=t.DEFAULTSIDE,u.overrideMaterialSideOrientation=null,n=u.getScene(),o){if(o._geometry&&o._geometry.applyToMesh(u),s.DeepCopier.DeepCopy(o,u,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","source","worldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances"],["_poseMatrix"]),u._internalMeshDataInfo._source=o,n.useClonedMeshMap&&(o._internalMeshDataInfo.meshMap||(o._internalMeshDataInfo.meshMap={}),o._internalMeshDataInfo.meshMap[u.uniqueId]=u),u._originalBuilderSideOrientation=o._originalBuilderSideOrientation,u._creationDataStorage=o._creationDataStorage,o._ranges){var d=o._ranges;for(var r in d)d.hasOwnProperty(r)&&d[r]&&u.createAnimationRange(r,d[r].from,d[r].to)}var h;if(o.metadata&&o.metadata.clone?u.metadata=o.metadata.clone():u.metadata=o.metadata,a.Tags&&a.Tags.HasTags(o)&&a.Tags.AddTagsTo(u,a.Tags.GetTags(o,!0)),u.setEnabled(o.isEnabled()),u.parent=o.parent,u.setPivotMatrix(o.getPivotMatrix()),u.id=r+"."+o.id,u.material=o.material,!l)for(var f=o.getDescendants(!0),p=0;p<f.length;p++){var m=f[p];m.clone&&m.clone(r+"."+m.name,u)}if(o.morphTargetManager&&(u.morphTargetManager=o.morphTargetManager),n.getPhysicsEngine){var g=n.getPhysicsEngine();if(c&&g){var _=g.getImpostorForPhysicsObject(o);_&&(u.physicsImpostor=_.clone(u))}}for(h=0;h<n.particleSystems.length;h++){var v=n.particleSystems[h];v.emitter===o&&v.clone(v.name,u)}u.refreshBoundingInfo(),u.computeWorldMatrix(!0)}return null!==i&&(u.parent=i),u._instanceDataStorage.hardwareInstancedRendering=u.getEngine().getCaps().instancedArrays,u}return Object(n.__extends)(t,e),t._GetDefaultSideOrientation=function(e){return e||t.FRONTSIDE},Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders},set:function(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&this._internalMeshDataInfo._sourceNormals&&(this.setVerticesData(d.VertexBuffer.PositionKind,this._internalMeshDataInfo._sourcePositions),this.setVerticesData(d.VertexBuffer.NormalKind,this._internalMeshDataInfo._sourceNormals)),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeRenderObservable",{get:function(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new i.Observable),this._internalMeshDataInfo._onBeforeRenderObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeBindObservable",{get:function(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new i.Observable),this._internalMeshDataInfo._onBeforeBindObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAfterRenderObservable",{get:function(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new i.Observable),this._internalMeshDataInfo._onAfterRenderObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeDrawObservable",{get:function(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new i.Observable),this._internalMeshDataInfo._onBeforeDrawObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeDraw",{set:function(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasInstances",{get:function(){return this.instances.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasThinInstances",{get:function(){var e;return(null!==(e=this._thinInstanceDataStorage.instancesCount)&&void 0!==e?e:0)>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"morphTargetManager",{get:function(){return this._internalMeshDataInfo._morphTargetManager},set:function(e){this._internalMeshDataInfo._morphTargetManager!==e&&(this._internalMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._internalMeshDataInfo._source},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnIndexed",{get:function(){return this._unIndexed},set:function(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldMatrixInstancedBuffer",{get:function(){return this._instanceDataStorage.instancesData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"manualUpdateOfWorldMatrixInstancedBuffer",{get:function(){return this._instanceDataStorage.manualUpdate},set:function(e){this._instanceDataStorage.manualUpdate=e},enumerable:!1,configurable:!0}),t.prototype.instantiateHierarchy=function(e,t,r){void 0===e&&(e=null);var n=!(this.getTotalVertices()>0)||t&&t.doNotInstantiate?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));n&&(n.parent=e||this.parent,n.position=this.position.clone(),n.scaling=this.scaling.clone(),this.rotationQuaternion?n.rotationQuaternion=this.rotationQuaternion.clone():n.rotation=this.rotation.clone(),r&&r(this,n));for(var i=0,o=this.getChildTransformNodes(!0);i<o.length;i++)o[i].instantiateHierarchy(n,t,r);return n},t.prototype.getClassName=function(){return"Mesh"},Object.defineProperty(t.prototype,"_isMesh",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.toString=function(t){var r=e.prototype.toString.call(this,t);if(r+=", n vertices: "+this.getTotalVertices(),r+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(var n=0;n<this.animations.length;n++)r+=", animation[0]: "+this.animations[n].toString(t);if(t)if(this._geometry){var i=this.getIndices(),o=this.getVerticesData(d.VertexBuffer.PositionKind);o&&i&&(r+=", flat shading: "+(o.length/3===i.length?"YES":"NO"))}else r+=", flat shading: UNKNOWN";return r},t.prototype._unBindEffect=function(){e.prototype._unBindEffect.call(this);for(var t=0,r=this.instances;t<r.length;t++)r[t]._unBindEffect()},Object.defineProperty(t.prototype,"hasLODLevels",{get:function(){return this._internalMeshDataInfo._LODLevels.length>0},enumerable:!1,configurable:!0}),t.prototype.getLODLevels=function(){return this._internalMeshDataInfo._LODLevels},t.prototype._sortLODLevels=function(){this._internalMeshDataInfo._LODLevels.sort((function(e,t){return e.distance<t.distance?1:e.distance>t.distance?-1:0}))},t.prototype.addLODLevel=function(e,t){if(t&&t._masterMesh)return T.Logger.Warn("You cannot use a mesh as LOD level twice"),this;var r=new E.MeshLODLevel(e,t);return this._internalMeshDataInfo._LODLevels.push(r),t&&(t._masterMesh=this),this._sortLODLevels(),this},t.prototype.getLODLevelAtDistance=function(e){for(var t=this._internalMeshDataInfo,r=0;r<t._LODLevels.length;r++){var n=t._LODLevels[r];if(n.distance===e)return n.mesh}return null},t.prototype.removeLODLevel=function(e){for(var t=this._internalMeshDataInfo,r=0;r<t._LODLevels.length;r++)t._LODLevels[r].mesh===e&&(t._LODLevels.splice(r,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this},t.prototype.getLOD=function(e,t){var r=this._internalMeshDataInfo;if(!r._LODLevels||0===r._LODLevels.length)return this;var n=(t||this.getBoundingInfo().boundingSphere).centerWorld.subtract(e.globalPosition).length();if(r._LODLevels[r._LODLevels.length-1].distance>n)return this.onLODLevelSelection&&this.onLODLevelSelection(n,this,this),this;for(var i=0;i<r._LODLevels.length;i++){var o=r._LODLevels[i];if(o.distance<n)return o.mesh&&(o.mesh._preActivate(),o.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)),this.onLODLevelSelection&&this.onLODLevelSelection(n,this,o.mesh),o.mesh}return this.onLODLevelSelection&&this.onLODLevelSelection(n,this,this),this},Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),t.prototype.getTotalVertices=function(){return null===this._geometry||void 0===this._geometry?0:this._geometry.getTotalVertices()},t.prototype.getVerticesData=function(e,t,r){return this._geometry?this._geometry.getVerticesData(e,t,r):null},t.prototype.getVertexBuffer=function(e){return this._geometry?this._geometry.getVertexBuffer(e):null},t.prototype.isVerticesDataPresent=function(e){return this._geometry?this._geometry.isVerticesDataPresent(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)},t.prototype.isVertexBufferUpdatable=function(e){return this._geometry?this._geometry.isVertexBufferUpdatable(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)},t.prototype.getVerticesDataKinds=function(){if(!this._geometry){var e=new Array;return this._delayInfo&&this._delayInfo.forEach((function(t){e.push(t)})),e}return this._geometry.getVerticesDataKinds()},t.prototype.getTotalIndices=function(){return this._geometry?this._geometry.getTotalIndices():0},t.prototype.getIndices=function(e,t){return this._geometry?this._geometry.getIndices(e,t):[]},Object.defineProperty(t.prototype,"isBlocked",{get:function(){return null!==this._masterMesh&&void 0!==this._masterMesh},enumerable:!1,configurable:!0}),t.prototype.isReady=function(t,r){var n,i,o,s,a,l;if(void 0===t&&(t=!1),void 0===r&&(r=!1),this.delayLoadState===b.Constants.DELAYLOADSTATE_LOADING)return!1;if(!e.prototype.isReady.call(this,t))return!1;if(!this.subMeshes||0===this.subMeshes.length)return!0;if(!t)return!0;var c=this.getEngine(),u=this.getScene(),d=r||c.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();var h=this.material||u.defaultMaterial;if(h)if(h._storeEffectOnSubMeshes)for(var f=0,p=this.subMeshes;f<p.length;f++){var m=(T=p[f]).getMaterial();if(m)if(m._storeEffectOnSubMeshes){if(!m.isReadyForSubMesh(this,T,d))return!1}else if(!m.isReady(this,d))return!1}else if(!h.isReady(this,d))return!1;for(var g=0,_=this.lightSources;g<_.length;g++){var v=_[g].getShadowGenerator();if(v&&(!(null===(n=v.getShadowMap())||void 0===n?void 0:n.renderList)||(null===(i=v.getShadowMap())||void 0===i?void 0:i.renderList)&&-1!==(null===(s=null===(o=v.getShadowMap())||void 0===o?void 0:o.renderList)||void 0===s?void 0:s.indexOf(this))))for(var y=0,A=this.subMeshes;y<A.length;y++){var T=A[y];if(!v.isReady(T,d,null!==(l=null===(a=T.getMaterial())||void 0===a?void 0:a.needAlphaBlendingForMesh(this))&&void 0!==l&&l))return!1}}for(var M=0,P=this._internalMeshDataInfo._LODLevels;M<P.length;M++){var S=P[M];if(S.mesh&&!S.mesh.isReady(d))return!1}return!0},Object.defineProperty(t.prototype,"areNormalsFrozen",{get:function(){return this._internalMeshDataInfo._areNormalsFrozen},enumerable:!1,configurable:!0}),t.prototype.freezeNormals=function(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this},t.prototype.unfreezeNormals=function(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this},Object.defineProperty(t.prototype,"overridenInstanceCount",{set:function(e){this._instanceDataStorage.overridenInstanceCount=e},enumerable:!1,configurable:!0}),t.prototype._preActivate=function(){var e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t||(e._preActivateId=t,this._instanceDataStorage.visibleInstances=null),this},t.prototype._preActivateForIntermediateRendering=function(e){return this._instanceDataStorage.visibleInstances&&(this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId=e),this},t.prototype._registerInstanceForRenderId=function(e,t){return this._instanceDataStorage.visibleInstances||(this._instanceDataStorage.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId}),this._instanceDataStorage.visibleInstances[t]||(this._instanceDataStorage.visibleInstances[t]=new Array),this._instanceDataStorage.visibleInstances[t].push(e),this},t.prototype._afterComputeWorldMatrix=function(){e.prototype._afterComputeWorldMatrix.call(this),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))},t.prototype._postActivate=function(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))},t.prototype.refreshBoundingInfo=function(e){if(void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked)return this;var t=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getPositionData(e),t),this},t.prototype._createGlobalSubMesh=function(e){var t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){var r=this.getIndices();if(!r)return null;var n=r.length,i=!1;if(e)i=!0;else for(var o=0,s=this.subMeshes;o<s.length;o++){var a=s[o];if(a.indexStart+a.indexCount>n){i=!0;break}if(a.verticesStart+a.verticesCount>t){i=!0;break}}if(!i)return this.subMeshes[0]}return this.releaseSubMeshes(),new m.SubMesh(0,0,t,0,this.getTotalIndices(),this)},t.prototype.subdivide=function(e){if(!(e<1)){for(var t=this.getTotalIndices(),r=t/e|0,n=0;r%3!=0;)r++;this.releaseSubMeshes();for(var i=0;i<e&&!(n>=t);i++)m.SubMesh.CreateFromIndices(0,n,i===e-1?t-n:r,this),n+=r;this.synchronizeInstances()}},t.prototype.setVerticesData=function(e,t,r,n){if(void 0===r&&(r=!1),this._geometry)this._geometry.setVerticesData(e,t,r,n);else{var i=new h.VertexData;i.set(t,e);var o=this.getScene();new f.Geometry(f.Geometry.RandomId(),o,i,r,this)}return this},t.prototype.removeVerticesData=function(e){this._geometry&&this._geometry.removeVerticesData(e)},t.prototype.markVerticesDataAsUpdatable=function(e,t){void 0===t&&(t=!0);var r=this.getVertexBuffer(e);r&&r.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)},t.prototype.setVerticesBuffer=function(e){return this._geometry||(this._geometry=f.Geometry.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e),this},t.prototype.updateVerticesData=function(e,t,r,n){return this._geometry?(n?(this.makeGeometryUnique(),this.updateVerticesData(e,t,r,!1)):this._geometry.updateVerticesData(e,t,r),this):this},t.prototype.updateMeshPositions=function(e,t){void 0===t&&(t=!0);var r=this.getVerticesData(d.VertexBuffer.PositionKind);if(!r)return this;if(e(r),this.updateVerticesData(d.VertexBuffer.PositionKind,r,!1,!1),t){var n=this.getIndices(),i=this.getVerticesData(d.VertexBuffer.NormalKind);if(!i)return this;h.VertexData.ComputeNormals(r,n,i),this.updateVerticesData(d.VertexBuffer.NormalKind,i,!1,!1)}return this},t.prototype.makeGeometryUnique=function(){if(!this._geometry)return this;if(1===this._geometry.meshes.length)return this;var e=this._geometry,t=this._geometry.copy(f.Geometry.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this},t.prototype.setIndices=function(e,t,r){if(void 0===t&&(t=null),void 0===r&&(r=!1),this._geometry)this._geometry.setIndices(e,t,r);else{var n=new h.VertexData;n.indices=e;var i=this.getScene();new f.Geometry(f.Geometry.RandomId(),i,n,r,this)}return this},t.prototype.updateIndices=function(e,t,r){return void 0===r&&(r=!1),this._geometry?(this._geometry.updateIndices(e,t,r),this):this},t.prototype.toLeftHanded=function(){return this._geometry?(this._geometry.toLeftHanded(),this):this},t.prototype._bind=function(e,t,r){if(!this._geometry)return this;var n,i=this.getScene().getEngine();if(this._unIndexed)n=null;else switch(r){case _.Material.PointFillMode:n=null;break;case _.Material.WireFrameFillMode:n=e._getLinesIndexBuffer(this.getIndices(),i);break;default:case _.Material.TriangleFillMode:n=this._geometry.getIndexBuffer()}return this._geometry._bind(t,n),this},t.prototype._draw=function(e,t,r){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);var n=this.getScene().getEngine();return this._unIndexed||t==_.Material.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,r):t==_.Material.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,r):n.drawElementsType(t,e.indexStart,e.indexCount,r),this},t.prototype.registerBeforeRender=function(e){return this.onBeforeRenderObservable.add(e),this},t.prototype.unregisterBeforeRender=function(e){return this.onBeforeRenderObservable.removeCallback(e),this},t.prototype.registerAfterRender=function(e){return this.onAfterRenderObservable.add(e),this},t.prototype.unregisterAfterRender=function(e){return this.onAfterRenderObservable.removeCallback(e),this},t.prototype._getInstancesRenderList=function(e,t){if(void 0===t&&(t=!1),this._instanceDataStorage.isFrozen&&this._instanceDataStorage.previousBatch)return this._instanceDataStorage.previousBatch;var r=this.getScene(),n=r._isInIntermediateRendering(),i=n?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,o=this._instanceDataStorage.batchCache;if(o.mustReturn=!1,o.renderSelf[e]=t||!i&&this.isEnabled()&&this.isVisible,o.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances&&!t){var s=this._instanceDataStorage.visibleInstances,a=r.getRenderId(),l=n?s.intermediateDefaultRenderId:s.defaultRenderId;o.visibleInstances[e]=s[a],!o.visibleInstances[e]&&l&&(o.visibleInstances[e]=s[l])}return o.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&null!==o.visibleInstances[e]&&void 0!==o.visibleInstances[e],this._instanceDataStorage.previousBatch=o,o},t.prototype._renderWithInstances=function(e,t,r,n,i){var o=r.visibleInstances[e._id];if(!o)return this;for(var s=this._instanceDataStorage,a=s.instancesBufferSize,l=s.instancesBuffer,c=16*(o.length+1)*4;s.instancesBufferSize<c;)s.instancesBufferSize*=2;s.instancesData&&a==s.instancesBufferSize||(s.instancesData=new Float32Array(s.instancesBufferSize/4));var u=0,h=0,f=r.renderSelf[e._id],p=!l||a!==s.instancesBufferSize;if(this._instanceDataStorage.manualUpdate||s.isFrozen&&!p)h=(f?1:0)+o.length;else{var m=this._effectiveMesh.getWorldMatrix();if(f&&(m.copyToArray(s.instancesData,u),u+=16,h++),o)for(var g=0;g<o.length;g++)o[g].getWorldMatrix().copyToArray(s.instancesData,u),u+=16,h++}return p?(l&&l.dispose(),l=new d.Buffer(i,s.instancesData,!0,16,!1,!0),s.instancesBuffer=l,this.setVerticesBuffer(l.createVertexBuffer("world0",0,4)),this.setVerticesBuffer(l.createVertexBuffer("world1",4,4)),this.setVerticesBuffer(l.createVertexBuffer("world2",8,4)),this.setVerticesBuffer(l.createVertexBuffer("world3",12,4))):this._instanceDataStorage.isFrozen||l.updateDirectly(s.instancesData,0,h),this._processInstancedBuffers(o,f),this.getScene()._activeIndices.addCount(e.indexCount*h,!1),this._bind(e,n,t),this._draw(e,t,h),i.unbindInstanceAttributes(),this},t.prototype._renderWithThinInstances=function(e,t,r,n){var i,o,s=null!==(o=null===(i=this._thinInstanceDataStorage)||void 0===i?void 0:i.instancesCount)&&void 0!==o?o:0;this.getScene()._activeIndices.addCount(e.indexCount*s,!1),this._bind(e,r,t),this._draw(e,t,s),n.unbindInstanceAttributes()},t.prototype._processInstancedBuffers=function(e,t){},t.prototype._processRendering=function(e,t,r,n,i,o,s,a){var l=this.getScene(),c=l.getEngine();if(o&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,n,r,c),this;if(o)this._renderWithInstances(t,n,i,r,c);else{var u=0;i.renderSelf[t._id]&&(s&&s(!1,e._effectiveMesh.getWorldMatrix(),a),u++,this._draw(t,n,this._instanceDataStorage.overridenInstanceCount));var d=i.visibleInstances[t._id];if(d){var h=d.length;u+=h;for(var f=0;f<h;f++){var p=d[f].getWorldMatrix();s&&s(!0,p,a),this._draw(t,n)}}l._activeIndices.addCount(t.indexCount*u,!1)}return this},t.prototype._rebuild=function(){this._instanceDataStorage.instancesBuffer&&(this._instanceDataStorage.instancesBuffer.dispose(),this._instanceDataStorage.instancesBuffer=null),e.prototype._rebuild.call(this)},t.prototype._freeze=function(){if(this.subMeshes){for(var e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}},t.prototype._unFreeze=function(){this._instanceDataStorage.isFrozen=!1,this._instanceDataStorage.previousBatch=null},t.prototype.render=function(e,t,r){var n=this.getScene();if(this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1,this._checkOcclusionQuery())return this;var i=this._getInstancesRenderList(e._id,!!r);if(i.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);var o,s=n.getEngine(),a=i.hardwareInstancedRendering[e._id]||e.getRenderingMesh().hasThinInstances,l=this._instanceDataStorage,c=e.getMaterial();if(!c)return this;if(!l.isFrozen||!this._effectiveMaterial||this._effectiveMaterial!==c){if(c._storeEffectOnSubMeshes){if(!c.isReadyForSubMesh(this,e,a))return this}else if(!c.isReady(this,a))return this;this._effectiveMaterial=c}t&&s.setAlphaMode(this._effectiveMaterial.alphaMode);for(var u=0,d=n._beforeRenderingMeshStage;u<d.length;u++)d[u].action(this,e,i);if(!(o=this._effectiveMaterial._storeEffectOnSubMeshes?e.effect:this._effectiveMaterial.getEffect()))return this;n.prePassRenderer&&n.prePassRenderer.bindAttachmentsForEffect(o);var h,f=r||this._effectiveMesh;if(l.isFrozen||!this._effectiveMaterial.backFaceCulling&&null===this.overrideMaterialSideOrientation)h=l.sideOrientation;else{var p=f._getWorldMatrixDeterminant();null==(h=this.overrideMaterialSideOrientation)&&(h=this._effectiveMaterial.sideOrientation),p<0&&(h=h===_.Material.ClockWiseSideOrientation?_.Material.CounterClockWiseSideOrientation:_.Material.ClockWiseSideOrientation),l.sideOrientation=h}var m=this._effectiveMaterial._preBind(o,h);this._effectiveMaterial.forceDepthWrite&&s.setDepthWrite(!0);var g=n.forcePointsCloud?_.Material.PointFillMode:n.forceWireframe?_.Material.WireFrameFillMode:this._effectiveMaterial.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),a||this._bind(e,o,g);var v=f.getWorldMatrix();this._effectiveMaterial._storeEffectOnSubMeshes?this._effectiveMaterial.bindForSubMesh(v,this,e):this._effectiveMaterial.bind(v,this),!this._effectiveMaterial.backFaceCulling&&this._effectiveMaterial.separateCullingPass&&(s.setState(!0,this._effectiveMaterial.zOffset,!1,!m),this._processRendering(this,e,o,g,i,a,this._onBeforeDraw,this._effectiveMaterial),s.setState(!0,this._effectiveMaterial.zOffset,!1,m)),this._processRendering(this,e,o,g,i,a,this._onBeforeDraw,this._effectiveMaterial),this._effectiveMaterial.unbind();for(var y=0,b=n._afterRenderingMeshStage;y<b.length;y++)b[y].action(this,e,i);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),this},t.prototype._onBeforeDraw=function(e,t,r){e&&r&&r.bindOnlyWorldMatrix(t)},t.prototype.cleanMatrixWeights=function(){this.isVerticesDataPresent(d.VertexBuffer.MatricesWeightsKind)&&(this.isVerticesDataPresent(d.VertexBuffer.MatricesWeightsExtraKind)?this.normalizeSkinWeightsAndExtra():this.normalizeSkinFourWeights())},t.prototype.normalizeSkinFourWeights=function(){for(var e=this.getVerticesData(d.VertexBuffer.MatricesWeightsKind),t=e.length,r=0;r<t;r+=4){var n=e[r]+e[r+1]+e[r+2]+e[r+3];if(0===n)e[r]=1;else{var i=1/n;e[r]*=i,e[r+1]*=i,e[r+2]*=i,e[r+3]*=i}}this.setVerticesData(d.VertexBuffer.MatricesWeightsKind,e)},t.prototype.normalizeSkinWeightsAndExtra=function(){for(var e=this.getVerticesData(d.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(d.VertexBuffer.MatricesWeightsKind),r=t.length,n=0;n<r;n+=4){var i=t[n]+t[n+1]+t[n+2]+t[n+3];if(0===(i+=e[n]+e[n+1]+e[n+2]+e[n+3]))t[n]=1;else{var o=1/i;t[n]*=o,t[n+1]*=o,t[n+2]*=o,t[n+3]*=o,e[n]*=o,e[n+1]*=o,e[n+2]*=o,e[n+3]*=o}}this.setVerticesData(d.VertexBuffer.MatricesWeightsKind,t),this.setVerticesData(d.VertexBuffer.MatricesWeightsKind,e)},t.prototype.validateSkinning=function(){var e=this.getVerticesData(d.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(d.VertexBuffer.MatricesWeightsKind);if(null===t||null==this.skeleton)return{skinned:!1,valid:!0,report:"not skinned"};for(var r=t.length,n=0,i=0,o=0,s=0,a=null===e?4:8,l=new Array,c=0;c<=a;c++)l[c]=0;for(c=0;c<r;c+=4){for(var u=t[c],h=u,f=0===h?0:1,p=1;p<a;p++){var m=p<4?t[c+p]:e[c+p-4];m>u&&n++,0!==m&&f++,h+=m,u=m}if(l[f]++,f>o&&(o=f),0===h)i++;else{var g=1/h,_=0;for(p=0;p<a;p++)_+=p<4?Math.abs(t[c+p]-t[c+p]*g):Math.abs(e[c+p-4]-e[c+p-4]*g);_>.001&&s++}}var v=this.skeleton.bones.length,y=this.getVerticesData(d.VertexBuffer.MatricesIndicesKind),b=this.getVerticesData(d.VertexBuffer.MatricesIndicesExtraKind),A=0;for(c=0;c<r;c++)for(p=0;p<a;p++){var T=p<4?y[p]:b[p-4];(T>=v||T<0)&&A++}return{skinned:!0,valid:0===i&&0===s&&0===A,report:"Number of Weights = "+r/4+"\nMaximum influences = "+o+"\nMissing Weights = "+i+"\nNot Sorted = "+n+"\nNot Normalized = "+s+"\nWeightCounts = ["+l+"]\nNumber of bones = "+v+"\nBad Bone Indices = "+A}},t.prototype._checkDelayState=function(){var e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===b.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=b.Constants.DELAYLOADSTATE_LOADING,this._queueLoad(e)),this},t.prototype._queueLoad=function(e){var t=this;e._addPendingData(this);var r=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return o.Tools.LoadFile(this.delayLoadingFile,(function(r){r instanceof ArrayBuffer?t._delayLoadingFunction(r,t):t._delayLoadingFunction(JSON.parse(r),t),t.instances.forEach((function(e){e.refreshBoundingInfo(),e._syncSubMeshes()})),t.delayLoadState=b.Constants.DELAYLOADSTATE_LOADED,e._removePendingData(t)}),(function(){}),e.offlineProvider,r),this},t.prototype.isInFrustum=function(t){return this.delayLoadState!==b.Constants.DELAYLOADSTATE_LOADING&&!!e.prototype.isInFrustum.call(this,t)&&(this._checkDelayState(),!0)},t.prototype.setMaterialByID=function(e){var t,r=this.getScene().materials;for(t=r.length-1;t>-1;t--)if(r[t].id===e)return this.material=r[t],this;var n=this.getScene().multiMaterials;for(t=n.length-1;t>-1;t--)if(n[t].id===e)return this.material=n[t],this;return this},t.prototype.getAnimatables=function(){var e=new Array;return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e},t.prototype.bakeTransformIntoVertices=function(e){if(!this.isVerticesDataPresent(d.VertexBuffer.PositionKind))return this;var t=this.subMeshes.splice(0);this._resetPointsArrayCache();var r,n=this.getVerticesData(d.VertexBuffer.PositionKind),i=new Array;for(r=0;r<n.length;r+=3)l.Vector3.TransformCoordinates(l.Vector3.FromArray(n,r),e).toArray(i,r);if(this.setVerticesData(d.VertexBuffer.PositionKind,i,this.getVertexBuffer(d.VertexBuffer.PositionKind).isUpdatable()),this.isVerticesDataPresent(d.VertexBuffer.NormalKind)){for(n=this.getVerticesData(d.VertexBuffer.NormalKind),i=[],r=0;r<n.length;r+=3)l.Vector3.TransformNormal(l.Vector3.FromArray(n,r),e).normalize().toArray(i,r);this.setVerticesData(d.VertexBuffer.NormalKind,i,this.getVertexBuffer(d.VertexBuffer.NormalKind).isUpdatable())}return e.m[0]*e.m[5]*e.m[10]<0&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=t,this},t.prototype.bakeCurrentTransformIntoVertices=function(e){return void 0===e&&(e=!0),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this},Object.defineProperty(t.prototype,"_positions",{get:function(){return this._geometry?this._geometry._positions:null},enumerable:!1,configurable:!0}),t.prototype._resetPointsArrayCache=function(){return this._geometry&&this._geometry._resetPointsArrayCache(),this},t.prototype._generatePointsArray=function(){return!!this._geometry&&this._geometry._generatePointsArray()},t.prototype.clone=function(e,r,n,i){return void 0===e&&(e=""),void 0===r&&(r=null),void 0===i&&(i=!0),new t(e,this.getScene(),r,this,n,i)},t.prototype.dispose=function(t,r){void 0===r&&(r=!1),this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);var n=this._internalMeshDataInfo;if(n._onBeforeDrawObservable&&n._onBeforeDrawObservable.clear(),n._onBeforeBindObservable&&n._onBeforeBindObservable.clear(),n._onBeforeRenderObservable&&n._onBeforeRenderObservable.clear(),n._onAfterRenderObservable&&n._onAfterRenderObservable.clear(),this._scene.useClonedMeshMap){if(n.meshMap)for(var i in n.meshMap)(a=n.meshMap[i])&&(a._internalMeshDataInfo._source=null,n.meshMap[i]=void 0);n._source&&n._source._internalMeshDataInfo.meshMap&&(n._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else for(var o=0,s=this.getScene().meshes;o<s.length;o++){var a;(a=s[o])._internalMeshDataInfo&&a._internalMeshDataInfo._source&&a._internalMeshDataInfo._source===this&&(a._internalMeshDataInfo._source=null)}n._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),e.prototype.dispose.call(this,t,r)},t.prototype._disposeInstanceSpecificData=function(){},t.prototype._disposeThinInstanceSpecificData=function(){},t.prototype.applyDisplacementMap=function(e,t,r,n,i,s,a){var l=this;void 0===a&&(a=!1);var c=this.getScene();return o.Tools.LoadImage(e,(function(e){var o=e.width,c=e.height,u=C.CanvasGenerator.CreateCanvas(o,c).getContext("2d");u.drawImage(e,0,0);var d=u.getImageData(0,0,o,c).data;l.applyDisplacementMapFromBuffer(d,o,c,t,r,i,s,a),n&&n(l)}),(function(){}),c.offlineProvider),this},t.prototype.applyDisplacementMapFromBuffer=function(e,t,r,n,i,o,s,a){if(void 0===a&&(a=!1),!this.isVerticesDataPresent(d.VertexBuffer.PositionKind)||!this.isVerticesDataPresent(d.VertexBuffer.NormalKind)||!this.isVerticesDataPresent(d.VertexBuffer.UVKind))return T.Logger.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;var c=this.getVerticesData(d.VertexBuffer.PositionKind,!0,!0),u=this.getVerticesData(d.VertexBuffer.NormalKind),f=this.getVerticesData(d.VertexBuffer.UVKind),p=l.Vector3.Zero(),m=l.Vector3.Zero(),g=l.Vector2.Zero();o=o||l.Vector2.Zero(),s=s||new l.Vector2(1,1);for(var _=0;_<c.length;_+=3){l.Vector3.FromArrayToRef(c,_,p),l.Vector3.FromArrayToRef(u,_,m),l.Vector2.FromArrayToRef(f,_/3*2,g);var v=4*((Math.abs(g.x*s.x+o.x)*t%t|0)+(Math.abs(g.y*s.y+o.y)*r%r|0)*t),y=e[v]/255*.3+e[v+1]/255*.59+e[v+2]/255*.11;m.normalize(),m.scaleInPlace(n+(i-n)*y),(p=p.add(m)).toArray(c,_)}return h.VertexData.ComputeNormals(c,this.getIndices(),u),a?(this.setVerticesData(d.VertexBuffer.PositionKind,c),this.setVerticesData(d.VertexBuffer.NormalKind,u)):(this.updateVerticesData(d.VertexBuffer.PositionKind,c),this.updateVerticesData(d.VertexBuffer.NormalKind,u)),this},t.prototype.convertToFlatShadedMesh=function(){var e,t,r=this.getVerticesDataKinds(),n={},i={},o={},s=!1;for(e=0;e<r.length;e++){t=r[e];var a=this.getVertexBuffer(t);t!==d.VertexBuffer.NormalKind?(n[t]=a,i[t]=n[t].getData(),o[t]=[]):(s=a.isUpdatable(),r.splice(e,1),e--)}var c,u=this.subMeshes.slice(0),h=this.getIndices(),f=this.getTotalIndices();for(c=0;c<f;c++){var p=h[c];for(e=0;e<r.length;e++)for(var g=n[t=r[e]].getStrideSize(),_=0;_<g;_++)o[t].push(i[t][p*g+_])}var v=[],y=o[d.VertexBuffer.PositionKind];for(c=0;c<f;c+=3){h[c]=c,h[c+1]=c+1,h[c+2]=c+2;for(var b=l.Vector3.FromArray(y,3*c),A=l.Vector3.FromArray(y,3*(c+1)),T=l.Vector3.FromArray(y,3*(c+2)),M=b.subtract(A),P=T.subtract(A),S=l.Vector3.Normalize(l.Vector3.Cross(M,P)),E=0;E<3;E++)v.push(S.x),v.push(S.y),v.push(S.z)}for(this.setIndices(h),this.setVerticesData(d.VertexBuffer.NormalKind,v,s),e=0;e<r.length;e++)t=r[e],this.setVerticesData(t,o[t],n[t].isUpdatable());this.releaseSubMeshes();for(var C=0;C<u.length;C++){var x=u[C];m.SubMesh.AddToMesh(x.materialIndex,x.indexStart,x.indexCount,x.indexStart,x.indexCount,this)}return this.synchronizeInstances(),this},t.prototype.convertToUnIndexedMesh=function(){var e,t,r=this.getVerticesDataKinds(),n={},i={},o={};for(e=0;e<r.length;e++){t=r[e];var s=this.getVertexBuffer(t);n[t]=s,i[t]=n[t].getData(),o[t]=[]}var a,l=this.subMeshes.slice(0),c=this.getIndices(),u=this.getTotalIndices();for(a=0;a<u;a++){var d=c[a];for(e=0;e<r.length;e++)for(var h=n[t=r[e]].getStrideSize(),f=0;f<h;f++)o[t].push(i[t][d*h+f])}for(a=0;a<u;a+=3)c[a]=a,c[a+1]=a+1,c[a+2]=a+2;for(this.setIndices(c),e=0;e<r.length;e++)t=r[e],this.setVerticesData(t,o[t],n[t].isUpdatable());this.releaseSubMeshes();for(var p=0;p<l.length;p++){var g=l[p];m.SubMesh.AddToMesh(g.materialIndex,g.indexStart,g.indexCount,g.indexStart,g.indexCount,this)}return this._unIndexed=!0,this.synchronizeInstances(),this},t.prototype.flipFaces=function(e){void 0===e&&(e=!1);var t,r,n=h.VertexData.ExtractFromMesh(this);if(e&&this.isVerticesDataPresent(d.VertexBuffer.NormalKind)&&n.normals)for(t=0;t<n.normals.length;t++)n.normals[t]*=-1;if(n.indices)for(t=0;t<n.indices.length;t+=3)r=n.indices[t+1],n.indices[t+1]=n.indices[t+2],n.indices[t+2]=r;return n.applyToMesh(this,this.isVertexBufferUpdatable(d.VertexBuffer.PositionKind)),this},t.prototype.increaseVertices=function(e){var t=h.VertexData.ExtractFromMesh(this),r=t.uvs,n=t.indices,i=t.positions,o=t.normals;if(null===n||null===i||null===o||null===r)T.Logger.Warn("VertexData contains null entries");else{for(var s,a,c=e+1,u=new Array,f=0;f<c+1;f++)u[f]=new Array;var p,m=new l.Vector3(0,0,0),g=new l.Vector3(0,0,0),_=new l.Vector2(0,0),v=new Array,y=new Array,b=new Array,A=i.length,M=r.length;for(f=0;f<n.length;f+=3){y[0]=n[f],y[1]=n[f+1],y[2]=n[f+2];for(var P=0;P<3;P++)if(s=y[P],a=y[(P+1)%3],void 0===b[s]&&void 0===b[a]?(b[s]=new Array,b[a]=new Array):(void 0===b[s]&&(b[s]=new Array),void 0===b[a]&&(b[a]=new Array)),void 0===b[s][a]&&void 0===b[a][s]){b[s][a]=[],m.x=(i[3*a]-i[3*s])/c,m.y=(i[3*a+1]-i[3*s+1])/c,m.z=(i[3*a+2]-i[3*s+2])/c,g.x=(o[3*a]-o[3*s])/c,g.y=(o[3*a+1]-o[3*s+1])/c,g.z=(o[3*a+2]-o[3*s+2])/c,_.x=(r[2*a]-r[2*s])/c,_.y=(r[2*a+1]-r[2*s+1])/c,b[s][a].push(s);for(var S=1;S<c;S++)b[s][a].push(i.length/3),i[A]=i[3*s]+S*m.x,o[A++]=o[3*s]+S*g.x,i[A]=i[3*s+1]+S*m.y,o[A++]=o[3*s+1]+S*g.y,i[A]=i[3*s+2]+S*m.z,o[A++]=o[3*s+2]+S*g.z,r[M++]=r[2*s]+S*_.x,r[M++]=r[2*s+1]+S*_.y;b[s][a].push(a),b[a][s]=new Array,p=b[s][a].length;for(var E=0;E<p;E++)b[a][s][E]=b[s][a][p-1-E]}for(u[0][0]=n[f],u[1][0]=b[n[f]][n[f+1]][1],u[1][1]=b[n[f]][n[f+2]][1],S=2;S<c;S++)for(u[S][0]=b[n[f]][n[f+1]][S],u[S][S]=b[n[f]][n[f+2]][S],m.x=(i[3*u[S][S]]-i[3*u[S][0]])/S,m.y=(i[3*u[S][S]+1]-i[3*u[S][0]+1])/S,m.z=(i[3*u[S][S]+2]-i[3*u[S][0]+2])/S,g.x=(o[3*u[S][S]]-o[3*u[S][0]])/S,g.y=(o[3*u[S][S]+1]-o[3*u[S][0]+1])/S,g.z=(o[3*u[S][S]+2]-o[3*u[S][0]+2])/S,_.x=(r[2*u[S][S]]-r[2*u[S][0]])/S,_.y=(r[2*u[S][S]+1]-r[2*u[S][0]+1])/S,P=1;P<S;P++)u[S][P]=i.length/3,i[A]=i[3*u[S][0]]+P*m.x,o[A++]=o[3*u[S][0]]+P*g.x,i[A]=i[3*u[S][0]+1]+P*m.y,o[A++]=o[3*u[S][0]+1]+P*g.y,i[A]=i[3*u[S][0]+2]+P*m.z,o[A++]=o[3*u[S][0]+2]+P*g.z,r[M++]=r[2*u[S][0]]+P*_.x,r[M++]=r[2*u[S][0]+1]+P*_.y;for(u[c]=b[n[f+1]][n[f+2]],v.push(u[0][0],u[1][0],u[1][1]),S=1;S<c;S++){for(P=0;P<S;P++)v.push(u[S][P],u[S+1][P],u[S+1][P+1]),v.push(u[S][P],u[S+1][P+1],u[S][P+1]);v.push(u[S][P],u[S+1][P],u[S+1][P+1])}}t.indices=v,t.applyToMesh(this,this.isVertexBufferUpdatable(d.VertexBuffer.PositionKind))}},t.prototype.forceSharedVertices=function(){var e=h.VertexData.ExtractFromMesh(this),t=e.uvs,r=e.indices,n=e.positions,i=e.colors;if(void 0===r||void 0===n||null===r||null===n)T.Logger.Warn("VertexData contains empty entries");else{for(var o,s,a=new Array,l=new Array,c=new Array,u=new Array,f=new Array,p=0,m={},g=0;g<r.length;g+=3){s=[r[g],r[g+1],r[g+2]],f=new Array;for(var _=0;_<3;_++){f[_]="";for(var v=0;v<3;v++)Math.abs(n[3*s[_]+v])<1e-8&&(n[3*s[_]+v]=0),f[_]+=n[3*s[_]+v]+"|"}if(f[0]!=f[1]&&f[0]!=f[2]&&f[1]!=f[2])for(_=0;_<3;_++){if(void 0===(o=m[f[_]])){for(m[f[_]]=p,o=p++,v=0;v<3;v++)a.push(n[3*s[_]+v]);if(null!=i)for(v=0;v<4;v++)u.push(i[4*s[_]+v]);if(null!=t)for(v=0;v<2;v++)c.push(t[2*s[_]+v])}l.push(o)}}var y=new Array;h.VertexData.ComputeNormals(a,l,y),e.positions=a,e.indices=l,e.normals=y,null!=t&&(e.uvs=c),null!=i&&(e.colors=u),e.applyToMesh(this,this.isVertexBufferUpdatable(d.VertexBuffer.PositionKind))}},t._instancedMeshFactory=function(e,t){throw P._DevTools.WarnImport("InstancedMesh")},t._PhysicsImpostorParser=function(e,t,r){throw P._DevTools.WarnImport("PhysicsImpostor")},t.prototype.createInstance=function(e){var r=this.geometry;if(r&&r.meshes.length>1)for(var n=0,i=r.meshes.slice(0);n<i.length;n++){var o=i[n];o!==this&&o.makeGeometryUnique()}return t._instancedMeshFactory(e,this)},t.prototype.synchronizeInstances=function(){this._geometry&&1!==this._geometry.meshes.length&&this.instances.length&&this.makeGeometryUnique();for(var e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this},t.prototype.optimizeIndices=function(e){var t=this,r=this.getIndices(),n=this.getVerticesData(d.VertexBuffer.PositionKind);if(!n||!r)return this;for(var i=new Array,s=0;s<n.length;s+=3)i.push(l.Vector3.FromArray(n,s));var a=new Array;return o.AsyncLoop.SyncAsyncForLoop(i.length,40,(function(e){for(var t=i.length-1-e,r=i[t],n=0;n<t;++n){var o=i[n];if(r.equals(o)){a[t]=n;break}}}),(function(){for(var n=0;n<r.length;++n)r[n]=a[r[n]]||r[n];var i=t.subMeshes.slice(0);t.setIndices(r),t.subMeshes=i,e&&e(t)})),this},t.prototype.serialize=function(e){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),a.Tags&&a.Tags.HasTags(this)&&(e.tags=a.Tags.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.checkCollisions=this.checkCollisions,e.isBlocker=this.isBlocker,e.overrideMaterialSideOrientation=this.overrideMaterialSideOrientation,this.parent&&(e.parentId=this.parent.id),e.isUnIndexed=this.isUnIndexed;var t=this._geometry;if(t){var r=t.id;e.geometryId=r,e.subMeshes=[];for(var n=0;n<this.subMeshes.length;n++){var i=this.subMeshes[n];e.subMeshes.push({materialIndex:i.materialIndex,verticesStart:i.verticesStart,verticesCount:i.verticesCount,indexStart:i.indexStart,indexCount:i.indexCount})}}this.material?this.material.doNotSerialize||(e.materialId=this.material.id):this.material=null,this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id),this.getScene()._getComponent(S.SceneComponentConstants.NAME_PHYSICSENGINE)&&(l=this.getPhysicsImpostor())&&(e.physicsMass=l.getParam("mass"),e.physicsFriction=l.getParam("friction"),e.physicsRestitution=l.getParam("mass"),e.physicsImpostor=l.type),this.metadata&&(e.metadata=this.metadata),e.instances=[];for(var o=0;o<this.instances.length;o++){var s=this.instances[o];if(!s.doNotSerialize){var l,c={name:s.name,id:s.id,isPickable:s.isPickable,checkCollisions:s.checkCollisions,position:s.position.asArray(),scaling:s.scaling.asArray()};s.parent&&(c.parentId=s.parent.id),s.rotationQuaternion?c.rotationQuaternion=s.rotationQuaternion.asArray():s.rotation&&(c.rotation=s.rotation.asArray()),this.getScene()._getComponent(S.SceneComponentConstants.NAME_PHYSICSENGINE)&&(l=s.getPhysicsImpostor())&&(c.physicsMass=l.getParam("mass"),c.physicsFriction=l.getParam("friction"),c.physicsRestitution=l.getParam("mass"),c.physicsImpostor=l.type),s.metadata&&(c.metadata=s.metadata),e.instances.push(c),A.SerializationHelper.AppendSerializedAnimations(s,c),c.ranges=s.serializeAnimationRanges()}}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize},this._userThinInstanceBuffersStorage)){var u={data:{},sizes:{},strides:{}};for(var d in this._userThinInstanceBuffersStorage.data)u.data[d]=Array.from(this._userThinInstanceBuffersStorage.data[d]),u.sizes[d]=this._userThinInstanceBuffersStorage.sizes[d],u.strides[d]=this._userThinInstanceBuffersStorage.strides[d];e.thinInstances.userThinInstance=u}A.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name))},t.prototype._syncGeometryWithMorphTargetManager=function(){if(this.geometry){this._markSubMeshesAsAttributesDirty();var e=this._internalMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices())return T.Logger.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),void(this.morphTargetManager=null);for(var t=0;t<e.numInfluencers;t++){var r=e.getActiveTarget(t),n=r.getPositions();if(!n)return void T.Logger.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(d.VertexBuffer.PositionKind+t,n,!1,3);var i=r.getNormals();i&&this.geometry.setVerticesData(d.VertexBuffer.NormalKind+t,i,!1,3);var o=r.getTangents();o&&this.geometry.setVerticesData(d.VertexBuffer.TangentKind+t,o,!1,3);var s=r.getUVs();s&&this.geometry.setVerticesData(d.VertexBuffer.UVKind+"_"+t,s,!1,2)}}else for(t=0;this.geometry.isVerticesDataPresent(d.VertexBuffer.PositionKind+t);)this.geometry.removeVerticesData(d.VertexBuffer.PositionKind+t),this.geometry.isVerticesDataPresent(d.VertexBuffer.NormalKind+t)&&this.geometry.removeVerticesData(d.VertexBuffer.NormalKind+t),this.geometry.isVerticesDataPresent(d.VertexBuffer.TangentKind+t)&&this.geometry.removeVerticesData(d.VertexBuffer.TangentKind+t),this.geometry.isVerticesDataPresent(d.VertexBuffer.UVKind+t)&&this.geometry.removeVerticesData(d.VertexBuffer.UVKind+"_"+t),t++}},t.Parse=function(e,r,n){var i;if((i=e.type&&"GroundMesh"===e.type?t._GroundMeshParser(e,r):new t(e.name,r)).id=e.id,a.Tags&&a.Tags.AddTagsTo(i,e.tags),i.position=l.Vector3.FromArray(e.position),void 0!==e.metadata&&(i.metadata=e.metadata),e.rotationQuaternion?i.rotationQuaternion=l.Quaternion.FromArray(e.rotationQuaternion):e.rotation&&(i.rotation=l.Vector3.FromArray(e.rotation)),i.scaling=l.Vector3.FromArray(e.scaling),e.localMatrix?i.setPreTransformMatrix(l.Matrix.FromArray(e.localMatrix)):e.pivotMatrix&&i.setPivotMatrix(l.Matrix.FromArray(e.pivotMatrix)),i.setEnabled(e.isEnabled),i.isVisible=e.isVisible,i.infiniteDistance=e.infiniteDistance,i.showBoundingBox=e.showBoundingBox,i.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,void 0!==e.applyFog&&(i.applyFog=e.applyFog),void 0!==e.pickable&&(i.isPickable=e.pickable),void 0!==e.alphaIndex&&(i.alphaIndex=e.alphaIndex),i.receiveShadows=e.receiveShadows,i.billboardMode=e.billboardMode,void 0!==e.visibility&&(i.visibility=e.visibility),i.checkCollisions=e.checkCollisions,i.overrideMaterialSideOrientation=e.overrideMaterialSideOrientation,void 0!==e.isBlocker&&(i.isBlocker=e.isBlocker),i._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(i._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),e.parentId&&(i._waitingParentId=e.parentId),void 0!==e.actions&&(i._waitingData.actions=e.actions),void 0!==e.overlayAlpha&&(i.overlayAlpha=e.overlayAlpha),void 0!==e.overlayColor&&(i.overlayColor=c.Color3.FromArray(e.overlayColor)),void 0!==e.renderOverlay&&(i.renderOverlay=e.renderOverlay),i.isUnIndexed=!!e.isUnIndexed,i.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(i.delayLoadState=b.Constants.DELAYLOADSTATE_NOTLOADED,i.delayLoadingFile=n+e.delayLoadingFile,i._boundingInfo=new g.BoundingInfo(l.Vector3.FromArray(e.boundingBoxMinimum),l.Vector3.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(i._binaryInfo=e._binaryInfo),i._delayInfo=[],e.hasUVs&&i._delayInfo.push(d.VertexBuffer.UVKind),e.hasUVs2&&i._delayInfo.push(d.VertexBuffer.UV2Kind),e.hasUVs3&&i._delayInfo.push(d.VertexBuffer.UV3Kind),e.hasUVs4&&i._delayInfo.push(d.VertexBuffer.UV4Kind),e.hasUVs5&&i._delayInfo.push(d.VertexBuffer.UV5Kind),e.hasUVs6&&i._delayInfo.push(d.VertexBuffer.UV6Kind),e.hasColors&&i._delayInfo.push(d.VertexBuffer.ColorKind),e.hasMatricesIndices&&i._delayInfo.push(d.VertexBuffer.MatricesIndicesKind),e.hasMatricesWeights&&i._delayInfo.push(d.VertexBuffer.MatricesWeightsKind),i._delayLoadingFunction=f.Geometry._ImportGeometry,y.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&i._checkDelayState()):f.Geometry._ImportGeometry(e,i),e.materialId?i.setMaterialByID(e.materialId):i.material=null,e.morphTargetManagerId>-1&&(i.morphTargetManager=r.getMorphTargetManagerById(e.morphTargetManagerId)),e.skeletonId>-1&&(i.skeleton=r.getLastSkeletonByID(e.skeletonId),e.numBoneInfluencers&&(i.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(var o=0;o<e.animations.length;o++){var s=e.animations[o];(_=M._TypeStore.GetClass("BABYLON.Animation"))&&i.animations.push(_.Parse(s))}u.Node.ParseAnimationRanges(i,e,r)}if(e.autoAnimate&&r.beginAnimation(i,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?i.layerMask=Math.abs(parseInt(e.layerMask)):i.layerMask=268435455,e.physicsImpostor&&t._PhysicsImpostorParser(r,i,e),e.lodMeshIds&&(i._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(var h=0;h<e.instances.length;h++){var p=e.instances[h],m=i.createInstance(p.name);if(p.id&&(m.id=p.id),a.Tags&&(p.tags?a.Tags.AddTagsTo(m,p.tags):a.Tags.AddTagsTo(m,e.tags)),m.position=l.Vector3.FromArray(p.position),void 0!==p.metadata&&(m.metadata=p.metadata),p.parentId&&(m._waitingParentId=p.parentId),void 0!==p.isPickable&&null!==p.isPickable&&(m.isPickable=p.isPickable),p.rotationQuaternion?m.rotationQuaternion=l.Quaternion.FromArray(p.rotationQuaternion):p.rotation&&(m.rotation=l.Vector3.FromArray(p.rotation)),m.scaling=l.Vector3.FromArray(p.scaling),null!=p.checkCollisions&&null!=p.checkCollisions&&(m.checkCollisions=p.checkCollisions),null!=p.pickable&&null!=p.pickable&&(m.isPickable=p.pickable),null!=p.showBoundingBox&&null!=p.showBoundingBox&&(m.showBoundingBox=p.showBoundingBox),null!=p.showSubMeshesBoundingBox&&null!=p.showSubMeshesBoundingBox&&(m.showSubMeshesBoundingBox=p.showSubMeshesBoundingBox),null!=p.alphaIndex&&null!=p.showSubMeshesBoundingBox&&(m.alphaIndex=p.alphaIndex),p.physicsImpostor&&t._PhysicsImpostorParser(r,m,p),p.animations){for(o=0;o<p.animations.length;o++){var _;s=p.animations[o],(_=M._TypeStore.GetClass("BABYLON.Animation"))&&m.animations.push(_.Parse(s))}u.Node.ParseAnimationRanges(m,p,r),p.autoAnimate&&r.beginAnimation(m,p.autoAnimateFrom,p.autoAnimateTo,p.autoAnimateLoop,p.autoAnimateSpeed||1)}}if(e.thinInstances){var v=e.thinInstances;if(v.matrixData?(i.thinInstanceSetBuffer("matrix",new Float32Array(v.matrixData),16,!1),i._thinInstanceDataStorage.matrixBufferSize=v.matrixBufferSize,i._thinInstanceDataStorage.instancesCount=v.instancesCount):i._thinInstanceDataStorage.matrixBufferSize=v.matrixBufferSize,e.thinInstances.userThinInstance){var A=e.thinInstances.userThinInstance;for(var T in A.data)i.thinInstanceSetBuffer(T,new Float32Array(A.data[T]),A.strides[T],!1),i._userThinInstanceBuffersStorage.sizes[T]=A.sizes[T]}}return i},t.CreateRibbon=function(e,t,r,n,i,o,s,a,l){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateDisc=function(e,t,r,n,i,o){throw void 0===n&&(n=null),P._DevTools.WarnImport("MeshBuilder")},t.CreateBox=function(e,t,r,n,i){throw void 0===r&&(r=null),P._DevTools.WarnImport("MeshBuilder")},t.CreateSphere=function(e,t,r,n,i,o){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateHemisphere=function(e,t,r,n){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateCylinder=function(e,t,r,n,i,o,s,a,l){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateTorus=function(e,t,r,n,i,o,s){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateTorusKnot=function(e,t,r,n,i,o,s,a,l,c){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateLines=function(e,t,r,n,i){throw void 0===r&&(r=null),void 0===n&&(n=!1),void 0===i&&(i=null),P._DevTools.WarnImport("MeshBuilder")},t.CreateDashedLines=function(e,t,r,n,i,o,s,a){throw void 0===o&&(o=null),P._DevTools.WarnImport("MeshBuilder")},t.CreatePolygon=function(e,t,r,n,i,o,s){throw void 0===s&&(s=earcut),P._DevTools.WarnImport("MeshBuilder")},t.ExtrudePolygon=function(e,t,r,n,i,o,s,a){throw void 0===a&&(a=earcut),P._DevTools.WarnImport("MeshBuilder")},t.ExtrudeShape=function(e,t,r,n,i,o,s,a,l,c){throw void 0===s&&(s=null),P._DevTools.WarnImport("MeshBuilder")},t.ExtrudeShapeCustom=function(e,t,r,n,i,o,s,a,l,c,u,d){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateLathe=function(e,t,r,n,i,o,s){throw P._DevTools.WarnImport("MeshBuilder")},t.CreatePlane=function(e,t,r,n,i){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateGround=function(e,t,r,n,i,o){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateTiledGround=function(e,t,r,n,i,o,s,a,l){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateGroundFromHeightMap=function(e,t,r,n,i,o,s,a,l,c,u){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateTube=function(e,t,r,n,i,o,s,a,l,c){throw P._DevTools.WarnImport("MeshBuilder")},t.CreatePolyhedron=function(e,t,r){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateIcoSphere=function(e,t,r){throw P._DevTools.WarnImport("MeshBuilder")},t.CreateDecal=function(e,t,r,n,i,o){throw P._DevTools.WarnImport("MeshBuilder")},t.prototype.setPositionsForCPUSkinning=function(){var e=this._internalMeshDataInfo;if(!e._sourcePositions){var t=this.getVerticesData(d.VertexBuffer.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(d.VertexBuffer.PositionKind)||this.setVerticesData(d.VertexBuffer.PositionKind,t,!0)}return e._sourcePositions},t.prototype.setNormalsForCPUSkinning=function(){var e=this._internalMeshDataInfo;if(!e._sourceNormals){var t=this.getVerticesData(d.VertexBuffer.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(d.VertexBuffer.NormalKind)||this.setVerticesData(d.VertexBuffer.NormalKind,t,!0)}return e._sourceNormals},t.prototype.applySkeleton=function(e){if(!this.geometry)return this;if(this.geometry._softwareSkinningFrameId==this.getScene().getFrameId())return this;if(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(d.VertexBuffer.PositionKind))return this;if(!this.isVerticesDataPresent(d.VertexBuffer.NormalKind))return this;if(!this.isVerticesDataPresent(d.VertexBuffer.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(d.VertexBuffer.MatricesWeightsKind))return this;var t=this._internalMeshDataInfo;if(!t._sourcePositions){var r=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=r}t._sourceNormals||this.setNormalsForCPUSkinning();var n=this.getVerticesData(d.VertexBuffer.PositionKind);if(!n)return this;n instanceof Float32Array||(n=new Float32Array(n));var i=this.getVerticesData(d.VertexBuffer.NormalKind);if(!i)return this;i instanceof Float32Array||(i=new Float32Array(i));var o=this.getVerticesData(d.VertexBuffer.MatricesIndicesKind),s=this.getVerticesData(d.VertexBuffer.MatricesWeightsKind);if(!s||!o)return this;for(var a,c=this.numBoneInfluencers>4,u=c?this.getVerticesData(d.VertexBuffer.MatricesIndicesExtraKind):null,h=c?this.getVerticesData(d.VertexBuffer.MatricesWeightsExtraKind):null,f=e.getTransformMatrices(this),p=l.Vector3.Zero(),m=new l.Matrix,g=new l.Matrix,_=0,v=0;v<n.length;v+=3,_+=4){var y;for(a=0;a<4;a++)(y=s[_+a])>0&&(l.Matrix.FromFloat32ArrayToRefScaled(f,Math.floor(16*o[_+a]),y,g),m.addToSelf(g));if(c)for(a=0;a<4;a++)(y=h[_+a])>0&&(l.Matrix.FromFloat32ArrayToRefScaled(f,Math.floor(16*u[_+a]),y,g),m.addToSelf(g));l.Vector3.TransformCoordinatesFromFloatsToRef(t._sourcePositions[v],t._sourcePositions[v+1],t._sourcePositions[v+2],m,p),p.toArray(n,v),l.Vector3.TransformNormalFromFloatsToRef(t._sourceNormals[v],t._sourceNormals[v+1],t._sourceNormals[v+2],m,p),p.toArray(i,v),m.reset()}return this.updateVerticesData(d.VertexBuffer.PositionKind,n),this.updateVerticesData(d.VertexBuffer.NormalKind,i),this},t.MinMax=function(e){var t=null,r=null;return e.forEach((function(e){var n=e.getBoundingInfo().boundingBox;t&&r?(t.minimizeInPlace(n.minimumWorld),r.maximizeInPlace(n.maximumWorld)):(t=n.minimumWorld,r=n.maximumWorld)})),t&&r?{min:t,max:r}:{min:l.Vector3.Zero(),max:l.Vector3.Zero()}},t.Center=function(e){var r=e instanceof Array?t.MinMax(e):e;return l.Vector3.Center(r.min,r.max)},t.MergeMeshes=function(e,r,n,i,o,s){var a;if(void 0===r&&(r=!0),!n){var l=0;for(a=0;a<e.length;a++)if(e[a]&&(l+=e[a].getTotalVertices())>=65536)return T.Logger.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}if(s){var c,u,d=null;o=!1}var f,p=new Array,g=new Array,_=null,y=new Array,b=null;for(a=0;a<e.length;a++)if(e[a]){var A=e[a];if(A.isAnInstance)return T.Logger.Warn("Cannot merge instance meshes."),null;var M=A.computeWorldMatrix(!0);if((f=h.VertexData.ExtractFromMesh(A,!0,!0)).transform(M),_?_.merge(f,n):(_=f,b=A),o&&y.push(A.getTotalIndices()),s)if(A.material){var P=A.material;if(P instanceof v.MultiMaterial){for(u=0;u<P.subMaterials.length;u++)p.indexOf(P.subMaterials[u])<0&&p.push(P.subMaterials[u]);for(c=0;c<A.subMeshes.length;c++)g.push(p.indexOf(P.subMaterials[A.subMeshes[c].materialIndex])),y.push(A.subMeshes[c].indexCount)}else for(p.indexOf(P)<0&&p.push(P),c=0;c<A.subMeshes.length;c++)g.push(p.indexOf(P)),y.push(A.subMeshes[c].indexCount)}else for(c=0;c<A.subMeshes.length;c++)g.push(0),y.push(A.subMeshes[c].indexCount)}if(b=b,i||(i=new t(b.name+"_merged",b.getScene())),_.applyToMesh(i),i.checkCollisions=b.checkCollisions,i.overrideMaterialSideOrientation=b.overrideMaterialSideOrientation,r)for(a=0;a<e.length;a++)e[a]&&e[a].dispose();if(o||s){i.releaseSubMeshes(),a=0;for(var S=0;a<y.length;)m.SubMesh.CreateFromIndices(0,S,y[a],i),S+=y[a],a++}if(s){for((d=new v.MultiMaterial(b.name+"_merged",b.getScene())).subMaterials=p,c=0;c<i.subMeshes.length;c++)i.subMeshes[c].materialIndex=g[c];i.material=d}else i.material=b.material;return i},t.prototype.addInstance=function(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)},t.prototype.removeInstance=function(e){var t=e._indexInSourceMeshInstanceArray;if(-1!=t){if(t!==this.instances.length-1){var r=this.instances[this.instances.length-1];this.instances[t]=r,r._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}},t.FRONTSIDE=h.VertexData.FRONTSIDE,t.BACKSIDE=h.VertexData.BACKSIDE,t.DOUBLESIDE=h.VertexData.DOUBLESIDE,t.DEFAULTSIDE=h.VertexData.DEFAULTSIDE,t.NO_CAP=0,t.CAP_START=1,t.CAP_END=2,t.CAP_ALL=3,t.NO_FLIP=0,t.FLIP_TILE=1,t.ROTATE_TILE=2,t.FLIP_ROW=3,t.ROTATE_ROW=4,t.FLIP_N_ROTATE_TILE=5,t.FLIP_N_ROTATE_ROW=6,t.CENTER=0,t.LEFT=1,t.RIGHT=2,t.TOP=3,t.BOTTOM=4,t._GroundMeshParser=function(e,t){throw P._DevTools.WarnImport("GroundMesh")},t}(p.AbstractMesh)},"./Meshes/mesh.vertexData.ts":
- /*!***********************************!*\
- !*** ./Meshes/mesh.vertexData.ts ***!
- \***********************************/
- /*! exports provided: VertexData */function(e,t,r){"use strict";r.r(t),r.d(t,"VertexData",(function(){return l}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=function(){function e(){}return e.prototype.set=function(e,t){switch(e.length||a.Logger.Warn("Setting vertex data kind '"+t+"' with an empty array"),t){case i.VertexBuffer.PositionKind:this.positions=e;break;case i.VertexBuffer.NormalKind:this.normals=e;break;case i.VertexBuffer.TangentKind:this.tangents=e;break;case i.VertexBuffer.UVKind:this.uvs=e;break;case i.VertexBuffer.UV2Kind:this.uvs2=e;break;case i.VertexBuffer.UV3Kind:this.uvs3=e;break;case i.VertexBuffer.UV4Kind:this.uvs4=e;break;case i.VertexBuffer.UV5Kind:this.uvs5=e;break;case i.VertexBuffer.UV6Kind:this.uvs6=e;break;case i.VertexBuffer.ColorKind:this.colors=e;break;case i.VertexBuffer.MatricesIndicesKind:this.matricesIndices=e;break;case i.VertexBuffer.MatricesWeightsKind:this.matricesWeights=e;break;case i.VertexBuffer.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case i.VertexBuffer.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}},e.prototype.applyToMesh=function(e,t){return this._applyTo(e,t),this},e.prototype.applyToGeometry=function(e,t){return this._applyTo(e,t),this},e.prototype.updateMesh=function(e){return this._update(e),this},e.prototype.updateGeometry=function(e){return this._update(e),this},e.prototype._applyTo=function(e,t){return void 0===t&&(t=!1),this.positions&&e.setVerticesData(i.VertexBuffer.PositionKind,this.positions,t),this.normals&&e.setVerticesData(i.VertexBuffer.NormalKind,this.normals,t),this.tangents&&e.setVerticesData(i.VertexBuffer.TangentKind,this.tangents,t),this.uvs&&e.setVerticesData(i.VertexBuffer.UVKind,this.uvs,t),this.uvs2&&e.setVerticesData(i.VertexBuffer.UV2Kind,this.uvs2,t),this.uvs3&&e.setVerticesData(i.VertexBuffer.UV3Kind,this.uvs3,t),this.uvs4&&e.setVerticesData(i.VertexBuffer.UV4Kind,this.uvs4,t),this.uvs5&&e.setVerticesData(i.VertexBuffer.UV5Kind,this.uvs5,t),this.uvs6&&e.setVerticesData(i.VertexBuffer.UV6Kind,this.uvs6,t),this.colors&&e.setVerticesData(i.VertexBuffer.ColorKind,this.colors,t),this.matricesIndices&&e.setVerticesData(i.VertexBuffer.MatricesIndicesKind,this.matricesIndices,t),this.matricesWeights&&e.setVerticesData(i.VertexBuffer.MatricesWeightsKind,this.matricesWeights,t),this.matricesIndicesExtra&&e.setVerticesData(i.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),this.matricesWeightsExtra&&e.setVerticesData(i.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),this.indices?e.setIndices(this.indices,null,t):e.setIndices([],null),this},e.prototype._update=function(e,t,r){return this.positions&&e.updateVerticesData(i.VertexBuffer.PositionKind,this.positions,t,r),this.normals&&e.updateVerticesData(i.VertexBuffer.NormalKind,this.normals,t,r),this.tangents&&e.updateVerticesData(i.VertexBuffer.TangentKind,this.tangents,t,r),this.uvs&&e.updateVerticesData(i.VertexBuffer.UVKind,this.uvs,t,r),this.uvs2&&e.updateVerticesData(i.VertexBuffer.UV2Kind,this.uvs2,t,r),this.uvs3&&e.updateVerticesData(i.VertexBuffer.UV3Kind,this.uvs3,t,r),this.uvs4&&e.updateVerticesData(i.VertexBuffer.UV4Kind,this.uvs4,t,r),this.uvs5&&e.updateVerticesData(i.VertexBuffer.UV5Kind,this.uvs5,t,r),this.uvs6&&e.updateVerticesData(i.VertexBuffer.UV6Kind,this.uvs6,t,r),this.colors&&e.updateVerticesData(i.VertexBuffer.ColorKind,this.colors,t,r),this.matricesIndices&&e.updateVerticesData(i.VertexBuffer.MatricesIndicesKind,this.matricesIndices,t,r),this.matricesWeights&&e.updateVerticesData(i.VertexBuffer.MatricesWeightsKind,this.matricesWeights,t,r),this.matricesIndicesExtra&&e.updateVerticesData(i.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,r),this.matricesWeightsExtra&&e.updateVerticesData(i.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,r),this.indices&&e.setIndices(this.indices,null),this},e.prototype.transform=function(e){var t,r=e.m[0]*e.m[5]*e.m[10]<0,i=n.Vector3.Zero();if(this.positions){var o=n.Vector3.Zero();for(t=0;t<this.positions.length;t+=3)n.Vector3.FromArrayToRef(this.positions,t,o),n.Vector3.TransformCoordinatesToRef(o,e,i),this.positions[t]=i.x,this.positions[t+1]=i.y,this.positions[t+2]=i.z}if(this.normals){var s=n.Vector3.Zero();for(t=0;t<this.normals.length;t+=3)n.Vector3.FromArrayToRef(this.normals,t,s),n.Vector3.TransformNormalToRef(s,e,i),this.normals[t]=i.x,this.normals[t+1]=i.y,this.normals[t+2]=i.z}if(this.tangents){var a=n.Vector4.Zero(),l=n.Vector4.Zero();for(t=0;t<this.tangents.length;t+=4)n.Vector4.FromArrayToRef(this.tangents,t,a),n.Vector4.TransformNormalToRef(a,e,l),this.tangents[t]=l.x,this.tangents[t+1]=l.y,this.tangents[t+2]=l.z,this.tangents[t+3]=l.w}if(r&&this.indices)for(t=0;t<this.indices.length;t+=3){var c=this.indices[t+1];this.indices[t+1]=this.indices[t+2],this.indices[t+2]=c}return this},e.prototype.merge=function(e,t){if(void 0===t&&(t=!1),this._validate(),e._validate(),!this.normals!=!e.normals||!this.tangents!=!e.tangents||!this.uvs!=!e.uvs||!this.uvs2!=!e.uvs2||!this.uvs3!=!e.uvs3||!this.uvs4!=!e.uvs4||!this.uvs5!=!e.uvs5||!this.uvs6!=!e.uvs6||!this.colors!=!e.colors||!this.matricesIndices!=!e.matricesIndices||!this.matricesWeights!=!e.matricesWeights||!this.matricesIndicesExtra!=!e.matricesIndicesExtra||!this.matricesWeightsExtra!=!e.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes");if(e.indices){this.indices||(this.indices=[]);var r=this.positions?this.positions.length/3:0;if(void 0!==this.indices.BYTES_PER_ELEMENT){var n=this.indices.length+e.indices.length,i=t||this.indices instanceof Uint32Array?new Uint32Array(n):new Uint16Array(n);i.set(this.indices);for(var o=this.indices.length,s=0;s<e.indices.length;s++)i[o+s]=e.indices[s]+r;this.indices=i}else for(s=0;s<e.indices.length;s++)this.indices.push(e.indices[s]+r)}return this.positions=this._mergeElement(this.positions,e.positions),this.normals=this._mergeElement(this.normals,e.normals),this.tangents=this._mergeElement(this.tangents,e.tangents),this.uvs=this._mergeElement(this.uvs,e.uvs),this.uvs2=this._mergeElement(this.uvs2,e.uvs2),this.uvs3=this._mergeElement(this.uvs3,e.uvs3),this.uvs4=this._mergeElement(this.uvs4,e.uvs4),this.uvs5=this._mergeElement(this.uvs5,e.uvs5),this.uvs6=this._mergeElement(this.uvs6,e.uvs6),this.colors=this._mergeElement(this.colors,e.colors),this.matricesIndices=this._mergeElement(this.matricesIndices,e.matricesIndices),this.matricesWeights=this._mergeElement(this.matricesWeights,e.matricesWeights),this.matricesIndicesExtra=this._mergeElement(this.matricesIndicesExtra,e.matricesIndicesExtra),this.matricesWeightsExtra=this._mergeElement(this.matricesWeightsExtra,e.matricesWeightsExtra),this},e.prototype._mergeElement=function(e,t){if(!e)return t;if(!t)return e;var r=t.length+e.length,n=e instanceof Float32Array,i=t instanceof Float32Array;if(n){var o=new Float32Array(r);return o.set(e),o.set(t,e.length),o}if(i){var s=e.slice(0),a=0;for(r=t.length;a<r;a++)s.push(t[a]);return s}return e.concat(t)},e.prototype._validate=function(){if(!this.positions)throw new Error("Positions are required");var e=function(e,t){var r=i.VertexBuffer.DeduceStride(e);if(t.length%r!=0)throw new Error("The "+e+"s array count must be a multiple of "+r);return t.length/r},t=e(i.VertexBuffer.PositionKind,this.positions),r=function(r,n){var i=e(r,n);if(i!==t)throw new Error("The "+r+"s element count ("+i+") does not match the positions count ("+t+")")};this.normals&&r(i.VertexBuffer.NormalKind,this.normals),this.tangents&&r(i.VertexBuffer.TangentKind,this.tangents),this.uvs&&r(i.VertexBuffer.UVKind,this.uvs),this.uvs2&&r(i.VertexBuffer.UV2Kind,this.uvs2),this.uvs3&&r(i.VertexBuffer.UV3Kind,this.uvs3),this.uvs4&&r(i.VertexBuffer.UV4Kind,this.uvs4),this.uvs5&&r(i.VertexBuffer.UV5Kind,this.uvs5),this.uvs6&&r(i.VertexBuffer.UV6Kind,this.uvs6),this.colors&&r(i.VertexBuffer.ColorKind,this.colors),this.matricesIndices&&r(i.VertexBuffer.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&r(i.VertexBuffer.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&r(i.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&r(i.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra)},e.prototype.serialize=function(){var e=this.serialize();return this.positions&&(e.positions=this.positions),this.normals&&(e.normals=this.normals),this.tangents&&(e.tangents=this.tangents),this.uvs&&(e.uvs=this.uvs),this.uvs2&&(e.uvs2=this.uvs2),this.uvs3&&(e.uvs3=this.uvs3),this.uvs4&&(e.uvs4=this.uvs4),this.uvs5&&(e.uvs5=this.uvs5),this.uvs6&&(e.uvs6=this.uvs6),this.colors&&(e.colors=this.colors),this.matricesIndices&&(e.matricesIndices=this.matricesIndices,e.matricesIndices._isExpanded=!0),this.matricesWeights&&(e.matricesWeights=this.matricesWeights),this.matricesIndicesExtra&&(e.matricesIndicesExtra=this.matricesIndicesExtra,e.matricesIndicesExtra._isExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=this.matricesWeightsExtra),e.indices=this.indices,e},e.ExtractFromMesh=function(t,r,n){return e._ExtractFrom(t,r,n)},e.ExtractFromGeometry=function(t,r,n){return e._ExtractFrom(t,r,n)},e._ExtractFrom=function(t,r,n){var o=new e;return t.isVerticesDataPresent(i.VertexBuffer.PositionKind)&&(o.positions=t.getVerticesData(i.VertexBuffer.PositionKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.NormalKind)&&(o.normals=t.getVerticesData(i.VertexBuffer.NormalKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.TangentKind)&&(o.tangents=t.getVerticesData(i.VertexBuffer.TangentKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.UVKind)&&(o.uvs=t.getVerticesData(i.VertexBuffer.UVKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.UV2Kind)&&(o.uvs2=t.getVerticesData(i.VertexBuffer.UV2Kind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.UV3Kind)&&(o.uvs3=t.getVerticesData(i.VertexBuffer.UV3Kind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.UV4Kind)&&(o.uvs4=t.getVerticesData(i.VertexBuffer.UV4Kind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.UV5Kind)&&(o.uvs5=t.getVerticesData(i.VertexBuffer.UV5Kind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.UV6Kind)&&(o.uvs6=t.getVerticesData(i.VertexBuffer.UV6Kind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.ColorKind)&&(o.colors=t.getVerticesData(i.VertexBuffer.ColorKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.MatricesIndicesKind)&&(o.matricesIndices=t.getVerticesData(i.VertexBuffer.MatricesIndicesKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.MatricesWeightsKind)&&(o.matricesWeights=t.getVerticesData(i.VertexBuffer.MatricesWeightsKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.MatricesIndicesExtraKind)&&(o.matricesIndicesExtra=t.getVerticesData(i.VertexBuffer.MatricesIndicesExtraKind,r,n)),t.isVerticesDataPresent(i.VertexBuffer.MatricesWeightsExtraKind)&&(o.matricesWeightsExtra=t.getVerticesData(i.VertexBuffer.MatricesWeightsExtraKind,r,n)),o.indices=t.getIndices(r,n),o},e.CreateRibbon=function(e){throw o._DevTools.WarnImport("ribbonBuilder")},e.CreateBox=function(e){throw o._DevTools.WarnImport("boxBuilder")},e.CreateTiledBox=function(e){throw o._DevTools.WarnImport("tiledBoxBuilder")},e.CreateTiledPlane=function(e){throw o._DevTools.WarnImport("tiledPlaneBuilder")},e.CreateSphere=function(e){throw o._DevTools.WarnImport("sphereBuilder")},e.CreateCylinder=function(e){throw o._DevTools.WarnImport("cylinderBuilder")},e.CreateTorus=function(e){throw o._DevTools.WarnImport("torusBuilder")},e.CreateLineSystem=function(e){throw o._DevTools.WarnImport("linesBuilder")},e.CreateDashedLines=function(e){throw o._DevTools.WarnImport("linesBuilder")},e.CreateGround=function(e){throw o._DevTools.WarnImport("groundBuilder")},e.CreateTiledGround=function(e){throw o._DevTools.WarnImport("groundBuilder")},e.CreateGroundFromHeightMap=function(e){throw o._DevTools.WarnImport("groundBuilder")},e.CreatePlane=function(e){throw o._DevTools.WarnImport("planeBuilder")},e.CreateDisc=function(e){throw o._DevTools.WarnImport("discBuilder")},e.CreatePolygon=function(e,t,r,n,i,s,a){throw o._DevTools.WarnImport("polygonBuilder")},e.CreateIcoSphere=function(e){throw o._DevTools.WarnImport("icoSphereBuilder")},e.CreatePolyhedron=function(e){throw o._DevTools.WarnImport("polyhedronBuilder")},e.CreateTorusKnot=function(e){throw o._DevTools.WarnImport("torusKnotBuilder")},e.ComputeNormals=function(e,t,r,i){var o=0,s=0,a=0,l=0,c=0,u=0,d=0,h=0,f=0,p=0,m=0,g=0,_=0,v=0,y=0,b=0,A=0,T=0,M=0,P=0,S=!1,E=!1,C=!1,x=!1,R=1,O=0,I=null;if(i&&(S=!!i.facetNormals,E=!!i.facetPositions,C=!!i.facetPartitioning,R=!0===i.useRightHandedSystem?-1:1,O=i.ratio||0,x=!!i.depthSort,I=i.distanceTo,x)){void 0===I&&(I=n.Vector3.Zero());var D=i.depthSortedFacets}var B=0,N=0,L=0,w=0;if(C&&i&&i.bbSize){var F=0,V=0,k=0,U=0,z=0,G=0,j=0,H=0,W=0,X=0,Y=0,Q=0,K=0,q=0,Z=0,J=0,$=i.bbSize.x>i.bbSize.y?i.bbSize.x:i.bbSize.y;$=$>i.bbSize.z?$:i.bbSize.z,B=i.subDiv.X*O/i.bbSize.x,N=i.subDiv.Y*O/i.bbSize.y,L=i.subDiv.Z*O/i.bbSize.z,w=i.subDiv.max*i.subDiv.max,i.facetPartitioning.length=0}for(o=0;o<e.length;o++)r[o]=0;var ee=t.length/3|0;for(o=0;o<ee;o++){if(_=1+(g=3*t[3*o]),v=g+2,b=1+(y=3*t[3*o+1]),A=y+2,M=1+(T=3*t[3*o+2]),P=T+2,s=e[g]-e[y],a=e[_]-e[b],l=e[v]-e[A],c=e[T]-e[y],u=e[M]-e[b],h=R*(a*(d=e[P]-e[A])-l*u),f=R*(l*c-s*d),p=R*(s*u-a*c),h/=m=0===(m=Math.sqrt(h*h+f*f+p*p))?1:m,f/=m,p/=m,S&&i&&(i.facetNormals[o].x=h,i.facetNormals[o].y=f,i.facetNormals[o].z=p),E&&i&&(i.facetPositions[o].x=(e[g]+e[y]+e[T])/3,i.facetPositions[o].y=(e[_]+e[b]+e[M])/3,i.facetPositions[o].z=(e[v]+e[A]+e[P])/3),C&&i&&(F=Math.floor((i.facetPositions[o].x-i.bInfo.minimum.x*O)*B),V=Math.floor((i.facetPositions[o].y-i.bInfo.minimum.y*O)*N),k=Math.floor((i.facetPositions[o].z-i.bInfo.minimum.z*O)*L),U=Math.floor((e[g]-i.bInfo.minimum.x*O)*B),z=Math.floor((e[_]-i.bInfo.minimum.y*O)*N),G=Math.floor((e[v]-i.bInfo.minimum.z*O)*L),j=Math.floor((e[y]-i.bInfo.minimum.x*O)*B),H=Math.floor((e[b]-i.bInfo.minimum.y*O)*N),W=Math.floor((e[A]-i.bInfo.minimum.z*O)*L),X=Math.floor((e[T]-i.bInfo.minimum.x*O)*B),Y=Math.floor((e[M]-i.bInfo.minimum.y*O)*N),Q=Math.floor((e[P]-i.bInfo.minimum.z*O)*L),q=U+i.subDiv.max*z+w*G,Z=j+i.subDiv.max*H+w*W,J=X+i.subDiv.max*Y+w*Q,K=F+i.subDiv.max*V+w*k,i.facetPartitioning[K]=i.facetPartitioning[K]?i.facetPartitioning[K]:new Array,i.facetPartitioning[q]=i.facetPartitioning[q]?i.facetPartitioning[q]:new Array,i.facetPartitioning[Z]=i.facetPartitioning[Z]?i.facetPartitioning[Z]:new Array,i.facetPartitioning[J]=i.facetPartitioning[J]?i.facetPartitioning[J]:new Array,i.facetPartitioning[q].push(o),Z!=q&&i.facetPartitioning[Z].push(o),J!=Z&&J!=q&&i.facetPartitioning[J].push(o),K!=q&&K!=Z&&K!=J&&i.facetPartitioning[K].push(o)),x&&i&&i.facetPositions){var te=D[o];te.ind=3*o,te.sqDistance=n.Vector3.DistanceSquared(i.facetPositions[o],I)}r[g]+=h,r[_]+=f,r[v]+=p,r[y]+=h,r[b]+=f,r[A]+=p,r[T]+=h,r[M]+=f,r[P]+=p}for(o=0;o<r.length/3;o++)h=r[3*o],f=r[3*o+1],p=r[3*o+2],h/=m=0===(m=Math.sqrt(h*h+f*f+p*p))?1:m,f/=m,p/=m,r[3*o]=h,r[3*o+1]=f,r[3*o+2]=p},e._ComputeSides=function(t,r,i,o,s,a,l){var c,u,d=i.length,h=o.length;switch(t=t||e.DEFAULTSIDE){case e.FRONTSIDE:break;case e.BACKSIDE:var f;for(c=0;c<d;c+=3)f=i[c],i[c]=i[c+2],i[c+2]=f;for(u=0;u<h;u++)o[u]=-o[u];break;case e.DOUBLESIDE:for(var p=r.length,m=p/3,g=0;g<p;g++)r[p+g]=r[g];for(c=0;c<d;c+=3)i[c+d]=i[c+2]+m,i[c+1+d]=i[c+1]+m,i[c+2+d]=i[c]+m;for(u=0;u<h;u++)o[h+u]=-o[u];var _=s.length,v=0;for(v=0;v<_;v++)s[v+_]=s[v];for(a=a||new n.Vector4(0,0,1,1),l=l||new n.Vector4(0,0,1,1),v=0,c=0;c<_/2;c++)s[v]=a.x+(a.z-a.x)*s[v],s[v+1]=a.y+(a.w-a.y)*s[v+1],s[v+_]=l.x+(l.z-l.x)*s[v+_],s[v+_+1]=l.y+(l.w-l.y)*s[v+_+1],v+=2}},e.ImportVertexData=function(t,r){var n=new e,o=t.positions;o&&n.set(o,i.VertexBuffer.PositionKind);var a=t.normals;a&&n.set(a,i.VertexBuffer.NormalKind);var l=t.tangents;l&&n.set(l,i.VertexBuffer.TangentKind);var c=t.uvs;c&&n.set(c,i.VertexBuffer.UVKind);var u=t.uv2s;u&&n.set(u,i.VertexBuffer.UV2Kind);var d=t.uv3s;d&&n.set(d,i.VertexBuffer.UV3Kind);var h=t.uv4s;h&&n.set(h,i.VertexBuffer.UV4Kind);var f=t.uv5s;f&&n.set(f,i.VertexBuffer.UV5Kind);var p=t.uv6s;p&&n.set(p,i.VertexBuffer.UV6Kind);var m=t.colors;m&&n.set(s.Color4.CheckColors4(m,o.length/3),i.VertexBuffer.ColorKind);var g=t.matricesIndices;g&&n.set(g,i.VertexBuffer.MatricesIndicesKind);var _=t.matricesWeights;_&&n.set(_,i.VertexBuffer.MatricesWeightsKind);var v=t.indices;v&&(n.indices=v),r.setAllVerticesData(n,t.updatable)},e.FRONTSIDE=0,e.BACKSIDE=1,e.DOUBLESIDE=2,e.DEFAULTSIDE=0,e}()},"./Meshes/meshBuilder.ts":
- /*!*******************************!*\
- !*** ./Meshes/meshBuilder.ts ***!
- \*******************************/
- /*! exports provided: MeshBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"MeshBuilder",(function(){return T}));var n=r(/*! ./Builders/ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts"),i=r(/*! ./Builders/discBuilder */"./Meshes/Builders/discBuilder.ts"),o=r(/*! ./Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),s=r(/*! ./Builders/tiledBoxBuilder */"./Meshes/Builders/tiledBoxBuilder.ts"),a=r(/*! ./Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),l=r(/*! ./Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),c=r(/*! ./Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),u=r(/*! ./Builders/torusKnotBuilder */"./Meshes/Builders/torusKnotBuilder.ts"),d=r(/*! ./Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),h=r(/*! ./Builders/polygonBuilder */"./Meshes/Builders/polygonBuilder.ts"),f=r(/*! ./Builders/shapeBuilder */"./Meshes/Builders/shapeBuilder.ts"),p=r(/*! ./Builders/latheBuilder */"./Meshes/Builders/latheBuilder.ts"),m=r(/*! ./Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),g=r(/*! ./Builders/tiledPlaneBuilder */"./Meshes/Builders/tiledPlaneBuilder.ts"),_=r(/*! ./Builders/groundBuilder */"./Meshes/Builders/groundBuilder.ts"),v=r(/*! ./Builders/tubeBuilder */"./Meshes/Builders/tubeBuilder.ts"),y=r(/*! ./Builders/polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts"),b=r(/*! ./Builders/icoSphereBuilder */"./Meshes/Builders/icoSphereBuilder.ts"),A=r(/*! ./Builders/decalBuilder */"./Meshes/Builders/decalBuilder.ts"),T=function(){function e(){}return e.CreateBox=function(e,t,r){return void 0===r&&(r=null),o.BoxBuilder.CreateBox(e,t,r)},e.CreateTiledBox=function(e,t,r){return void 0===r&&(r=null),s.TiledBoxBuilder.CreateTiledBox(e,t,r)},e.CreateSphere=function(e,t,r){return void 0===r&&(r=null),a.SphereBuilder.CreateSphere(e,t,r)},e.CreateDisc=function(e,t,r){return void 0===r&&(r=null),i.DiscBuilder.CreateDisc(e,t,r)},e.CreateIcoSphere=function(e,t,r){return void 0===r&&(r=null),b.IcoSphereBuilder.CreateIcoSphere(e,t,r)},e.CreateRibbon=function(e,t,r){return void 0===r&&(r=null),n.RibbonBuilder.CreateRibbon(e,t,r)},e.CreateCylinder=function(e,t,r){return void 0===r&&(r=null),l.CylinderBuilder.CreateCylinder(e,t,r)},e.CreateTorus=function(e,t,r){return void 0===r&&(r=null),c.TorusBuilder.CreateTorus(e,t,r)},e.CreateTorusKnot=function(e,t,r){return void 0===r&&(r=null),u.TorusKnotBuilder.CreateTorusKnot(e,t,r)},e.CreateLineSystem=function(e,t,r){return d.LinesBuilder.CreateLineSystem(e,t,r)},e.CreateLines=function(e,t,r){return void 0===r&&(r=null),d.LinesBuilder.CreateLines(e,t,r)},e.CreateDashedLines=function(e,t,r){return void 0===r&&(r=null),d.LinesBuilder.CreateDashedLines(e,t,r)},e.ExtrudeShape=function(e,t,r){return void 0===r&&(r=null),f.ShapeBuilder.ExtrudeShape(e,t,r)},e.ExtrudeShapeCustom=function(e,t,r){return void 0===r&&(r=null),f.ShapeBuilder.ExtrudeShapeCustom(e,t,r)},e.CreateLathe=function(e,t,r){return void 0===r&&(r=null),p.LatheBuilder.CreateLathe(e,t,r)},e.CreateTiledPlane=function(e,t,r){return void 0===r&&(r=null),g.TiledPlaneBuilder.CreateTiledPlane(e,t,r)},e.CreatePlane=function(e,t,r){return void 0===r&&(r=null),m.PlaneBuilder.CreatePlane(e,t,r)},e.CreateGround=function(e,t,r){return void 0===r&&(r=null),_.GroundBuilder.CreateGround(e,t,r)},e.CreateTiledGround=function(e,t,r){return void 0===r&&(r=null),_.GroundBuilder.CreateTiledGround(e,t,r)},e.CreateGroundFromHeightMap=function(e,t,r,n){return void 0===n&&(n=null),_.GroundBuilder.CreateGroundFromHeightMap(e,t,r,n)},e.CreatePolygon=function(e,t,r,n){return void 0===r&&(r=null),void 0===n&&(n=earcut),h.PolygonBuilder.CreatePolygon(e,t,r,n)},e.ExtrudePolygon=function(e,t,r,n){return void 0===r&&(r=null),void 0===n&&(n=earcut),h.PolygonBuilder.ExtrudePolygon(e,t,r,n)},e.CreateTube=function(e,t,r){return void 0===r&&(r=null),v.TubeBuilder.CreateTube(e,t,r)},e.CreatePolyhedron=function(e,t,r){return void 0===r&&(r=null),y.PolyhedronBuilder.CreatePolyhedron(e,t,r)},e.CreateDecal=function(e,t,r){return A.DecalBuilder.CreateDecal(e,t,r)},e}()},"./Meshes/meshLODLevel.ts":
- /*!********************************!*\
- !*** ./Meshes/meshLODLevel.ts ***!
- \********************************/
- /*! exports provided: MeshLODLevel */function(e,t,r){"use strict";r.r(t),r.d(t,"MeshLODLevel",(function(){return n}));var n=function(e,t){this.distance=e,this.mesh=t}},"./Meshes/meshSimplification.ts":
- /*!**************************************!*\
- !*** ./Meshes/meshSimplification.ts ***!
- \**************************************/
- /*! exports provided: SimplificationSettings, SimplificationQueue, SimplificationType, QuadraticErrorSimplification */function(e,t,r){"use strict";r.r(t),r.d(t,"SimplificationSettings",(function(){return u})),r.d(t,"SimplificationQueue",(function(){return d})),r.d(t,"SimplificationType",(function(){return n})),r.d(t,"QuadraticErrorSimplification",(function(){return g}));var n,i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Misc/tools */"./Misc/tools.ts"),c=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),u=function(e,t,r){this.quality=e,this.distance=t,this.optimizeMesh=r},d=function(){function e(){this.running=!1,this._simplificationArray=[]}return e.prototype.addTask=function(e){this._simplificationArray.push(e)},e.prototype.executeNext=function(){var e=this._simplificationArray.pop();e?(this.running=!0,this.runSimplification(e)):this.running=!1},e.prototype.runSimplification=function(e){var t=this;if(e.parallelProcessing)e.settings.forEach((function(r){t.getSimplifier(e).simplify(r,(function(n){e.mesh.addLODLevel(r.distance,n),n.isVisible=!0,r.quality===e.settings[e.settings.length-1].quality&&e.successCallback&&e.successCallback(),t.executeNext()}))}));else{var r=this.getSimplifier(e);l.AsyncLoop.Run(e.settings.length,(function(t){var n,i;n=e.settings[t.index],i=function(){t.executeNext()},r.simplify(n,(function(t){e.mesh.addLODLevel(n.distance,t),t.isVisible=!0,i()}))}),(function(){e.successCallback&&e.successCallback(),t.executeNext()}))}},e.prototype.getSimplifier=function(e){switch(e.simplificationType){case n.QUADRATIC:default:return new g(e.mesh)}},e}();!function(e){e[e.QUADRATIC=0]="QUADRATIC"}(n||(n={}));var h=function(e){this.vertices=e,this.error=new Array(4),this.deleted=!1,this.isDirty=!1,this.deletePending=!1,this.borderFactor=0},f=function(){function e(e,t){this.position=e,this.id=t,this.isBorder=!0,this.q=new p,this.triangleCount=0,this.triangleStart=0,this.originalOffsets=[]}return e.prototype.updatePosition=function(e){this.position.copyFrom(e)},e}(),p=function(){function e(e){this.data=new Array(10);for(var t=0;t<10;++t)e&&e[t]?this.data[t]=e[t]:this.data[t]=0}return e.prototype.det=function(e,t,r,n,i,o,s,a,l){return this.data[e]*this.data[i]*this.data[l]+this.data[r]*this.data[n]*this.data[a]+this.data[t]*this.data[o]*this.data[s]-this.data[r]*this.data[i]*this.data[s]-this.data[e]*this.data[o]*this.data[a]-this.data[t]*this.data[n]*this.data[l]},e.prototype.addInPlace=function(e){for(var t=0;t<10;++t)this.data[t]+=e.data[t]},e.prototype.addArrayInPlace=function(e){for(var t=0;t<10;++t)this.data[t]+=e[t]},e.prototype.add=function(t){for(var r=new e,n=0;n<10;++n)r.data[n]=this.data[n]+t.data[n];return r},e.FromData=function(t,r,n,i){return new e(e.DataFromNumbers(t,r,n,i))},e.DataFromNumbers=function(e,t,r,n){return[e*e,e*t,e*r,e*n,t*t,t*r,t*n,r*r,r*n,n*n]},e}(),m=function(e,t){this.vertexId=e,this.triangleId=t},g=function(){function e(e){this._mesh=e,this.syncIterations=5e3,this.aggressiveness=7,this.decimationIterations=100,this.boundingBoxEpsilon=c.Epsilon}return e.prototype.simplify=function(e,t){var r=this;this.initDecimatedMesh(),l.AsyncLoop.Run(this._mesh.subMeshes.length,(function(t){r.initWithMesh(t.index,(function(){r.runDecimation(e,t.index,(function(){t.executeNext()}))}),e.optimizeMesh)}),(function(){setTimeout((function(){t(r._reconstructedMesh)}),0)}))},e.prototype.runDecimation=function(e,t,r){var n=this,o=~~(this.triangles.length*e.quality),s=0,a=this.triangles.length;l.AsyncLoop.Run(this.decimationIterations,(function(e){var t,r;a-s<=o?e.breakLoop():(t=e.index,r=function(){e.executeNext()},setTimeout((function(){t%5==0&&n.updateMesh(0===t);for(var e=0;e<n.triangles.length;++e)n.triangles[e].isDirty=!1;var c=1e-9*Math.pow(t+3,n.aggressiveness);l.AsyncLoop.SyncAsyncForLoop(n.triangles.length,n.syncIterations,(function(e){var t=~~((n.triangles.length/2+e)%n.triangles.length),r=n.triangles[t];if(r&&!(r.error[3]>c||r.deleted||r.isDirty))for(var o=0;o<3;++o)if(r.error[o]<c){var a=[],l=[],u=r.vertices[o],d=r.vertices[(o+1)%3];if(u.isBorder||d.isBorder)continue;var h=i.Vector3.Zero();n.calculateError(u,d,h);var f=new Array;if(n.isFlipped(u,d,h,a,f))continue;if(n.isFlipped(d,u,h,l,f))continue;if(a.indexOf(!0)<0||l.indexOf(!0)<0)continue;var p=new Array;if(f.forEach((function(e){-1===p.indexOf(e)&&(e.deletePending=!0,p.push(e))})),p.length%2!=0)continue;u.q=d.q.add(u.q),u.updatePosition(h);var m=n.references.length;s=n.updateTriangles(u,u,a,s),s=n.updateTriangles(u,d,l,s);var g=n.references.length-m;if(g<=u.triangleCount){if(g)for(var _=0;_<g;_++)n.references[u.triangleStart+_]=n.references[m+_]}else u.triangleStart=m;u.triangleCount=g;break}}),r,(function(){return a-s<=o}))}),0))}),(function(){setTimeout((function(){n.reconstructMesh(t),r()}),0)}))},e.prototype.initWithMesh=function(e,t,r){var n=this;this.vertices=[],this.triangles=[];var s=this._mesh.getVerticesData(o.VertexBuffer.PositionKind),a=this._mesh.getIndices(),c=this._mesh.subMeshes[e],u=[],d=c.verticesCount;l.AsyncLoop.SyncAsyncForLoop(d,this.syncIterations/4>>0,(function(e){if(s){var t=e+c.verticesStart,o=i.Vector3.FromArray(s,3*t),a=function(e){if(r)for(var t=0;t<n.vertices.length;++t)if(n.vertices[t].position.equals(e))return n.vertices[t];return null}(o)||new f(o,n.vertices.length);a.originalOffsets.push(t),a.id===n.vertices.length&&n.vertices.push(a),u.push(a.id)}}),(function(){l.AsyncLoop.SyncAsyncForLoop(c.indexCount/3,n.syncIterations,(function(e){if(a){var t=3*(c.indexStart/3+e),r=a[t+0],i=a[t+1],o=a[t+2],s=n.vertices[u[r-c.verticesStart]],l=n.vertices[u[i-c.verticesStart]],d=n.vertices[u[o-c.verticesStart]],f=new h([s,l,d]);f.originalOffset=t,n.triangles.push(f)}}),(function(){n.init(t)}))}))},e.prototype.init=function(e){var t=this;l.AsyncLoop.SyncAsyncForLoop(this.triangles.length,this.syncIterations,(function(e){var r=t.triangles[e];r.normal=i.Vector3.Cross(r.vertices[1].position.subtract(r.vertices[0].position),r.vertices[2].position.subtract(r.vertices[0].position)).normalize();for(var n=0;n<3;n++)r.vertices[n].q.addArrayInPlace(p.DataFromNumbers(r.normal.x,r.normal.y,r.normal.z,-i.Vector3.Dot(r.normal,r.vertices[0].position)))}),(function(){l.AsyncLoop.SyncAsyncForLoop(t.triangles.length,t.syncIterations,(function(e){for(var r=t.triangles[e],n=0;n<3;++n)r.error[n]=t.calculateError(r.vertices[n],r.vertices[(n+1)%3]);r.error[3]=Math.min(r.error[0],r.error[1],r.error[2])}),(function(){e()}))}))},e.prototype.reconstructMesh=function(e){var t,r,n,i=[];for(t=0;t<this.vertices.length;++t)this.vertices[t].triangleCount=0;for(t=0;t<this.triangles.length;++t)if(!this.triangles[t].deleted){for(r=this.triangles[t],n=0;n<3;++n)r.vertices[n].triangleCount=1;i.push(r)}var a=this._reconstructedMesh.getVerticesData(o.VertexBuffer.PositionKind)||[],l=this._reconstructedMesh.getVerticesData(o.VertexBuffer.NormalKind)||[],c=this._reconstructedMesh.getVerticesData(o.VertexBuffer.UVKind)||[],u=this._reconstructedMesh.getVerticesData(o.VertexBuffer.ColorKind)||[],d=this._mesh.getVerticesData(o.VertexBuffer.NormalKind),h=this._mesh.getVerticesData(o.VertexBuffer.UVKind),f=this._mesh.getVerticesData(o.VertexBuffer.ColorKind),p=0;for(t=0;t<this.vertices.length;++t){var m=this.vertices[t];m.id=p,m.triangleCount&&m.originalOffsets.forEach((function(e){d&&(a.push(m.position.x),a.push(m.position.y),a.push(m.position.z),l.push(d[3*e]),l.push(d[3*e+1]),l.push(d[3*e+2]),h&&h.length&&(c.push(h[2*e]),c.push(h[2*e+1])),f&&f.length&&(u.push(f[4*e]),u.push(f[4*e+1]),u.push(f[4*e+2]),u.push(f[4*e+3])),++p)}))}var g=this._reconstructedMesh.getTotalIndices(),_=this._reconstructedMesh.getTotalVertices(),v=this._reconstructedMesh.subMeshes;this._reconstructedMesh.subMeshes=[];var y=this._reconstructedMesh.getIndices(),b=this._mesh.getIndices();for(t=0;t<i.length;++t)r=i[t],[0,1,2].forEach((function(e){var t=b[r.originalOffset+e],n=r.vertices[e].originalOffsets.indexOf(t);n<0&&(n=0),y.push(r.vertices[e].id+n+_)}));this._reconstructedMesh.setIndices(y),this._reconstructedMesh.setVerticesData(o.VertexBuffer.PositionKind,a),this._reconstructedMesh.setVerticesData(o.VertexBuffer.NormalKind,l),c.length>0&&this._reconstructedMesh.setVerticesData(o.VertexBuffer.UVKind,c),u.length>0&&this._reconstructedMesh.setVerticesData(o.VertexBuffer.ColorKind,u);var A=this._mesh.subMeshes[e];e>0&&(this._reconstructedMesh.subMeshes=[],v.forEach((function(e){s.SubMesh.AddToMesh(e.materialIndex,e.verticesStart,e.verticesCount,e.indexStart,e.indexCount,e.getMesh())})),s.SubMesh.AddToMesh(A.materialIndex,_,p,g,3*i.length,this._reconstructedMesh))},e.prototype.initDecimatedMesh=function(){this._reconstructedMesh=new a.Mesh(this._mesh.name+"Decimated",this._mesh.getScene()),this._reconstructedMesh.material=this._mesh.material,this._reconstructedMesh.parent=this._mesh.parent,this._reconstructedMesh.isVisible=!1,this._reconstructedMesh.renderingGroupId=this._mesh.renderingGroupId},e.prototype.isFlipped=function(e,t,r,n,o){for(var s=0;s<e.triangleCount;++s){var a=this.triangles[this.references[e.triangleStart+s].triangleId];if(!a.deleted){var l=this.references[e.triangleStart+s].vertexId,c=a.vertices[(l+1)%3],u=a.vertices[(l+2)%3];if(c!==t&&u!==t){var d=c.position.subtract(r);d=d.normalize();var h=u.position.subtract(r);if(h=h.normalize(),Math.abs(i.Vector3.Dot(d,h))>.999)return!0;var f=i.Vector3.Cross(d,h).normalize();if(n[s]=!1,i.Vector3.Dot(f,a.normal)<.2)return!0}else n[s]=!0,o.push(a)}}return!1},e.prototype.updateTriangles=function(e,t,r,n){for(var i=n,o=0;o<t.triangleCount;++o){var s=this.references[t.triangleStart+o],a=this.triangles[s.triangleId];a.deleted||(r[o]&&a.deletePending?(a.deleted=!0,i++):(a.vertices[s.vertexId]=e,a.isDirty=!0,a.error[0]=this.calculateError(a.vertices[0],a.vertices[1])+a.borderFactor/2,a.error[1]=this.calculateError(a.vertices[1],a.vertices[2])+a.borderFactor/2,a.error[2]=this.calculateError(a.vertices[2],a.vertices[0])+a.borderFactor/2,a.error[3]=Math.min(a.error[0],a.error[1],a.error[2]),this.references.push(s)))}return i},e.prototype.identifyBorder=function(){for(var e=0;e<this.vertices.length;++e){var t,r=[],n=[],i=this.vertices[e];for(t=0;t<i.triangleCount;++t)for(var o=this.triangles[this.references[i.triangleStart+t].triangleId],s=0;s<3;s++){for(var a=0,l=o.vertices[s];a<r.length&&n[a]!==l.id;)++a;a===r.length?(r.push(1),n.push(l.id)):r[a]++}for(t=0;t<r.length;++t)1===r[t]?this.vertices[n[t]].isBorder=!0:this.vertices[n[t]].isBorder=!1}},e.prototype.updateMesh=function(e){var t,r,n,i;if(void 0===e&&(e=!1),!e){var o=[];for(t=0;t<this.triangles.length;++t)this.triangles[t].deleted||o.push(this.triangles[t]);this.triangles=o}for(t=0;t<this.vertices.length;++t)this.vertices[t].triangleCount=0,this.vertices[t].triangleStart=0;for(t=0;t<this.triangles.length;++t)for(r=this.triangles[t],n=0;n<3;++n)(i=r.vertices[n]).triangleCount++;var s=0;for(t=0;t<this.vertices.length;++t)this.vertices[t].triangleStart=s,s+=this.vertices[t].triangleCount,this.vertices[t].triangleCount=0;var a=new Array(3*this.triangles.length);for(t=0;t<this.triangles.length;++t)for(r=this.triangles[t],n=0;n<3;++n)a[(i=r.vertices[n]).triangleStart+i.triangleCount]=new m(n,t),i.triangleCount++;this.references=a,e&&this.identifyBorder()},e.prototype.vertexError=function(e,t){var r=t.x,n=t.y,i=t.z;return e.data[0]*r*r+2*e.data[1]*r*n+2*e.data[2]*r*i+2*e.data[3]*r+e.data[4]*n*n+2*e.data[5]*n*i+2*e.data[6]*n+e.data[7]*i*i+2*e.data[8]*i+e.data[9]},e.prototype.calculateError=function(e,t,r){var n=e.q.add(t.q),o=e.isBorder&&t.isBorder,s=0,a=n.det(0,1,2,1,4,5,2,5,7);if(0===a||o){var l=e.position.add(t.position).divide(new i.Vector3(2,2,2)),c=this.vertexError(n,e.position),u=this.vertexError(n,t.position),d=this.vertexError(n,l);(s=Math.min(c,u,d))===c?r&&r.copyFrom(e.position):s===u?r&&r.copyFrom(t.position):r&&r.copyFrom(l)}else r||(r=i.Vector3.Zero()),r.x=-1/a*n.det(1,2,3,4,5,6,5,7,8),r.y=1/a*n.det(0,2,3,1,5,6,2,7,8),r.z=-1/a*n.det(0,1,3,1,4,6,2,5,8),s=this.vertexError(n,r);return s},e}()},"./Meshes/meshSimplificationSceneComponent.ts":
- /*!****************************************************!*\
- !*** ./Meshes/meshSimplificationSceneComponent.ts ***!
- \****************************************************/
- /*! exports provided: SimplicationQueueSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"SimplicationQueueSceneComponent",(function(){return a}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ./mesh */"./Meshes/mesh.ts"),o=r(/*! ./meshSimplification */"./Meshes/meshSimplification.ts"),s=r(/*! ../sceneComponent */"./sceneComponent.ts");Object.defineProperty(n.Scene.prototype,"simplificationQueue",{get:function(){if(!this._simplificationQueue){this._simplificationQueue=new o.SimplificationQueue;var e=this._getComponent(s.SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE);e||(e=new a(this),this._addComponent(e))}return this._simplificationQueue},set:function(e){this._simplificationQueue=e},enumerable:!0,configurable:!0}),i.Mesh.prototype.simplify=function(e,t,r,n){return void 0===t&&(t=!0),void 0===r&&(r=o.SimplificationType.QUADRATIC),this.getScene().simplificationQueue.addTask({settings:e,parallelProcessing:t,mesh:this,simplificationType:r,successCallback:n}),this};var a=function(){function e(e){this.name=s.SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE,this.scene=e}return e.prototype.register=function(){this.scene._beforeCameraUpdateStage.registerStep(s.SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE,this,this._beforeCameraUpdate)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._beforeCameraUpdate=function(){this.scene._simplificationQueue&&!this.scene._simplificationQueue.running&&this.scene._simplificationQueue.executeNext()},e}()},"./Meshes/polygonMesh.ts":
- /*!*******************************!*\
- !*** ./Meshes/polygonMesh.ts ***!
- \*******************************/
- /*! exports provided: Polygon, PolygonMeshBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"Polygon",(function(){return f})),r.d(t,"PolygonMeshBuilder",(function(){return p}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),c=r(/*! ../Engines/engine */"./Engines/engine.ts"),u=r(/*! ../Maths/math.path */"./Maths/math.path.ts"),d=function(e){function t(t,r){var n=e.call(this,t.x,t.y)||this;return n.index=r,n}return Object(n.__extends)(t,e),t}(o.Vector2),h=function(){function e(){this.elements=new Array}return e.prototype.add=function(e){var t=this,r=new Array;return e.forEach((function(e){if(0===r.length||!e.equalsWithEpsilon(r[0])){var n=new d(e,t.elements.length);r.push(n),t.elements.push(n)}})),r},e.prototype.computeBounds=function(){var e=new o.Vector2(this.elements[0].x,this.elements[0].y),t=new o.Vector2(this.elements[0].x,this.elements[0].y);return this.elements.forEach((function(r){r.x<e.x?e.x=r.x:r.x>t.x&&(t.x=r.x),r.y<e.y?e.y=r.y:r.y>t.y&&(t.y=r.y)})),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}},e}(),f=function(){function e(){}return e.Rectangle=function(e,t,r,n){return[new o.Vector2(e,t),new o.Vector2(r,t),new o.Vector2(r,n),new o.Vector2(e,n)]},e.Circle=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=32);for(var i=new Array,s=0,a=2*Math.PI/n,l=0;l<n;l++)i.push(new o.Vector2(t+Math.cos(s)*e,r+Math.sin(s)*e)),s-=a;return i},e.Parse=function(e){var t,r=e.split(/[^-+eE\.\d]+/).map(parseFloat).filter((function(e){return!isNaN(e)})),n=[];for(t=0;t<(2147483646&r.length);t+=2)n.push(new o.Vector2(r[t],r[t+1]));return n},e.StartingAt=function(e,t){return u.Path2.StartingAt(e,t)},e}(),p=function(){function e(e,t,r,n){var o;void 0===n&&(n=earcut),this._points=new h,this._outlinepoints=new h,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=n,this._name=e,this._scene=r||c.Engine.LastCreatedScene,o=t instanceof u.Path2?t.getPoints():t,this._addToepoint(o),this._points.add(o),this._outlinepoints.add(o),void 0===this.bjsEarcut&&i.Logger.Warn("Earcut was not found, the polygon will not be built.")}return e.prototype._addToepoint=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this._epoints.push(n.x,n.y)}},e.prototype.addHole=function(e){this._points.add(e);var t=new h;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this},e.prototype.build=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=0);var r=new a.Mesh(this._name,this._scene),n=this.buildVertexData(t);return r.setVerticesData(s.VertexBuffer.PositionKind,n.positions,e),r.setVerticesData(s.VertexBuffer.NormalKind,n.normals,e),r.setVerticesData(s.VertexBuffer.UVKind,n.uvs,e),r.setIndices(n.indices),r},e.prototype.buildVertexData=function(e){var t=this;void 0===e&&(e=0);var r=new l.VertexData,n=new Array,i=new Array,o=new Array,s=this._points.computeBounds();this._points.elements.forEach((function(e){n.push(0,1,0),i.push(e.x,0,e.y),o.push((e.x-s.min.x)/s.width,(e.y-s.min.y)/s.height)}));for(var a=new Array,c=this.bjsEarcut(this._epoints,this._eholes,2),u=0;u<c.length;u++)a.push(c[u]);if(e>0){var d=i.length/3;this._points.elements.forEach((function(t){n.push(0,-1,0),i.push(t.x,-e,t.y),o.push(1-(t.x-s.min.x)/s.width,1-(t.y-s.min.y)/s.height)}));var h=a.length;for(u=0;u<h;u+=3){var f=a[u+0],p=a[u+1],m=a[u+2];a.push(m+d),a.push(p+d),a.push(f+d)}this.addSide(i,n,o,a,s,this._outlinepoints,e,!1),this._holes.forEach((function(r){t.addSide(i,n,o,a,s,r,e,!0)}))}return r.indices=a,r.positions=i,r.normals=n,r.uvs=o,r},e.prototype.addSide=function(e,t,r,n,i,s,a,l){for(var c=e.length/3,u=0,d=0;d<s.elements.length;d++){var h,f=s.elements[d];h=d+1>s.elements.length-1?s.elements[0]:s.elements[d+1],e.push(f.x,0,f.y),e.push(f.x,-a,f.y),e.push(h.x,0,h.y),e.push(h.x,-a,h.y);var p=new o.Vector3(f.x,0,f.y),m=new o.Vector3(h.x,0,h.y).subtract(p),g=new o.Vector3(0,1,0),_=o.Vector3.Cross(m,g);_=_.normalize(),r.push(u/i.width,0),r.push(u/i.width,1),u+=m.length(),r.push(u/i.width,0),r.push(u/i.width,1),l?(t.push(_.x,_.y,_.z),t.push(_.x,_.y,_.z),t.push(_.x,_.y,_.z),t.push(_.x,_.y,_.z),n.push(c),n.push(c+2),n.push(c+1),n.push(c+1),n.push(c+2),n.push(c+3)):(t.push(-_.x,-_.y,-_.z),t.push(-_.x,-_.y,-_.z),t.push(-_.x,-_.y,-_.z),t.push(-_.x,-_.y,-_.z),n.push(c),n.push(c+1),n.push(c+2),n.push(c+1),n.push(c+3),n.push(c+2)),c+=4}},e}()},"./Meshes/subMesh.ts":
- /*!***************************!*\
- !*** ./Meshes/subMesh.ts ***!
- \***************************/
- /*! exports provided: SubMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"SubMesh",(function(){return l}));var n=r(/*! ./buffer */"./Meshes/buffer.ts"),i=r(/*! ../Collisions/intersectionInfo */"./Collisions/intersectionInfo.ts"),o=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../Maths/math.functions */"./Maths/math.functions.ts"),l=function(){function e(e,t,r,n,i,o,s,a,l){void 0===a&&(a=!0),void 0===l&&(l=!0),this.materialIndex=e,this.verticesStart=t,this.verticesCount=r,this.indexStart=n,this.indexCount=i,this._materialDefines=null,this._materialEffect=null,this._effectOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=o,this._renderingMesh=s||o,l&&o.subMeshes.push(this),this._trianglePlanes=[],this._id=o.subMeshes.length-1,a&&(this.refreshBoundingInfo(),o.computeWorldMatrix(!0))}return Object.defineProperty(e.prototype,"materialDefines",{get:function(){return this._materialDefines},set:function(e){this._materialDefines=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"effect",{get:function(){var e;return null!==(e=this._effectOverride)&&void 0!==e?e:this._materialEffect},enumerable:!1,configurable:!0}),e.prototype.setEffect=function(e,t){void 0===t&&(t=null),this._materialEffect!==e?(this._materialDefines=t,this._materialEffect=e):e||(this._materialDefines=null)},e.AddToMesh=function(t,r,n,i,o,s,a,l){return void 0===l&&(l=!0),new e(t,r,n,i,o,s,a,l)},Object.defineProperty(e.prototype,"IsGlobal",{get:function(){return 0===this.verticesStart&&this.verticesCount===this._mesh.getTotalVertices()},enumerable:!1,configurable:!0}),e.prototype.getBoundingInfo=function(){return this.IsGlobal?this._mesh.getBoundingInfo():this._boundingInfo},e.prototype.setBoundingInfo=function(e){return this._boundingInfo=e,this},e.prototype.getMesh=function(){return this._mesh},e.prototype.getRenderingMesh=function(){return this._renderingMesh},e.prototype.getReplacementMesh=function(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null},e.prototype.getEffectiveMesh=function(){var e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh},e.prototype.getMaterial=function(){var e=this._renderingMesh.material;if(null==e)return this._mesh.getScene().defaultMaterial;if(this._IsMultiMaterial(e)){var t=e.getSubMaterial(this.materialIndex);return this._currentMaterial!==t&&(this._currentMaterial=t,this._materialDefines=null),t}return e},e.prototype._IsMultiMaterial=function(e){return void 0!==e.getSubMaterial},e.prototype.refreshBoundingInfo=function(e){if(void 0===e&&(e=null),this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(n.VertexBuffer.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;var t,r=this._renderingMesh.getIndices();if(0===this.indexStart&&this.indexCount===r.length){var i=this._renderingMesh.getBoundingInfo();t={minimum:i.minimum.clone(),maximum:i.maximum.clone()}}else t=Object(a.extractMinAndMaxIndexed)(e,r,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(t.minimum,t.maximum):this._boundingInfo=new o.BoundingInfo(t.minimum,t.maximum),this},e.prototype._checkCollision=function(e){return this.getBoundingInfo()._checkCollision(e)},e.prototype.updateBoundingInfo=function(e){var t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this},e.prototype.isInFrustum=function(e){var t=this.getBoundingInfo();return!!t&&t.isInFrustum(e,this._mesh.cullingStrategy)},e.prototype.isCompletelyInFrustum=function(e){var t=this.getBoundingInfo();return!!t&&t.isCompletelyInFrustum(e)},e.prototype.render=function(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this},e.prototype._getLinesIndexBuffer=function(e,t){if(!this._linesIndexBuffer){for(var r=[],n=this.indexStart;n<this.indexStart+this.indexCount;n+=3)r.push(e[n],e[n+1],e[n+1],e[n+2],e[n+2],e[n]);this._linesIndexBuffer=t.createIndexBuffer(r),this._linesIndexCount=r.length}return this._linesIndexBuffer},e.prototype.canIntersects=function(e){var t=this.getBoundingInfo();return!!t&&e.intersectsBox(t.boundingBox)},e.prototype.intersects=function(e,t,r,n,i){var o=this.getMaterial();if(!o)return null;var a=3,l=!1;switch(o.fillMode){case s.Constants.MATERIAL_PointListDrawMode:case s.Constants.MATERIAL_LineListDrawMode:case s.Constants.MATERIAL_LineLoopDrawMode:case s.Constants.MATERIAL_LineStripDrawMode:case s.Constants.MATERIAL_TriangleFanDrawMode:return null;case s.Constants.MATERIAL_TriangleStripDrawMode:a=1,l=!0}return"InstancedLinesMesh"===this._mesh.getClassName()||"LinesMesh"===this._mesh.getClassName()?r.length?this._intersectLines(e,t,r,this._mesh.intersectionThreshold,n):this._intersectUnIndexedLines(e,t,r,this._mesh.intersectionThreshold,n):!r.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,r,n,i):this._intersectTriangles(e,t,r,a,l,n,i)},e.prototype._intersectLines=function(e,t,r,n,o){for(var s=null,a=this.indexStart;a<this.indexStart+this.indexCount;a+=2){var l=t[r[a]],c=t[r[a+1]],u=e.intersectionSegment(l,c,n);if(!(u<0)&&(o||!s||u<s.distance)&&((s=new i.IntersectionInfo(null,null,u)).faceId=a/2,o))break}return s},e.prototype._intersectUnIndexedLines=function(e,t,r,n,o){for(var s=null,a=this.verticesStart;a<this.verticesStart+this.verticesCount;a+=2){var l=t[a],c=t[a+1],u=e.intersectionSegment(l,c,n);if(!(u<0)&&(o||!s||u<s.distance)&&((s=new i.IntersectionInfo(null,null,u)).faceId=a/2,o))break}return s},e.prototype._intersectTriangles=function(e,t,r,n,i,o,s){for(var a=null,l=-1,c=this.indexStart;c<this.indexStart+this.indexCount;c+=n){l++;var u=r[c],d=r[c+1],h=r[c+2];if(i&&4294967295===h)c+=2;else{var f=t[u],p=t[d],m=t[h];if(!s||s(f,p,m,e)){var g=e.intersectsTriangle(f,p,m);if(g){if(g.distance<0)continue;if((o||!a||g.distance<a.distance)&&((a=g).faceId=l,o))break}}}}return a},e.prototype._intersectUnIndexedTriangles=function(e,t,r,n,i){for(var o=null,s=this.verticesStart;s<this.verticesStart+this.verticesCount;s+=3){var a=t[s],l=t[s+1],c=t[s+2];if(!i||i(a,l,c,e)){var u=e.intersectsTriangle(a,l,c);if(u){if(u.distance<0)continue;if((n||!o||u.distance<o.distance)&&((o=u).faceId=s/3,n))break}}}return o},e.prototype._rebuild=function(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)},e.prototype.clone=function(t,r){var n=new e(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,t,r,!1);if(!this.IsGlobal){var i=this.getBoundingInfo();if(!i)return n;n._boundingInfo=new o.BoundingInfo(i.minimum,i.maximum)}return n},e.prototype.dispose=function(){this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);var e=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(e,1)},e.prototype.getClassName=function(){return"SubMesh"},e.CreateFromIndices=function(t,r,n,i,o){for(var s=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=(o||i).getIndices(),c=r;c<r+n;c++){var u=l[c];u<s&&(s=u),u>a&&(a=u)}return new e(t,s,a-s+1,r,n,i,o)},e}()},"./Meshes/thinInstanceMesh.ts":
- /*!************************************!*\
- !*** ./Meshes/thinInstanceMesh.ts ***!
- \************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),i=r(/*! ./buffer */"./Meshes/buffer.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts");n.Mesh.prototype.thinInstanceAdd=function(e,t){void 0===t&&(t=!0),this._thinInstanceUpdateBufferSize("matrix",Array.isArray(e)?e.length:1);var r=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(e))for(var n=0;n<e.length;++n)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e[n],n===e.length-1&&t);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e,t);return r},n.Mesh.prototype.thinInstanceAddSelf=function(e){return void 0===e&&(e=!0),this.thinInstanceAdd(o.Matrix.IdentityReadOnly,e)},n.Mesh.prototype.thinInstanceRegisterAttribute=function(e,t){this.removeVerticesData(e),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[e]=t,this._userThinInstanceBuffersStorage.sizes[e]=t*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[e]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[e]),this._userThinInstanceBuffersStorage.vertexBuffers[e]=new i.VertexBuffer(this.getEngine(),this._userThinInstanceBuffersStorage.data[e],e,!0,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])},n.Mesh.prototype.thinInstanceSetMatrixAt=function(e,t,r){if(void 0===r&&(r=!0),!this._thinInstanceDataStorage.matrixData||e>=this._thinInstanceDataStorage.instancesCount)return!1;var n=this._thinInstanceDataStorage.matrixData;return t.copyToArray(n,16*e),r&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0},n.Mesh.prototype.thinInstanceSetAttributeAt=function(e,t,r,n){return void 0===n&&(n=!0),!(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[e]||t>=this._thinInstanceDataStorage.instancesCount||(this._thinInstanceUpdateBufferSize(e,0),this._userThinInstanceBuffersStorage.data[e].set(r,t*this._userThinInstanceBuffersStorage.strides[e]),n&&this.thinInstanceBufferUpdated(e),0))},Object.defineProperty(n.Mesh.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(e){var t,r;e<=(null!==(r=null===(t=this._thinInstanceDataStorage.matrixData)||void 0===t?void 0:t.length)&&void 0!==r?r:0)/16&&(this._thinInstanceDataStorage.instancesCount=e)},enumerable:!0,configurable:!0}),n.Mesh.prototype.thinInstanceSetBuffer=function(e,t,r,n){var o,s;if(void 0===r&&(r=0),void 0===n&&(n=!1),r=r||16,"matrix"===e)if(null===(o=this._thinInstanceDataStorage.matrixBuffer)||void 0===o||o.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=t?t.length:32*r,this._thinInstanceDataStorage.matrixData=t,null!==t){this._thinInstanceDataStorage.instancesCount=t.length/r;var a=new i.Buffer(this.getEngine(),t,!n,r,!1,!0);this._thinInstanceDataStorage.matrixBuffer=a,this.setVerticesBuffer(a.createVertexBuffer("world0",0,4)),this.setVerticesBuffer(a.createVertexBuffer("world1",4,4)),this.setVerticesBuffer(a.createVertexBuffer("world2",8,4)),this.setVerticesBuffer(a.createVertexBuffer("world3",12,4)),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)}else this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo(!0);else null===t?(null===(s=this._userThinInstanceBuffersStorage)||void 0===s?void 0:s.data[e])&&(this.removeVerticesData(e),delete this._userThinInstanceBuffersStorage.data[e],delete this._userThinInstanceBuffersStorage.strides[e],delete this._userThinInstanceBuffersStorage.sizes[e],delete this._userThinInstanceBuffersStorage.vertexBuffers[e]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[e]=t,this._userThinInstanceBuffersStorage.strides[e]=r,this._userThinInstanceBuffersStorage.sizes[e]=t.length,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new i.VertexBuffer(this.getEngine(),t,e,!n,!1,r,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))},n.Mesh.prototype.thinInstanceBufferUpdated=function(e){var t;"matrix"===e?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount):(null===(t=this._userThinInstanceBuffersStorage)||void 0===t?void 0:t.vertexBuffers[e])&&this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(this._userThinInstanceBuffersStorage.data[e],0)},n.Mesh.prototype.thinInstanceRefreshBoundingInfo=function(e){if(void 0===e&&(e=!1),this._thinInstanceDataStorage.matrixData&&this._thinInstanceDataStorage.matrixBuffer){var t=this._thinInstanceDataStorage.boundingVectors;e&&(t.length=0,this.refreshBoundingInfo(!0));var r=this.getBoundingInfo(),n=this._thinInstanceDataStorage.matrixData;if(0===t.length)for(var i=this.getWorldMatrix(),s=0;s<r.boundingBox.vectors.length;++s)t.push(r.boundingBox.vectors[s].clone()),o.Vector3.TransformCoordinatesToRef(t[s],i,t[s]);o.TmpVectors.Vector3[0].setAll(Number.MAX_VALUE),o.TmpVectors.Vector3[1].setAll(Number.MIN_VALUE);for(var a=0;a<this._thinInstanceDataStorage.instancesCount;++a)for(o.Matrix.FromArrayToRef(n,16*a,o.TmpVectors.Matrix[0]),s=0;s<t.length;++s)o.Vector3.TransformCoordinatesToRef(t[s],o.TmpVectors.Matrix[0],o.TmpVectors.Vector3[2]),o.TmpVectors.Vector3[0].minimizeInPlace(o.TmpVectors.Vector3[2]),o.TmpVectors.Vector3[1].maximizeInPlace(o.TmpVectors.Vector3[2]);r.reConstruct(o.TmpVectors.Vector3[0],o.TmpVectors.Vector3[1])}},n.Mesh.prototype._thinInstanceUpdateBufferSize=function(e,t){var r,n;void 0===t&&(t=1);var o="matrix"===e;if(o||this._userThinInstanceBuffersStorage&&this._userThinInstanceBuffersStorage.strides[e]){for(var s=o?16:this._userThinInstanceBuffersStorage.strides[e],a=o?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[e],l=o?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[e],c=(this._thinInstanceDataStorage.instancesCount+t)*s,u=a;u<c;)u*=2;if(!l||a!=u){if(l){var d=new Float32Array(u);d.set(l,0),l=d}else l=new Float32Array(u);if(o){null===(r=this._thinInstanceDataStorage.matrixBuffer)||void 0===r||r.dispose();var h=new i.Buffer(this.getEngine(),l,!0,s,!1,!0);this._thinInstanceDataStorage.matrixBuffer=h,this._thinInstanceDataStorage.matrixData=l,this._thinInstanceDataStorage.matrixBufferSize=u,this.setVerticesBuffer(h.createVertexBuffer("world0",0,4)),this.setVerticesBuffer(h.createVertexBuffer("world1",4,4)),this.setVerticesBuffer(h.createVertexBuffer("world2",8,4)),this.setVerticesBuffer(h.createVertexBuffer("world3",12,4))}else null===(n=this._userThinInstanceBuffersStorage.vertexBuffers[e])||void 0===n||n.dispose(),this._userThinInstanceBuffersStorage.data[e]=l,this._userThinInstanceBuffersStorage.sizes[e]=u,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new i.VertexBuffer(this.getEngine(),l,e,!0,!1,s,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])}}},n.Mesh.prototype._thinInstanceInitializeUserStorage=function(){this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})},n.Mesh.prototype._disposeThinInstanceSpecificData=function(){var e;(null===(e=this._thinInstanceDataStorage)||void 0===e?void 0:e.matrixBuffer)&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null)}},"./Meshes/trailMesh.ts":
- /*!*****************************!*\
- !*** ./Meshes/trailMesh.ts ***!
- \*****************************/
- /*! exports provided: TrailMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"TrailMesh",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),o=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),c=function(e){function t(t,r,n,i,o,a){void 0===i&&(i=1),void 0===o&&(o=60),void 0===a&&(a=!0);var l=e.call(this,t,n)||this;l._sectionPolygonPointsCount=4,l._running=!1,l._autoStart=a,l._generator=r,l._diameter=i,l._length=o,l._sectionVectors=[],l._sectionNormalVectors=[];for(var c=0;c<l._sectionPolygonPointsCount;c++)l._sectionVectors[c]=s.Vector3.Zero(),l._sectionNormalVectors[c]=s.Vector3.Zero();return l._createMesh(),l}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"TrailMesh"},t.prototype._createMesh=function(){var e=new l.VertexData,t=[],r=[],n=[],o=s.Vector3.Zero();o=this._generator instanceof i.AbstractMesh&&this._generator._boundingInfo?this._generator._boundingInfo.boundingBox.centerWorld:this._generator.position;for(var a=2*Math.PI/this._sectionPolygonPointsCount,c=0;c<this._sectionPolygonPointsCount;c++)t.push(o.x+Math.cos(c*a)*this._diameter,o.y+Math.sin(c*a)*this._diameter,o.z);for(c=1;c<=this._length;c++){for(var u=0;u<this._sectionPolygonPointsCount;u++)t.push(o.x+Math.cos(u*a)*this._diameter,o.y+Math.sin(u*a)*this._diameter,o.z);var d=t.length/3-2*this._sectionPolygonPointsCount;for(u=0;u<this._sectionPolygonPointsCount-1;u++)n.push(d+u,d+u+this._sectionPolygonPointsCount,d+u+this._sectionPolygonPointsCount+1),n.push(d+u,d+u+this._sectionPolygonPointsCount+1,d+u+1);n.push(d+this._sectionPolygonPointsCount-1,d+this._sectionPolygonPointsCount-1+this._sectionPolygonPointsCount,d+this._sectionPolygonPointsCount),n.push(d+this._sectionPolygonPointsCount-1,d+this._sectionPolygonPointsCount,d)}l.VertexData.ComputeNormals(t,n,r),e.positions=t,e.normals=r,e.indices=n,e.applyToMesh(this,!0),this._autoStart&&this.start()},t.prototype.start=function(){var e=this;this._running||(this._running=!0,this._beforeRenderObserver=this.getScene().onBeforeRenderObservable.add((function(){e.update()})))},t.prototype.stop=function(){this._beforeRenderObserver&&this._running&&(this._running=!1,this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver))},t.prototype.update=function(){var e=this.getVerticesData(a.VertexBuffer.PositionKind),t=this.getVerticesData(a.VertexBuffer.NormalKind),r=this._generator.getWorldMatrix();if(e&&t){for(var n=3*this._sectionPolygonPointsCount;n<e.length;n++)e[n-3*this._sectionPolygonPointsCount]=e[n]-t[n]/this._length*this._diameter;for(n=3*this._sectionPolygonPointsCount;n<t.length;n++)t[n-3*this._sectionPolygonPointsCount]=t[n];var i=e.length-3*this._sectionPolygonPointsCount,o=2*Math.PI/this._sectionPolygonPointsCount;for(n=0;n<this._sectionPolygonPointsCount;n++)this._sectionVectors[n].copyFromFloats(Math.cos(n*o)*this._diameter,Math.sin(n*o)*this._diameter,0),this._sectionNormalVectors[n].copyFromFloats(Math.cos(n*o),Math.sin(n*o),0),s.Vector3.TransformCoordinatesToRef(this._sectionVectors[n],r,this._sectionVectors[n]),s.Vector3.TransformNormalToRef(this._sectionNormalVectors[n],r,this._sectionNormalVectors[n]);for(n=0;n<this._sectionPolygonPointsCount;n++)e[i+3*n]=this._sectionVectors[n].x,e[i+3*n+1]=this._sectionVectors[n].y,e[i+3*n+2]=this._sectionVectors[n].z,t[i+3*n]=this._sectionNormalVectors[n].x,t[i+3*n+1]=this._sectionNormalVectors[n].y,t[i+3*n+2]=this._sectionNormalVectors[n].z;this.updateVerticesData(a.VertexBuffer.PositionKind,e,!0,!1),this.updateVerticesData(a.VertexBuffer.NormalKind,t,!0,!1)}},t.prototype.clone=function(e,r){return void 0===e&&(e=""),new t(e,void 0===r?this._generator:r,this.getScene(),this._diameter,this._length,this._autoStart)},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t)},t.Parse=function(e,r){return new t(e.name,e._generator,r,e._diameter,e._length,e._autoStart)},t}(o.Mesh)},"./Meshes/transformNode.ts":
- /*!*********************************!*\
- !*** ./Meshes/transformNode.ts ***!
- \*********************************/
- /*! exports provided: TransformNode */function(e,t,r){"use strict";r.r(t),r.d(t,"TransformNode",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../node */"./node.ts"),l=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),c=function(e){function t(r,n,i){void 0===n&&(n=null),void 0===i&&(i=!0);var a=e.call(this,r,n)||this;return a._forward=new s.Vector3(0,0,1),a._forwardInverted=new s.Vector3(0,0,-1),a._up=new s.Vector3(0,1,0),a._right=new s.Vector3(1,0,0),a._rightInverted=new s.Vector3(-1,0,0),a._position=s.Vector3.Zero(),a._rotation=s.Vector3.Zero(),a._rotationQuaternion=null,a._scaling=s.Vector3.One(),a._isDirty=!1,a._transformToBoneReferal=null,a._isAbsoluteSynced=!1,a._billboardMode=t.BILLBOARDMODE_NONE,a._preserveParentRotationForBillboard=!1,a.scalingDeterminant=1,a._infiniteDistance=!1,a.ignoreNonUniformScaling=!1,a.reIntegrateRotationIntoRotationQuaternion=!1,a._poseMatrix=null,a._localMatrix=s.Matrix.Zero(),a._usePivotMatrix=!1,a._absolutePosition=s.Vector3.Zero(),a._absoluteScaling=s.Vector3.Zero(),a._absoluteRotationQuaternion=s.Quaternion.Identity(),a._pivotMatrix=s.Matrix.Identity(),a._postMultiplyPivotMatrix=!1,a._isWorldMatrixFrozen=!1,a._indexInSceneTransformNodesArray=-1,a.onAfterWorldMatrixUpdateObservable=new o.Observable,a._nonUniformScaling=!1,i&&a.getScene().addTransformNode(a),a}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"billboardMode",{get:function(){return this._billboardMode},set:function(e){this._billboardMode!==e&&(this._billboardMode=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"preserveParentRotationForBillboard",{get:function(){return this._preserveParentRotationForBillboard},set:function(e){e!==this._preserveParentRotationForBillboard&&(this._preserveParentRotationForBillboard=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"infiniteDistance",{get:function(){return this._infiniteDistance},set:function(e){this._infiniteDistance!==e&&(this._infiniteDistance=e)},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"TransformNode"},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation=e,this._rotationQuaternion=null,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._rotationQuaternion},set:function(e){this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forward",{get:function(){return s.Vector3.Normalize(s.Vector3.TransformNormal(this.getScene().useRightHandedSystem?this._forwardInverted:this._forward,this.getWorldMatrix()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"up",{get:function(){return s.Vector3.Normalize(s.Vector3.TransformNormal(this._up,this.getWorldMatrix()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return s.Vector3.Normalize(s.Vector3.TransformNormal(this.getScene().useRightHandedSystem?this._rightInverted:this._right,this.getWorldMatrix()))},enumerable:!1,configurable:!0}),t.prototype.updatePoseMatrix=function(e){return this._poseMatrix?(this._poseMatrix.copyFrom(e),this):(this._poseMatrix=e.clone(),this)},t.prototype.getPoseMatrix=function(){return this._poseMatrix||(this._poseMatrix=s.Matrix.Identity()),this._poseMatrix},t.prototype._isSynchronized=function(){var e=this._cache;return!(this.billboardMode!==e.billboardMode||this.billboardMode!==t.BILLBOARDMODE_NONE||e.pivotMatrixUpdated||this.infiniteDistance||this.position._isDirty||this.scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this.rotation._isDirty)},t.prototype._initCache=function(){e.prototype._initCache.call(this);var t=this._cache;t.localMatrixUpdated=!1,t.billboardMode=-1,t.infiniteDistance=!1},t.prototype.markAsDirty=function(e){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this},Object.defineProperty(t.prototype,"absolutePosition",{get:function(){return this._absolutePosition},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"absoluteScaling",{get:function(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"absoluteRotationQuaternion",{get:function(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion},enumerable:!1,configurable:!0}),t.prototype.setPreTransformMatrix=function(e){return this.setPivotMatrix(e,!1)},t.prototype.setPivotMatrix=function(e,t){return void 0===t&&(t=!0),this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=s.Matrix.Invert(this._pivotMatrix)),this},t.prototype.getPivotMatrix=function(){return this._pivotMatrix},t.prototype.instantiateHierarchy=function(e,t,r){void 0===e&&(e=null);var n=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);n&&r&&r(this,n);for(var i=0,o=this.getChildTransformNodes(!0);i<o.length;i++)o[i].instantiateHierarchy(n,t,r);return n},t.prototype.freezeWorldMatrix=function(e){return void 0===e&&(e=null),e?this._worldMatrix=e:(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this},t.prototype.unfreezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this},Object.defineProperty(t.prototype,"isWorldMatrixFrozen",{get:function(){return this._isWorldMatrixFrozen},enumerable:!1,configurable:!0}),t.prototype.getAbsolutePosition=function(){return this.computeWorldMatrix(),this._absolutePosition},t.prototype.setAbsolutePosition=function(e){if(!e)return this;var t,r,n;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],r=arguments[1],n=arguments[2]}else t=e.x,r=e.y,n=e.z;if(this.parent){var i=s.TmpVectors.Matrix[0];this.parent.getWorldMatrix().invertToRef(i),s.Vector3.TransformCoordinatesFromFloatsToRef(t,r,n,i,this.position)}else this.position.x=t,this.position.y=r,this.position.z=n;return this._absolutePosition.copyFrom(e),this},t.prototype.setPositionWithLocalVector=function(e){return this.computeWorldMatrix(),this.position=s.Vector3.TransformNormal(e,this._localMatrix),this},t.prototype.getPositionExpressedInLocalSpace=function(){this.computeWorldMatrix();var e=s.TmpVectors.Matrix[0];return this._localMatrix.invertToRef(e),s.Vector3.TransformNormal(this.position,e)},t.prototype.locallyTranslate=function(e){return this.computeWorldMatrix(!0),this.position=s.Vector3.TransformCoordinates(e,this._localMatrix),this},t.prototype.lookAt=function(e,r,n,i,o){void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=l.Space.LOCAL);var a=t._lookAtVectorCache,c=o===l.Space.LOCAL?this.position:this.getAbsolutePosition();if(e.subtractToRef(c,a),this.setDirection(a,r,n,i),o===l.Space.WORLD&&this.parent)if(this.rotationQuaternion){var u=s.TmpVectors.Matrix[0];this.rotationQuaternion.toRotationMatrix(u);var d=s.TmpVectors.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(d),d.invert(),u.multiplyToRef(d,u),this.rotationQuaternion.fromRotationMatrix(u)}else{var h=s.TmpVectors.Quaternion[0];s.Quaternion.FromEulerVectorToRef(this.rotation,h),u=s.TmpVectors.Matrix[0],h.toRotationMatrix(u),d=s.TmpVectors.Matrix[1],this.parent.getWorldMatrix().getRotationMatrixToRef(d),d.invert(),u.multiplyToRef(d,u),h.fromRotationMatrix(u),h.toEulerAnglesToRef(this.rotation)}return this},t.prototype.getDirection=function(e){var t=s.Vector3.Zero();return this.getDirectionToRef(e,t),t},t.prototype.getDirectionToRef=function(e,t){return s.Vector3.TransformNormalToRef(e,this.getWorldMatrix(),t),this},t.prototype.setDirection=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0);var i=-Math.atan2(e.z,e.x)+Math.PI/2,o=Math.sqrt(e.x*e.x+e.z*e.z),a=-Math.atan2(e.y,o);return this.rotationQuaternion?s.Quaternion.RotationYawPitchRollToRef(i+t,a+r,n,this.rotationQuaternion):(this.rotation.x=a+r,this.rotation.y=i+t,this.rotation.z=n),this},t.prototype.setPivotPoint=function(e,t){void 0===t&&(t=l.Space.LOCAL),0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);var r=this.getWorldMatrix();if(t==l.Space.WORLD){var n=s.TmpVectors.Matrix[0];r.invertToRef(n),e=s.Vector3.TransformCoordinates(e,n)}return this.setPivotMatrix(s.Matrix.Translation(-e.x,-e.y,-e.z),!0)},t.prototype.getPivotPoint=function(){var e=s.Vector3.Zero();return this.getPivotPointToRef(e),e},t.prototype.getPivotPointToRef=function(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this},t.prototype.getAbsolutePivotPoint=function(){var e=s.Vector3.Zero();return this.getAbsolutePivotPointToRef(e),e},t.prototype.getAbsolutePivotPointToRef=function(e){return this.getPivotPointToRef(e),s.Vector3.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this},t.prototype.setParent=function(e){if(!e&&!this.parent)return this;var t=s.TmpVectors.Quaternion[0],r=s.TmpVectors.Vector3[0],n=s.TmpVectors.Vector3[1];if(e){var i=s.TmpVectors.Matrix[0],o=s.TmpVectors.Matrix[1];this.computeWorldMatrix(!0),e.computeWorldMatrix(!0),e.getWorldMatrix().invertToRef(o),this.getWorldMatrix().multiplyToRef(o,i),i.decompose(n,t,r)}else this.computeWorldMatrix(!0),this.getWorldMatrix().decompose(n,t,r);return this.rotationQuaternion?this.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(n),this.position.copyFrom(r),this.parent=e,this},Object.defineProperty(t.prototype,"nonUniformScaling",{get:function(){return this._nonUniformScaling},enumerable:!1,configurable:!0}),t.prototype._updateNonUniformScalingState=function(e){return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)},t.prototype.attachToBone=function(e,t){return this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(),e.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this},t.prototype.detachFromBone=function(){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,this.parent=null,this):this},t.prototype.rotate=function(e,r,n){var i;if(e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),n&&n!==l.Space.LOCAL){if(this.parent){var o=s.TmpVectors.Matrix[0];this.parent.getWorldMatrix().invertToRef(o),e=s.Vector3.TransformNormal(e,o)}(i=s.Quaternion.RotationAxisToRef(e,r,t._rotationAxisCache)).multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else i=s.Quaternion.RotationAxisToRef(e,r,t._rotationAxisCache),this.rotationQuaternion.multiplyToRef(i,this.rotationQuaternion);return this},t.prototype.rotateAround=function(e,t,r){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));var n=s.TmpVectors.Vector3[0],i=s.TmpVectors.Vector3[1],o=s.TmpVectors.Vector3[2],a=s.TmpVectors.Quaternion[0],l=s.TmpVectors.Matrix[0],c=s.TmpVectors.Matrix[1],u=s.TmpVectors.Matrix[2],d=s.TmpVectors.Matrix[3];return e.subtractToRef(this.position,n),s.Matrix.TranslationToRef(n.x,n.y,n.z,l),s.Matrix.TranslationToRef(-n.x,-n.y,-n.z,c),s.Matrix.RotationAxisToRef(t,r,u),c.multiplyToRef(u,d),d.multiplyToRef(l,d),d.decompose(i,a,o),this.position.addInPlace(o),a.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this},t.prototype.translate=function(e,t,r){var n=e.scale(t);if(r&&r!==l.Space.LOCAL)this.setAbsolutePosition(this.getAbsolutePosition().add(n));else{var i=this.getPositionExpressedInLocalSpace().add(n);this.setPositionWithLocalVector(i)}return this},t.prototype.addRotation=function(e,t,r){var n;this.rotationQuaternion?n=this.rotationQuaternion:(n=s.TmpVectors.Quaternion[1],s.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,n));var i=s.TmpVectors.Quaternion[0];return s.Quaternion.RotationYawPitchRollToRef(t,e,r,i),n.multiplyInPlace(i),this.rotationQuaternion||n.toEulerAnglesToRef(this.rotation),this},t.prototype._getEffectiveParent=function(){return this.parent},t.prototype.computeWorldMatrix=function(e){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;var r=this.getScene().getRenderId();if(!this._isDirty&&!e&&this.isSynchronized())return this._currentRenderId=r,this._worldMatrix;var n=this.getScene().activeCamera,i=0!=(this._billboardMode&t.BILLBOARDMODE_USE_POSITION),o=this._billboardMode!==t.BILLBOARDMODE_NONE&&!this.preserveParentRotationForBillboard;o&&n&&i&&(this.lookAt(n.position),(this.billboardMode&t.BILLBOARDMODE_X)!==t.BILLBOARDMODE_X&&(this.rotation.x=0),(this.billboardMode&t.BILLBOARDMODE_Y)!==t.BILLBOARDMODE_Y&&(this.rotation.y=0),(this.billboardMode&t.BILLBOARDMODE_Z)!==t.BILLBOARDMODE_Z&&(this.rotation.z=0)),this._updateCache();var a=this._cache;a.pivotMatrixUpdated=!1,a.billboardMode=this.billboardMode,a.infiniteDistance=this.infiniteDistance,this._currentRenderId=r,this._childUpdateId++,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;var l,c=this._getEffectiveParent(),u=t._TmpScaling,d=this._position;if(this._infiniteDistance&&!this.parent&&n){var h=n.getWorldMatrix(),f=new s.Vector3(h.m[12],h.m[13],h.m[14]);(d=t._TmpTranslation).copyFromFloats(this._position.x+f.x,this._position.y+f.y,this._position.z+f.z)}if(u.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant),this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,l=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(s.Quaternion.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(l=t._TmpRotation,s.Quaternion.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,l)),this._usePivotMatrix){var p=s.TmpVectors.Matrix[1];s.Matrix.ScalingToRef(u.x,u.y,u.z,p);var m=s.TmpVectors.Matrix[0];l.toRotationMatrix(m),this._pivotMatrix.multiplyToRef(p,s.TmpVectors.Matrix[4]),s.TmpVectors.Matrix[4].multiplyToRef(m,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(d.x,d.y,d.z)}else s.Matrix.ComposeToRef(u,l,d,this._localMatrix);if(c&&c.getWorldMatrix){if(e&&c.computeWorldMatrix(),o){this._transformToBoneReferal?c.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.TmpVectors.Matrix[7]):s.TmpVectors.Matrix[7].copyFrom(c.getWorldMatrix());var g=s.TmpVectors.Vector3[5],_=s.TmpVectors.Vector3[6];s.TmpVectors.Matrix[7].decompose(_,void 0,g),s.Matrix.ScalingToRef(_.x,_.y,_.z,s.TmpVectors.Matrix[7]),s.TmpVectors.Matrix[7].setTranslation(g),this._localMatrix.multiplyToRef(s.TmpVectors.Matrix[7],this._worldMatrix)}else this._transformToBoneReferal?(this._localMatrix.multiplyToRef(c.getWorldMatrix(),s.TmpVectors.Matrix[6]),s.TmpVectors.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)):this._localMatrix.multiplyToRef(c.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(o&&n&&this.billboardMode&&!i){var v=s.TmpVectors.Vector3[0];if(this._worldMatrix.getTranslationToRef(v),s.TmpVectors.Matrix[1].copyFrom(n.getViewMatrix()),s.TmpVectors.Matrix[1].setTranslationFromFloats(0,0,0),s.TmpVectors.Matrix[1].invertToRef(s.TmpVectors.Matrix[0]),(this.billboardMode&t.BILLBOARDMODE_ALL)!==t.BILLBOARDMODE_ALL){s.TmpVectors.Matrix[0].decompose(void 0,s.TmpVectors.Quaternion[0],void 0);var y=s.TmpVectors.Vector3[1];s.TmpVectors.Quaternion[0].toEulerAnglesToRef(y),(this.billboardMode&t.BILLBOARDMODE_X)!==t.BILLBOARDMODE_X&&(y.x=0),(this.billboardMode&t.BILLBOARDMODE_Y)!==t.BILLBOARDMODE_Y&&(y.y=0),(this.billboardMode&t.BILLBOARDMODE_Z)!==t.BILLBOARDMODE_Z&&(y.z=0),s.Matrix.RotationYawPitchRollToRef(y.y,y.x,y.z,s.TmpVectors.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(s.TmpVectors.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(s.TmpVectors.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):c&&c._nonUniformScaling?this._updateNonUniformScalingState(c._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=s.Matrix.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix},t.prototype.resetLocalMatrix=function(e){if(void 0===e&&(e=!0),this.computeWorldMatrix(),e)for(var t=this.getChildren(),r=0;r<t.length;++r){var n=t[r];if(n){n.computeWorldMatrix();var i=s.TmpVectors.Matrix[0];n._localMatrix.multiplyToRef(this._localMatrix,i);var o=s.TmpVectors.Quaternion[0];i.decompose(n.scaling,o,n.position),n.rotationQuaternion?n.rotationQuaternion=o:o.toEulerAnglesToRef(n.rotation)}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=s.Quaternion.Identity()),this._worldMatrix=s.Matrix.Identity()},t.prototype._afterComputeWorldMatrix=function(){},t.prototype.registerAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.add(e),this},t.prototype.unregisterAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this},t.prototype.getPositionInCameraSpace=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),s.Vector3.TransformCoordinates(this.getAbsolutePosition(),e.getViewMatrix())},t.prototype.getDistanceToCamera=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),this.getAbsolutePosition().subtract(e.globalPosition).length()},t.prototype.clone=function(e,r,n){var o=this,s=i.SerializationHelper.Clone((function(){return new t(e,o.getScene())}),this);if(s.name=e,s.id=e,r&&(s.parent=r),!n)for(var a=this.getDescendants(!0),l=0;l<a.length;l++){var c=a[l];c.clone&&c.clone(e+"."+c.name,s)}return s},t.prototype.serialize=function(e){var t=i.SerializationHelper.Serialize(this,e);return t.type=this.getClassName(),this.parent&&(t.parentId=this.parent.id),t.localMatrix=this.getPivotMatrix().asArray(),t.isEnabled=this.isEnabled(),this.parent&&(t.parentId=this.parent.id),t},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse((function(){return new t(e.name,r)}),e,r,n);return e.localMatrix?o.setPreTransformMatrix(s.Matrix.FromArray(e.localMatrix)):e.pivotMatrix&&o.setPivotMatrix(s.Matrix.FromArray(e.pivotMatrix)),o.setEnabled(e.isEnabled),e.parentId&&(o._waitingParentId=e.parentId),o},t.prototype.getChildTransformNodes=function(e,r){var n=[];return this._getDescendants(n,e,(function(e){return(!r||r(e))&&e instanceof t})),n},t.prototype.dispose=function(t,r){if(void 0===r&&(r=!1),this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this.onAfterWorldMatrixUpdateObservable.clear(),t)for(var n=0,i=this.getChildTransformNodes(!0);n<i.length;n++){var o=i[n];o.parent=null,o.computeWorldMatrix(!0)}e.prototype.dispose.call(this,t,r)},t.prototype.normalizeToUnitCube=function(e,t,r){void 0===e&&(e=!0),void 0===t&&(t=!1);var n=null,i=null;t&&(this.rotationQuaternion?(i=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(n=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));var o=this.getHierarchyBoundingVectors(e,r),s=o.max.subtract(o.min),a=Math.max(s.x,s.y,s.z);if(0===a)return this;var l=1/a;return this.scaling.scaleInPlace(l),t&&(this.rotationQuaternion&&i?this.rotationQuaternion.copyFrom(i):this.rotation&&n&&this.rotation.copyFrom(n)),this},t.prototype._syncAbsoluteScalingAndRotation=function(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)},t.BILLBOARDMODE_NONE=0,t.BILLBOARDMODE_X=1,t.BILLBOARDMODE_Y=2,t.BILLBOARDMODE_Z=4,t.BILLBOARDMODE_ALL=7,t.BILLBOARDMODE_USE_POSITION=128,t._TmpRotation=s.Quaternion.Zero(),t._TmpScaling=s.Vector3.Zero(),t._TmpTranslation=s.Vector3.Zero(),t._lookAtVectorCache=new s.Vector3(0,0,0),t._rotationAxisCache=new s.Quaternion,Object(n.__decorate)([Object(i.serializeAsVector3)("position")],t.prototype,"_position",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)("rotation")],t.prototype,"_rotation",void 0),Object(n.__decorate)([Object(i.serializeAsQuaternion)("rotationQuaternion")],t.prototype,"_rotationQuaternion",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)("scaling")],t.prototype,"_scaling",void 0),Object(n.__decorate)([Object(i.serialize)("billboardMode")],t.prototype,"_billboardMode",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"scalingDeterminant",void 0),Object(n.__decorate)([Object(i.serialize)("infiniteDistance")],t.prototype,"_infiniteDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"ignoreNonUniformScaling",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"reIntegrateRotationIntoRotationQuaternion",void 0),t}(a.Node)},"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts":
- /*!***************************************************************!*\
- !*** ./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts ***!
- \***************************************************************/
- /*! exports provided: CubeMapToSphericalPolynomialTools */function(e,t,r){"use strict";r.r(t),r.d(t,"CubeMapToSphericalPolynomialTools",(function(){return u}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),o=r(/*! ../../Maths/sphericalPolynomial */"./Maths/sphericalPolynomial.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../../Maths/math.constants */"./Maths/math.constants.ts"),l=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),c=function(e,t,r,n){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=r,this.worldAxisForFileY=n},u=function(){function e(){}return e.ConvertCubeMapTextureToSphericalPolynomial=function(e){if(!e.isCube)return null;var t,r,n=e.getSize().width,i=e.readPixels(0),o=e.readPixels(1);e.isRenderTarget?(t=e.readPixels(3),r=e.readPixels(2)):(t=e.readPixels(2),r=e.readPixels(3));var a=e.readPixels(4),l=e.readPixels(5),c=e.gammaSpace,u=s.Constants.TEXTUREFORMAT_RGBA,d=s.Constants.TEXTURETYPE_UNSIGNED_INT;e.textureType!=s.Constants.TEXTURETYPE_FLOAT&&e.textureType!=s.Constants.TEXTURETYPE_HALF_FLOAT||(d=s.Constants.TEXTURETYPE_FLOAT);var h={size:n,right:i,left:o,up:t,down:r,front:a,back:l,format:u,type:d,gammaSpace:c};return this.ConvertCubeMapToSphericalPolynomial(h)},e.ConvertCubeMapToSphericalPolynomial=function(e){for(var t=new o.SphericalHarmonics,r=0,n=2/e.size,c=n,u=.5*n-1,d=0;d<6;d++)for(var h=this.FileFaces[d],f=e[h.name],p=u,m=e.format===s.Constants.TEXTUREFORMAT_RGBA?4:3,g=0;g<e.size;g++){for(var _=u,v=0;v<e.size;v++){var y=h.worldAxisForFileX.scale(_).add(h.worldAxisForFileY.scale(p)).add(h.worldAxisForNormal);y.normalize();var b=Math.pow(1+_*_+p*p,-1.5),A=f[g*e.size*m+v*m+0],T=f[g*e.size*m+v*m+1],M=f[g*e.size*m+v*m+2];isNaN(A)&&(A=0),isNaN(T)&&(T=0),isNaN(M)&&(M=0),e.type===s.Constants.TEXTURETYPE_UNSIGNED_INT&&(A/=255,T/=255,M/=255),e.gammaSpace&&(A=Math.pow(i.Scalar.Clamp(A),a.ToLinearSpace),T=Math.pow(i.Scalar.Clamp(T),a.ToLinearSpace),M=Math.pow(i.Scalar.Clamp(M),a.ToLinearSpace)),A=i.Scalar.Clamp(A,0,4096),T=i.Scalar.Clamp(T,0,4096),M=i.Scalar.Clamp(M,0,4096);var P=new l.Color3(A,T,M);t.addLight(y,P,b),r+=b,_+=n}p+=c}var S=4*Math.PI*6/6/r;return t.scaleInPlace(S),t.convertIncidentRadianceToIrradiance(),t.convertIrradianceToLambertianRadiance(),o.SphericalPolynomial.FromHarmonics(t)},e.FileFaces=[new c("right",new n.Vector3(1,0,0),new n.Vector3(0,0,-1),new n.Vector3(0,-1,0)),new c("left",new n.Vector3(-1,0,0),new n.Vector3(0,0,1),new n.Vector3(0,-1,0)),new c("up",new n.Vector3(0,1,0),new n.Vector3(1,0,0),new n.Vector3(0,0,1)),new c("down",new n.Vector3(0,-1,0),new n.Vector3(1,0,0),new n.Vector3(0,0,-1)),new c("front",new n.Vector3(0,0,1),new n.Vector3(1,0,0),new n.Vector3(0,-1,0)),new c("back",new n.Vector3(0,0,-1),new n.Vector3(-1,0,0),new n.Vector3(0,-1,0))],e}()},"./Misc/HighDynamicRange/hdr.ts":
- /*!**************************************!*\
- !*** ./Misc/HighDynamicRange/hdr.ts ***!
- \**************************************/
- /*! exports provided: HDRTools */function(e,t,r){"use strict";r.r(t),r.d(t,"HDRTools",(function(){return i}));var n=r(/*! ./panoramaToCubemap */"./Misc/HighDynamicRange/panoramaToCubemap.ts"),i=function(){function e(){}return e.Ldexp=function(e,t){return t>1023?e*Math.pow(2,1023)*Math.pow(2,t-1023):t<-1074?e*Math.pow(2,-1074)*Math.pow(2,t+1074):e*Math.pow(2,t)},e.Rgbe2float=function(e,t,r,n,i,o){i>0?(i=this.Ldexp(1,i-136),e[o+0]=t*i,e[o+1]=r*i,e[o+2]=n*i):(e[o+0]=0,e[o+1]=0,e[o+2]=0)},e.readStringLine=function(e,t){for(var r="",n="",i=t;i<e.length-t&&"\n"!=(n=String.fromCharCode(e[i]));i++)r+=n;return r},e.RGBE_ReadHeader=function(e){var t,r,n=this.readStringLine(e,0);if("#"!=n[0]||"?"!=n[1])throw"Bad HDR Format.";var i=!1,o=!1,s=0;do{s+=n.length+1,"FORMAT=32-bit_rle_rgbe"==(n=this.readStringLine(e,s))?o=!0:0==n.length&&(i=!0)}while(!i);if(!o)throw"HDR Bad header format, unsupported FORMAT";s+=n.length+1,n=this.readStringLine(e,s);var a=/^\-Y (.*) \+X (.*)$/g.exec(n);if(!a||a.length<3)throw"HDR Bad header format, no size";if(r=parseInt(a[2]),t=parseInt(a[1]),r<8||r>32767)throw"HDR Bad header format, unsupported size";return{height:t,width:r,dataPosition:s+=n.length+1}},e.GetCubeMapTextureData=function(e,t){var r=new Uint8Array(e),i=this.RGBE_ReadHeader(r),o=this.RGBE_ReadPixels(r,i);return n.PanoramaToCubeMapTools.ConvertPanoramaToCubemap(o,i.width,i.height,t)},e.RGBE_ReadPixels=function(e,t){return this.RGBE_ReadPixels_RLE(e,t)},e.RGBE_ReadPixels_RLE=function(e,t){for(var r,n,i,o,s,a=t.height,l=t.width,c=t.dataPosition,u=0,d=0,h=0,f=new ArrayBuffer(4*l),p=new Uint8Array(f),m=new ArrayBuffer(t.width*t.height*4*3),g=new Float32Array(m);a>0;){if(r=e[c++],n=e[c++],i=e[c++],o=e[c++],2!=r||2!=n||128&i||t.width<8||t.width>32767)return this.RGBE_ReadPixels_NOT_RLE(e,t);if((i<<8|o)!=l)throw"HDR Bad header format, wrong scan line width";for(u=0,h=0;h<4;h++)for(d=(h+1)*l;u<d;)if(r=e[c++],n=e[c++],r>128){if(0==(s=r-128)||s>d-u)throw"HDR Bad Format, bad scanline data (run)";for(;s-- >0;)p[u++]=n}else{if(0==(s=r)||s>d-u)throw"HDR Bad Format, bad scanline data (non-run)";if(p[u++]=n,--s>0)for(var _=0;_<s;_++)p[u++]=e[c++]}for(h=0;h<l;h++)r=p[h],n=p[h+l],i=p[h+2*l],o=p[h+3*l],this.Rgbe2float(g,r,n,i,o,(t.height-a)*l*3+3*h);a--}return g},e.RGBE_ReadPixels_NOT_RLE=function(e,t){for(var r,n,i,o,s,a=t.height,l=t.width,c=t.dataPosition,u=new ArrayBuffer(t.width*t.height*4*3),d=new Float32Array(u);a>0;){for(s=0;s<t.width;s++)r=e[c++],n=e[c++],i=e[c++],o=e[c++],this.Rgbe2float(d,r,n,i,o,(t.height-a)*l*3+3*s);a--}return d},e}()},"./Misc/HighDynamicRange/index.ts":
- /*!****************************************!*\
- !*** ./Misc/HighDynamicRange/index.ts ***!
- \****************************************/
- /*! exports provided: CubeMapToSphericalPolynomialTools, HDRTools, PanoramaToCubeMapTools */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts");r.d(t,"CubeMapToSphericalPolynomialTools",(function(){return n.CubeMapToSphericalPolynomialTools}));var i=r(/*! ./hdr */"./Misc/HighDynamicRange/hdr.ts");r.d(t,"HDRTools",(function(){return i.HDRTools}));var o=r(/*! ./panoramaToCubemap */"./Misc/HighDynamicRange/panoramaToCubemap.ts");r.d(t,"PanoramaToCubeMapTools",(function(){return o.PanoramaToCubeMapTools}))},"./Misc/HighDynamicRange/panoramaToCubemap.ts":
- /*!****************************************************!*\
- !*** ./Misc/HighDynamicRange/panoramaToCubemap.ts ***!
- \****************************************************/
- /*! exports provided: PanoramaToCubeMapTools */function(e,t,r){"use strict";r.r(t),r.d(t,"PanoramaToCubeMapTools",(function(){return o}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Engines/constants */"./Engines/constants.ts"),o=function(){function e(){}return e.ConvertPanoramaToCubemap=function(e,t,r,n){if(!e)throw"ConvertPanoramaToCubemap: input cannot be null";if(e.length!=t*r*3)throw"ConvertPanoramaToCubemap: input size is wrong";return{front:this.CreateCubemapTexture(n,this.FACE_FRONT,e,t,r),back:this.CreateCubemapTexture(n,this.FACE_BACK,e,t,r),left:this.CreateCubemapTexture(n,this.FACE_LEFT,e,t,r),right:this.CreateCubemapTexture(n,this.FACE_RIGHT,e,t,r),up:this.CreateCubemapTexture(n,this.FACE_UP,e,t,r),down:this.CreateCubemapTexture(n,this.FACE_DOWN,e,t,r),size:n,type:i.Constants.TEXTURETYPE_FLOAT,format:i.Constants.TEXTUREFORMAT_RGB,gammaSpace:!1}},e.CreateCubemapTexture=function(e,t,r,n,i){for(var o=new ArrayBuffer(e*e*4*3),s=new Float32Array(o),a=t[1].subtract(t[0]).scale(1/e),l=t[3].subtract(t[2]).scale(1/e),c=1/e,u=0,d=0;d<e;d++){for(var h=t[0],f=t[2],p=0;p<e;p++){var m=f.subtract(h).scale(u).add(h);m.normalize();var g=this.CalcProjectionSpherical(m,r,n,i);s[d*e*3+3*p+0]=g.r,s[d*e*3+3*p+1]=g.g,s[d*e*3+3*p+2]=g.b,h=h.add(a),f=f.add(l)}u+=c}return s},e.CalcProjectionSpherical=function(e,t,r,n){for(var i=Math.atan2(e.z,e.x),o=Math.acos(e.y);i<-Math.PI;)i+=2*Math.PI;for(;i>Math.PI;)i-=2*Math.PI;var s=i/Math.PI,a=o/Math.PI;s=.5*s+.5;var l=Math.round(s*r);l<0?l=0:l>=r&&(l=r-1);var c=Math.round(a*n);c<0?c=0:c>=n&&(c=n-1);var u=n-c-1;return{r:t[u*r*3+3*l+0],g:t[u*r*3+3*l+1],b:t[u*r*3+3*l+2]}},e.FACE_LEFT=[new n.Vector3(-1,-1,-1),new n.Vector3(1,-1,-1),new n.Vector3(-1,1,-1),new n.Vector3(1,1,-1)],e.FACE_RIGHT=[new n.Vector3(1,-1,1),new n.Vector3(-1,-1,1),new n.Vector3(1,1,1),new n.Vector3(-1,1,1)],e.FACE_FRONT=[new n.Vector3(1,-1,-1),new n.Vector3(1,-1,1),new n.Vector3(1,1,-1),new n.Vector3(1,1,1)],e.FACE_BACK=[new n.Vector3(-1,-1,1),new n.Vector3(-1,-1,-1),new n.Vector3(-1,1,1),new n.Vector3(-1,1,-1)],e.FACE_DOWN=[new n.Vector3(1,1,-1),new n.Vector3(1,1,1),new n.Vector3(-1,1,-1),new n.Vector3(-1,1,1)],e.FACE_UP=[new n.Vector3(-1,-1,-1),new n.Vector3(-1,-1,1),new n.Vector3(1,-1,-1),new n.Vector3(1,-1,1)],e}()},"./Misc/andOrNotEvaluator.ts":
- /*!***********************************!*\
- !*** ./Misc/andOrNotEvaluator.ts ***!
- \***********************************/
- /*! exports provided: AndOrNotEvaluator */function(e,t,r){"use strict";r.r(t),r.d(t,"AndOrNotEvaluator",(function(){return n}));var n=function(){function e(){}return e.Eval=function(t,r){return"true"===(t=t.match(/\([^\(\)]*\)/g)?t.replace(/\([^\(\)]*\)/g,(function(t){return t=t.slice(1,t.length-1),e._HandleParenthesisContent(t,r)})):e._HandleParenthesisContent(t,r))||"false"!==t&&e.Eval(t,r)},e._HandleParenthesisContent=function(t,r){var n;r=r||function(e){return"true"===e};var i=t.split("||");for(var o in i)if(i.hasOwnProperty(o)){var s=e._SimplifyNegation(i[o].trim()),a=s.split("&&");if(a.length>1)for(var l=0;l<a.length;++l){var c=e._SimplifyNegation(a[l].trim());if(!(n="true"!==c&&"false"!==c?"!"===c[0]?!r(c.substring(1)):r(c):"true"===c)){s="false";break}}if(n||"true"===s){n=!0;break}n="true"!==s&&"false"!==s?"!"===s[0]?!r(s.substring(1)):r(s):"true"===s}return n?"true":"false"},e._SimplifyNegation=function(e){return"!true"===(e=(e=e.replace(/^[\s!]+/,(function(e){return(e=e.replace(/[\s]/g,(function(){return""}))).length%2?"!":""}))).trim())?e="false":"!false"===e&&(e="true"),e},e}()},"./Misc/arrayTools.ts":
- /*!****************************!*\
- !*** ./Misc/arrayTools.ts ***!
- \****************************/
- /*! exports provided: ArrayTools */function(e,t,r){"use strict";r.r(t),r.d(t,"ArrayTools",(function(){return n}));var n=function(){function e(){}return e.BuildArray=function(e,t){for(var r=[],n=0;n<e;++n)r.push(t());return r},e}()},"./Misc/assetsManager.ts":
- /*!*******************************!*\
- !*** ./Misc/assetsManager.ts ***!
- \*******************************/
- /*! exports provided: AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, EquiRectangularCubeTextureAssetTask, AssetsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"AssetTaskState",(function(){return n})),r.d(t,"AbstractAssetTask",(function(){return f})),r.d(t,"AssetsProgressEvent",(function(){return p})),r.d(t,"MeshAssetTask",(function(){return m})),r.d(t,"TextFileAssetTask",(function(){return g})),r.d(t,"BinaryFileAssetTask",(function(){return _})),r.d(t,"ImageAssetTask",(function(){return v})),r.d(t,"TextureAssetTask",(function(){return y})),r.d(t,"CubeTextureAssetTask",(function(){return b})),r.d(t,"HDRCubeTextureAssetTask",(function(){return A})),r.d(t,"EquiRectangularCubeTextureAssetTask",(function(){return T})),r.d(t,"AssetsManager",(function(){return M}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../Loading/sceneLoader */"./Loading/sceneLoader.ts"),s=r(/*! ./tools */"./Misc/tools.ts"),a=r(/*! ./observable */"./Misc/observable.ts"),l=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),u=r(/*! ../Materials/Textures/hdrCubeTexture */"./Materials/Textures/hdrCubeTexture.ts"),d=r(/*! ../Materials/Textures/equiRectangularCubeTexture */"./Materials/Textures/equiRectangularCubeTexture.ts"),h=r(/*! ../Misc/logger */"./Misc/logger.ts");!function(e){e[e.INIT=0]="INIT",e[e.RUNNING=1]="RUNNING",e[e.DONE=2]="DONE",e[e.ERROR=3]="ERROR"}(n||(n={}));var f=function(){function e(e){this.name=e,this._isCompleted=!1,this._taskState=n.INIT}return Object.defineProperty(e.prototype,"isCompleted",{get:function(){return this._isCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskState",{get:function(){return this._taskState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorObject",{get:function(){return this._errorObject},enumerable:!1,configurable:!0}),e.prototype._setErrorObject=function(e,t){this._errorObject||(this._errorObject={message:e,exception:t})},e.prototype.run=function(e,t,r){var i=this;this._taskState=n.RUNNING,this.runTask(e,(function(){i.onDoneCallback(t,r)}),(function(e,t){i.onErrorCallback(r,e,t)}))},e.prototype.runTask=function(e,t,r){throw new Error("runTask is not implemented")},e.prototype.reset=function(){this._taskState=n.INIT},e.prototype.onErrorCallback=function(e,t,r){this._taskState=n.ERROR,this._errorObject={message:t,exception:r},this.onError&&this.onError(this,t,r),e()},e.prototype.onDoneCallback=function(e,t){try{this._taskState=n.DONE,this._isCompleted=!0,this.onSuccess&&this.onSuccess(this),e()}catch(e){this.onErrorCallback(t,"Task is done, error executing success callback(s)",e)}},e}(),p=function(e,t,r){this.remainingCount=e,this.totalCount=t,this.task=r},m=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.name=t,o.meshesNames=r,o.rootUrl=n,o.sceneFilename=i,o}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){var n=this;o.SceneLoader.ImportMesh(this.meshesNames,this.rootUrl,this.sceneFilename,e,(function(e,r,i,o){n.loadedMeshes=e,n.loadedParticleSystems=r,n.loadedSkeletons=i,n.loadedAnimationGroups=o,t()}),null,(function(e,t,n){r(t,n)}))},t}(f),g=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name=t,n.url=r,n}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){var n=this;e._loadFile(this.url,(function(e){n.text=e,t()}),void 0,!1,!1,(function(e,t){e&&r(e.status+" "+e.statusText,t)}))},t}(f),_=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name=t,n.url=r,n}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){var n=this;e._loadFile(this.url,(function(e){n.data=e,t()}),void 0,!0,!0,(function(e,t){e&&r(e.status+" "+e.statusText,t)}))},t}(f),v=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name=t,n.url=r,n}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){var n=this,i=new Image;s.Tools.SetCorsBehavior(this.url,i),i.onload=function(){n.image=i,t()},i.onerror=function(e){r("Error loading image",e)},i.src=this.url},t}(f),y=function(e){function t(t,r,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=l.Texture.TRILINEAR_SAMPLINGMODE);var s=e.call(this,t)||this;return s.name=t,s.url=r,s.noMipmap=n,s.invertY=i,s.samplingMode=o,s}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){this.texture=new l.Texture(this.url,e,this.noMipmap,this.invertY,this.samplingMode,(function(){t()}),(function(e,t){r(e,t)}))},t}(f),b=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;return s.name=t,s.url=r,s.extensions=n,s.noMipmap=i,s.files=o,s}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){this.texture=new c.CubeTexture(this.url,e,this.extensions,this.noMipmap,this.files,(function(){t()}),(function(e,t){r(e,t)}))},t}(f),A=function(e){function t(t,r,n,i,o,s,a){void 0===i&&(i=!1),void 0===o&&(o=!0),void 0===s&&(s=!1),void 0===a&&(a=!1);var l=e.call(this,t)||this;return l.name=t,l.url=r,l.size=n,l.noMipmap=i,l.generateHarmonics=o,l.gammaSpace=s,l.reserved=a,l}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){this.texture=new u.HDRCubeTexture(this.url,e,this.size,this.noMipmap,this.generateHarmonics,this.gammaSpace,this.reserved,(function(){t()}),(function(e,t){r(e,t)}))},t}(f),T=function(e){function t(t,r,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=!0);var s=e.call(this,t)||this;return s.name=t,s.url=r,s.size=n,s.noMipmap=i,s.gammaSpace=o,s}return Object(i.__extends)(t,e),t.prototype.runTask=function(e,t,r){this.texture=new d.EquiRectangularCubeTexture(this.url,e,this.size,this.noMipmap,this.gammaSpace,(function(){t()}),(function(e,t){r(e,t)}))},t}(f),M=function(){function e(e){this._isLoading=!1,this._tasks=new Array,this._waitingTasksCount=0,this._totalTasksCount=0,this.onTaskSuccessObservable=new a.Observable,this.onTaskErrorObservable=new a.Observable,this.onTasksDoneObservable=new a.Observable,this.onProgressObservable=new a.Observable,this.useDefaultLoadingScreen=!0,this.autoHideLoadingUI=!0,this._scene=e}return e.prototype.addMeshTask=function(e,t,r,n){var i=new m(e,t,r,n);return this._tasks.push(i),i},e.prototype.addTextFileTask=function(e,t){var r=new g(e,t);return this._tasks.push(r),r},e.prototype.addBinaryFileTask=function(e,t){var r=new _(e,t);return this._tasks.push(r),r},e.prototype.addImageTask=function(e,t){var r=new v(e,t);return this._tasks.push(r),r},e.prototype.addTextureTask=function(e,t,r,n,i){void 0===i&&(i=l.Texture.TRILINEAR_SAMPLINGMODE);var o=new y(e,t,r,n,i);return this._tasks.push(o),o},e.prototype.addCubeTextureTask=function(e,t,r,n,i){var o=new b(e,t,r,n,i);return this._tasks.push(o),o},e.prototype.addHDRCubeTextureTask=function(e,t,r,n,i,o,s){void 0===n&&(n=!1),void 0===i&&(i=!0),void 0===o&&(o=!1),void 0===s&&(s=!1);var a=new A(e,t,r,n,i,o,s);return this._tasks.push(a),a},e.prototype.addEquiRectangularCubeTextureAssetTask=function(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i=!0);var o=new T(e,t,r,n,i);return this._tasks.push(o),o},e.prototype.removeTask=function(e){var t=this._tasks.indexOf(e);t>-1&&this._tasks.splice(t,1)},e.prototype._decreaseWaitingTasksCount=function(e){this._waitingTasksCount--;try{this.onProgress&&this.onProgress(this._waitingTasksCount,this._totalTasksCount,e),this.onProgressObservable.notifyObservers(new p(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){h.Logger.Error("Error running progress callbacks."),console.log(e)}if(0===this._waitingTasksCount){try{var t=this._tasks.slice();this.onFinish&&this.onFinish(t);for(var r=0,i=t;r<i.length;r++)if((e=i[r]).taskState===n.DONE){var o=this._tasks.indexOf(e);o>-1&&this._tasks.splice(o,1)}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(e){h.Logger.Error("Error running tasks-done callbacks."),console.log(e)}this._isLoading=!1,this.autoHideLoadingUI&&this._scene.getEngine().hideLoadingUI()}},e.prototype._runTask=function(e){var t=this,r=function(r,n){e._setErrorObject(r,n),t.onTaskError&&t.onTaskError(e),t.onTaskErrorObservable.notifyObservers(e),t._decreaseWaitingTasksCount(e)};e.run(this._scene,(function(){try{t.onTaskSuccess&&t.onTaskSuccess(e),t.onTaskSuccessObservable.notifyObservers(e),t._decreaseWaitingTasksCount(e)}catch(e){r("Error executing task success callbacks",e)}}),r)},e.prototype.reset=function(){return this._isLoading=!1,this._tasks=new Array,this},e.prototype.load=function(){if(this._isLoading)return this;if(this._isLoading=!0,this._waitingTasksCount=this._tasks.length,this._totalTasksCount=this._tasks.length,0===this._waitingTasksCount)return this._isLoading=!1,this.onFinish&&this.onFinish(this._tasks),this.onTasksDoneObservable.notifyObservers(this._tasks),this;this.useDefaultLoadingScreen&&this._scene.getEngine().displayLoadingUI();for(var e=0;e<this._tasks.length;e++){var t=this._tasks[e];t.taskState===n.INIT&&this._runTask(t)}return this},e.prototype.loadAsync=function(){var e=this;return new Promise((function(t,r){e._isLoading?t():(e.onTasksDoneObservable.addOnce((function(e){e&&e.length?r(e):t()})),e.load())}))},e}()},"./Misc/baseError.ts":
- /*!***************************!*\
- !*** ./Misc/baseError.ts ***!
- \***************************/
- /*! exports provided: BaseError */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseError",(function(){return i}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t._setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t}(Error)},"./Misc/basis.ts":
- /*!***********************!*\
- !*** ./Misc/basis.ts ***!
- \***********************/
- /*! exports provided: BasisTranscodeConfiguration, BasisTools */function(e,t,r){"use strict";r.r(t),r.d(t,"BasisTranscodeConfiguration",(function(){return c})),r.d(t,"BasisTools",(function(){return u}));var n,i=r(/*! ./tools */"./Misc/tools.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=function(){};!function(e){e[e.cTFETC1=0]="cTFETC1",e[e.cTFBC1=1]="cTFBC1",e[e.cTFBC4=2]="cTFBC4",e[e.cTFPVRTC1_4_OPAQUE_ONLY=3]="cTFPVRTC1_4_OPAQUE_ONLY",e[e.cTFBC7_M6_OPAQUE_ONLY=4]="cTFBC7_M6_OPAQUE_ONLY",e[e.cTFETC2=5]="cTFETC2",e[e.cTFBC3=6]="cTFBC3",e[e.cTFBC5=7]="cTFBC5"}(n||(n={}));var u=function(){function e(){}return e.GetInternalFormatFromBasisFormat=function(e){if(e===n.cTFETC1)return 36196;if(e===n.cTFBC1)return 33776;if(e===n.cTFBC3)return 33779;throw"The chosen Basis transcoder format is not currently supported"},e._CreateWorkerAsync=function(){var t=this;return this._WorkerPromise||(this._WorkerPromise=new Promise((function(r){t._Worker?r(t._Worker):i.Tools.LoadFileAsync(e.WasmModuleURL).then((function(n){var i=URL.createObjectURL(new Blob(["("+d+")()"],{type:"application/javascript"}));t._Worker=new Worker(i);var o=function(e){"init"===e.data.action&&(t._Worker.removeEventListener("message",o),r(t._Worker))};t._Worker.addEventListener("message",o),t._Worker.postMessage({action:"init",url:e.JSModuleURL,wasmBinary:n})}))}))),this._WorkerPromise},e.TranscodeAsync=function(e,t){var r=this,n=e instanceof ArrayBuffer?new Uint8Array(e):e;return new Promise((function(e,i){r._CreateWorkerAsync().then((function(){var o=r._actionId++,s=function(t){"transcode"===t.data.action&&t.data.id===o&&(r._Worker.removeEventListener("message",s),t.data.success?e(t.data):i("Transcode is not supported on this device"))};r._Worker.addEventListener("message",s);var a=new Uint8Array(n.byteLength);a.set(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),r._Worker.postMessage({action:"transcode",id:o,imageData:a,config:t,ignoreSupportedFormats:r._IgnoreSupportedFormats},[a.buffer])}))}))},e.LoadTextureFromTranscodeResult=function(t,r){for(var n,c=t.getEngine(),u=function(){if(n=r.fileInfo.images[d].levels[0],t._invertVScale=t.invertY,-1===r.format)if(t.type=l.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,t.format=l.Constants.TEXTUREFORMAT_RGB,c.webGLVersion<2&&(a.Scalar.Log2(n.width)%1!=0||a.Scalar.Log2(n.height)%1!=0)){var u=new s.InternalTexture(c,s.InternalTextureSource.Temp);t._invertVScale=t.invertY,u.type=l.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,u.format=l.Constants.TEXTUREFORMAT_RGB,u.width=n.width+3&-4,u.height=n.height+3&-4,c._bindTextureDirectly(c._gl.TEXTURE_2D,u,!0),c._uploadDataToTextureDirectly(u,n.transcodedPixels,d,0,l.Constants.TEXTUREFORMAT_RGB,!0),c._rescaleTexture(u,t,c.scenes[0],c._getInternalFormat(l.Constants.TEXTUREFORMAT_RGB),(function(){c._releaseTexture(u),c._bindTextureDirectly(c._gl.TEXTURE_2D,t,!0)}))}else t._invertVScale=!t.invertY,t.width=n.width+3&-4,t.height=n.height+3&-4,c._uploadDataToTextureDirectly(t,n.transcodedPixels,d,0,l.Constants.TEXTUREFORMAT_RGB,!0);else t.width=n.width,t.height=n.height,r.fileInfo.images[d].levels.forEach((function(n,i){c._uploadCompressedDataToTextureDirectly(t,e.GetInternalFormatFromBasisFormat(r.format),n.width,n.height,n.transcodedPixels,d,i)})),c.webGLVersion<2&&(a.Scalar.Log2(t.width)%1!=0||a.Scalar.Log2(t.height)%1!=0)&&(i.Tools.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."),t._cachedWrapU=o.Texture.CLAMP_ADDRESSMODE,t._cachedWrapV=o.Texture.CLAMP_ADDRESSMODE)},d=0;d<r.fileInfo.images.length;d++)u()},e._IgnoreSupportedFormats=!1,e.JSModuleURL="https://preview.babylonjs.com/basisTranscoder/basis_transcoder.js",e.WasmModuleURL="https://preview.babylonjs.com/basisTranscoder/basis_transcoder.wasm",e._WorkerPromise=null,e._Worker=null,e._actionId=0,e}();function d(){var e=0,t=1,r=5,n=6,i=null;function o(e,t,r,n,i){var o=e.getImageTranscodedSizeInBytes(t,r,n),s=new Uint8Array(o);return e.transcodeImage(s,t,r,n,1,0)?(i&&(s=function(e,t,r,n){for(var i=new Uint16Array(4),o=new Uint16Array(r*n),s=r/4,a=n/4,l=0;l<a;l++)for(var c=0;c<s;c++){var u=t+8*(l*s+c);i[0]=e[u]|e[u+1]<<8,i[1]=e[u+2]|e[u+3]<<8,i[2]=(2*(31&i[0])+1*(31&i[1]))/3|(2*(2016&i[0])+1*(2016&i[1]))/3&2016|(2*(63488&i[0])+1*(63488&i[1]))/3&63488,i[3]=(2*(31&i[1])+1*(31&i[0]))/3|(2*(2016&i[1])+1*(2016&i[0]))/3&2016|(2*(63488&i[1])+1*(63488&i[0]))/3&63488;for(var d=0;d<4;d++){var h=e[u+4+d],f=(4*l+d)*r+4*c;o[f++]=i[3&h],o[f++]=i[h>>2&3],o[f++]=i[h>>4&3],o[f++]=i[h>>6&3]}}return o}(s,0,e.getImageWidth(t,r)+3&-4,e.getImageHeight(t,r)+3&-4)),s):null}onmessage=function(s){if("init"===s.data.action)i||(Module={wasmBinary:s.data.wasmBinary},importScripts(s.data.url),i=new Promise((function(e){Module.onRuntimeInitialized=function(){Module.initializeBasis(),e()}}))),i.then((function(){postMessage({action:"init"})}));else if("transcode"===s.data.action){var a=s.data.config,l=s.data.imageData,c=new Module.BasisFile(l),u=function(e){for(var t=e.getHasAlpha(),r=e.getNumImages(),n=[],i=0;i<r;i++){for(var o={levels:[]},s=e.getNumLevels(i),a=0;a<s;a++){var l={width:e.getImageWidth(i,a),height:e.getImageHeight(i,a)};o.levels.push(l)}n.push(o)}return{hasAlpha:t,images:n}}(c),d=s.data.ignoreSupportedFormats?null:function(i,o){var s=null;return i.supportedCompressionFormats&&(i.supportedCompressionFormats.etc1?s=e:i.supportedCompressionFormats.s3tc?s=o.hasAlpha?n:t:i.supportedCompressionFormats.pvrtc||i.supportedCompressionFormats.etc2&&(s=r)),s}(s.data.config,u),h=!1;null===d&&(h=!0,d=u.hasAlpha?n:t);var f=!0;c.startTranscoding()||(f=!1);for(var p=[],m=0;m<u.images.length&&f;m++){var g=u.images[m];if(void 0===a.loadSingleImage||a.loadSingleImage===m){var _=g.levels.length;!1===a.loadMipmapLevels&&(_=1);for(var v=0;v<_;v++){var y=g.levels[v],b=o(c,m,v,d,h);if(!b){f=!1;break}y.transcodedPixels=b,p.push(y.transcodedPixels.buffer)}}}c.close(),c.delete(),h&&(d=-1),f?postMessage({action:"transcode",success:f,id:s.data.id,fileInfo:u,format:d},p):postMessage({action:"transcode",success:f,id:s.data.id})}}}},"./Misc/brdfTextureTools.ts":
- /*!**********************************!*\
- !*** ./Misc/brdfTextureTools.ts ***!
- \**********************************/
- /*! exports provided: BRDFTextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"BRDFTextureTools",(function(){return o}));var n=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),i=r(/*! ./rgbdTextureTools */"./Misc/rgbdTextureTools.ts"),o=function(){function e(){}return e.GetEnvironmentBRDFTexture=function(e){if(!e.environmentBRDFTexture){var t=e.useDelayedTextureLoading;e.useDelayedTextureLoading=!1;var r=e._blockEntityCollection;e._blockEntityCollection=!1;var o=n.Texture.CreateFromBase64String(this._environmentBRDFBase64Texture,"EnvironmentBRDFTexture"+this._instanceNumber++,e,!0,!1,n.Texture.BILINEAR_SAMPLINGMODE);e._blockEntityCollection=r;var s=e.getEngine().getLoadedTexturesCache(),a=s.indexOf(o.getInternalTexture());-1!==a&&s.splice(a,1),o.isRGBD=!0,o.wrapU=n.Texture.CLAMP_ADDRESSMODE,o.wrapV=n.Texture.CLAMP_ADDRESSMODE,e.environmentBRDFTexture=o,e.useDelayedTextureLoading=t,i.RGBDTextureTools.ExpandRGBDTexture(o)}return e.environmentBRDFTexture},e._instanceNumber=0,e._environmentBRDFBase64Texture="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiPy9iPy/IvIzEfm5iPxCRH4lIt/c/393//9BRD6KyKf7f488fP74/PH544dJAF9cLl98IZfLBZtuqterXr/7Dt9982v95S9+Lv+gF/3i7Spv/8lf/vnf/vGf/dF/JfKnIvLnIvLvReQ/NEngn0TklyLy6/v/34jIt00iGJOBlxAsdvv54/PH5493SQCXy9t2ueh2ueimKorrFbjq9eNH+fDtb+TXv/ol/vHyhX4Fxfbx7euPf/Lnf/PfiPyeiPyhiPxxkwB+fk8AvxzQgJcIrGTwFsiAEXH4/PH54/PHUgLY7whgu2C7bLqpQgHB2xvePn6SDx8+6G9+84384vKF/IPu8iVU9Y/+7C/+jWxffiHytYj8VER+X0T+oEEBvxqQwCMJeIngo5EI3goIwVMIPn98/vj8ESaAbbtu2ybbvl8u2ybbdtluSECA65u8ffqIDx8+6G++/VZ/efkV/sO261dQXP7wT/7kX8vl8qXIFyLylbySwe/dE0CLAr65B/9vGn0gQwRMMqgmhM/J4fPH548eAezbZd/lsm3YtssNAYiqiogAAkCvb5/k46cP8u2HD/rrb7+R/2/b9Wu9yJe//8d/9Ney6S5yEZFdRL68/38khG/uKOCnAwoYkcCoEXwkEgGDDq7CeQfyOTl8/vhd1QCum26ybZtu2yabbrKpQvXue1yvuF6v+vbpTT5+/CDffviAX1++1V9sO77WXb/66R/+4V/dgkbllQi+aBLBV/dE8LWRALwkYCWCNyMZXElkwLTMeMkga/P4/PH547ccAVwuctkvdxSw6bbdtYDbTfSZBN7e8PHTR/3u4wf55vKd/nL7DX6mu3791U9//5+/gkNFZGuSgZUQvnKowKgLWLTAQgRtEniTuEfwaELw0MJvf3LQzynud+53uG+X6y3gN9kul+2y6XVT1U27JCDAFVc8ksAn/e7jR/nN5YP+avtWfq6Xy9f7Vz/9w1dgRYngiyYhfNkkgzYBWHTg44AEMmqQUYQKOmDaiCIa8TmsfmzB+DnZDQjgcpGLbti2y3bZHjRAdRMVvb/dcYU8kcDbPQlsH/CrbddfbF98+RPZfvLFnAQeieCRDC5DMvju/vmD4JkEvjRQgKULeGggowdHkAHTYxihg89vu88I5UeGAPSOAFTlrgPopiqbKPSmCKreUoAAkCcSePukHz590m8vH+WbD9/JP335k6/+tA86KxFchv8jMvhiogE4JQm8XhfKqOAqx5qRPyeGzx8/cgSwbXcUoLJtim27C4Oi93+4v6VxQwKAvl2v+Hj9pB8+fZJvt4/yzfbF9lPdv/wJnsE2BogmyeCRED40tGFvksIXiSbgiYSRRpDNDZ6BDI6ghM+J4fPHeyKAO+zX7cb9t4tedMMNAQju5V+f1uAtBSiu1zsduMrHy5t8ePsk3376KN98sX/xE5FPAnm7/782o0DiUINXMkCXCB7/P94/e87AWUmARQWVvgMuKej9t1RLBp+Tw+ePgwngsutFFdu26WXbbl+rSvdfbnqAiuA23QcBgCugV1zl7e1NPm5v+LC96XfbJ/1W9y++fgXjA3bDYXV+MuhRwSPwL3JLMFYC+HS/LU8HYrGwIhwyNOF12SvgM4SgztdifP85MXz+KGsA2C6X7aJ6bXSAOwrY5OYIqGy3d5uq4P5GhABXuV6veLvRAf10fZMPb2/y3b7vX7+g+9v98/WOBq7GG7RNAlYy+Dgkhhb+Xxp0sE8IAC4SGAP/TbgVJK/PoJPBnAiwPKxsXfbbnRg+i3s/JAK4Q/4b9NfLtomBAqCickMBjy7BuywAUVyv8na94tMjCVzf9KNcLl/0SeA6oAEYb1i9g+FtSALb/bKL8/+t+wxXFMyswqiHoK4ToIgKqslgpg1qUC0QoYbvJZg/B/q5v4szHmPX7YEAsD0CX25OwEUVm9xag1+agKg+nxQArnKjAtDr9U0+Xd/k4/UqH7bL5YsewrcBBiMJZPRAp6TwQgWfjM9vgRbgUYGL8AvLWH2gqhesCokeUmCSwPsnhs8fP2YNYMO2XeSmAWxy2VQaXeDmDIhApf33rD4PTUCuV+DtCn27XuXT5ir8VmCJ2G5BpBM8/r/dEcJb8/0lEQMtJHA5TAlqNuLRhJChhEpSqFabH3di+G1AGj+W1/dyAR4IYJNNnuLf6+tWC9CHHiAtFhAIFLjK2/Uqn65X+SS67aK+3QeTDoy/IG2ogQ7fb/dAtz5vBgrYGqrwNtCHsVfgIvwK07OTQBURVNCBFpKCOjqCHn5L/67TgTN+fpySAC56nwSUi256kXsSuFGAVyLoUIDo8/Pz7fdoErr/v17lk162HbgHvFpIYDfoAJJfW4sGPjkU4VNAF8ZEcLmLhdc7kljdY1y1Dq9yLiI4IiRqcLujb138KIPn80ejATwRwIbtBvn1cqv+2J78/5EI5N4cJA8qIPcmwRsKAHDF9WYP6mV7VmrgLuTpxYTcMEW0LAmoQxFsuvAI8tv/a/C5fV2ZMMiKg++FCM7RDPRu8ebWY7VG6VJi+Bzk35MI2LsAckMAgwvQ0gC5DQjd3ABg2HQLAPpEAlZ1Bu7VV7MGHDFRAbo3VKsTbAY9sPWC/uvx86gBbDK3D1eEQS8pbAeSgSwmhepnJb6uBv/o/PzHLzxWA/X7TH77De5j6AGQi6o0CUGfCOD2X7cXAlCFQABtEsGLDtxuOyQB2UTQBKZe5GUPXgkUYCUAbZJRhBDeuq8xBf+bgwbehDm+BFQi2IJksOocvA8ysIMfxluVcRsY/eB3JzH8GFDAXQO48X/dcIf9jyDHptIigDsFkEe066tBSETQUYF7ElDdYEBytN4+rk9UcBPfrKaZqFHWcw3i4J8/X4ev2//bSXqAhwTay6OEIPLD2Ipt8OtAGzxkwLw9WVFRjTc/qC6H3+YK/b1oAA0KuOizHfieCLaHHiAb5NYTIC9EMEbZrVEQt1xwhVy1UfBh8PUOquMizwaap3tQXfY5B//tea/NZdfhsvbz+PURQTDSGWB87VX/7WSd4KxjUqrIgE0IUkoKGnhIvwvawpGf6eECXJ7tv4qbA7DJgwpsKthEmmYgfaAAffYF3HLxo0vwNjJ0SwRWMG4db4eh1gPNm18vQ+us/0eGmxDemu/fnM/X4evq/8342ksGHgLY5LyT/zg0wM8lcMjgGFXwqIOVFJBQw99eCvF9oZL9Mfl3QwAvIXDsBRC9R+fz8x0FPBLB0xJEpwUobrfAkARgIAF41h3wQgP6QAmX5E/7eI43IxGwwf/moIkRyWRJQIPgt9CA9b39nzt4bYUWjAlCjWDPgv8IEjgLJfzuaAsrv9VdVG4OwOXW/fdoA35qAdL0BDwvf6AAUVHd8LIEu94A3K+Q+2YxaB84MOH62P//qoo38fCRDERE2zf0JfmDa+MieElAjcDPKz+mRKCOtdgGtXaBjgNJ4H2owSpNeAW/rRH4CaHSpMwnBYYycjgSJwfie9CR6mPu20Uv8kABF206AvXlBMiIBPSlB9wjBW1fwEuSb94296VCqgMaGCt/G1BbExi3IG+r3a3J6P48Gv/J0YmEYoiGY7V/SxwFCwGoE/xa0AJ0CEiV9QPCJb1OJ5F1VTjEY2/MO9AEJvj1BJTQpqLfTlGwjABuzT962e4IoKnyrdh3+/6mzDVJ4PHOxj0JqGKoy20+wBMN6D1gLWi9NQHfVP5MEEPzjGYy8BMAOnTAJgEr8HUIejRo5xrA5xkR5AngmiSHs+zDDAmMgWzTg55GSJEmHE8IvWPAoYTfhWak/Wn/bQ0CGLSAjv83SUEfKp5q24LXuQICpzrjrgWoza8xVE00CQCORdhMJuTUT/rjuls0gO4Iby8BIEgK6gS7BsGuTtDrScH/fR68biUHNVGBnxjeNyHEvQe/ve3LZQqgG3rof6cEclsNflG9J4KtaQ8WHcVBHS1BtHE4QP9OBMS98mpbKTeDW7dJwRsnHpMBTFJpV4I+b0kY/NqInVFSyBLANbnMSgBM8F+Fqfxq/h657/Up+GaBnwV9hRqc9bZ/vA6vu+T9E8KPJWns94UfTeCj2QXwCHS9dNL8Xf3Ho/rfewSeFODGDV69AU0y6NFAE1DP3qK++rdB7/1HRxf86gT376zOr99T/h/ioBiXWQkgQgVeIrCC/WomhDmQK+hASI2ARQZKooHMLdCJwGEBBXC3+uERwg+VOHZ9ioAt9H80AI06wGgJ3nQA3BoCut6AhxYwgcPOFnxuFnrphk+NIKIGrWPQtgz3b0i7Y6D5rs1GKqTop0nQX52vmQC4BkjA+r4a7Kx9WLENGeegkhSETBCrNXIMdi/444Rw1n6E96ry7OPuj8UfLxtQ78NA2iSBbg7gIiIbdDLsb5agPhLC3RkYKv8NDbS2YGsatNRAG2oQwf9ZIOydgy1MAzBkAw8UwEEIDzSAqdPQ6za0PkeJAMH3Z0wXniUSZoHvBXU2mcjQgv56TedIKglCpIoQfgwCIjOytd8WgN0bfxoR8Fn9Gx0Aj5Zgq0lIZbsH/ibSJoFnS+C98g9ooHEELI3gliy25yONIiE6pb0NfBlyNEYyENoodkKwgl6I6s8kARgJ4ZoEfuYWHLEJa0LhSBXm7kImGeSfVdoJ1DO2G7WXsehAptupSOoyrCSF904k+6vt98X/ZcM98Hsd4JYIXhQAIg3/f9AAUYhsLQKAtkHVBnzjCKhOoYl2ym+iBtvzDzQ2DLXJ4PUmbJHAVnBQX4jkxfvHhNDqAdHXGQJgv0aSDGItgOseHIU+K9hXnIJzkoGlEKzNHagTdJ6VWEUH4iCKH4fd2AwDPaYBm4Wgng4gQ9V/CoGiuNmD04AQtNGMGzSAAQ2I2pzfogY9LRh7BrbOh4+D30sAencljFu2CUFrwY8UAWRfWwGvVOVfbx2uIILM0pwDv082dUTw8hYs8L+uIWiHGpWgClnAa1lMPJogovvvbePPs/q3Xr++kgCsfgB5oQF9WYKPJqEn6G+OE3i5AqouF59FQOmahQC8rlPLj38kg1c2f30vw+XaoIX24/pMGIgSBoZqoH3wo0sIIGlA9PWcCPrAtpPB8eBf6x1o6cHra+2+tpIFP4PgBfxZtZUJfo4qxELT948D9ucK8Mt9+ccjIQw6QJcEbrD/1g340ATuDgDkFfx6twSf1f9xvuBECYxq/7ythQQGm+5JDx6Brw4CkMGT3wgscCUoQ4sU2t6DR2ciBjTgtcpenQoZVX9NuL4Owc+dVaDursYVkVALX+shjSBKBuvCYDUZjE5BdNkxdHAUBexyHwB6NP7Iyw7sxUDViwge1t+mz8B/LAvVx/c3PeBBCToB8IUGOgqA3iV4yUg6UAOxaUFHDx6CYS8SorMOue0CCJGAf5YfRhoAI+A1CvwxqNkAY5yAIx2EQmkFfeWOXi+nEdSQQA0ZHMEItiagJArQxDXIrj8nCfQi4HZPAttrIahso9oPQ/2/JwV5JQU8zw+7I4D7/sBn4EO6rjw0FR+i3Z9fHtahzsFvJgM0X+tmVH5vaYiNDGAigewAz+gyNLThnjCURQFR1b9d3lZvnVqmj9mEPDKIUIC4KCCjBXywS4N+otp/Hk3QVthOkwEKlV9PQwXjT7s/zwF4Qf9toAAzFdjuaEB6S7D1//U5FIQu2MevO0rQQH8ZmoXE6B/IkgE60XCjVoq8gt2iCG0S8L5GdxkM1cGsfsCMArSCAnrr7dzAZxCEEpepvB8tqHJ/q+bmJGGts/AcAXFOMMeTwC7Pw0B6CtCtA2vWgonqBQJFSwH0JQK29OB2kvgj2HHXAoyeAIsCQO0kMNECAhFMqCBf8mElAkyBbX1tJQP2RJ/ha0gpAfS9l+/5n00CkrQpq0MZbOdAuxmMvHswog62jZj7BnYQe19b14kxNq2D/ehX/p68HEcF+x3yP7z/V/A/q/5DA3i5A/dzA5pdgbKp3v3/wQF4Bb70WkCTHGRAA6+KL0bFl6FJaFw0ImZwm6igSwbbwPn9RMBWf3sN2JgA/BVh/Rg0kQBgePf6HglAHLFQwqQQOwDjbdVxNZjR4iM6Qa3WxwvNxh0JFb3g/WzFQQS8b/ttKcDWoABtUMAd8j9hf0MB2uDXhzX4CHj03L9DBU3Qjz0C0l4mLSLQPicOOwZoVCB6P6dA7nDbGkVuxcNr8PU2JQO4wX5trEqmccZaHU4q8oCDFOpzAnOwqyMIMktNNNAHouDGxO37DgArQZzlmp/14W1QlqHTMaIIx7SCx0+5yza7AKJ3IXBrNAHVDcMZAU/BT/vgv/ULPOA+XiLggAREDF2g0ci6xNDRglegd7P7TWWH5oJfayliEg7bScQRBVgI4Ookg/F6rvpLWP29swREqA3CaG8/FpKqS8DTAV4TiBqIqtxfzaQRLys5I0XEFIFrPbZRQb+16Fgi2LvJv8EFUPW1gGfQv1T/F/d/HBnccP7rAwnIIyHI4ArgWeGbU4eHy6Tx/EeTZIb5bo/BsMBjmjBE08f/RB0PHYBd9eVRAGY7cHRwiBf8WeCPHY1bgBTa9xKTELzEkQX9CPtl0gJiqsAmCT7I8xbjivh3JGFI+D2nBcSJQJ8agDX+O9iBL7UfG4bzAkcaICrbtYHz1ycSmGmAjJfL3CMgT3tQpmrfB7gxSzC1DnvdhQMieG47u75+kTouKNkM8c/+vq/Q7ZYjO/hhVvRq8F/9gGfhP8aqE9EIdR6LTwJ1h0BItyDqB8iFwuNqASscRnYioxOg9ApvnYA35f8e9Ohbfe8J4rknoFkO0lmA2gmAG0YK0DkB4ieEjiLoMD8wBzom27ANZkzIoU8EMHk/uo1mzeVoEoRWKn8L/62EYAX/lsB7D/LXg74uAMr9oGivJ0CNJCGD6i9DhZdQF+gtOp4S+NODRzsDVbhdgv4BqTMNyIL9SCKwL9/FGPp5oQKxIf8A/UX6r231H7YIqLML0Ae2GtrADOvRQH5b/MPE9dt9BGLNG8jVTAQvIaK5TtvvvWQgDvyXIClUA78S9Nfg7VtIBlO7cbsEYkQDMot+ygQ7QwmOawTHnAM2XUSnJvPIYRYMmYPS+sv3J+cfP3d04JYIXsF/EwMbBKB9Q9AY+BiSwFj9mzrSXmcJhFPVHySTbgHJCPvRQ/z7G/SVUETsg0ZF+i3CRoCjhf7y1A9mOiDD7TwdwEoEXjLwAv+avLE2B7Jnb+OqDpBoAchoQJskxKnss0vu7Q2YhcDv4ySeLOg9GsCKiUIihP7yfW7zbTsBh0TQfN0iAWn9f72Z56/Ax9P7j5OAH/Qvv3/QxKfk0DgDuP+R3USg3bzBC7bO/QT9Eeh9QvDPG7glBQzJwK740lAFFgFk8P88CqDGAa223YckWYhr+c0BPdwetl2ocnsfzePAWcVnnAIp6gDVhDLyfV4nqFEDPxHsbWD3k4BDkN+pARqKMLYBPzYEvxp9xmCHQQdgWH/9EtH2TIFpu3AH/cdGydv1j0TQbRrq+D/mLcX3ZACZ15bF378CG0My6Kq/zoGOQwhASDFwFbxyNGBuSxbCEhQ/uEPe/6gAERWQObCVVfjPpQX+rexxYhYFxIkgpgX7Y/vPs+Pvxf9vwt8kAs7i32t3QCP+3SPaTwIytQXP38u0PESm+YER+o9B3vr8mETAUfDrEkPI80ck0FZ0dXh9U+HRbhey0cAc2H7A4y4egoD6y8JfkBiigLdFP8v2W00E8deT2IeAKujZ/QAVKpAtKI20gLWksHedfgPcb+0+NEHefd9vB9rayi8h7J91gBbaw20MsnWAF5xHkyDUCOoXp+yrOwwxcKj0aL6fFppaaKDv6OpHR5sgx5BAlK/+fYhuP1D196o8e7lFBaKqv5YIMnFQpd0FGVR35RJCnCDaABaXBtgbiSwtICMtalKC+1JQ6bx/PLcDPQL91QFodQNKpwOgF/9eqcBxBBqRcKAAVk+ArQOMx1RYGgB6naDhlK+uQQwJYx4meQbxtNnYQwMjt/d4f3M9ZE4UOld1LAh99fbfzOxiEkKFCkTJIUIMUeVnJ/9sDt8/e1NEJOi9oVHDGYhgnSLss9DX2IAqw1zALUncKcDr0FB5NP+0cBQNrEezDiyiADPkt9qGpwoPdL0AGPx/NOKeyf3b9WJNdfcFv6bKd2cLMJVfJ6Y3B6wB9WFUfWWEwKMfGiQL+3bz9XGQz2EHKhF41GCtZyDi/gUCsNhYoAr3UNJ58YidHKqnMb/6AB5J4N73/4L+t7mAkeeP3P+1LNSB/l0SkMEd8DcEuUlguEw6t2AU/PCE/q++Akw6QFf1u6SBrj1ZnnhG50AfkoGIdf7gJv1KcSfgzWWkQ9U33Z3tHXYASKJ9e/YhU90rvD+q9Ej69/wxYJVs506Eg/r3DkMDzEdDBRGgcZay49XihLA30P+l8N+hf1f57/0AoxbQbwYaan/rBMirE9Dk+sBzTkC8JNDEUlv5McB8PP19Y01Gayep+hC/2zvQ/2HGLAurowsNGlA1cnqGGzeH5weiYLZm7h3QQC4O2tXdhvMMk1ZS5ebpgI8eMrPvPGkwaxayk8Yc6PMOBPEdC1XZ+2UfbfOPtxLMQQAG9BcZFoF0gp/RKjxe7+oAw9T7ZPWhgedodgz0gf5KBtrtIZhQAZpAV1Bi36w6t98qVfH7hqGI318lLCjLCUFlxRHwqYEH9a2qb4XjWvDT7kBwfbZA5P0+PNuRuW1yf4yNQH3zzwv6b70QOJ0G9OT/dhoYRUGT15uQH/71MjQLtQlxfDuiCXrtM+SkA+icQdH6sU/xz7Ze7FlubV4TpoTQ2osdpaEjtqADmEU7OkBEFoLeC3IWFFeswJXKXzkboNL+wzcFHU8hTGKIboO7CLi1/P+5F+gydQhuvRbwEgxvtACmANikhLTbj0gCYk8KdlYgmj+4Ymaod7TwahwadICuX0Cm2fE5iNHPK0x/CDV66Kyg1MnqjNFBnhBoLQCgUULfaVe5nq/6EQWY67bXCszUb+7232fVPz51iGB12owK9peyP1T4raMFF/OEYJP792mgXYfZ04GHMAhBkCSmSj+dKqRPgVFGHbpLEGMiGFeQWfSgrY52VxaeDUPSNJI0P7NoisG729HHl78z6hxfs9rV3m4JjgM/lsui2qmThjCfDFSb+I9vwUqG5wwL55U7C+6ot8B+7N2o6r3q37T9trfpjgmTvv7PSQATLLeRAOZhIJHBQfDQQJPBdUwEbVW3+L08EcEE/9G4ANrCeWcnPKRHDupbNynMx5AA9IRYLmrc/YLSiD5EaEBS/s/TgnU9ILcH19n+CpHwegLejx7Mn/d25fdN+e9U/1vgb7bqf08MOtf8EXxaoh+GY8L6gDfhvs4i6HQ7seYI2sv1GchdMsBIG3xlvxcCRzdgCPTn+6q/TW00VE8Q9FaFv+R2VlOM1vm/hhjhDCdgNflVKME5B47I9xT8z0YgPAJ8myb/LqHy36j/Mwqw9AALxuO1JVjiuQAYLcFzIhiEPe05fk8tRjGw7yWQbsfuLAT2VqOId1osnr0F49VM8INACPHDoBz4B5mqqSnUgyh3ArjXxfQH5BbgUS8gP7aU+w0zHD9GGD0CGHf+P1p/DeivlhU4BbxR9a2kYFR58YaDZCUR2P0DMmgED2eg77puegy6PgDphEB0CwlG/i9d+/Hs34pBEQrBn0W51mqGnJAk3ACCHeiqkQ1XFQA5AlKH7Lk8yJKWY3/nym14h2C3JvxeMwD9ZVMz0BPMi1n1RbKl1cYhIVblF3G0ATsRiCMUvoK9//OgcwYMoe+ZKOLlC6/Xk50br9NFz9fanqA8UIYSpCwlBO4kHc4WLLBfBHVaKwKgLQjmP4Un61Vq+3s7Bsyi0WztmLjJwJwFeE0I2vD/1Q6MVwefxfUf32skCPbCnxQqf+QMPEUDHZ7vGeyj020JgkPXXwsldA7SYR1RE3h94NvNtugswcgxXEkIcBPCGZ1rmrgDC0A4K88nm2fn/eTnpQtWyZfybRoK8Dro4zYDIMGsf7saTBzvX0SMbkAD6o9CYbsfMK38cJKD9l2FJt9/VGs0h5Gib33pxMKWNsigFUh3G2un+/N1WUglI/EEx8fq27vUNnwsiOoKecL7kQS8VnWAGCFUgn6dBtQhv40CmIYggwK0uwDHRGAuBXVdfwzHUjZzATLMAoyJ4FmBhzaWBlrHld9CCWpPHRqofBqMReMGTJ78q9rDes1Tv7/0m0v0AFHXNR6P6g30SHivin7V1BOhh3iWPwvps/yE836L2XiwnUT8x2iHgfqhnwn667QHEE8oLQjEvtEW7GYBZDrDVkwNIO4G5GiBDf9fGoFM6n+vbEtzXwP6u9AduaWnGYSLAlVdl/AU+ikrSeEIKgwdaZ4AACAASURBVKj4/wtgHcHtdO2nWKcBkPfxcvnNQvsj2Me9f02r76T8q0IBn9OLKfz1HX8yVXQYGoAB/2UeBQ5/5kCL6+H/OGGoRnLSwdd3oH8r7KkGTbgIxEwVWvnF8KOpHnyzfF9Jod5Px+IF1h8owyitDw/XEgRb5bPqbt1uvn7qBIQ16vtS/u+DP3cR7CH0WWJgd5mTJKYgNzoGjQrfvu99NDBC+bnyW1x/qhTatv2OaMKgJWPvv5kwnMgxHYGFRtJW8VMl3uP+MgoqSZyWFKr7+KIDw1d6+IiOgZI4+d5iYL3imzbgyO+tph9t2oSBxOM3ugHtPoFZ1LM0hF4kXNEBssvVgPdjdXZWK7uKvyS3q1Xb1WQwtVDqSUggq+Vw3t56JA2cz7PXOwGNW1ecwxPhfe3QEUsDsFaAz8jg0nf+iZMAHNg/XSazDuC18Iq1HBRrOsAQ8NLB+16g614jmuSgs3bROxE55D+WDDQNA4ivdMJ9M1b309UqknaDU8ObV9/PwmMPATvTMAxpABLBzugUtV9bLdhNDQA+7B9tQJ06/7QNDHGSwtgZOCIA47InIoDdROQGtt0U1HI3GaoUnCnC/rzBMQJteN17+VaAzYNA7e+PFqHQUyXPUYB7iQYa5ZFjq1Zqpx8Uqu/XT7+6BWC1Xaj0GlBIwMoHu7UzcI/6/Acb8KIq+hzmGWmAYnADrIpvKP7TZeLaf0LAeQkGgebbq9FToI44p654F47tekKkI0L5PQNZPsDwPBpy/ni+wKMN76Vav4+2cFZFf8+JwAraMt0DFB7beA/u4Zz/a+RXx0M/ct4/jwaNAS8G17eSwmta0Fhx0VRxJkHMivso+onMXr+YwdWKbgioy1jp4x4AzIKg5lEA7wvHEYCRmdx11TAuT6lDLVl4KvXkAET9P4RT8H2u+lg9EPQIpw+/NpJ7RwE8HaDv/Mu4f3OdNkq/EfAiEiOANjEALvcWL9gfFV4NZbgbQc6qPky4Pm35QZxtH1f4j+P/jXuaYPcWwIEH/fmEPBoAO4m4LGxV3txOQqDU+dXgey+UwSzuqP++uImO/u/6ogCb7wTc1n61sL+vZi87rxnrNas+giTg6QLzaUCjIp6JfhwtGI7AjBBB9JjDY4ePYVR6ZPgN4owVv6Q2N5hhVHwNeYrM+w6dN6K1sMHZm/Ce7bHe3dzKr1xw1w4JrSQMZtgnoQHlr18fzunAszD4qurNUg/TDqzx/lfCaO6t4tACMUQ6P6htWjDPC1hCoZ8kpODzJ70MUR9AODcgwyqyPhmE+wfHYB/hvSqt6qeXUShhXH+d9SR8DzrDaZZdpSp/HxqLMQuATgDU/qDPRgOIeT8cvz/h/XC6BtE7ACLOWPE0KIS4UUjmZaJ2grBphiWgT41BUVWZfP3AnEIT6OrfoF122l2rMycBoU5i/OXoUZ4/aglsXwLzHNU++FVF3qikOj5HXm2PBitT1WuvJRAB+6O//W0/PY8vQH5IrAsMs/WuVmAdHBrQgrbOxJShXwRSsu08h8JMBpo0+aDTALwV4tbswgzHrftG/dJKIAQb5h9KCssWIMeto+GYqG12/HWGjx8kzqNJaa0noMWOr2KwW01AMwJoNvhMQda2/RKQP/3ecABM3g9uD6BY68Ntz9+nDOMb5iV+hIE+dP/Zs/wwJhJ9mgBnohBuStABUXjugF3hkXF9ZZJAjefKdHZCc389LoStKvIl7QIEb1d9RyciQgFDI9Cjyccc/23Aam7/PZJBhgDgin5CtQvbCzX8ip9YgIFtOAt+w0owp/hOiCWgEGbVHuYjRigPGR/YOnEoqPDoV5z5YqB3mRq2ox5ICmSSgAP1Ne+XV2NE+/vuFbCTRADxtS70VRBCjgBk2OyDUQiUgfl77b7DwaHm2rAZ7osRSOOUoHgKfNBSLI767+oDYrfwZvqChSpGfj3pFwZFsCJg2jeIQQBUiyI4WgD68ww4qO8khuWkkIuDrxWv2nv+UTBpJYiPd0KemTA8qqFiuUF1jWS3BoG6pADJq751JqBI0wvAVPyMQvjcX1zbELltKK+zBiXRFiRxG+b7q3M9xuLdzR8g0gCGNzSM5gNYfqGO9CBT8OHct6oB3KsSDBisUnwsFuISQaRHxDSv0vptt2oeLHMERfRn/FG/Cx01EpgIQG8LP+/i37PKw53xn6sYCM4/JwSRrCnIeB1ZkLsawDhaPKv/njU3wnZ/dBdGE8+YTHSG8+ofGgIjsC19YnwdM/KAnTSsqj6ig7uGgIPw3nYFzhhIIvriAxFP9CQd4HSlnzgxONIdrE7A8ZDPx9fjib8ifgegNIliRgdx95+E1T7+3nQVNNhEzDgGA3T2rEDLduwtPpuuouPcs8swwXFjdTaMKt+jA5gUAQPcf95KJQxYU0cYxEDvsBSmYuukp7AwnqniC9Afa5z8vboI68ImT0t26CvwBzSggkj447r9IojvCn7U92J/Hw0QSdwZKNNjxPCfSxRqnATkdwpOwh88oc4J8KTSm/wdbZjrc+4iFP8YO0/5JJDCfaijK5xVXevqfg6zGRrQf83chvX4aRfAE//6vv5+6490U4ADdO7QgM/5bcHP/n4OtCQhBEFeDWSvos8DPq8/IwzLzjpa8/U6MMSkBklDm8e0mn3QIY7XG1Om8wzN48y7HwhOK3P0/ZwUQHHv4psbdoVeb9VlAjChBCdtDDpOKTh9ZfcagOYq31RFjN4/gwBYzp8lAwYNwBELhZoxECeZxMlAzWGdCRV0fQWGHo8+8Kx+AAxnCIzowAxy9KvNepWfsfp4RR9kUrD88CPVTuXRybhqqTHcnxEGndsgub1Gdug8yz9fHt3Hpl57x/mfCOC29FOSQ7/noAZR5W3Ob24UMpuPYAYiQrQgk1gnFoUIKr4vKFpV15pHUJO3Y5rfH3UFHU4bGkU+NKJ9f2hJyOMxDBDpjAgwiYqvk5TqNl9EH2Arb6fA3yaA4cBtPWewhkEcIQJBlGzYp6zRmr1v+e3Fv27xpzvyI44NGDkCIi7CGNV9Dw0M8NtHC2vUwHINumCGNG8erxOwtQINsW88Tlwdoc+F85nI559ngEDpt2F/Uu3hiXYrkN/pBFS26hYDAkFgErMK67y9mGBA3L5ore5izf8b3n805MOq/t7XU4WHv1DUF/5gugCSOAIW/59uMwl6CHWAib8bvfxWl9/rBGEMTTwDfG+ezEYG4yk6FvRPuPwE+wvc39IRjENWM+/cm5b0W4Pf4WuKUnw/vD6eDbB1ETs5vl77Dhnm/51g6wPWwQAqxnivgQaeS3gy/u/1H4hpTPrIgHAN0mSgXUX13YP5PMIuQAfBr/f70cdeE+QoCX3i8nFMLcAjInBoAIYqt1LhC1WdtvmSab28AYffaeivCB+ohdYQgfUa/WS4ToMsNLHLc9nnvPZLwn1/EefPVf+U/xvnCVSEQEkEQEnEQJO7S7RvYDxNeNYKrG7DKMhtsQ8cMmhgPKKKj+F7CiHYFR5KIIPxOmg5IVAtu3ACQSPh7CzUQOgAej5CWEkIe3vgxz0ROGO//qYfz/dnLT+ZxDr4QW0eNCJBorCFOVC312Ec2TiY5Bk0cAaQmiA1VH1MOwDHQ0kHdEDDf+2UTWhS4Z8diQMicLx8MLBfverLcP/jQzF0P8EJj5+NGK9RCz755S6F/f1+X/gxeP+Wsedv+vF8/54aSPJYFjIQd624MDz/UDLQnr8HU3ztKHRf8Qeno1vyAQJBaLcMtTV3cvgP56COCqd/QP9xLgBkH4BxO13n4hNUDtACC6G1S3zqooZ6Ba4lp/zcAFb7iERKQwQcF39IFJjdXECGADw0IE4gg674pYAnk4HoHPx54tD5daO5vxrugSkMjgiiqc7TVKAT6AT8R4ckbHEQCYR/IZBxJgA+XZjsR7vaoRpIxWqeqfXuGC2CxwudicwePEB1kNkaZCuwyF0DuKv/4sz9mzP/Qxdg3BDkBTMC8Q+loD6UGBzx0Kz6eAX/KArOQTlPHFoI4vVtf4rNuLrca9edRn4xBP7k8w+9AgZCgBfEUZWfEs8iFNZ3UO7TqmkjCO/rWdgco/yIqHcQWaC2EGTzgz5y/iXQAvyx3riyxxV/JeBriaGB9OrTA5g9/eokM+37GszqfA/UZk9iW5UnCtBqBl3XoNN6Ag/+zy6A5evPAp+TIFDn15gQw9rjrOzFX0s2JBVAxa/nP1a6AsNWYGjPNGPLTQgBsNUFvOA3Ht9o/rGDN0tWOCcxJGp+f7++kkP7PxcGv1+GjkaLt/fawpwwerQxBJNW4b+PJsYEgiAYYdEAGIlDNaAbRkIgK3ut0jKByp+8yz23X6GttmBmjwDvChgiYLP5V/zhH6/110sGcKo5CkggCngxnIPoPja0j2B+1BRkiYJiviaLJqghDI63G2nAgAxMCuDdnoD0wIQm+urMB3VuAwbBrFGgGgnhAFqg9+ujKsLxB3qGCQNEEtPinIQlAj4WgIw7/iXc9V/x/yUWFs2KH504bAh4aYWf4TrTLGTy9YbftyLeVOWNfYNyt/ji29mQnqMAltU3ioTtbX343yv/1u0YPUBz6zB702tQucnX0gWaFh6DgPdmhXaapGotw0SFz1qDiTMdd8h45HfcqCPRUhA3+NmKz1l9teCPaMd4urGaewRitNBDdahR5c3AfQmDCFT9vmtQEwqAYXX4XI2n23Z9B/Yb1FL+LWox6wHGbZSo6FR1LzyG+3hriSZvWT6jfXhl2cmQZJDrAbuYAqAHo1GA/EOgD8eGcU7A8eDvH4fQBuAhBL/Zp/vamPTrRENDGLTV/7E1WEPLDlP/PwzU4YhusIMUgfIPAr6Dhv5R4y2r8ldFwiFoYHnmr8TAHbhRQSZOctH598ZYhqt6wP7q/ouqe77RJxvzFYaji/z4vna4v5cUMDXqDAJ5ytktqtBDckyjvJg04hl16LB0xFfyMfD77PZjErGQRRjYIfSvoAXntks0ok8MsUC4KARWnYPlJBeIgLeFrUgDOHYCag0/XNAbWgRwQuLAsaQwIhC1g7+jCNKuT38JfnYSyTi+QQEwwHeT4/dWHYxJPxfOj5oAnRQqgU3YgGZSOaDyK3n/qkDYBKptzR3oD6B4fyRKjp2AzSl80YR/3P+/1vBjX18Jbu+YsrMRgbqPP8zrDLTAaupphfeZtyPs9BPztpLSBZjowF3woYRwBwOWaqbev15b7X4RWsiqYiY6ZkFEIoUwUA2OrkeEQE8HYNyD/rl3m88jCGgO/nPW3xy8x4Q/HBcM1dYg5q8N+B/SBSYhtD0EY1PRGLDoKIBHF3yLz4H/gSYQJRETgqeB2d4vC8L2NVnQn4PoVJJAcP0inahAfdXVI8CFszjRagCTtRdV7Sr895NBpRKXIT64RMFw/iw5eChhEvmmyUIH+k+Qu3cLzOAN6ILlFvgWnx3YWFDz0f38ze9GlfP6UQ3ojEY0gtqRIEbA5/WgQFhsEuIeL75uTzvqHktAWfj/OD6sQXssROcGiRgFn0QVkld7OznMDT7CJKzhMIqxW9B+LCOQdH4uyxIcE49VTSeLj0wKjzcp2oDXQA8YoDEGBLMW0BJw+eAxXejPV/IXd59/tp5rVyYXDw5BlRetSpQAcvgfOwVM8ObzBq/AQ2wX4lwkQV3vNhYFfn2LFgaoDU1ogqsfqGkJYmrj9Tr22KQwBLzbLuzDeA9yzyJjVRfwegWq0H+FThDPA6ZhZwX2M2Kh4waovCzAWJTzD/qY00c+6PM8coz08VNqglzx54LfHuTJK7z2rwX35ABLg1DzsZ7Qv7l/f2yXDlbf4C/irg0MJ0aCuD0wP74MrxfdFlX7tq+vtRdCpvt599EG9Yz3V+P+Oj/n4zLruZHcJ7oMt/MNp9eD6HEeFb6/TMfbWo85Pb79HJo8t3371/PuIAZqMvjPC34nVV6ZB4hEuA7AzA5cfU0y2n6ux89D/35/n2/vWY5Bf0qwf3tPLISO1Tap9qzFB6eap/beqI94NCCbGwgqOItY3CGl446CaQ8i2Q9g0AvmgJOnBoAA0gu17tsKtKS7D4udgCYERy2QIceCX/P7mBW+g/7D9S6Mn50CS0eAoQPDcBjopIA5+EcxEjLweRjXq0UbLIjcBxsGx2IZvlf0ATjz/6qypAmY7bhrk4ahsIis6ccXKHdueAfUgk+RWPCLh42c6zEeKyJpRTdRAOqBbl/Wq/uT+q+Fx3FoTIuCzc6+hN8j4veGjuAnhSE5gKnco3A3XwYlq2sq+lmP4yEOpqEoG0M+mGDYuYT0pKCFHgLHKt3T7T9p8GcWH+n1UwGa8X6kQt2x4CeqPexegT6o/Z4Cr313PHdgrsS2ZReLfpKIf+IMFnmVmwxQ9AhithYT73+p2s+JIVfrjwiHnpAZrSsr9CMstQXP1+1+510N/q8E/YoekMN9OMFvi5LvkRDsy9rgFCOoPdpgaQIWBZjf5KCSQszZJ1ivTvLokpen6tsJAVND0NFqb6GUGg2Im4Dyx9Pn7/0dm4pADAslJzTv+dKNrAPQ0wyySm7bj1RQgbAXsRa4R+mBJzpaQmHLmy0BLoL+Nh2ZRca8uUc6P37k97n451fvTieAE8BdZ2ItqFEK6oOJIYPsiU4woo140Oh+H/UC++gatHYcOFT+2y3AYvD1rM/fpxdUcsAi70c0OxAEP45X/hymE9XeoC0zfYhbcqfbhs09HpwnKMDR6g0mmYyKth/UcLl9ITGQ8N1S6s+gA1HvQCc2pluPvN2Br8SyZyfyxPP/VhCi1L1HWX2CQCuAE8TIq/sBYdANZmTIwqq0sb0HIzhhugBeUpBZLFyA8y+EErsBUYDZHYN9QAAooQwOws+uQlhdESSSqk5Qsh8LSYI6LDS1AbmOvLlRBqQIeITvM36+TP63VfE5hFClCTr9zEyVFwS3STQBy66DMHB+PJWIrfgGnYBx2dTboPa2X49GaBVlePA7CFx4iaGi4ns0aLVjMGvtPTDtmO4XEE8E5Kb/8qYai+NHl60LgAICcUCoJPVeiYG6Pxw/X9VFNVbFn9FNPzXoIRDTyzcpREYB5Fm1EQQn3KRi9wKApR8Tz48SwxnV3qM0q7ZhpdKvr0zfY+gO4oQf+EGPFYW/Xf5hwWsUgxiBbShGoGIx+D2eH1h2EeR3UQMH4zMaUKr4033nzkSkfQADelFbLOQCalxdxvN8mInhPas9bxtGJw29Fx3Y8429MAS0fL33Oeo7qFZeiToCC3B/VSNYuU0fgDnkhxGgMFdxiYEY7MYel+OHPH30IMeVFK1C79l+QdXVpFqHlMAXEf3EYDyfkkGdNvJ8f3RAXU0jpgM7jMNA5yCrtfzOicKG/M9bgEkEjqqPPDEcDfqVwGZv6zcO9avDfOhf4OmLFd9OLBHHdxp51HvOBlnAoQksYjASA1xnIhPsapTCPjbsGB2YevpPpgM73EYeSYIftgPgte6CWesVBB9QEgfnWYMgoeC8ql69bWoRIqYHvSIv/u26bj/jdqZ9KSGk74JRo6QS9PuTiSHm6Z62kLUGH0UO4rwWrhtRETkR4iKRdI8giJ2D2nUCMjsA0TXiVDb98NAf/rCMlajA9wesWHZrAe1dlwRyVI2jx4KkyUHSx7YDe6YD4tOC6XW01puEdAJwaEJzf1uATHi6ZlSCpBQscsh6C1xRcWEG4bCFeKcAVhVlDu54JQIkTT21hptIT/Afk0kMcS9BKfjBJozcDXCrtgbWXxbMAw3INQIxtQJPAGwXmYaBbYh4SCsuKwLOAQ5awKskCMmRg8P3xwlBfbosQaDqyZqBkyQe1CLQACoTgN4qbyHsPwkTiF2pYaj6MAXBmUosQHnUEYCsBL3MW39SNKMJ5PfoBsT33DVJCEbFnBCMOkHfvj6Xq8uw+dgRIhGgAiUqf5QgKDFyhe8nnYrlqn9sG1GoAfirubygX4H+8IM1CmQrMFAJ5ExzKIp54nPoVU2Auh6eBShDlTV4u5c4HE/fVvjFrsII0Ik6QX+Iq68jB19ziLoKC27FYe0gC+j1RSS+BgB7AvAM3m8HLdy5fV60C8RMVuhD1ieQB32MCCq0QPJuvuw5IHF/geMKwOPdpmsxBwVEfGEOgeincJqNmuSFIPhPq/xM81CWIIi+gCFBqDX3QPYd2OcCRo6GZBoA3AM+00aesAOQ7/2Pe/vBCXoguD4OBD1WfPwClzcui12AuH+gC0gEwW72KfjBCQRBr05D0IQc7N8PzOCMehPWK384MPVDJQim7yDdoiRTItzzFV/ZOX9sYFetP0fsQzb6O7wOoFjxk89YoQXv+BmSN+yYHYO+BsDRAXHhuJXsEFbdIEGZQWUkNVNzGA9NZUVBIQL7jASR0AclE4Pb7JN3BO72mG92+o8UG3nybj+mASh0FsLKn9GPxDrEcS2Au35BzHO1BksriIJdpqWjKR1wlpR4fN977rZqI+XbYjYDgVDpcYQalOYKMiuQbB3G6Pu/HlMbi9a0EMkksXtjvvXTfgMKAEZRN/i/O7yD8Da2S2Bdh3ICWfp8yuMkYl5a4df4vVWt4UF0yyqEnaT6swYyWB8/j111Y1ERS9oB0SLMtBGDEBD1PEHwtdjUEAHnqmoHU4wCDAoAS+lHwtu9eQLUAgmxVvAuMB9cELMV3m8EUtcBYYI9nkNIEEJYrQeUHfnzzRyC39j8CgSkir/E0P2odnAmAqDnDIhqrtV9BDNS2POjv/0pwKr6z1h/PMz3uf9ykFYq9TtoAXSwpz0HljdvBCVAPY6t7osv6gFhMpkX13rcfXQMIpuTsfTibkfOPRAC2meLRipI4mDPwMD5x+v3+Ey+qEfACwoUEkKQSMZxYJDz9R68PyP43yvo2aYf881rNQbZgRU/jp80QnW/hdXqJxMvCFxXQSNHpE8QiF4XI+wFfQcw7VL2Md7RRajsKgh2D+6SLAKPF356+/7yXYBTUgFy/38StUjFHweD+iiHh8/LV/i/TSvGk4L5x7F6AsIKbgb4C0YjgdGRIToGUx7cgS3JKP8pRcgak95BJGQbjaJdBYQ1qHYnYHL8F45QgHx2gLMQ2cDxBD/4SeR0LSDi5XzPQNjM4ySE/HGG6g+ugltLNSARn281BPtNO72eJLjdX4ITSEgpQvJYFEUg24f1qAYQNQdxx6Q/RcB85j9f+03zf2QV33IDPHegNgPABTfqFR8cZK9TA7/ll0EQbUUHW8Gr1d+MSadia+LRHwhunv87yWoJ3h/pRDwJAbDNQQFd2P2mH4kP/wDT/ZeN3CK3+ZjvgVpw4r20AMafb58j4N1UMknuj6iCx883PU9g2VHVH5JX2eEcPghSgRBCKPzK0Q3fknwPN0Hk0CyC0zBkz//7duEetgFjVtypASDI4CsknYJgYDhqsBxxy29+eyxrAZX75EEf8f+CkOcijMDDHx4ASYGGu8WHgPwpHJc0qOG8FgFTuVk0cRZVePFwHEIUEu8xSHoL5qWg4I7/HgOKXe2dcnu2SSdCGIDTA+AcxY1zYL6Q6AAFu+/1GvjKPSeEoJV3NiM4Dz9C6oWkEav+NWjPWXNOIkKgNTi2I8LeBgaZHJxqrC4oNXoB9pzzMws/OW3ghSyQJgjbygOVEDhoj4nHLld8HPD6UUMFVLIgKrTL7cFoBRLQgEdXIseZ2/HhFPKbk4d5tYWwwR0nIFQSD2P5gQhs6meVfB+Bkyz2fOIvX/zxqsSODuAGIOLtPNnmIPCrv6Kqvgz3q4tCwNl9lWYfnsdHj2HTgQw5IBHwULmfSu1jEV3gDFSxTBmqSEVqiYK2IkWcRiAkwV/cyW9YhqHXDw9dkNQAcO6HFNJT7oChfrPUYc3KY17zAd+evAwF2w5SCKLV4EuCEKsKfjBVWHu9Q9Arh4CoBqEMWYBsNX7YgKP/69uC3M7/mOOz232QT+ox4iCyJGEFP4oBHd+GVvXBwX35nqp7qeIbV6L6tdZub3ueJ+gBIKgC6S5gOQFxDoGr+Bv2nzqbknd7ph/EmXzO0o+kZdc/wqvQkAOUffVMzKtYgx5Vob1/+HAfCdzHSiXHenX35/2JTr3KZ9Ruj2lYiMhLIFoNyMq9hFroeYMTE0bSLbhb4l3YlFPa6hMd2jk8dmrDgdQCnC4/+ANFlYTB6ATlx2GDGXP1rvL+SnWHw+cJes5/rRWt4H2pw9GklD4uSMpwasIQiaYR92gIyFX5S8dtRZt/nCAH48VXW3hRE/HKOsGquj8EM85Q9cfeAV4XwNGAlmIFIwPYrfLKuxV476RRetzcdeAsRSZhiHizCKEIOHn3EMOWy5X4uIJnXX6sFiBFLaBm/THOQAkVJK9j6TKwiSDTBWpwHkSPQJX7U959uAkoaTUuug6oQCBz1Zlxm0OJSIoIw04M+7zCGuYiznCfHww9AN6Ir+HXA7lfn2oBSJ2FOOh8SzINfmcAyITq8JX/sOMPx6A9LeYtVfwgCBZhdu25OB9/XmWWNPUEPD5dUuJ68wd1AqD2+w1PI9KxE9BW5t3z/igdYGWiL7L+wPv9jgVY8f0ZcbCKCuLAHN+c5wa69Zpr0J9t2KnpAGzyiAIPiFalJ8/xXrrA6Y+/8NoDnWCPNwFJzf5DpVkHte8hx76P+HU1+HEytEeSEIzAsu5r6wPJGu6oLz8VrKofXLce+ywIHhNa/Dmw8LrptWXZ4NKZm4pr/QQ7Qk8ehMrPtAF7PQCD309QgRgRZMKgAbFREAfBBXNalbHA9cEHMo4IgIUuPjjBWEUFEQpYTkhVO43eRiynJw9Jjj8TOUIlJExK+0wA4gWgQvcFBHAc7P4/u78/Ff4CC5ATB3P3oUwFClYgcALcxzp/B9Ez4DUV8RjBbsCBrMH4dLNwIDaCGhA6o3pXksdBvYBsktrXDgNJKAFy1Z+ZGIy5NXgXoBT8a3ZgVSPIUAMV6DjLxhsV8wX4n4ibbONObHNyCr8Z4FinNFjg8ziiF5zSV8A99u7Zdf5OisvVaAAAG3VJREFU/kIPAJLWX3hUIFD6o7MD4WkHIMXBk4IftSrPNBJVk0OoC7ice8HGS8XBKDoz/YFBLaQi392lGpCMJfhD9xVkx5Xbj73P9V4m1j0v73x9FjDDPlYvATkgFAVWcdNvJBamliOjAwRV0EpeRymAe717kMYRyy/j5FwFBX0fP7Dyx8gq8wn2ZXi8GfGYR+lFcGJSxa3Y84WgzBHetlU4cvKY44Ps4iP9fsgsPGEhQTAcHqwwGCj61SoPexKwasXFqtxq8qhD9SixoBBYcJEDNzmIoi3J7QkoJActVHocTVpPBCDhElAvMDK1PT/Sq3DwB/ygmyB9GNhYDH4so4Foy48kkPtZfZEv1PQTxYpyX0EI3Bu+/5krcN8fgwVdwWu2JNVNWAk+PcOOPMNdGFyAZ5Aj6gicgzNfwuHZg0HrLxBWfjSRl88fVCo/apX/IBrIvf65ZxtEoK9Bec4KZIPLe76osQns46NwW0pUPCPAyMc4A/KXOwZzFLGbAqD5xhhbgBcWfoJBAlarcCSQgdQJ+Movnih4gjZQTw51rz588y/ZgxVUEAQ8soCfX8OR26JwujCLGFAMsOjnwGrlPuQw9D/PPv8BYVR7pG/eeFtQpsLzR2KFI8SwKj9KlX++HeLOPuSBKrKeHBi7L4b+Kx184+ptAp4Trcscv69oARVYzWgaK01H1X0K3zNSmARKtxXYHvwJuT+8gLGGWgpHcWOmBeljFB2Ckg6wiAYOqfxEK3GMCAj6kIiTWdCBCXhkjUKMgJcLk271N9uLSbtvvK0S69OXAvoA5z94VsFubbmZvx4QAnXgBnJxENyQjy38wef81uPhxMpPJIQzr5ckuUTKe0wZyN57iFTWga8GvCwlh5UqvYgmaNV9XSxEVWs40kkosFwA70RgNOu8mLZfR6wDiwRa35y7j08NksqPQhcfkRBK/J8R75Iz+9C8gJpqzwiIeZII3QnYOkJWbVEI5jNuA+o2BwK82ifwnpSgHwaC+GNAdmW2VXfC+vPu6wR6lBj84C9WfvivZyUhZMJlJhjSukDlFJ3g4AvGJfC1iEpQJ/CaEd7G9wds7p71+odruKrHip/C7RdsxeVjzIxhoNkFGOW/+sk/YVAGtltfzZAIfzix8gcHhZCXpcGN2u69qWqD9OlRFAy7x2fQBhHUiETB+DocqvArYt98f+AEAXApsEmEcNLC0t2uPHCqPQIXwHYDfI4/9+8LMpchqr5HK39MJSrBXwnutNqjovjHFdq+fcHLp7YLR4mGgduW5hFpAXUoL4cTTuW5HJSkB5PC0S7A+8c+837DyoM1J9iv/po/o3BunlDqPjOSO/YbLFd+FGy9sxKFeT8b+nLNPrkAyD53FtT27yUS32yqUaEGTMBiASGcZ0FmK8nWxbvjC1q6WQC4VdWdAcBY8eFoAzIrC0b7Wt8wlPcIdE1FhUWeKU1Igv8Q/0dl4k/NnYSxdlDon8diUDeuQB4c8XVzcahRgyyZmNC+LAgeCfSVALde8/t1DCYawNoePGT83wlOpFUdOZKwxn89OsMEf0X8CxJCBN/dwKbFwkSMgx0ACJJDJD4iC1JEYh6XcEqVHpx4+J4I4UiAl26r5x64sttvSlAn3LBuQCz6edU8C+J5epBrC4YP52EFDgHrCw1B0eU9bOaTgh3wmYvQV3Oqqcf53XnVNXUBELX1xtSgFrirlII5d3HFulxBCNEfZx0h7K2f34XwdHpuYQcguN189Ow/nPXclaUcqMH5leCXjKOjbv3F0a7i2ZaRHmBe5zwnhA9S736ZC8AH8LHkg/T5znYgmES1dtuzGo92qwHIquiWX+4KgVLd8utv9Ml1BQNhEJW/FOgweiTguCUoQHkEwYhjfQIgm8eAzPKzHqAG5xGiiPyxeGRRaYetUpDVpHVC1T9bHGyaknb/TQTnuG7rDYwYCUT7/cMjtILzA+Go/FPw581F/mWeTkDuBsBCAK8ki+A29nMzPn4Rzjv6QV7xWW4fzQFUxb9jQQ1qc28kMi4mDl1NBr4usIsz5ltZqNm7AeJXfuTHd7nioLEyPBISU+8/tP1AC4Il/n+YGmjg2NiBRdl6yCw//zG5ph7bqaBuz8B4VMU/TqSsNPbwCeZA1cdxyG9SgKzRZPL+GXFOiH1/SFZ9wX8M3zUgvH8a4rMBjZj/h1W9MrwTiN6MlsCKiI4gycBzgV/xUaQGjGDHwHiYi0VIzeEAasCpNuL76AC7BIEl7i4AIxnAfoMxk35eJbZ68wWEUChs8IPz/EEE9BkUoNA4RCWSLJkY1h0Y/dG9bVCtUVPe7QRhtStXG4nOECDfUxc4Uw/Ik8JkA9o9+a83IrfHH11EdFUWc4phNgVFWkPsIHBnCvCCYBSgqEN9qtoXuwHhByYoJJA7BxIkkRwpDGgAHo+vQ3ZGOwCFJCJKUAx4MBpFZWvReeLgtBBkDDQu2OJxXa7SE/P4ZiUPHABjY1DsFIhPAaygWewiXK72hHjow/k8gCL6gKES8qcDZ7A+EhYlWCPGCX1wXIwzkQEKt8cP6iqkC0FEhFj/ZYtvXCtwuBLcDT5wXN+9H6ZEIkTwV/x/s78fXFX3siWHEKrC3tw7EFZ31Ll7ttknQyEMGgAqCaVe1bGk8r8nFWCQQR0h7CY0dsU/mIeIuA1AGCo02Q0YVXxub36sG1Qgfo0CBBUXxap+ECFEycQVyViBEBFPt14TK9rZHB9EwMG7DPXOv0OVHkdtx7OSCXfb3av4CFZGTwQBwT7/hKPHE4PzpJ4L4+FM9r1n8B+B+9R9I4Fu9brYUZgCunZWNxdQgIs8mASBQ4F8hJpEiaf4GPihk8FdAxin/kybjZjTj+mAQy6ihZ9whDvHAWB6BKrBXQr+5SBfqPaINwiz12UIwoTmbPACZY/fshBBBKNlW8ZCHwH/cVKSOZMm4Mxk4OwE9JeB+EFkn1IzcPQoiSB4vGgNeJSoik1A7m0TCmE/HrggB+/1M12C1Z18ACGoIeH1pH2IhAqFWgBq+kDFEWAvA3X8tpW0cnSD5WAOriOHhnYraF1eLTkS8P/QsHUBdtMPnOrMaANJE9AZiaKWII5Ue/8PTHn/UcCSTgIF2xN4zdmAQYIAKeBFl6FiO0aKfq5jcImHfPwTxcEdRmD3LcFoAva1Hdjm9UgGggI9YOoPkOBYLsT8HlG3nucMDGkOOJ8CkNOELdSO7D5qqAeJYBb2GpABgRi2gxLITgrOQ9C937HgB+0i7MeRx3gfPWCXLtgbLJAu/gCFBPzRX8eADJqCvA3FViC/BlOQC4LZyrBq8BdQAOUKoKjqR7v7EFfVFMojPgEoSlJesNIePyLHwW9NRgq7E6HvUN8A0yj0wyWDHRZ3J2A1jHdMyu3hCGwSDwdRir7h9VP7AKLgPoMCgKziOFLtrUm8aIFHlgxYfz8WBYUU55iAXauo+evJaIK/NTgRJM9sUcZRzcCnMdNKMJc7usnAyrpxHYkTRHK+n1HxS01LheAHqRWwKIDqLvQC0+PupHZgBawfVGsiniTVHwZHRqbUI/D4Cd+ftgyLAR1ehkIiqaKFw7MJEwUIuK5zsu4svoFYCFKgBJZACBuppOId2RDkPZas8H9kULcA9a0KTCQDGtpnzT+RMJiOGseHl4BQ1C29AWUXIIf/OIwwqoNEK3SCuA7FRiBrE9B4/PcrGJ1OQNj83F4Xbol/TgVHfMiIZLAdcaVkgh8sLrd+liNQH/FqsNTfj15m1J0X+ffZuq/gTY7QnvIfJz6UzBJLs83ItQpt3RfZz5iuGfNPajpngUm0R8DoA5jDlzsOTAwZjzsC3Jjxg7H914PjlcskGdghgx9HG4OOQH34uwQyzz61/0qiYNQjXxECuWYbGM/DrjtPH/Mw/K+gBLLSA+cEfPr4MroArzcDuybbr8Zc72i2UnzeHnTgzD4Ug78SzIvCoARVOQxaFFR3TzWnkkHUVFShEuqKxZnKz4p4YYcf8ZhYhuu8wFgSHcuuwCJagI4bgchJQK/qe9c/RT6nGcg6KGREJpb+MI0EY/b0jcsni3AJBeCQNsBOFVYoApcM2Aom4VFgIRdHpeIG8D3YaxBD+qCiQ+rBOSVnci8hzkAG1t/pgHA4uwDzmu8xFKkkkIqCfkIRs204r/hiDgutoAAcowBMZ9+KS0CcXVBOHCvJw2jMQSJyeoeExF2DuTuRcuWAo9sefyUQ6/oBaIjPtiRH1KvQKvygAHb171d+vc4GRMDPoxN/kL5pwlVh1mBQ1quQJAJ5j0TgOAis+h8d3mnC8xTKE34+8sDNjyVXE6nFMN+H39TQDmocHScENvN74LoGScGU4f7g6IG3n3C3qnG6JBS+Z5tHOOzRYQx+u7MZmAl0OSsRLAS/VIKfRAWU92+12aaVPksGDBWQuCMvgNy2M2Mt8EwqbjosZAec5xLEAmXmcFTHiOWARWglpNpjdEtBQRxJJU5VL5/7F1X86XntXgUK4q+KggsUoIIK8oA+kgy4+zLaACqQGTVOX6MBWdehL6BxHn+tlyBMDGAqufd7WOX5WTJwKYDfXJJP2GXDPk7Tj5Ed7BOG7DMFaBRAJgI/+H2Ngeb2SKb0zkoGlQBHkefDr7xMA5HZeJPtKIzyApI9gmnPgf1c3mulfhe0gFekDCdNFnrOwi4Gs6eTACNjB+Uegcgojog4V25P8bctRYY6RL8AJklE9ACFAGZdBEahd4d4CmghFhbzcwaXYH5qTlS6DY+KfNH5Avzjo2JJ0poDkSCMxLn73H/eB+ifvgvyIFCWAji7BWC8hd0qj0FziMdrS70BlVbgamIgcmotGZDNPwm0L9l5iHv7WRoAFx57ScFS2r2iwot8oKu8l+TOCOg2mZ2nFdjTgOFQENzKkJ8OjEnsE8f6AzyXwT6MNF3RDRnuj0Lwo6wTlBMDIyqaz6G+RiLJMg/KUrQV/rh9uH0tWduwoxmky0kSMQ+rnXxZsGadgnxfgk1pCnsIsGYltvfdzTOBIclIsN8MLAGcz5gBwj94AE8DuC9Molip/JGwB57nRyJiyD3pyk6q5ij+3TzRLohcqyqCEQBTepF15+WVmW8SEr5jMUUkx3oMIsrH3ndwAQganKzyMpOJNxMQooGBYwcByw7axIhgPRGEr6GSGJhkAELoQ1YRg+dPeD5IIRDIqq5PA2Jh0Rq0YcS8XBi0ghGRFpCtWTdum5+yLOsQf2EuYY8AfnbQZDgCjHxBSKwTGpt8QCIDVH3/4H5OwEvldhliINwAFLsEyyIfGKV+vm3eEehVqKTdNxtDiPoLHCRiuwTJxCECxMDqDjTvZ63KaPKvRgV2i/F3ohm88V8LN8hgJcXD5pVGIPPNn9EBqSQC0I4AMxBUcQNCkarkFgSn/oCs9GCVep4eUG5BRAOcQOCWlGSc3If0IFqRfURQGRrKewPKEJ9sLnIowKCcw+f48N6UHjqYtgInaCCkBbPSj8VEkCr2g8U43wY1xX/BNkwreQrzg+oaJghOCGTU8RBxuIp6VFOGoEXgEsBLIgV6gBgxoLSI5CgiYNT+GBHsU01GthrceiMUtv9KgAYktgVNeGrBbtiOQVi9x8WjiAW7UNUnm4Vet7WtsFgDCDYEwQ/EVL1PnQf/xCDLTowTh4c4HPRDoQaiwhKIAae4B7xgCBydI/CDPOrevK0FR4p6w3VfoXgQiB3T1N8Y1PCD0X19JqcHGfzB5WkQE4p/kdeXBcEVUXEIFqSij82lMyrWq/7c+LFHA7z5/dwOHHg8s/Y8C2CmhbmALtare+4UWLfb25BmXABKABTniC8gRAP2yvDAiUAsElnrxFzITQa/sAFecAOY7zPV/8jMQHSbWAiUPGkQNABhw85xrSCv+mMSzFR8+7mjw01A8f4F8S/td4jnDHYxpT8/OEyV3gz2+GTfdAeAszswfJNGlQhEIjB0Bls0BKn4Iw7WKu9f1gmSagmvqleEwJwnZwjO7npz1HdCJ1hS/mlBcRXyF3i/M7NxqJFoeH27z7nnJaBmpUZKHsTbGUc1ALEoIGsGYl9ixS50gjAT/VhB8IzvGTrBVfWEz1MzAkRFTtecW731VdjNQPukVdhdn0Y8d/a7WYH6i/TBPBzUFwAlHwtGHOQISrgb1AMUgDETTA3+THAdeRJhg59V/Ektofa9I8wxVICkC7QQSAd2O3cftzPzdMK6aA4iZI4ILfYRbb9RgqICt2AxVnYZ4kkBvHOBxT/zN9ybHx/f5Ql2fkGCX6ANm6F8WCfqAS+Eq5AGcHJd2IFHagTMHAAj+mWBnDXuc81CjhsAi5dL2K8QCYI1aJ/PJtSSxEFXASv7C2I3ZB9/a0j/7nDn/j1pHsz9Jr8fNpxPBUAUUYD4wz5GBlmyAiORjtAIGDFwzSUwqiNZ1d1tPiB7/Q9VeI9KeJU16/knkEeQJEALjY4rkp74fCZiMDSA/PgvT/aT2gYgp5E/P29AKBQAo6TRth5T4VesQFb0i4K7RA2MZpgyFXCEQHCOixuYMPgy2L7+45ezSSKt2oUkURlpXkEMOLSiXPuDQZjk63N5bmzOSxQdLHX7AhwUEA0BAeQPJIQzkAuFlOK/GtyLdiGDKEBdllQ7YouxV2Xdwza9So4Kp5Z0yAgUhTlJgFzSFrznIHYIwKcCu2/L3LsCg6UI1b1/CA+ApIV5/32HqOIjdQusE4azip5Wc1b0q/QGIAlaWEJbXP3r/L+AEipw/+BtkQVY9fIM2i/ZhgVEgJO6DZ1ksVtlYdoQAPhVO0oKmYBmnAYco4DRCRB3TwCziptaE0auER9/VzRqKNOEYINOQg2m1l9GpGNQAhh1v6UmxNQh2M4+LmlUzll0OTjYQOaGlZAEMCrdhmBphaMBwBADrSQQc3//He8KgFETT7p6BHnjj2X9EXsDjrgBS6ihoAmcSQVYmE4JgYWFpp1waAQRoqDzxDhU+HxSnZHz/9JEY6Y5MJA+cwoWrt99+U3Mc/9g/NQTFaigAEtwB1yBzwzucZSX7RZEILhR1d5GDCsBLVUdIQvsldZfEJt5i/MHx2hGJZFkVVyK242iFeh58oBUFqIQbkfp2DV2X0CkAYgv1sU+P+I/HmBu8nErugdRnUWhfp+A/ddlbEH3uQlBsNobUEMHasK1HOYn8BEEvCUaiuigXRIKj+sGOPA4KAWz9/s7WxcgB4+a6/fI2osEwv4yOENAiPf+wQhbc/5f0gGisWuQaRFmGoIqguARWsBQgTTocDLMT5OJUQnhqdCEig+/EShKSEgTVV0MBMnz04BcshPnLk/+OaV0/dwKzB4QUt1NB6uTDfGOP+cNm9mEsBAFiM7AQh9AKVEU75vy68jeOxrUC4mDEuYO0oLqoSdHaEF2eXYYSm0V+oEOwpLmYFOF3Z4CmAeBTIGueiIw2xoKPzDBJVBXQ5g5O8/twwA+QguIjJt3+g0NQEcDfUXgO5gsqlTBLkQLdl86K3CWneitQ8sg/5oWAUJP2C3V3RoEyji5n4b9lB4t9pz2CA+cAFn1Z9I/uzYsU/ELtEBOCHYQQqGcFejV+yeuRJX31zsKV5IGjway9z6PLDxKwNEPsBuOEiqw57jGgOtZ1Y++T50AuMFl7hPIbhskiOwsATtRoc7rS7dXrpcgrMCGJca6ELJo+Y0be0BW5ZKGcFz4y8W9BduwcDnK9iO5fagsKpp9ANnvDPxeP8THNyIVFo1AMas8Qk5v2Ytm0LCCYAXqn+wQsPTBh/5Bcnne14Os3uCQt28vsK1WUESJFviBgAW//3u9PLxusXchcCR2WsNzv/ImvgZzzkUByDUAIrjTvmSHAowpJBQE4SUlxMxnARlQbIqkArVAJ6pBBvELCCKlkyCDAP45BYfEPfcUpfMch3Vn4bheYK4E66BxAxHSVd5INgEPgU/NBCDfNQ8Ho1CoINAPQAW/QT8OCIZlNFCB84XhoDChFByHGjx35v9BLgyhmojqHYb5QYXnuAecvua0hZe6BV9f7v4ibvgvamrmAc1TmaEir0LQ9h97eYAYVoM/nWA60i8Q3Ifezha9BqaaL3zvqd6IAuwwLSCCuCLuJWch4h30giPtyiAphKEBcCu9BV5wwzkMxID8rhMwdwMhcSFgrBT3RUTQboAUg3+p+Qe1IGarOioVnazmefV3lHpwA0AcLWCahUiXwePHWJsP+GH1gnp/we5KfOhJAbsj0H/BIEb04TbrTPsAyb2LLu93KwfCvn5PLAwrOXAa72eEQRo1CNdw5IprsAZ3hApy9zlcITG2vpCihsRSYxNS+J4vdBZ6B52eqRcQ/QXmSjAWSfa/5GA5qEg4iJFtm624AqXLrSA2gx8p1Mdqcghv41S0lSp/xAYs9gakQc4Ie2RTUYwYgt748mV+FU1Xgp14eW3XYZ6cdqGTNHwHICTwEeTPl0jEZwIgP9gDEaogeg5IHWCF+1eoAhvEKPB/EAeTRsM/pSAP5wjWEUMM1/NJRhwJbpJSgK7S7zF3EOsI5jBQBK9DV80Z8Y0COzvmWzJXgDl40KEC6cqvqgi4OB5cpgLFYK/1CvDiItXqC6/S87wfAUfPtxqfGNzlYaOjlf1IsHPPvffHgDAoEeEST4ZLZUd/RSo91/BjXY5ggWgQ4In3fyj4mUqPrInHOCLKO3wUwRsfyXpt1nEIRLrqcWeTuk7bigsbid1zD4iDRQtnIdQsyIXnFCn1I9D7ADgxEhOvR5AJosoUbu1FkJyYCi9OhQERoIx+4AX/YqUXQhtYEwKN4Cy1HntLMmtaAQpqfrT/UCoLSxeswjA5UWPPi0mjajUWxMTdVusNvt/ChMdmILK5IRMFu90BMEzFYHdg2GAgeYVHMMJIBTA7EFTx/5fpgTFXz9w/en0ZjD8kCDoKPNGwlB01BmoWQbh+AxR689mBponGJOr9OwmMu3dtJ/ylW1Tik4ElUPmR9RqII+pVhD9ychABMQ51gOIZg+/G+5mGIzLB1JJC5WhzYjhJ7IWmLDpA8jzsAafUPkB2WnFBF4iSxkq1ty7f25rv/+EQLOxs2oUdTSA9HIR9swdBlCcFe9owPC3XWDDC0ISVzsEVbSCF/sWdA5Fu4HJqankp2SeQCYYrImNalfmhpVxYrGkUS4LeSUjg8dD7+D7w/ybIfy7vlB9/HJ978zr7/45Qgajzj+4EjIK/ULHPRAOlKr/aG0AFcqCyu0GcW45Igh6JMJmhA49/U+cEssHNJhtXDC1MOya3j/sAiAGcrEtqtgjBD6wEzSDc7D8o6C8rIqAZyPk+NQoNLAZ1hR64Yl1FBY648smUYKnSg1Xwk/0DyRyArByMUobyByhCcPnOaPyoegREFS4jNfYAw+IHCjdC1J2WDZBke/OyN85J24WiXwDYPoJyYuCD238ulvuzwt6KgHf0shWKsqCFFGjB/w8HU8eeTED9wAAAAABJRU5ErkJggg==",e}()},"./Misc/canvasGenerator.ts":
- /*!*********************************!*\
- !*** ./Misc/canvasGenerator.ts ***!
- \*********************************/
- /*! exports provided: CanvasGenerator */function(e,t,r){"use strict";r.r(t),r.d(t,"CanvasGenerator",(function(){return n}));var n=function(){function e(){}return e.CreateCanvas=function(e,t){if("undefined"==typeof document)return new OffscreenCanvas(e,t);var r=document.createElement("canvas");return r.width=e,r.height=t,r},e}()},"./Misc/customAnimationFrameRequester.ts":
- /*!***********************************************!*\
- !*** ./Misc/customAnimationFrameRequester.ts ***!
- \***********************************************/
- /*! no static exports found */function(e,t){},"./Misc/dataReader.ts":
- /*!****************************!*\
- !*** ./Misc/dataReader.ts ***!
- \****************************/
- /*! exports provided: DataReader */function(e,t,r){"use strict";r.r(t),r.d(t,"DataReader",(function(){return i}));var n=r(/*! ./stringTools */"./Misc/stringTools.ts"),i=function(){function e(e){this.byteOffset=0,this.buffer=e}return e.prototype.loadAsync=function(e){var t=this;return delete this._dataView,delete this._dataByteOffset,this.buffer.readAsync(this.byteOffset,e).then((function(e){t._dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),t._dataByteOffset=0}))},e.prototype.readUint32=function(){var e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e},e.prototype.readUint8Array=function(e){var t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t},e.prototype.readString=function(e){return n.StringTools.Decode(this.readUint8Array(e))},e.prototype.skipBytes=function(e){this._dataByteOffset+=e,this.byteOffset+=e},e}()},"./Misc/dataStorage.ts":
- /*!*****************************!*\
- !*** ./Misc/dataStorage.ts ***!
- \*****************************/
- /*! exports provided: DataStorage */function(e,t,r){"use strict";r.r(t),r.d(t,"DataStorage",(function(){return n}));var n=function(){function e(){}return e._GetStorage=function(){try{return localStorage.setItem("test",""),localStorage.removeItem("test"),localStorage}catch(t){var e={};return{getItem:function(t){var r=e[t];return void 0===r?null:r},setItem:function(t,r){e[t]=r}}}},e.ReadString=function(e,t){var r=this._Storage.getItem(e);return null!==r?r:t},e.WriteString=function(e,t){this._Storage.setItem(e,t)},e.ReadBoolean=function(e,t){var r=this._Storage.getItem(e);return null!==r?"true"===r:t},e.WriteBoolean=function(e,t){this._Storage.setItem(e,t?"true":"false")},e.ReadNumber=function(e,t){var r=this._Storage.getItem(e);return null!==r?parseFloat(r):t},e.WriteNumber=function(e,t){this._Storage.setItem(e,t.toString())},e._Storage=e._GetStorage(),e}()},"./Misc/dds.ts":
- /*!*********************!*\
- !*** ./Misc/dds.ts ***!
- \*********************/
- /*! exports provided: DDSTools */function(e,t,r){"use strict";r.r(t),r.d(t,"DDSTools",(function(){return g}));var n=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),i=r(/*! ../Maths/sphericalPolynomial */"./Maths/sphericalPolynomial.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=r(/*! ../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),c=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),u=(r(/*! ../Engines/Extensions/engine.cubeTexture */"./Engines/Extensions/engine.cubeTexture.ts"),r(/*! ../Engines/thinEngine */"./Engines/thinEngine.ts"));function d(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var h=d("DXT1"),f=d("DXT3"),p=d("DXT5"),m=d("DX10"),g=function(){function e(){}return e.GetDDSInfo=function(e){var t=new Int32Array(e.buffer,e.byteOffset,31),r=new Int32Array(e.buffer,e.byteOffset,35),n=1;131072&t[2]&&(n=Math.max(1,t[7]));var i=t[21],s=i===m?r[32]:0,a=o.Constants.TEXTURETYPE_UNSIGNED_INT;switch(i){case 113:a=o.Constants.TEXTURETYPE_HALF_FLOAT;break;case 116:a=o.Constants.TEXTURETYPE_FLOAT;break;case m:if(10===s){a=o.Constants.TEXTURETYPE_HALF_FLOAT;break}if(2===s){a=o.Constants.TEXTURETYPE_FLOAT;break}}return{width:t[4],height:t[3],mipmapCount:n,isFourCC:4==(4&t[20]),isRGB:64==(64&t[20]),isLuminance:131072==(131072&t[20]),isCube:512==(512&t[28]),isCompressed:i===h||i===f||i===p,dxgiFormat:s,textureType:a}},e._ToHalfFloat=function(t){e._FloatView||(e._FloatView=new Float32Array(1),e._Int32View=new Int32Array(e._FloatView.buffer)),e._FloatView[0]=t;var r=e._Int32View[0],n=r>>16&32768,i=r>>12&2047,o=r>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&r):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)},e._FromHalfFloat=function(e){var t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):31==r?n?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,r-15)*(1+n/Math.pow(2,10))},e._GetHalfFloatAsFloatRGBAArrayBuffer=function(t,r,n,i,o,s){for(var a=new Float32Array(i),l=new Uint16Array(o,n),c=0,u=0;u<r;u++)for(var d=0;d<t;d++){var h=4*(d+u*t);a[c]=e._FromHalfFloat(l[h]),a[c+1]=e._FromHalfFloat(l[h+1]),a[c+2]=e._FromHalfFloat(l[h+2]),e.StoreLODInAlphaChannel?a[c+3]=s:a[c+3]=e._FromHalfFloat(l[h+3]),c+=4}return a},e._GetHalfFloatRGBAArrayBuffer=function(t,r,n,i,o,s){if(e.StoreLODInAlphaChannel){for(var a=new Uint16Array(i),l=new Uint16Array(o,n),c=0,u=0;u<r;u++)for(var d=0;d<t;d++){var h=4*(d+u*t);a[c]=l[h],a[c+1]=l[h+1],a[c+2]=l[h+2],a[c+3]=e._ToHalfFloat(s),c+=4}return a}return new Uint16Array(o,n,i)},e._GetFloatRGBAArrayBuffer=function(t,r,n,i,o,s){if(e.StoreLODInAlphaChannel){for(var a=new Float32Array(i),l=new Float32Array(o,n),c=0,u=0;u<r;u++)for(var d=0;d<t;d++){var h=4*(d+u*t);a[c]=l[h],a[c+1]=l[h+1],a[c+2]=l[h+2],a[c+3]=s,c+=4}return a}return new Float32Array(o,n,i)},e._GetFloatAsUIntRGBAArrayBuffer=function(t,r,i,o,s,a){for(var l=new Uint8Array(o),c=new Float32Array(s,i),u=0,d=0;d<r;d++)for(var h=0;h<t;h++){var f=4*(h+d*t);l[u]=255*n.Scalar.Clamp(c[f]),l[u+1]=255*n.Scalar.Clamp(c[f+1]),l[u+2]=255*n.Scalar.Clamp(c[f+2]),e.StoreLODInAlphaChannel?l[u+3]=a:l[u+3]=255*n.Scalar.Clamp(c[f+3]),u+=4}return l},e._GetHalfFloatAsUIntRGBAArrayBuffer=function(t,r,i,o,s,a){for(var l=new Uint8Array(o),c=new Uint16Array(s,i),u=0,d=0;d<r;d++)for(var h=0;h<t;h++){var f=4*(h+d*t);l[u]=255*n.Scalar.Clamp(e._FromHalfFloat(c[f])),l[u+1]=255*n.Scalar.Clamp(e._FromHalfFloat(c[f+1])),l[u+2]=255*n.Scalar.Clamp(e._FromHalfFloat(c[f+2])),e.StoreLODInAlphaChannel?l[u+3]=a:l[u+3]=255*n.Scalar.Clamp(e._FromHalfFloat(c[f+3])),u+=4}return l},e._GetRGBAArrayBuffer=function(e,t,r,n,i,o,s,a,l){for(var c=new Uint8Array(n),u=new Uint8Array(i,r),d=0,h=0;h<t;h++)for(var f=0;f<e;f++){var p=4*(f+h*e);c[d]=u[p+o],c[d+1]=u[p+s],c[d+2]=u[p+a],c[d+3]=u[p+l],d+=4}return c},e._ExtractLongWordOrder=function(t){return 0===t||255===t||-16777216===t?0:1+e._ExtractLongWordOrder(t>>8)},e._GetRGBArrayBuffer=function(e,t,r,n,i,o,s,a){for(var l=new Uint8Array(n),c=new Uint8Array(i,r),u=0,d=0;d<t;d++)for(var h=0;h<e;h++){var f=3*(h+d*e);l[u]=c[f+o],l[u+1]=c[f+s],l[u+2]=c[f+a],u+=3}return l},e._GetLuminanceArrayBuffer=function(e,t,r,n,i){for(var o=new Uint8Array(n),s=new Uint8Array(i,r),a=0,l=0;l<t;l++)for(var c=0;c<e;c++){var u=c+l*e;o[a]=s[u],a++}return o},e.UploadDDSLevels=function(t,r,n,i,s,c,u,d){void 0===u&&(u=-1);var g=null;i.sphericalPolynomial&&(g=new Array);var _,v,y,b,A,T,M,P=t.getCaps().s3tc,S=new Int32Array(n.buffer,n.byteOffset,31),E=0,C=0,x=1;if(542327876===S[0])if(i.isFourCC||i.isRGB||i.isLuminance)if(!i.isCompressed||P){var R=S[22];b=S[1]+4;var O,I=!1;if(i.isFourCC)switch(_=S[21]){case h:x=8,C=P.COMPRESSED_RGBA_S3TC_DXT1_EXT;break;case f:x=16,C=P.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case p:x=16,C=P.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;case 113:case 116:I=!0;break;case m:b+=20;var D=!1;switch(i.dxgiFormat){case 10:case 2:I=!0,D=!0;break;case 88:i.isRGB=!0,i.isFourCC=!1,R=32,D=!0}if(D)break;default:return void console.error("Unsupported FourCC code:",(O=_,String.fromCharCode(255&O,O>>8&255,O>>16&255,O>>24&255)))}var B=e._ExtractLongWordOrder(S[23]),N=e._ExtractLongWordOrder(S[24]),L=e._ExtractLongWordOrder(S[25]),w=e._ExtractLongWordOrder(S[26]);I&&(C=t._getRGBABufferInternalSizedFormat(i.textureType)),T=1,131072&S[2]&&!1!==s&&(T=Math.max(1,S[7]));for(var F=d||0;F<c;F++){for(v=S[4],y=S[3],M=0;M<T;++M){if(-1===u||u===M){var V=-1===u?M:0;if(!i.isCompressed&&i.isFourCC){r.format=o.Constants.TEXTUREFORMAT_RGBA,E=v*y*4;var k=null;t._badOS||t._badDesktopOS||!t.getCaps().textureHalfFloat&&!t.getCaps().textureFloat?(128===R?(k=e._GetFloatAsUIntRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V),g&&0==V&&g.push(e._GetFloatRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V))):64===R&&(k=e._GetHalfFloatAsUIntRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V),g&&0==V&&g.push(e._GetHalfFloatAsFloatRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V))),r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT):128===R?(r.type=o.Constants.TEXTURETYPE_FLOAT,k=e._GetFloatRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V),g&&0==V&&g.push(k)):64!==R||t.getCaps().textureHalfFloat?(r.type=o.Constants.TEXTURETYPE_HALF_FLOAT,k=e._GetHalfFloatRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V),g&&0==V&&g.push(e._GetHalfFloatAsFloatRGBAArrayBuffer(v,y,b,E,n.buffer,V))):(r.type=o.Constants.TEXTURETYPE_FLOAT,k=e._GetHalfFloatAsFloatRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,V),g&&0==V&&g.push(k)),k&&t._uploadDataToTextureDirectly(r,k,F,V)}else if(i.isRGB)r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT,24===R?(r.format=o.Constants.TEXTUREFORMAT_RGB,E=v*y*3,A=e._GetRGBArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,B,N,L),t._uploadDataToTextureDirectly(r,A,F,V)):(r.format=o.Constants.TEXTUREFORMAT_RGBA,E=v*y*4,A=e._GetRGBAArrayBuffer(v,y,n.byteOffset+b,E,n.buffer,B,N,L,w),t._uploadDataToTextureDirectly(r,A,F,V));else if(i.isLuminance){var U=t._getUnpackAlignement(),z=v;E=Math.floor((v+U-1)/U)*U*(y-1)+z,A=e._GetLuminanceArrayBuffer(v,y,n.byteOffset+b,E,n.buffer),r.format=o.Constants.TEXTUREFORMAT_LUMINANCE,r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT,t._uploadDataToTextureDirectly(r,A,F,V)}else E=Math.max(4,v)/4*Math.max(4,y)/4*x,A=new Uint8Array(n.buffer,n.byteOffset+b,E),r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT,t._uploadCompressedDataToTextureDirectly(r,C,v,y,A,F,V)}b+=R?v*y*(R/8):E,v*=.5,y*=.5,v=Math.max(1,v),y=Math.max(1,y)}if(void 0!==d)break}g&&g.length>0?i.sphericalPolynomial=l.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial({size:S[4],right:g[0],left:g[1],up:g[2],down:g[3],front:g[4],back:g[5],format:o.Constants.TEXTUREFORMAT_RGBA,type:o.Constants.TEXTURETYPE_FLOAT,gammaSpace:!1}):i.sphericalPolynomial=void 0}else a.Logger.Error("Compressed textures are not supported on this platform.");else a.Logger.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");else a.Logger.Error("Invalid magic number in DDS header")},e.StoreLODInAlphaChannel=!1,e}();u.ThinEngine.prototype.createPrefilteredCubeTexture=function(e,t,r,o,l,u,d,h,f){var p=this;return void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===f&&(f=!0),this.createCubeTexture(e,t,null,!1,(function(e){if(e){var u=e.texture;if(f?e.info.sphericalPolynomial&&(u._sphericalPolynomial=e.info.sphericalPolynomial):u._sphericalPolynomial=new i.SphericalPolynomial,u._source=s.InternalTextureSource.CubePrefiltered,p.getCaps().textureLOD)l&&l(u);else{var d=p._gl,h=e.width;if(h){for(var m=[],_=0;_<3;_++){var v=1-_/2,y=o,b=n.Scalar.Log2(h)*r+o,A=y+(b-y)*v,T=Math.round(Math.min(Math.max(A,0),b)),M=new s.InternalTexture(p,s.InternalTextureSource.Temp);if(M.type=u.type,M.format=u.format,M.width=Math.pow(2,Math.max(n.Scalar.Log2(h)-T,0)),M.height=M.width,M.isCube=!0,p._bindTextureDirectly(d.TEXTURE_CUBE_MAP,M,!0),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),e.isDDS){var P=e.info,S=e.data;p._unpackFlipY(P.isCompressed),g.UploadDDSLevels(p,M,S,P,!0,6,T)}else a.Logger.Warn("DDS is the only prefiltered cube map supported so far.");p._bindTextureDirectly(d.TEXTURE_CUBE_MAP,null);var E=new c.BaseTexture(t);E.isCube=!0,E._texture=M,M.isReady=!0,m.push(E)}u._lodTextureHigh=m[2],u._lodTextureMid=m[1],u._lodTextureLow=m[0],l&&l(u)}}}else l&&l(null)}),u,d,h,f,r,o)}},"./Misc/decorators.ts":
- /*!****************************!*\
- !*** ./Misc/decorators.ts ***!
- \****************************/
- /*! exports provided: expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsMatrix, serializeAsCameraReference, SerializationHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"expandToProperty",(function(){return h})),r.d(t,"serialize",(function(){return f})),r.d(t,"serializeAsTexture",(function(){return p})),r.d(t,"serializeAsColor3",(function(){return m})),r.d(t,"serializeAsFresnelParameters",(function(){return g})),r.d(t,"serializeAsVector2",(function(){return _})),r.d(t,"serializeAsVector3",(function(){return v})),r.d(t,"serializeAsMeshReference",(function(){return y})),r.d(t,"serializeAsColorCurves",(function(){return b})),r.d(t,"serializeAsColor4",(function(){return A})),r.d(t,"serializeAsImageProcessingConfiguration",(function(){return T})),r.d(t,"serializeAsQuaternion",(function(){return M})),r.d(t,"serializeAsMatrix",(function(){return P})),r.d(t,"serializeAsCameraReference",(function(){return S})),r.d(t,"SerializationHelper",(function(){return E}));var n=r(/*! ../Misc/tags */"./Misc/tags.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./devTools */"./Misc/devTools.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a={},l={},c=function(e,t,r){var i=e();n.Tags&&n.Tags.AddTagsTo(i,t.tags);var o=u(i);for(var s in o){var a=o[s],l=t[s],c=a.type;if(null!=l&&"uniqueId"!==s)switch(c){case 0:case 6:case 11:i[s]=l;break;case 1:i[s]=r||l.isRenderTarget?l:l.clone();break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:i[s]=r?l:l.clone()}}return i};function u(e){var t=e.getClassName();if(l[t])return l[t];l[t]={};for(var r=l[t],n=e,i=t;i;){var o=a[i];for(var s in o)r[s]=o[s];var c=void 0,u=!1;do{if(!(c=Object.getPrototypeOf(n)).getClassName){u=!0;break}if(c.getClassName()!==i)break;n=c}while(c);if(u)break;i=c.getClassName(),n=c}return r}function d(e,t){return function(r,n){var i=function(e){var t=e.getClassName();return a[t]||(a[t]={}),a[t]}(r);i[n]||(i[n]={type:e,sourceName:t})}}function h(e,t){return void 0===t&&(t=null),function(e,t){return void 0===t&&(t=null),function(r,n){var i=t||"_"+n;Object.defineProperty(r,n,{get:function(){return this[i]},set:function(t){this[i]!==t&&(this[i]=t,r[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)}function f(e){return d(0,e)}function p(e){return d(1,e)}function m(e){return d(2,e)}function g(e){return d(3,e)}function _(e){return d(4,e)}function v(e){return d(5,e)}function y(e){return d(6,e)}function b(e){return d(7,e)}function A(e){return d(8,e)}function T(e){return d(9,e)}function M(e){return d(10,e)}function P(e){return d(12,e)}function S(e){return d(11,e)}var E=function(){function e(){}return e.AppendSerializedAnimations=function(e,t){if(e.animations){t.animations=[];for(var r=0;r<e.animations.length;r++){var n=e.animations[r];t.animations.push(n.serialize())}}},e.Serialize=function(e,t){t||(t={}),n.Tags&&(t.tags=n.Tags.GetTags(e));var r=u(e);for(var i in r){var o=r[i],s=o.sourceName||i,a=o.type,l=e[i];if(null!=l)switch(a){case 0:t[s]=l;break;case 1:t[s]=l.serialize();break;case 2:t[s]=l.asArray();break;case 3:t[s]=l.serialize();break;case 4:case 5:t[s]=l.asArray();break;case 6:t[s]=l.id;break;case 7:t[s]=l.serialize();break;case 8:t[s]=l.asArray();break;case 9:t[s]=l.serialize();break;case 10:t[s]=l.asArray();break;case 11:t[s]=l.id;case 12:t[s]=l.asArray()}}return t},e.Parse=function(t,r,o,a){void 0===a&&(a=null);var l=t();a||(a=""),n.Tags&&n.Tags.AddTagsTo(l,r.tags);var c=u(l);for(var d in c){var h=c[d],f=r[h.sourceName||d],p=h.type;if(null!=f){var m=l;switch(p){case 0:m[d]=f;break;case 1:o&&(m[d]=e._TextureParser(f,o,a));break;case 2:m[d]=s.Color3.FromArray(f);break;case 3:m[d]=e._FresnelParametersParser(f);break;case 4:m[d]=i.Vector2.FromArray(f);break;case 5:m[d]=i.Vector3.FromArray(f);break;case 6:o&&(m[d]=o.getLastMeshByID(f));break;case 7:m[d]=e._ColorCurvesParser(f);break;case 8:m[d]=s.Color4.FromArray(f);break;case 9:m[d]=e._ImageProcessingConfigurationParser(f);break;case 10:m[d]=i.Quaternion.FromArray(f);break;case 11:o&&(m[d]=o.getCameraByID(f));case 12:m[d]=i.Matrix.FromArray(f)}}}return l},e.Clone=function(e,t){return c(e,t,!1)},e.Instanciate=function(e,t){return c(e,t,!0)},e._ImageProcessingConfigurationParser=function(e){throw o._DevTools.WarnImport("ImageProcessingConfiguration")},e._FresnelParametersParser=function(e){throw o._DevTools.WarnImport("FresnelParameters")},e._ColorCurvesParser=function(e){throw o._DevTools.WarnImport("ColorCurves")},e._TextureParser=function(e,t,r){throw o._DevTools.WarnImport("Texture")},e}()},"./Misc/deepCopier.ts":
- /*!****************************!*\
- !*** ./Misc/deepCopier.ts ***!
- \****************************/
- /*! exports provided: DeepCopier */function(e,t,r){"use strict";r.r(t),r.d(t,"DeepCopier",(function(){return s}));var n=r(/*! ./stringTools */"./Misc/stringTools.ts"),i=r(/*! ./logger */"./Misc/logger.ts"),o=function(e,t){return e?e.getClassName&&"Mesh"===e.getClassName()?null:e.getClassName&&"SubMesh"===e.getClassName()?e.clone(t):e.clone?e.clone():null:null},s=function(){function e(){}return e.DeepCopy=function(e,t,r,s){for(var a=0,l=function(e){var t=[];do{Object.getOwnPropertyNames(e).forEach((function(e){-1===t.indexOf(e)&&t.push(e)}))}while(e=Object.getPrototypeOf(e));return t}(e);a<l.length;a++){var c=l[a];if(("_"!==c[0]||s&&-1!==s.indexOf(c))&&!(n.StringTools.EndsWith(c,"Observable")||r&&-1!==r.indexOf(c))){var u=e[c],d=typeof u;if("function"!==d)try{if("object"===d)if(u instanceof Array){if(t[c]=[],u.length>0)if("object"==typeof u[0])for(var h=0;h<u.length;h++){var f=o(u[h],t);-1===t[c].indexOf(f)&&t[c].push(f)}else t[c]=u.slice(0)}else t[c]=o(u,t);else t[c]=u}catch(e){i.Logger.Warn(e.message)}}}},e}()},"./Misc/deferred.ts":
- /*!**************************!*\
- !*** ./Misc/deferred.ts ***!
- \**************************/
- /*! exports provided: Deferred */function(e,t,r){"use strict";r.r(t),r.d(t,"Deferred",(function(){return n}));var n=function(){function e(){var e=this;this.promise=new Promise((function(t,r){e._resolve=t,e._reject=r}))}return Object.defineProperty(e.prototype,"resolve",{get:function(){return this._resolve},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reject",{get:function(){return this._reject},enumerable:!1,configurable:!0}),e}()},"./Misc/depthReducer.ts":
- /*!******************************!*\
- !*** ./Misc/depthReducer.ts ***!
- \******************************/
- /*! exports provided: DepthReducer */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthReducer",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ../Rendering/depthRenderer */"./Rendering/depthRenderer.ts"),s=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"depthRenderer",{get:function(){return this._depthRenderer},enumerable:!1,configurable:!0}),t.prototype.setDepthRenderer=function(t,r,n){void 0===t&&(t=null),void 0===r&&(r=i.Constants.TEXTURETYPE_HALF_FLOAT),void 0===n&&(n=!0);var s=this._camera.getScene();this._depthRenderer&&(delete s._depthRenderer[this._depthRendererId],this._depthRenderer.dispose(),this._depthRenderer=null),null===t&&(s._depthRenderer||(s._depthRenderer={}),(t=this._depthRenderer=new o.DepthRenderer(s,r,this._camera,!1)).enabled=!1,this._depthRendererId="minmax"+this._camera.id,s._depthRenderer[this._depthRendererId]=t),e.prototype.setSourceTexture.call(this,t.getDepthMap(),!0,r,n)},t.prototype.setSourceTexture=function(t,r,n,o){void 0===n&&(n=i.Constants.TEXTURETYPE_HALF_FLOAT),void 0===o&&(o=!0),e.prototype.setSourceTexture.call(this,t,r,n,o)},t.prototype.activate=function(){this._depthRenderer&&(this._depthRenderer.enabled=!0),e.prototype.activate.call(this)},t.prototype.deactivate=function(){e.prototype.deactivate.call(this),this._depthRenderer&&(this._depthRenderer.enabled=!1)},t.prototype.dispose=function(t){if(void 0===t&&(t=!0),e.prototype.dispose.call(this,t),this._depthRenderer&&t){var r=this._depthRenderer.getDepthMap().getScene();r&&delete r._depthRenderer[this._depthRendererId],this._depthRenderer.dispose(),this._depthRenderer=null}},t}(r(/*! ./minMaxReducer */"./Misc/minMaxReducer.ts").MinMaxReducer)},"./Misc/devTools.ts":
- /*!**************************!*\
- !*** ./Misc/devTools.ts ***!
- \**************************/
- /*! exports provided: _DevTools */function(e,t,r){"use strict";r.r(t),r.d(t,"_DevTools",(function(){return n}));var n=function(){function e(){}return e.WarnImport=function(e){return e+" needs to be imported before as it contains a side-effect required by your code."},e}()},"./Misc/domManagement.ts":
- /*!*******************************!*\
- !*** ./Misc/domManagement.ts ***!
- \*******************************/
- /*! exports provided: DomManagement */function(e,t,r){"use strict";r.r(t),r.d(t,"DomManagement",(function(){return n}));var n=function(){function e(){}return e.IsWindowObjectExist=function(){return"undefined"!=typeof window},e.IsNavigatorAvailable=function(){return"undefined"!=typeof navigator},e.IsDocumentAvailable=function(){return"undefined"!=typeof document},e.GetDOMTextContent=function(e){for(var t="",r=e.firstChild;r;)3===r.nodeType&&(t+=r.textContent),r=r.nextSibling;return t},e}()},"./Misc/environmentTextureTools.ts":
- /*!*****************************************!*\
- !*** ./Misc/environmentTextureTools.ts ***!
- \*****************************************/
- /*! exports provided: EnvironmentTextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"EnvironmentTextureTools",(function(){return f}));var n=r(/*! ./tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../Maths/sphericalPolynomial */"./Maths/sphericalPolynomial.ts"),a=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),l=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),c=r(/*! ../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../scene */"./scene.ts"),d=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),h=r(/*! ../Misc/logger */"./Misc/logger.ts"),f=(r(/*! ../Engines/Extensions/engine.renderTargetCube */"./Engines/Extensions/engine.renderTargetCube.ts"),r(/*! ../Engines/Extensions/engine.readTexture */"./Engines/Extensions/engine.readTexture.ts"),r(/*! ../Materials/Textures/baseTexture.polynomial */"./Materials/Textures/baseTexture.polynomial.ts"),r(/*! ../Shaders/rgbdEncode.fragment */"./Shaders/rgbdEncode.fragment.ts"),r(/*! ../Shaders/rgbdDecode.fragment */"./Shaders/rgbdDecode.fragment.ts"),function(){function e(){}return e.GetEnvInfo=function(t){for(var r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=0,i=0;i<e._MagicBytes.length;i++)if(r.getUint8(n++)!==e._MagicBytes[i])return h.Logger.Error("Not a babylon environment map"),null;for(var o="",s=0;s=r.getUint8(n++);)o+=String.fromCharCode(s);var a=JSON.parse(o);return a.specular&&(a.specular.specularDataPosition=n,a.specular.lodGenerationScale=a.specular.lodGenerationScale||.8),a},e.CreateEnvTextureAsync=function(t){var r=this,i=t.getInternalTexture();if(!i)return Promise.reject("The cube texture is invalid.");var s=i.getEngine();if(s&&s.premultipliedAlpha)return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");if(t.textureType===c.Constants.TEXTURETYPE_UNSIGNED_INT)return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");var a=s.getRenderingCanvas();if(!a)return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");var l=c.Constants.TEXTURETYPE_FLOAT;if(!s.getCaps().textureFloatRender&&(l=c.Constants.TEXTURETYPE_HALF_FLOAT,!s.getCaps().textureHalfFloatRender))return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");var h=i.width,f=new u.Scene(s),p={},m=[],g=o.Scalar.Log2(i.width);g=Math.round(g);for(var _=function(e){for(var r=Math.pow(2,g-e),i=function(i){var o=t.readPixels(i,e),u=s.createRawTexture(o,r,r,c.Constants.TEXTUREFORMAT_RGBA,!1,!1,c.Constants.TEXTURE_NEAREST_SAMPLINGMODE,null,l),h=new Promise((function(t,o){var l=new d.PostProcess("rgbdEncode","rgbdEncode",null,null,1,null,c.Constants.TEXTURE_NEAREST_SAMPLINGMODE,s,!1,void 0,c.Constants.TEXTURETYPE_UNSIGNED_INT,void 0,null,!1);l.getEffect().executeWhenCompiled((function(){l.onApply=function(e){e._bindTexture("textureSampler",u)};var o=s.getRenderWidth(),c=s.getRenderHeight();s.setSize(r,r),f.postProcessManager.directRender([l],null),n.Tools.ToBlob(a,(function(r){var n=new FileReader;n.onload=function(r){var n=r.target.result;p[6*e+i]=n,t()},n.readAsArrayBuffer(r)})),s.setSize(o,c)}))}));m.push(h)},o=0;o<6;o++)i(o)},v=0;v<=g;v++)_(v);return Promise.all(m).then((function(){f.dispose();for(var n={version:1,width:h,irradiance:r._CreateEnvTextureIrradiance(t),specular:{mipmaps:[],lodGenerationScale:t.lodGenerationScale}},i=0,o=0;o<=g;o++)for(var s=0;s<6;s++){var a=p[6*o+s].byteLength;n.specular.mipmaps.push({length:a,position:i}),i+=a}for(var l=JSON.stringify(n),c=new ArrayBuffer(l.length+1),u=new Uint8Array(c),d=(o=0,l.length);o<d;o++)u[o]=l.charCodeAt(o);u[l.length]=0;var m=e._MagicBytes.length+i+c.byteLength,_=new ArrayBuffer(m),v=new Uint8Array(_),y=new DataView(_),b=0;for(o=0;o<e._MagicBytes.length;o++)y.setUint8(b++,e._MagicBytes[o]);for(v.set(new Uint8Array(c),b),b+=c.byteLength,o=0;o<=g;o++)for(s=0;s<6;s++){var A=p[6*o+s];v.set(new Uint8Array(A),b),b+=A.byteLength}return _}))},e._CreateEnvTextureIrradiance=function(e){var t=e.sphericalPolynomial;return null==t?null:{x:[t.x.x,t.x.y,t.x.z],y:[t.y.x,t.y.y,t.y.z],z:[t.z.x,t.z.y,t.z.z],xx:[t.xx.x,t.xx.y,t.xx.z],yy:[t.yy.x,t.yy.y,t.yy.z],zz:[t.zz.x,t.zz.y,t.zz.z],yz:[t.yz.x,t.yz.y,t.yz.z],zx:[t.zx.x,t.zx.y,t.zx.z],xy:[t.xy.x,t.xy.y,t.xy.z]}},e.CreateImageDataArrayBufferViews=function(e,t){if(1!==t.version)throw new Error('Unsupported babylon environment map version "'+t.version+'"');var r=t.specular,n=o.Scalar.Log2(t.width);if(n=Math.round(n)+1,r.mipmaps.length!==6*n)throw new Error('Unsupported specular mipmaps number "'+r.mipmaps.length+'"');for(var i=new Array(n),s=0;s<n;s++){i[s]=new Array(6);for(var a=0;a<6;a++){var l=r.mipmaps[6*s+a];i[s][a]=new Uint8Array(e.buffer,e.byteOffset+r.specularDataPosition+l.position,l.length)}}return i},e.UploadEnvLevelsAsync=function(t,r,n){if(1!==n.version)throw new Error('Unsupported babylon environment map version "'+n.version+'"');var i=n.specular;if(!i)return Promise.resolve();t._lodGenerationScale=i.lodGenerationScale;var o=e.CreateImageDataArrayBufferViews(r,n);return e.UploadLevelsAsync(t,o)},e._OnImageReadyAsync=function(e,t,r,n,i,o,s,a,l,u,d){return new Promise((function(h,f){if(r){var p=t.createTexture(null,!0,!0,null,c.Constants.TEXTURE_NEAREST_SAMPLINGMODE,null,(function(e){f(e)}),e);n.getEffect().executeWhenCompiled((function(){n.onApply=function(e){e._bindTexture("textureSampler",p),e.setFloat2("scale",1,1)},t.scenes[0].postProcessManager.directRender([n],u,!0,o,s),t.restoreDefaultFramebuffer(),p.dispose(),URL.revokeObjectURL(i),h()}))}else{if(t._uploadImageToTexture(d,e,o,s),a){var m=l[s];m&&t._uploadImageToTexture(m._texture,e,o,0)}h()}}))},e.UploadLevelsAsync=function(e,t){var r=this;if(!n.Tools.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");var i=Math.round(o.Scalar.Log2(e.width))+1,s=e.getEngine(),u=!1,h=!1,f=null,p=null,m=null,g=s.getCaps();if(e.format=c.Constants.TEXTUREFORMAT_RGBA,e.type=c.Constants.TEXTURETYPE_UNSIGNED_INT,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,s.updateTextureSamplingMode(c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,e),g.textureLOD?s.webGLVersion<2?u=!1:g.textureHalfFloatRender&&g.textureHalfFloatLinearFiltering?(u=!0,e.type=c.Constants.TEXTURETYPE_HALF_FLOAT):g.textureFloatRender&&g.textureFloatLinearFiltering&&(u=!0,e.type=c.Constants.TEXTURETYPE_FLOAT):(u=!1,h=!0,m={}),u)f=new d.PostProcess("rgbdDecode","rgbdDecode",null,null,1,null,c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,s,!1,void 0,e.type,void 0,null,!1),e._isRGBD=!1,e.invertY=!1,p=s.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,type:e.type,format:c.Constants.TEXTUREFORMAT_RGBA});else if(e._isRGBD=!0,e.invertY=!0,h)for(var _=e._lodGenerationScale,v=e._lodGenerationOffset,y=0;y<3;y++){var b=(i-1)*_+v,A=v+(b-v)*(1-y/2),T=Math.round(Math.min(Math.max(A,0),b)),M=new a.InternalTexture(s,a.InternalTextureSource.Temp);M.isCube=!0,M.invertY=!0,M.generateMipMaps=!1,s.updateTextureSamplingMode(c.Constants.TEXTURE_LINEAR_LINEAR,M);var P=new l.BaseTexture(null);switch(P.isCube=!0,P._texture=M,m[T]=P,y){case 0:e._lodTextureLow=P;break;case 1:e._lodTextureMid=P;break;case 2:e._lodTextureHigh=P}}var S=[],E=function(n){for(var i=function(i){var o=t[n][i],a=new Blob([o],{type:"image/png"}),l=URL.createObjectURL(a),c=void 0;if("undefined"==typeof Image)c=createImageBitmap(a).then((function(t){return r._OnImageReadyAsync(t,s,u,f,l,i,n,h,m,p,e)}));else{var d=new Image;d.src=l,c=new Promise((function(t,o){d.onload=function(){r._OnImageReadyAsync(d,s,u,f,l,i,n,h,m,p,e).then((function(){return t()})).catch((function(e){o(e)}))},d.onerror=function(e){o(e)}}))}S.push(c)},o=0;o<6;o++)i(o)};for(y=0;y<t.length;y++)E(y);if(t.length<i){var C=void 0,x=Math.pow(2,i-1-t.length),R=x*x*4;switch(e.type){case c.Constants.TEXTURETYPE_UNSIGNED_INT:C=new Uint8Array(R);break;case c.Constants.TEXTURETYPE_HALF_FLOAT:C=new Uint16Array(R);break;case c.Constants.TEXTURETYPE_FLOAT:C=new Float32Array(R)}for(y=t.length;y<i;y++)for(var O=0;O<6;O++)s._uploadArrayBufferViewToTexture(e,C,O,y)}return Promise.all(S).then((function(){p&&(s._releaseFramebufferObjects(p),s._releaseTexture(e),p._swapAndDie(e)),f&&f.dispose(),h&&(e._lodTextureHigh&&e._lodTextureHigh._texture&&(e._lodTextureHigh._texture.isReady=!0),e._lodTextureMid&&e._lodTextureMid._texture&&(e._lodTextureMid._texture.isReady=!0),e._lodTextureLow&&e._lodTextureLow._texture&&(e._lodTextureLow._texture.isReady=!0))}))},e.UploadEnvSpherical=function(e,t){1!==t.version&&h.Logger.Warn('Unsupported babylon environment map version "'+t.version+'"');var r=t.irradiance;if(r){var n=new s.SphericalPolynomial;i.Vector3.FromArrayToRef(r.x,0,n.x),i.Vector3.FromArrayToRef(r.y,0,n.y),i.Vector3.FromArrayToRef(r.z,0,n.z),i.Vector3.FromArrayToRef(r.xx,0,n.xx),i.Vector3.FromArrayToRef(r.yy,0,n.yy),i.Vector3.FromArrayToRef(r.zz,0,n.zz),i.Vector3.FromArrayToRef(r.yz,0,n.yz),i.Vector3.FromArrayToRef(r.zx,0,n.zx),i.Vector3.FromArrayToRef(r.xy,0,n.xy),e._sphericalPolynomial=n}},e._UpdateRGBDAsync=function(t,r,n,i,o){return t._source=a.InternalTextureSource.CubeRawRGBD,t._bufferViewArrayArray=r,t._lodGenerationScale=i,t._lodGenerationOffset=o,t._sphericalPolynomial=n,e.UploadLevelsAsync(t,r).then((function(){t.isReady=!0}))},e._MagicBytes=[134,22,135,150,246,214,150,54],e}());a.InternalTexture._UpdateRGBDAsync=f._UpdateRGBDAsync},"./Misc/fileRequest.ts":
- /*!*****************************!*\
- !*** ./Misc/fileRequest.ts ***!
- \*****************************/
- /*! no static exports found */function(e,t){},"./Misc/fileTools.ts":
- /*!***************************!*\
- !*** ./Misc/fileTools.ts ***!
- \***************************/
- /*! exports provided: LoadFileError, RequestFileError, ReadFileError, FileTools */function(e,t,r){"use strict";r.r(t),r.d(t,"LoadFileError",(function(){return f})),r.d(t,"RequestFileError",(function(){return p})),r.d(t,"ReadFileError",(function(){return m})),r.d(t,"FileTools",(function(){return g}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webRequest */"./Misc/webRequest.ts"),o=r(/*! ./domManagement */"./Misc/domManagement.ts"),s=r(/*! ./observable */"./Misc/observable.ts"),a=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts"),l=r(/*! ./retryStrategy */"./Misc/retryStrategy.ts"),c=r(/*! ./baseError */"./Misc/baseError.ts"),u=r(/*! ./stringTools */"./Misc/stringTools.ts"),d=r(/*! ../Engines/thinEngine */"./Engines/thinEngine.ts"),h=r(/*! ../Engines/Processors/shaderProcessor */"./Engines/Processors/shaderProcessor.ts"),f=function(e){function t(r,n){var o=e.call(this,r)||this;return o.name="LoadFileError",c.BaseError._setPrototypeOf(o,t.prototype),n instanceof i.WebRequest?o.request=n:o.file=n,o}return Object(n.__extends)(t,e),t}(c.BaseError),p=function(e){function t(r,n){var i=e.call(this,r)||this;return i.request=n,i.name="RequestFileError",c.BaseError._setPrototypeOf(i,t.prototype),i}return Object(n.__extends)(t,e),t}(c.BaseError),m=function(e){function t(r,n){var i=e.call(this,r)||this;return i.file=n,i.name="ReadFileError",c.BaseError._setPrototypeOf(i,t.prototype),i}return Object(n.__extends)(t,e),t}(c.BaseError),g=function(){function e(){}return e._CleanUrl=function(e){return e=e.replace(/#/gm,"%23")},e.SetCorsBehavior=function(t,r){if((!t||0!==t.indexOf("data:"))&&e.CorsBehavior)if("string"==typeof e.CorsBehavior||this.CorsBehavior instanceof String)r.crossOrigin=e.CorsBehavior;else{var n=e.CorsBehavior(t);n&&(r.crossOrigin=n)}},e.LoadImage=function(t,r,n,i,o){var s;void 0===o&&(o="");var l=!1;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"undefined"!=typeof Blob?(s=URL.createObjectURL(new Blob([t],{type:o})),l=!0):s="data:"+o+";base64,"+u.StringTools.EncodeArrayBufferToBase64(t):t instanceof Blob?(s=URL.createObjectURL(t),l=!0):(s=e._CleanUrl(t),s=e.PreprocessUrl(t)),"undefined"==typeof Image)return e.LoadFile(s,(function(e){createImageBitmap(new Blob([e],{type:o})).then((function(e){r(e),l&&URL.revokeObjectURL(s)})).catch((function(e){n&&n("Error while trying to load image: "+t,e)}))}),void 0,i||void 0,!0,(function(e,r){n&&n("Error while trying to load image: "+t,r)})),null;var c=new Image;e.SetCorsBehavior(s,c);var d=function(){c.removeEventListener("load",d),c.removeEventListener("error",h),r(c),l&&c.src&&URL.revokeObjectURL(c.src)},h=function(e){if(c.removeEventListener("load",d),c.removeEventListener("error",h),n){var r=t.toString();n("Error while trying to load image: "+(r.length<32?r:r.slice(0,32)+"..."),e)}l&&c.src&&URL.revokeObjectURL(c.src)};c.addEventListener("load",d),c.addEventListener("error",h);var f=function(){c.src=s};if("data:"!==s.substr(0,5)&&i&&i.enableTexturesOffline)i.open((function(){i&&i.loadImage(s,c)}),f);else{if(-1!==s.indexOf("file:")){var p=decodeURIComponent(s.substring(5).toLowerCase());if(a.FilesInputStore.FilesToLoad[p]){try{var m;try{m=URL.createObjectURL(a.FilesInputStore.FilesToLoad[p])}catch(e){m=URL.createObjectURL(a.FilesInputStore.FilesToLoad[p])}c.src=m,l=!0}catch(e){c.src=""}return c}}f()}return c},e.ReadFile=function(e,t,r,n,i){var o=new FileReader,a={onCompleteObservable:new s.Observable,abort:function(){return o.abort()}};return o.onloadend=function(e){return a.onCompleteObservable.notifyObservers(a)},i&&(o.onerror=function(t){i(new m("Unable to read "+e.name,e))}),o.onload=function(e){t(e.target.result)},r&&(o.onprogress=r),n?o.readAsArrayBuffer(e):o.readAsText(e),a},e.LoadFile=function(t,r,n,i,o,s){if(-1!==t.indexOf("file:")){var l=decodeURIComponent(t.substring(5).toLowerCase());0===l.indexOf("./")&&(l=l.substring(2));var c=a.FilesInputStore.FilesToLoad[l];if(c)return e.ReadFile(c,r,n,o,s?function(e){return s(void 0,new f(e.message,e.file))}:void 0)}return e.RequestFile(t,(function(e,t){r(e,t?t.responseURL:void 0)}),n,i,o,s?function(e){s(e.request,new f(e.message,e.request))}:void 0)},e.RequestFile=function(t,r,n,a,l,c,u){t=e._CleanUrl(t),t=e.PreprocessUrl(t);var d=e.BaseUrl+t,h=!1,f={onCompleteObservable:new s.Observable,abort:function(){return h=!0}},m=function(){var t=new i.WebRequest,s=null;f.abort=function(){h=!0,t.readyState!==(XMLHttpRequest.DONE||4)&&t.abort(),null!==s&&(clearTimeout(s),s=null)};var a=function(m){t.open("GET",d),u&&u(t),l&&(t.responseType="arraybuffer"),n&&t.addEventListener("progress",n);var g=function(){t.removeEventListener("loadend",g),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear()};t.addEventListener("loadend",g);var _=function(){if(!h&&t.readyState===(XMLHttpRequest.DONE||4)){if(t.removeEventListener("readystatechange",_),t.status>=200&&t.status<300||0===t.status&&(!o.DomManagement.IsWindowObjectExist()||e.IsFileURL()))return void r(l?t.response:t.responseText,t);var n=e.DefaultRetryStrategy;if(n){var u=n(d,t,m);if(-1!==u)return t.removeEventListener("loadend",g),t=new i.WebRequest,void(s=setTimeout((function(){return a(m+1)}),u))}var f=new p("Error status: "+t.status+" "+t.statusText+" - Unable to load "+d,t);c&&c(f)}};t.addEventListener("readystatechange",_),t.send()};a(0)};if(a&&a.enableSceneOffline){var g=function(e){e&&e.status>400?c&&c(e):m()};a.open((function(){a&&a.loadFile(e.BaseUrl+t,(function(e){h||r(e),f.onCompleteObservable.notifyObservers(f)}),n?function(e){h||n(e)}:void 0,g,l)}),g)}else m();return f},e.IsFileURL=function(){return"file:"===location.protocol},e.DefaultRetryStrategy=l.RetryStrategy.ExponentialBackoff(),e.BaseUrl="",e.CorsBehavior="anonymous",e.PreprocessUrl=function(e){return e},e}();d.ThinEngine._FileToolsLoadImage=g.LoadImage.bind(g),d.ThinEngine._FileToolsLoadFile=g.LoadFile.bind(g),h.ShaderProcessor._FileToolsLoadFile=g.LoadFile.bind(g)},"./Misc/filesInput.ts":
- /*!****************************!*\
- !*** ./Misc/filesInput.ts ***!
- \****************************/
- /*! exports provided: FilesInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FilesInput",(function(){return s}));var n=r(/*! ../Loading/sceneLoader */"./Loading/sceneLoader.ts"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts"),s=function(){function e(e,t,r,n,i,o,s,a,l){this.onProcessFileCallback=function(){return!0},this._engine=e,this._currentScene=t,this._sceneLoadedCallback=r,this._progressCallback=n,this._additionalRenderLoopLogicCallback=i,this._textureLoadingCallback=o,this._startingProcessingFilesCallback=s,this._onReloadCallback=a,this._errorCallback=l}return Object.defineProperty(e,"FilesToLoad",{get:function(){return o.FilesInputStore.FilesToLoad},enumerable:!1,configurable:!0}),e.prototype.monitorElementForDragNDrop=function(e){var t=this;e&&(this._elementToMonitor=e,this._dragEnterHandler=function(e){t.drag(e)},this._dragOverHandler=function(e){t.drag(e)},this._dropHandler=function(e){t.drop(e)},this._elementToMonitor.addEventListener("dragenter",this._dragEnterHandler,!1),this._elementToMonitor.addEventListener("dragover",this._dragOverHandler,!1),this._elementToMonitor.addEventListener("drop",this._dropHandler,!1))},Object.defineProperty(e.prototype,"filesToLoad",{get:function(){return this._filesToLoad},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._elementToMonitor&&(this._elementToMonitor.removeEventListener("dragenter",this._dragEnterHandler),this._elementToMonitor.removeEventListener("dragover",this._dragOverHandler),this._elementToMonitor.removeEventListener("drop",this._dropHandler))},e.prototype.renderFunction=function(){if(this._additionalRenderLoopLogicCallback&&this._additionalRenderLoopLogicCallback(),this._currentScene){if(this._textureLoadingCallback){var e=this._currentScene.getWaitingItemsCount();e>0&&this._textureLoadingCallback(e)}this._currentScene.render()}},e.prototype.drag=function(e){e.stopPropagation(),e.preventDefault()},e.prototype.drop=function(e){e.stopPropagation(),e.preventDefault(),this.loadFiles(e)},e.prototype._traverseFolder=function(e,t,r,n){var i=this,o=e.createReader(),s=e.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");o.readEntries((function(e){r.count+=e.length;for(var o=0,a=e;o<a.length;o++){var l=a[o];l.isFile?l.file((function(e){e.correctName=s+e.name,t.push(e),0==--r.count&&n()})):l.isDirectory&&i._traverseFolder(l,t,r,n)}--r.count&&n()}))},e.prototype._processFiles=function(t){for(var r=0;r<t.length;r++){var i=t[r].correctName.toLowerCase(),o=i.split(".").pop();this.onProcessFileCallback(t[r],i,o)&&(n.SceneLoader.IsPluginForExtensionAvailable("."+o)&&(this._sceneFileToLoad=t[r]),e.FilesToLoad[i]=t[r])}},e.prototype.loadFiles=function(e){var t=this;if(e&&e.dataTransfer&&e.dataTransfer.files&&(this._filesToLoad=e.dataTransfer.files),e&&e.target&&e.target.files&&(this._filesToLoad=e.target.files),this._filesToLoad&&0!==this._filesToLoad.length&&(this._startingProcessingFilesCallback&&this._startingProcessingFilesCallback(this._filesToLoad),this._filesToLoad&&this._filesToLoad.length>0)){for(var r=new Array,n=[],i=e.dataTransfer?e.dataTransfer.items:null,o=0;o<this._filesToLoad.length;o++){var s=this._filesToLoad[o],a=s.name.toLowerCase(),l=void 0;if(s.correctName=a,i){var c=i[o];c.getAsEntry?l=c.getAsEntry():c.webkitGetAsEntry&&(l=c.webkitGetAsEntry())}l&&l.isDirectory?n.push(l):r.push(s)}if(0===n.length)this._processFiles(r),this._processReload();else for(var u={count:n.length},d=0,h=n;d<h.length;d++){var f=h[d];this._traverseFolder(f,r,u,(function(){t._processFiles(r),0===u.count&&t._processReload()}))}}},e.prototype._processReload=function(){this._onReloadCallback?this._onReloadCallback(this._sceneFileToLoad):this.reload()},e.prototype.reload=function(){var e=this;this._sceneFileToLoad?(this._currentScene&&(i.Logger.errorsCount>0&&i.Logger.ClearLogCache(),this._engine.stopRenderLoop()),n.SceneLoader.ShowLoadingScreen=!1,this._engine.displayLoadingUI(),n.SceneLoader.LoadAsync("file:",this._sceneFileToLoad,this._engine,(function(t){e._progressCallback&&e._progressCallback(t)})).then((function(t){e._currentScene&&e._currentScene.dispose(),e._currentScene=t,e._sceneLoadedCallback&&e._sceneLoadedCallback(e._sceneFileToLoad,e._currentScene),e._currentScene.executeWhenReady((function(){e._engine.hideLoadingUI(),e._engine.runRenderLoop((function(){e.renderFunction()}))}))})).catch((function(t){e._engine.hideLoadingUI(),e._errorCallback&&e._errorCallback(e._sceneFileToLoad,e._currentScene,t.message)}))):i.Logger.Error("Please provide a valid .babylon file.")},e}()},"./Misc/filesInputStore.ts":
- /*!*********************************!*\
- !*** ./Misc/filesInputStore.ts ***!
- \*********************************/
- /*! exports provided: FilesInputStore */function(e,t,r){"use strict";r.r(t),r.d(t,"FilesInputStore",(function(){return n}));var n=function(){function e(){}return e.FilesToLoad={},e}()},"./Misc/gradients.ts":
- /*!***************************!*\
- !*** ./Misc/gradients.ts ***!
- \***************************/
- /*! exports provided: ColorGradient, Color3Gradient, FactorGradient, GradientHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorGradient",(function(){return i})),r.d(t,"Color3Gradient",(function(){return o})),r.d(t,"FactorGradient",(function(){return s})),r.d(t,"GradientHelper",(function(){return a}));var n=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),i=function(){function e(e,t,r){this.gradient=e,this.color1=t,this.color2=r}return e.prototype.getColorToRef=function(e){this.color2?n.Color4.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)},e}(),o=function(e,t){this.gradient=e,this.color=t},s=function(){function e(e,t,r){this.gradient=e,this.factor1=t,this.factor2=r}return e.prototype.getFactor=function(){return void 0===this.factor2||this.factor2===this.factor1?this.factor1:this.factor1+(this.factor2-this.factor1)*Math.random()},e}(),a=function(){function e(){}return e.GetCurrentGradient=function(e,t,r){if(t[0].gradient>e)r(t[0],t[0],1);else{for(var n=0;n<t.length-1;n++){var i=t[n],o=t[n+1];if(e>=i.gradient&&e<=o.gradient)return void r(i,o,(e-i.gradient)/(o.gradient-i.gradient))}var s=t.length-1;r(t[s],t[s],1)}},e}()},"./Misc/guid.ts":
- /*!**********************!*\
- !*** ./Misc/guid.ts ***!
- \**********************/
- /*! exports provided: GUID */function(e,t,r){"use strict";r.r(t),r.d(t,"GUID",(function(){return n}));var n=function(){function e(){}return e.RandomId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e}()},"./Misc/iInspectable.ts":
- /*!******************************!*\
- !*** ./Misc/iInspectable.ts ***!
- \******************************/
- /*! exports provided: InspectableType */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"InspectableType",(function(){return n})),function(e){e[e.Checkbox=0]="Checkbox",e[e.Slider=1]="Slider",e[e.Vector3=2]="Vector3",e[e.Quaternion=3]="Quaternion",e[e.Color3=4]="Color3",e[e.String=5]="String"}(n||(n={}))},"./Misc/index.ts":
- /*!***********************!*\
- !*** ./Misc/index.ts ***!
- \***********************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./andOrNotEvaluator */"./Misc/andOrNotEvaluator.ts");r.d(t,"AndOrNotEvaluator",(function(){return n.AndOrNotEvaluator}));var i=r(/*! ./assetsManager */"./Misc/assetsManager.ts");r.d(t,"AssetTaskState",(function(){return i.AssetTaskState})),r.d(t,"AbstractAssetTask",(function(){return i.AbstractAssetTask})),r.d(t,"AssetsProgressEvent",(function(){return i.AssetsProgressEvent})),r.d(t,"MeshAssetTask",(function(){return i.MeshAssetTask})),r.d(t,"TextFileAssetTask",(function(){return i.TextFileAssetTask})),r.d(t,"BinaryFileAssetTask",(function(){return i.BinaryFileAssetTask})),r.d(t,"ImageAssetTask",(function(){return i.ImageAssetTask})),r.d(t,"TextureAssetTask",(function(){return i.TextureAssetTask})),r.d(t,"CubeTextureAssetTask",(function(){return i.CubeTextureAssetTask})),r.d(t,"HDRCubeTextureAssetTask",(function(){return i.HDRCubeTextureAssetTask})),r.d(t,"EquiRectangularCubeTextureAssetTask",(function(){return i.EquiRectangularCubeTextureAssetTask})),r.d(t,"AssetsManager",(function(){return i.AssetsManager}));var o=r(/*! ./basis */"./Misc/basis.ts");r.d(t,"BasisTranscodeConfiguration",(function(){return o.BasisTranscodeConfiguration})),r.d(t,"BasisTools",(function(){return o.BasisTools}));var s=r(/*! ./dds */"./Misc/dds.ts");r.d(t,"DDSTools",(function(){return s.DDSTools}));var a=r(/*! ./decorators */"./Misc/decorators.ts");r.d(t,"expandToProperty",(function(){return a.expandToProperty})),r.d(t,"serialize",(function(){return a.serialize})),r.d(t,"serializeAsTexture",(function(){return a.serializeAsTexture})),r.d(t,"serializeAsColor3",(function(){return a.serializeAsColor3})),r.d(t,"serializeAsFresnelParameters",(function(){return a.serializeAsFresnelParameters})),r.d(t,"serializeAsVector2",(function(){return a.serializeAsVector2})),r.d(t,"serializeAsVector3",(function(){return a.serializeAsVector3})),r.d(t,"serializeAsMeshReference",(function(){return a.serializeAsMeshReference})),r.d(t,"serializeAsColorCurves",(function(){return a.serializeAsColorCurves})),r.d(t,"serializeAsColor4",(function(){return a.serializeAsColor4})),r.d(t,"serializeAsImageProcessingConfiguration",(function(){return a.serializeAsImageProcessingConfiguration})),r.d(t,"serializeAsQuaternion",(function(){return a.serializeAsQuaternion})),r.d(t,"serializeAsMatrix",(function(){return a.serializeAsMatrix})),r.d(t,"serializeAsCameraReference",(function(){return a.serializeAsCameraReference})),r.d(t,"SerializationHelper",(function(){return a.SerializationHelper}));var l=r(/*! ./deferred */"./Misc/deferred.ts");r.d(t,"Deferred",(function(){return l.Deferred}));var c=r(/*! ./environmentTextureTools */"./Misc/environmentTextureTools.ts");r.d(t,"EnvironmentTextureTools",(function(){return c.EnvironmentTextureTools}));var u=r(/*! ./meshExploder */"./Misc/meshExploder.ts");r.d(t,"MeshExploder",(function(){return u.MeshExploder}));var d=r(/*! ./filesInput */"./Misc/filesInput.ts");r.d(t,"FilesInput",(function(){return d.FilesInput}));var h=r(/*! ./HighDynamicRange/index */"./Misc/HighDynamicRange/index.ts");r.d(t,"CubeMapToSphericalPolynomialTools",(function(){return h.CubeMapToSphericalPolynomialTools})),r.d(t,"HDRTools",(function(){return h.HDRTools})),r.d(t,"PanoramaToCubeMapTools",(function(){return h.PanoramaToCubeMapTools}));var f=r(/*! ./khronosTextureContainer */"./Misc/khronosTextureContainer.ts");r.d(t,"KhronosTextureContainer",(function(){return f.KhronosTextureContainer}));var p=r(/*! ./observable */"./Misc/observable.ts");r.d(t,"EventState",(function(){return p.EventState})),r.d(t,"Observer",(function(){return p.Observer})),r.d(t,"MultiObserver",(function(){return p.MultiObserver})),r.d(t,"Observable",(function(){return p.Observable}));var m=r(/*! ./performanceMonitor */"./Misc/performanceMonitor.ts");r.d(t,"PerformanceMonitor",(function(){return m.PerformanceMonitor})),r.d(t,"RollingAverage",(function(){return m.RollingAverage}));var g=r(/*! ./promise */"./Misc/promise.ts");r.d(t,"PromisePolyfill",(function(){return g.PromisePolyfill}));var _=r(/*! ./sceneOptimizer */"./Misc/sceneOptimizer.ts");r.d(t,"SceneOptimization",(function(){return _.SceneOptimization})),r.d(t,"TextureOptimization",(function(){return _.TextureOptimization})),r.d(t,"HardwareScalingOptimization",(function(){return _.HardwareScalingOptimization})),r.d(t,"ShadowsOptimization",(function(){return _.ShadowsOptimization})),r.d(t,"PostProcessesOptimization",(function(){return _.PostProcessesOptimization})),r.d(t,"LensFlaresOptimization",(function(){return _.LensFlaresOptimization})),r.d(t,"CustomOptimization",(function(){return _.CustomOptimization})),r.d(t,"ParticlesOptimization",(function(){return _.ParticlesOptimization})),r.d(t,"RenderTargetsOptimization",(function(){return _.RenderTargetsOptimization})),r.d(t,"MergeMeshesOptimization",(function(){return _.MergeMeshesOptimization})),r.d(t,"SceneOptimizerOptions",(function(){return _.SceneOptimizerOptions})),r.d(t,"SceneOptimizer",(function(){return _.SceneOptimizer}));var v=r(/*! ./sceneSerializer */"./Misc/sceneSerializer.ts");r.d(t,"SceneSerializer",(function(){return v.SceneSerializer}));var y=r(/*! ./smartArray */"./Misc/smartArray.ts");r.d(t,"SmartArray",(function(){return y.SmartArray})),r.d(t,"SmartArrayNoDuplicate",(function(){return y.SmartArrayNoDuplicate}));var b=r(/*! ./stringDictionary */"./Misc/stringDictionary.ts");r.d(t,"StringDictionary",(function(){return b.StringDictionary}));var A=r(/*! ./tags */"./Misc/tags.ts");r.d(t,"Tags",(function(){return A.Tags}));var T=r(/*! ./textureTools */"./Misc/textureTools.ts");r.d(t,"TextureTools",(function(){return T.TextureTools}));var M=r(/*! ./tga */"./Misc/tga.ts");r.d(t,"TGATools",(function(){return M.TGATools}));var P=r(/*! ./tools */"./Misc/tools.ts");r.d(t,"Tools",(function(){return P.Tools})),r.d(t,"className",(function(){return P.className})),r.d(t,"AsyncLoop",(function(){return P.AsyncLoop}));var S=r(/*! ./videoRecorder */"./Misc/videoRecorder.ts");r.d(t,"VideoRecorder",(function(){return S.VideoRecorder}));var E=r(/*! ./virtualJoystick */"./Misc/virtualJoystick.ts");r.d(t,"JoystickAxis",(function(){return E.JoystickAxis})),r.d(t,"VirtualJoystick",(function(){return E.VirtualJoystick}));var C=r(/*! ./workerPool */"./Misc/workerPool.ts");r.d(t,"WorkerPool",(function(){return C.WorkerPool}));var x=r(/*! ./logger */"./Misc/logger.ts");r.d(t,"Logger",(function(){return x.Logger}));var R=r(/*! ./typeStore */"./Misc/typeStore.ts");r.d(t,"_TypeStore",(function(){return R._TypeStore}));var O=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts");r.d(t,"FilesInputStore",(function(){return O.FilesInputStore}));var I=r(/*! ./deepCopier */"./Misc/deepCopier.ts");r.d(t,"DeepCopier",(function(){return I.DeepCopier}));var D=r(/*! ./pivotTools */"./Misc/pivotTools.ts");r.d(t,"PivotTools",(function(){return D.PivotTools}));var B=r(/*! ./precisionDate */"./Misc/precisionDate.ts");r.d(t,"PrecisionDate",(function(){return B.PrecisionDate}));var N=r(/*! ./screenshotTools */"./Misc/screenshotTools.ts");r.d(t,"ScreenshotTools",(function(){return N.ScreenshotTools}));var L=r(/*! ./webRequest */"./Misc/webRequest.ts");r.d(t,"WebRequest",(function(){return L.WebRequest}));var w=r(/*! ./iInspectable */"./Misc/iInspectable.ts");r.d(t,"InspectableType",(function(){return w.InspectableType}));var F=r(/*! ./brdfTextureTools */"./Misc/brdfTextureTools.ts");r.d(t,"BRDFTextureTools",(function(){return F.BRDFTextureTools}));var V=r(/*! ./rgbdTextureTools */"./Misc/rgbdTextureTools.ts");r.d(t,"RGBDTextureTools",(function(){return V.RGBDTextureTools}));var k=r(/*! ./gradients */"./Misc/gradients.ts");r.d(t,"ColorGradient",(function(){return k.ColorGradient})),r.d(t,"Color3Gradient",(function(){return k.Color3Gradient})),r.d(t,"FactorGradient",(function(){return k.FactorGradient})),r.d(t,"GradientHelper",(function(){return k.GradientHelper}));var U=r(/*! ./perfCounter */"./Misc/perfCounter.ts");r.d(t,"PerfCounter",(function(){return U.PerfCounter}));var z=r(/*! ./fileRequest */"./Misc/fileRequest.ts");for(var G in z)["AndOrNotEvaluator","AssetTaskState","AbstractAssetTask","AssetsProgressEvent","MeshAssetTask","TextFileAssetTask","BinaryFileAssetTask","ImageAssetTask","TextureAssetTask","CubeTextureAssetTask","HDRCubeTextureAssetTask","EquiRectangularCubeTextureAssetTask","AssetsManager","BasisTranscodeConfiguration","BasisTools","DDSTools","expandToProperty","serialize","serializeAsTexture","serializeAsColor3","serializeAsFresnelParameters","serializeAsVector2","serializeAsVector3","serializeAsMeshReference","serializeAsColorCurves","serializeAsColor4","serializeAsImageProcessingConfiguration","serializeAsQuaternion","serializeAsMatrix","serializeAsCameraReference","SerializationHelper","Deferred","EnvironmentTextureTools","MeshExploder","FilesInput","CubeMapToSphericalPolynomialTools","HDRTools","PanoramaToCubeMapTools","KhronosTextureContainer","EventState","Observer","MultiObserver","Observable","PerformanceMonitor","RollingAverage","PromisePolyfill","SceneOptimization","TextureOptimization","HardwareScalingOptimization","ShadowsOptimization","PostProcessesOptimization","LensFlaresOptimization","CustomOptimization","ParticlesOptimization","RenderTargetsOptimization","MergeMeshesOptimization","SceneOptimizerOptions","SceneOptimizer","SceneSerializer","SmartArray","SmartArrayNoDuplicate","StringDictionary","Tags","TextureTools","TGATools","Tools","className","AsyncLoop","VideoRecorder","JoystickAxis","VirtualJoystick","WorkerPool","Logger","_TypeStore","FilesInputStore","DeepCopier","PivotTools","PrecisionDate","ScreenshotTools","WebRequest","InspectableType","BRDFTextureTools","RGBDTextureTools","ColorGradient","Color3Gradient","FactorGradient","GradientHelper","PerfCounter","default"].indexOf(G)<0&&function(e){r.d(t,e,(function(){return z[e]}))}(G);var j=r(/*! ./customAnimationFrameRequester */"./Misc/customAnimationFrameRequester.ts");for(var G in j)["AndOrNotEvaluator","AssetTaskState","AbstractAssetTask","AssetsProgressEvent","MeshAssetTask","TextFileAssetTask","BinaryFileAssetTask","ImageAssetTask","TextureAssetTask","CubeTextureAssetTask","HDRCubeTextureAssetTask","EquiRectangularCubeTextureAssetTask","AssetsManager","BasisTranscodeConfiguration","BasisTools","DDSTools","expandToProperty","serialize","serializeAsTexture","serializeAsColor3","serializeAsFresnelParameters","serializeAsVector2","serializeAsVector3","serializeAsMeshReference","serializeAsColorCurves","serializeAsColor4","serializeAsImageProcessingConfiguration","serializeAsQuaternion","serializeAsMatrix","serializeAsCameraReference","SerializationHelper","Deferred","EnvironmentTextureTools","MeshExploder","FilesInput","CubeMapToSphericalPolynomialTools","HDRTools","PanoramaToCubeMapTools","KhronosTextureContainer","EventState","Observer","MultiObserver","Observable","PerformanceMonitor","RollingAverage","PromisePolyfill","SceneOptimization","TextureOptimization","HardwareScalingOptimization","ShadowsOptimization","PostProcessesOptimization","LensFlaresOptimization","CustomOptimization","ParticlesOptimization","RenderTargetsOptimization","MergeMeshesOptimization","SceneOptimizerOptions","SceneOptimizer","SceneSerializer","SmartArray","SmartArrayNoDuplicate","StringDictionary","Tags","TextureTools","TGATools","Tools","className","AsyncLoop","VideoRecorder","JoystickAxis","VirtualJoystick","WorkerPool","Logger","_TypeStore","FilesInputStore","DeepCopier","PivotTools","PrecisionDate","ScreenshotTools","WebRequest","InspectableType","BRDFTextureTools","RGBDTextureTools","ColorGradient","Color3Gradient","FactorGradient","GradientHelper","PerfCounter","default"].indexOf(G)<0&&function(e){r.d(t,e,(function(){return j[e]}))}(G);var H=r(/*! ./retryStrategy */"./Misc/retryStrategy.ts");r.d(t,"RetryStrategy",(function(){return H.RetryStrategy}));var W=r(/*! ./interfaces/screenshotSize */"./Misc/interfaces/screenshotSize.ts");for(var G in W)["AndOrNotEvaluator","AssetTaskState","AbstractAssetTask","AssetsProgressEvent","MeshAssetTask","TextFileAssetTask","BinaryFileAssetTask","ImageAssetTask","TextureAssetTask","CubeTextureAssetTask","HDRCubeTextureAssetTask","EquiRectangularCubeTextureAssetTask","AssetsManager","BasisTranscodeConfiguration","BasisTools","DDSTools","expandToProperty","serialize","serializeAsTexture","serializeAsColor3","serializeAsFresnelParameters","serializeAsVector2","serializeAsVector3","serializeAsMeshReference","serializeAsColorCurves","serializeAsColor4","serializeAsImageProcessingConfiguration","serializeAsQuaternion","serializeAsMatrix","serializeAsCameraReference","SerializationHelper","Deferred","EnvironmentTextureTools","MeshExploder","FilesInput","CubeMapToSphericalPolynomialTools","HDRTools","PanoramaToCubeMapTools","KhronosTextureContainer","EventState","Observer","MultiObserver","Observable","PerformanceMonitor","RollingAverage","PromisePolyfill","SceneOptimization","TextureOptimization","HardwareScalingOptimization","ShadowsOptimization","PostProcessesOptimization","LensFlaresOptimization","CustomOptimization","ParticlesOptimization","RenderTargetsOptimization","MergeMeshesOptimization","SceneOptimizerOptions","SceneOptimizer","SceneSerializer","SmartArray","SmartArrayNoDuplicate","StringDictionary","Tags","TextureTools","TGATools","Tools","className","AsyncLoop","VideoRecorder","JoystickAxis","VirtualJoystick","WorkerPool","Logger","_TypeStore","FilesInputStore","DeepCopier","PivotTools","PrecisionDate","ScreenshotTools","WebRequest","InspectableType","BRDFTextureTools","RGBDTextureTools","ColorGradient","Color3Gradient","FactorGradient","GradientHelper","PerfCounter","RetryStrategy","default"].indexOf(G)<0&&function(e){r.d(t,e,(function(){return W[e]}))}(G);var X=r(/*! ./canvasGenerator */"./Misc/canvasGenerator.ts");r.d(t,"CanvasGenerator",(function(){return X.CanvasGenerator}));var Y=r(/*! ./fileTools */"./Misc/fileTools.ts");r.d(t,"LoadFileError",(function(){return Y.LoadFileError})),r.d(t,"RequestFileError",(function(){return Y.RequestFileError})),r.d(t,"ReadFileError",(function(){return Y.ReadFileError})),r.d(t,"FileTools",(function(){return Y.FileTools}));var Q=r(/*! ./stringTools */"./Misc/stringTools.ts");r.d(t,"StringTools",(function(){return Q.StringTools}));var K=r(/*! ./dataReader */"./Misc/dataReader.ts");r.d(t,"DataReader",(function(){return K.DataReader}));var q=r(/*! ./minMaxReducer */"./Misc/minMaxReducer.ts");r.d(t,"MinMaxReducer",(function(){return q.MinMaxReducer}));var Z=r(/*! ./depthReducer */"./Misc/depthReducer.ts");r.d(t,"DepthReducer",(function(){return Z.DepthReducer}));var J=r(/*! ./dataStorage */"./Misc/dataStorage.ts");r.d(t,"DataStorage",(function(){return J.DataStorage}));var $=r(/*! ./sceneRecorder */"./Misc/sceneRecorder.ts");r.d(t,"SceneRecorder",(function(){return $.SceneRecorder}))},"./Misc/instantiationTools.ts":
- /*!************************************!*\
- !*** ./Misc/instantiationTools.ts ***!
- \************************************/
- /*! exports provided: InstantiationTools */function(e,t,r){"use strict";r.r(t),r.d(t,"InstantiationTools",(function(){return o}));var n=r(/*! ./logger */"./Misc/logger.ts"),i=r(/*! ./typeStore */"./Misc/typeStore.ts"),o=function(){function e(){}return e.Instantiate=function(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];var t=i._TypeStore.GetClass(e);if(t)return t;n.Logger.Warn(e+" not found, you may have missed an import.");for(var r=e.split("."),o=window||this,s=0,a=r.length;s<a;s++)o=o[r[s]];return"function"!=typeof o?null:o},e.RegisteredExternalClasses={},e}()},"./Misc/interfaces/screenshotSize.ts":
- /*!*******************************************!*\
- !*** ./Misc/interfaces/screenshotSize.ts ***!
- \*******************************************/
- /*! no static exports found */function(e,t){},"./Misc/khronosTextureContainer.ts":
- /*!*****************************************!*\
- !*** ./Misc/khronosTextureContainer.ts ***!
- \*****************************************/
- /*! exports provided: KhronosTextureContainer */function(e,t,r){"use strict";r.r(t),r.d(t,"KhronosTextureContainer",(function(){return i}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=function(){function e(t,r,i,o){if(this.data=t,this.isInvalid=!1,!e.IsValid(t))return this.isInvalid=!0,void n.Logger.Error("texture missing KTX identifier");var s=Uint32Array.BYTES_PER_ELEMENT,a=new DataView(this.data.buffer,this.data.byteOffset+12,13*s),l=67305985===a.getUint32(0,!0);this.glType=a.getUint32(1*s,l),this.glTypeSize=a.getUint32(2*s,l),this.glFormat=a.getUint32(3*s,l),this.glInternalFormat=a.getUint32(4*s,l),this.glBaseInternalFormat=a.getUint32(5*s,l),this.pixelWidth=a.getUint32(6*s,l),this.pixelHeight=a.getUint32(7*s,l),this.pixelDepth=a.getUint32(8*s,l),this.numberOfArrayElements=a.getUint32(9*s,l),this.numberOfFaces=a.getUint32(10*s,l),this.numberOfMipmapLevels=a.getUint32(11*s,l),this.bytesOfKeyValueData=a.getUint32(12*s,l),0===this.glType?(this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===r?this.loadType=e.COMPRESSED_2D:n.Logger.Error("number of faces expected"+r+", but found "+this.numberOfFaces):n.Logger.Error("texture arrays not currently supported"):n.Logger.Error("only 2D textures currently supported")):n.Logger.Error("only compressed formats currently supported")}return e.prototype.uploadLevels=function(t,r){switch(this.loadType){case e.COMPRESSED_2D:this._upload2DCompressedLevels(t,r);break;case e.TEX_2D:case e.COMPRESSED_3D:case e.TEX_3D:}},e.prototype._upload2DCompressedLevels=function(t,r){for(var n=e.HEADER_LEN+this.bytesOfKeyValueData,i=this.pixelWidth,o=this.pixelHeight,s=r?this.numberOfMipmapLevels:1,a=0;a<s;a++){var l=new Int32Array(this.data.buffer,this.data.byteOffset+n,1)[0];n+=4;for(var c=0;c<this.numberOfFaces;c++){var u=new Uint8Array(this.data.buffer,this.data.byteOffset+n,l);t.getEngine()._uploadCompressedDataToTextureDirectly(t,this.glInternalFormat,i,o,u,c,a),n+=l,n+=3-(l+3)%4}i=Math.max(1,.5*i),o=Math.max(1,.5*o)}},e.IsValid=function(e){if(e.byteLength>=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&49===t[5]&&49===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e.HEADER_LEN=64,e.COMPRESSED_2D=0,e.COMPRESSED_3D=1,e.TEX_2D=2,e.TEX_3D=3,e}()},"./Misc/khronosTextureContainer2.ts":
- /*!******************************************!*\
- !*** ./Misc/khronosTextureContainer2.ts ***!
- \******************************************/
- /*! exports provided: KhronosTextureContainer2 */function(e,t,r){"use strict";r.r(t),r.d(t,"KhronosTextureContainer2",(function(){return n}));var n=function(){function e(t){var r=this;e._ModulePromise||(e._ModulePromise=new Promise((function(n){LIBKTX({preinitializedWebGLContext:t._gl}).then((function(i){i.GL.makeContextCurrent(i.GL.registerContext(t._gl,{majorVersion:t._webGLVersion})),e._TranscodeFormat=r._determineTranscodeFormat(i.TranscodeTarget,t.getCaps()),n({module:i})}))})))}return e.prototype.uploadAsync=function(t,r){return e._ModulePromise.then((function(n){var i=new n.module.ktxTexture(t);try{i.needsTranscoding&&i.transcodeBasis(e._TranscodeFormat,0),r.width=r.baseWidth=i.baseWidth,r.height=r.baseHeight=i.baseHeight,r.generateMipMaps=!1;var o=i.glUpload();if(0!==o.error)throw new Error("Failed to upload: "+o.error);r._webGLTexture=o.texture,r.isReady=!0}finally{i.delete()}}))},e.prototype._determineTranscodeFormat=function(e,t){if(t.s3tc)return e.BC1_OR_3;if(t.etc2)return e.ETC;throw new Error("No compatible format available")},e.IsValid=function(e){if(e.byteLength>=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&50===t[5]&&48===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e}()},"./Misc/logger.ts":
- /*!************************!*\
- !*** ./Misc/logger.ts ***!
- \************************/
- /*! exports provided: Logger */function(e,t,r){"use strict";r.r(t),r.d(t,"Logger",(function(){return n}));var n=function(){function e(){}return e._AddLogEntry=function(t){e._LogCache=t+e._LogCache,e.OnNewCacheEntry&&e.OnNewCacheEntry(t)},e._FormatMessage=function(e){var t=function(e){return e<10?"0"+e:""+e},r=new Date;return"["+t(r.getHours())+":"+t(r.getMinutes())+":"+t(r.getSeconds())+"]: "+e},e._LogDisabled=function(e){},e._LogEnabled=function(t){var r=e._FormatMessage(t);console.log("BJS - "+r);var n="<div style='color:white'>"+r+"</div><br>";e._AddLogEntry(n)},e._WarnDisabled=function(e){},e._WarnEnabled=function(t){var r=e._FormatMessage(t);console.warn("BJS - "+r);var n="<div style='color:orange'>"+r+"</div><br>";e._AddLogEntry(n)},e._ErrorDisabled=function(e){},e._ErrorEnabled=function(t){e.errorsCount++;var r=e._FormatMessage(t);console.error("BJS - "+r);var n="<div style='color:red'>"+r+"</div><br>";e._AddLogEntry(n)},Object.defineProperty(e,"LogCache",{get:function(){return e._LogCache},enumerable:!1,configurable:!0}),e.ClearLogCache=function(){e._LogCache="",e.errorsCount=0},Object.defineProperty(e,"LogLevels",{set:function(t){(t&e.MessageLogLevel)===e.MessageLogLevel?e.Log=e._LogEnabled:e.Log=e._LogDisabled,(t&e.WarningLogLevel)===e.WarningLogLevel?e.Warn=e._WarnEnabled:e.Warn=e._WarnDisabled,(t&e.ErrorLogLevel)===e.ErrorLogLevel?e.Error=e._ErrorEnabled:e.Error=e._ErrorDisabled},enumerable:!1,configurable:!0}),e.NoneLogLevel=0,e.MessageLogLevel=1,e.WarningLogLevel=2,e.ErrorLogLevel=4,e.AllLogLevel=7,e._LogCache="",e.errorsCount=0,e.Log=e._LogEnabled,e.Warn=e._WarnEnabled,e.Error=e._ErrorEnabled,e}()},"./Misc/meshExploder.ts":
- /*!******************************!*\
- !*** ./Misc/meshExploder.ts ***!
- \******************************/
- /*! exports provided: MeshExploder */function(e,t,r){"use strict";r.r(t),r.d(t,"MeshExploder",(function(){return i}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=function(){function e(e,t){this._meshesOrigins=[],this._toCenterVectors=[],this._scaledDirection=n.Vector3.Zero(),this._newPosition=n.Vector3.Zero(),this._centerPosition=n.Vector3.Zero(),this._meshes=e.slice(),t?this._centerMesh=t:this._setCenterMesh();var r=this._meshes.indexOf(this._centerMesh);r>=0&&this._meshes.splice(r,1),this._centerPosition=this._centerMesh.getAbsolutePosition().clone();for(var i=0;i<this._meshes.length;i++)if(this._meshes[i]){var o=this._meshes[i];this._meshesOrigins[i]=o.getAbsolutePosition().clone(),this._toCenterVectors[i]=n.Vector3.Zero(),o._boundingInfo&&this._centerMesh._boundingInfo&&o._boundingInfo.boundingBox.centerWorld.subtractToRef(this._centerMesh._boundingInfo.boundingBox.centerWorld,this._toCenterVectors[i])}}return e.prototype._setCenterMesh=function(){for(var e=n.Vector3.Zero(),t=n.Vector3.Zero(),r=Number.MAX_VALUE,i=0;i<this._meshes.length;i++)this._meshes[i]&&(s=(o=this._meshes[i]).getBoundingInfo())&&t.addInPlace(s.boundingBox.centerWorld);for(e=t.scale(1/this._meshes.length),i=0;i<this._meshes.length;i++){var o,s;if(this._meshes[i]&&(s=(o=this._meshes[i]).getBoundingInfo())){var a=s.boundingBox.centerWorld.subtract(e).lengthSquared();a<r&&(this._centerMesh=o,r=a)}}},e.prototype.getClassName=function(){return"MeshExploder"},e.prototype.getMeshes=function(){var e=this._meshes.slice();return e.unshift(this._centerMesh),e},e.prototype.explode=function(e){void 0===e&&(e=1);for(var t=0;t<this._meshes.length;t++)this._meshes[t]&&this._meshesOrigins[t]&&this._toCenterVectors[t]&&(this._toCenterVectors[t].scaleToRef(e,this._scaledDirection),this._meshesOrigins[t].addToRef(this._scaledDirection,this._newPosition),this._meshes[t].setAbsolutePosition(this._newPosition));this._centerMesh.setAbsolutePosition(this._centerPosition)},e}()},"./Misc/minMaxReducer.ts":
- /*!*******************************!*\
- !*** ./Misc/minMaxReducer.ts ***!
- \*******************************/
- /*! exports provided: MinMaxReducer */function(e,t,r){"use strict";r.r(t),r.d(t,"MinMaxReducer",(function(){return a}));var n=r(/*! ../Engines/constants */"./Engines/constants.ts"),i=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../PostProcesses/postProcessManager */"./PostProcesses/postProcessManager.ts"),s=r(/*! ./observable */"./Misc/observable.ts"),a=(r(/*! ../Shaders/minmaxRedux.fragment */"./Shaders/minmaxRedux.fragment.ts"),function(){function e(e){this.onAfterReductionPerformed=new s.Observable,this._forceFullscreenViewport=!0,this._activated=!1,this._camera=e,this._postProcessManager=new o.PostProcessManager(e.getScene())}return Object.defineProperty(e.prototype,"sourceTexture",{get:function(){return this._sourceTexture},enumerable:!1,configurable:!0}),e.prototype.setSourceTexture=function(e,t,r,o){var s=this;if(void 0===r&&(r=n.Constants.TEXTURETYPE_HALF_FLOAT),void 0===o&&(o=!0),e!==this._sourceTexture){this.dispose(!1),this._sourceTexture=e,this._reductionSteps=[],this._forceFullscreenViewport=o;var a=this._camera.getScene(),l=new i.PostProcess("Initial reduction phase","minmaxRedux",["texSize"],["sourceTexture"],1,null,n.Constants.TEXTURE_NEAREST_NEAREST,a.getEngine(),!1,"#define INITIAL"+(t?"\n#define DEPTH_REDUX":""),r,void 0,void 0,void 0,n.Constants.TEXTUREFORMAT_RG);l.autoClear=!1,l.forceFullscreenViewport=o;var c=this._sourceTexture.getRenderWidth(),u=this._sourceTexture.getRenderHeight();l.onApply=function(e,t){return function(r){r.setTexture("sourceTexture",s._sourceTexture),r.setFloatArray2("texSize",new Float32Array([e,t]))}}(c,u),this._reductionSteps.push(l);for(var d=1;c>1||u>1;){c=Math.max(Math.round(c/2),1),u=Math.max(Math.round(u/2),1);var h=new i.PostProcess("Reduction phase "+d,"minmaxRedux",["texSize"],null,{width:c,height:u},null,n.Constants.TEXTURE_NEAREST_NEAREST,a.getEngine(),!1,"#define "+(1==c&&1==u?"LAST":1==c||1==u?"ONEBEFORELAST":"MAIN"),r,void 0,void 0,void 0,n.Constants.TEXTUREFORMAT_RG);h.autoClear=!1,h.forceFullscreenViewport=o,h.onApply=function(e,t){return function(r){1==e||1==t?r.setIntArray2("texSize",new Int32Array([e,t])):r.setFloatArray2("texSize",new Float32Array([e,t]))}}(c,u),this._reductionSteps.push(h),d++,1==c&&1==u&&h.onAfterRenderObservable.add(function(e,t,r){var n=new Float32Array(4*e*t),i={min:0,max:0};return function(){a.getEngine()._readTexturePixels(r.inputTexture,e,t,-1,0,n),i.min=n[0],i.max=n[1],s.onAfterReductionPerformed.notifyObservers(i)}}(c,u,h))}}},Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._sourceTexture?this._sourceTexture.refreshRate:-1},set:function(e){this._sourceTexture&&(this._sourceTexture.refreshRate=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activated",{get:function(){return this._activated},enumerable:!1,configurable:!0}),e.prototype.activate=function(){var e=this;!this._onAfterUnbindObserver&&this._sourceTexture&&(this._onAfterUnbindObserver=this._sourceTexture.onAfterUnbindObservable.add((function(){e._reductionSteps[0].activate(e._camera),e._postProcessManager.directRender(e._reductionSteps,e._reductionSteps[0].inputTexture,e._forceFullscreenViewport),e._camera.getScene().getEngine().unBindFramebuffer(e._reductionSteps[0].inputTexture,!1)})),this._activated=!0)},e.prototype.deactivate=function(){this._onAfterUnbindObserver&&this._sourceTexture&&(this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=null,this._activated=!1)},e.prototype.dispose=function(e){if(void 0===e&&(e=!0),e&&this.onAfterReductionPerformed.clear(),this.deactivate(),this._reductionSteps){for(var t=0;t<this._reductionSteps.length;++t)this._reductionSteps[t].dispose();this._reductionSteps=null}this._postProcessManager&&e&&this._postProcessManager.dispose(),this._sourceTexture=null},e}())},"./Misc/observable.ts":
- /*!****************************!*\
- !*** ./Misc/observable.ts ***!
- \****************************/
- /*! exports provided: EventState, Observer, MultiObserver, Observable */function(e,t,r){"use strict";r.r(t),r.d(t,"EventState",(function(){return n})),r.d(t,"Observer",(function(){return i})),r.d(t,"MultiObserver",(function(){return o})),r.d(t,"Observable",(function(){return s}));var n=function(){function e(e,t,r,n){void 0===t&&(t=!1),this.initalize(e,t,r,n)}return e.prototype.initalize=function(e,t,r,n){return void 0===t&&(t=!1),this.mask=e,this.skipNextObservers=t,this.target=r,this.currentTarget=n,this},e}(),i=function(e,t,r){void 0===r&&(r=null),this.callback=e,this.mask=t,this.scope=r,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1},o=function(){function e(){}return e.prototype.dispose=function(){if(this._observers&&this._observables)for(var e=0;e<this._observers.length;e++)this._observables[e].remove(this._observers[e]);this._observers=null,this._observables=null},e.Watch=function(t,r,n,i){void 0===n&&(n=-1),void 0===i&&(i=null);var o=new e;o._observers=new Array,o._observables=t;for(var s=0,a=t;s<a.length;s++){var l=a[s].add(r,n,!1,i);l&&o._observers.push(l)}return o},e}(),s=function(){function e(e){this._observers=new Array,this._eventState=new n(0),e&&(this._onObserverAdded=e)}return Object.defineProperty(e.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),e.prototype.add=function(e,t,r,n,o){if(void 0===t&&(t=-1),void 0===r&&(r=!1),void 0===n&&(n=null),void 0===o&&(o=!1),!e)return null;var s=new i(e,t,n);return s.unregisterOnNextCall=o,r?this._observers.unshift(s):this._observers.push(s),this._onObserverAdded&&this._onObserverAdded(s),s},e.prototype.addOnce=function(e){return this.add(e,void 0,void 0,void 0,!0)},e.prototype.remove=function(e){return!!e&&-1!==this._observers.indexOf(e)&&(this._deferUnregister(e),!0)},e.prototype.removeCallback=function(e,t){for(var r=0;r<this._observers.length;r++){var n=this._observers[r];if(!(n._willBeUnregistered||n.callback!==e||t&&t!==n.scope))return this._deferUnregister(n),!0}return!1},e.prototype._deferUnregister=function(e){var t=this;e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout((function(){t._remove(e)}),0)},e.prototype._remove=function(e){if(!e)return!1;var t=this._observers.indexOf(e);return-1!==t&&(this._observers.splice(t,1),!0)},e.prototype.makeObserverTopPriority=function(e){this._remove(e),this._observers.unshift(e)},e.prototype.makeObserverBottomPriority=function(e){this._remove(e),this._observers.push(e)},e.prototype.notifyObservers=function(e,t,r,n){if(void 0===t&&(t=-1),!this._observers.length)return!0;var i=this._eventState;i.mask=t,i.target=r,i.currentTarget=n,i.skipNextObservers=!1,i.lastReturnValue=e;for(var o=0,s=this._observers;o<s.length;o++){var a=s[o];if(!a._willBeUnregistered&&(a.mask&t&&(a.scope?i.lastReturnValue=a.callback.apply(a.scope,[e,i]):i.lastReturnValue=a.callback(e,i),a.unregisterOnNextCall&&this._deferUnregister(a)),i.skipNextObservers))return!1}return!0},e.prototype.notifyObserversWithPromise=function(e,t,r,n){var i=this;void 0===t&&(t=-1);var o=Promise.resolve(e);if(!this._observers.length)return o;var s=this._eventState;return s.mask=t,s.target=r,s.currentTarget=n,s.skipNextObservers=!1,this._observers.forEach((function(r){s.skipNextObservers||r._willBeUnregistered||r.mask&t&&(o=r.scope?o.then((function(t){return s.lastReturnValue=t,r.callback.apply(r.scope,[e,s])})):o.then((function(t){return s.lastReturnValue=t,r.callback(e,s)})),r.unregisterOnNextCall&&i._deferUnregister(r))})),o.then((function(){return e}))},e.prototype.notifyObserver=function(e,t,r){void 0===r&&(r=-1);var n=this._eventState;n.mask=r,n.skipNextObservers=!1,e.callback(t,n)},e.prototype.hasObservers=function(){return this._observers.length>0},e.prototype.clear=function(){this._observers=new Array,this._onObserverAdded=null},e.prototype.clone=function(){var t=new e;return t._observers=this._observers.slice(0),t},e.prototype.hasSpecificMask=function(e){void 0===e&&(e=-1);for(var t=0,r=this._observers;t<r.length;t++){var n=r[t];if(n.mask&e||n.mask===e)return!0}return!1},e}()},"./Misc/perfCounter.ts":
- /*!*****************************!*\
- !*** ./Misc/perfCounter.ts ***!
- \*****************************/
- /*! exports provided: PerfCounter */function(e,t,r){"use strict";r.r(t),r.d(t,"PerfCounter",(function(){return i}));var n=r(/*! ./precisionDate */"./Misc/precisionDate.ts"),i=function(){function e(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}return Object.defineProperty(e.prototype,"min",{get:function(){return this._min},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"average",{get:function(){return this._average},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecAverage",{get:function(){return this._lastSecAverage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this._totalAccumulated},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._totalValueCount},enumerable:!1,configurable:!0}),e.prototype.fetchNewFrame=function(){this._totalValueCount++,this._current=0,this._lastSecValueCount++},e.prototype.addCount=function(t,r){e.Enabled&&(this._current+=t,r&&this._fetchResult())},e.prototype.beginMonitoring=function(){e.Enabled&&(this._startMonitoringTime=n.PrecisionDate.Now)},e.prototype.endMonitoring=function(t){if(void 0===t&&(t=!0),e.Enabled){t&&this.fetchNewFrame();var r=n.PrecisionDate.Now;this._current=r-this._startMonitoringTime,t&&this._fetchResult()}},e.prototype._fetchResult=function(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;var e=n.PrecisionDate.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)},e.Enabled=!0,e}()},"./Misc/performanceMonitor.ts":
- /*!************************************!*\
- !*** ./Misc/performanceMonitor.ts ***!
- \************************************/
- /*! exports provided: PerformanceMonitor, RollingAverage */function(e,t,r){"use strict";r.r(t),r.d(t,"PerformanceMonitor",(function(){return i})),r.d(t,"RollingAverage",(function(){return o}));var n=r(/*! ./precisionDate */"./Misc/precisionDate.ts"),i=function(){function e(e){void 0===e&&(e=30),this._enabled=!0,this._rollingFrameTime=new o(e)}return e.prototype.sampleFrame=function(e){if(void 0===e&&(e=n.PrecisionDate.Now),this._enabled){if(null!=this._lastFrameTimeMs){var t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}},Object.defineProperty(e.prototype,"averageFrameTime",{get:function(){return this._rollingFrameTime.average},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageFrameTimeVariance",{get:function(){return this._rollingFrameTime.variance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instantaneousFrameTime",{get:function(){return this._rollingFrameTime.history(0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageFPS",{get:function(){return 1e3/this._rollingFrameTime.average},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instantaneousFPS",{get:function(){var e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSaturated",{get:function(){return this._rollingFrameTime.isSaturated()},enumerable:!1,configurable:!0}),e.prototype.enable=function(){this._enabled=!0},e.prototype.disable=function(){this._enabled=!1,this._lastFrameTimeMs=null},Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()},e}(),o=function(){function e(e){this._samples=new Array(e),this.reset()}return e.prototype.add=function(e){var t;if(this.isSaturated()){var r=this._samples[this._pos];t=r-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(r-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length},e.prototype.history=function(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;var t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]},e.prototype.isSaturated=function(){return this._sampleCount>=this._samples.length},e.prototype.reset=function(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0},e.prototype._wrapPosition=function(e){var t=this._samples.length;return(e%t+t)%t},e}()},"./Misc/pivotTools.ts":
- /*!****************************!*\
- !*** ./Misc/pivotTools.ts ***!
- \****************************/
- /*! exports provided: PivotTools */function(e,t,r){"use strict";r.r(t),r.d(t,"PivotTools",(function(){return i}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=function(){function e(){}return e._RemoveAndStorePivotPoint=function(t){t&&0===e._PivotCached&&(t.getPivotPointToRef(e._OldPivotPoint),e._OldPivotPoint.equalsToFloats(0,0,0)||(t.setPivotMatrix(n.Matrix.IdentityReadOnly),e._OldPivotPoint.subtractToRef(t.getPivotPoint(),e._PivotTranslation),e._PivotTmpVector.copyFromFloats(1,1,1),e._PivotTmpVector.subtractInPlace(t.scaling),e._PivotTmpVector.multiplyInPlace(e._PivotTranslation),t.position.addInPlace(e._PivotTmpVector))),e._PivotCached++},e._RestorePivotPoint=function(t){t&&!e._OldPivotPoint.equalsToFloats(0,0,0)&&1===e._PivotCached&&(t.setPivotPoint(e._OldPivotPoint),e._PivotTmpVector.copyFromFloats(1,1,1),e._PivotTmpVector.subtractInPlace(t.scaling),e._PivotTmpVector.multiplyInPlace(e._PivotTranslation),t.position.subtractInPlace(e._PivotTmpVector)),this._PivotCached--},e._PivotCached=0,e._OldPivotPoint=new n.Vector3,e._PivotTranslation=new n.Vector3,e._PivotTmpVector=new n.Vector3,e}()},"./Misc/precisionDate.ts":
- /*!*******************************!*\
- !*** ./Misc/precisionDate.ts ***!
- \*******************************/
- /*! exports provided: PrecisionDate */function(e,t,r){"use strict";r.r(t),r.d(t,"PrecisionDate",(function(){return i}));var n=r(/*! ./domManagement */"./Misc/domManagement.ts"),i=function(){function e(){}return Object.defineProperty(e,"Now",{get:function(){return n.DomManagement.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!1,configurable:!0}),e}()},"./Misc/promise.ts":
- /*!*************************!*\
- !*** ./Misc/promise.ts ***!
- \*************************/
- /*! exports provided: PromisePolyfill */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"PromisePolyfill",(function(){return s})),function(e){e[e.Pending=0]="Pending",e[e.Fulfilled=1]="Fulfilled",e[e.Rejected=2]="Rejected"}(n||(n={}));var i=function(){this.count=0,this.target=0,this.results=[]},o=function(){function e(e){var t=this;if(this._state=n.Pending,this._children=new Array,this._rejectWasConsumed=!1,e)try{e((function(e){t._resolve(e)}),(function(e){t._reject(e)}))}catch(e){this._reject(e)}}return Object.defineProperty(e.prototype,"_result",{get:function(){return this._resultValue},set:function(e){this._resultValue=e,this._parent&&void 0===this._parent._result&&(this._parent._result=e)},enumerable:!1,configurable:!0}),e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.then=function(t,r){var i=this,o=new e;return o._onFulfilled=t,o._onRejected=r,this._children.push(o),o._parent=this,this._state!==n.Pending&&setTimeout((function(){if(i._state===n.Fulfilled||i._rejectWasConsumed){var e=o._resolve(i._result);if(null!=e)if(void 0!==e._state){var t=e;o._children.push(t),t._parent=o,o=t}else o._result=e}else o._reject(i._reason)})),o},e.prototype._moveChildren=function(e){var t,r=this;if((t=this._children).push.apply(t,e.splice(0,e.length)),this._children.forEach((function(e){e._parent=r})),this._state===n.Fulfilled)for(var i=0,o=this._children;i<o.length;i++)o[i]._resolve(this._result);else if(this._state===n.Rejected)for(var s=0,a=this._children;s<a.length;s++)a[s]._reject(this._reason)},e.prototype._resolve=function(e){try{this._state=n.Fulfilled;var t=null;if(this._onFulfilled&&(t=this._onFulfilled(e)),null!=t)if(void 0!==t._state){var r=t;r._parent=this,r._moveChildren(this._children),e=r._result}else e=t;this._result=e;for(var i=0,o=this._children;i<o.length;i++)o[i]._resolve(e);this._children.length=0,delete this._onFulfilled,delete this._onRejected}catch(e){this._reject(e,!0)}},e.prototype._reject=function(e,t){if(void 0===t&&(t=!1),this._state=n.Rejected,this._reason=e,this._onRejected&&!t)try{this._onRejected(e),this._rejectWasConsumed=!0}catch(t){e=t}for(var r=0,i=this._children;r<i.length;r++){var o=i[r];this._rejectWasConsumed?o._resolve(null):o._reject(e)}this._children.length=0,delete this._onFulfilled,delete this._onRejected},e.resolve=function(t){var r=new e;return r._resolve(t),r},e._RegisterForFulfillment=function(e,t,r){e.then((function(e){return t.results[r]=e,t.count++,t.count===t.target&&t.rootPromise._resolve(t.results),null}),(function(e){t.rootPromise._state!==n.Rejected&&t.rootPromise._reject(e)}))},e.all=function(t){var r=new e,n=new i;if(n.target=t.length,n.rootPromise=r,t.length)for(var o=0;o<t.length;o++)e._RegisterForFulfillment(t[o],n,o);else r._resolve([]);return r},e.race=function(t){var r=new e;if(t.length)for(var n=0,i=t;n<i.length;n++)i[n].then((function(e){return r&&(r._resolve(e),r=null),null}),(function(e){r&&(r._reject(e),r=null)}));return r},e}(),s=function(){function e(){}return e.Apply=function(e){void 0===e&&(e=!1),(e||"undefined"==typeof Promise)&&(window.Promise=o)},e}()},"./Misc/retryStrategy.ts":
- /*!*******************************!*\
- !*** ./Misc/retryStrategy.ts ***!
- \*******************************/
- /*! exports provided: RetryStrategy */function(e,t,r){"use strict";r.r(t),r.d(t,"RetryStrategy",(function(){return n}));var n=function(){function e(){}return e.ExponentialBackoff=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=500),function(r,n,i){return 0!==n.status||i>=e||-1!==r.indexOf("file:")?-1:Math.pow(2,i)*t}},e}()},"./Misc/rgbdTextureTools.ts":
- /*!**********************************!*\
- !*** ./Misc/rgbdTextureTools.ts ***!
- \**********************************/
- /*! exports provided: RGBDTextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"RGBDTextureTools",(function(){return o}));var n=r(/*! ../Engines/constants */"./Engines/constants.ts"),i=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/rgbdDecode.fragment */"./Shaders/rgbdDecode.fragment.ts"),r(/*! ../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),function(){function e(){}return e.ExpandRGBDTexture=function(e){var t=e._texture;if(t&&e.isRGBD){var r=t.getEngine(),o=r.getCaps(),s=!1;o.textureHalfFloatRender&&o.textureHalfFloatLinearFiltering?(s=!0,t.type=n.Constants.TEXTURETYPE_HALF_FLOAT):o.textureFloatRender&&o.textureFloatLinearFiltering&&(s=!0,t.type=n.Constants.TEXTURETYPE_FLOAT),s&&(t.isReady=!1,t._isRGBD=!1,t.invertY=!1),e.onLoadObservable.addOnce((function(){if(s){var o=new i.PostProcess("rgbdDecode","rgbdDecode",null,null,1,null,n.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,r,!1,void 0,t.type,void 0,null,!1),a=r.createRenderTargetTexture(t.width,{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:t.samplingMode,type:t.type,format:n.Constants.TEXTUREFORMAT_RGBA});o.getEffect().executeWhenCompiled((function(){o.onApply=function(e){e._bindTexture("textureSampler",t),e.setFloat2("scale",1,1)},e.getScene().postProcessManager.directRender([o],a,!0),r.restoreDefaultFramebuffer(),r._releaseTexture(t),r._releaseFramebufferObjects(a),o&&o.dispose(),a._swapAndDie(t),t.isReady=!0}))}}))}},e}())},"./Misc/sceneOptimizer.ts":
- /*!********************************!*\
- !*** ./Misc/sceneOptimizer.ts ***!
- \********************************/
- /*! exports provided: SceneOptimization, TextureOptimization, HardwareScalingOptimization, ShadowsOptimization, PostProcessesOptimization, LensFlaresOptimization, CustomOptimization, ParticlesOptimization, RenderTargetsOptimization, MergeMeshesOptimization, SceneOptimizerOptions, SceneOptimizer */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneOptimization",(function(){return a})),r.d(t,"TextureOptimization",(function(){return l})),r.d(t,"HardwareScalingOptimization",(function(){return c})),r.d(t,"ShadowsOptimization",(function(){return u})),r.d(t,"PostProcessesOptimization",(function(){return d})),r.d(t,"LensFlaresOptimization",(function(){return h})),r.d(t,"CustomOptimization",(function(){return f})),r.d(t,"ParticlesOptimization",(function(){return p})),r.d(t,"RenderTargetsOptimization",(function(){return m})),r.d(t,"MergeMeshesOptimization",(function(){return g})),r.d(t,"SceneOptimizerOptions",(function(){return _})),r.d(t,"SceneOptimizer",(function(){return v}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),o=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ./observable */"./Misc/observable.ts"),a=function(){function e(e){void 0===e&&(e=0),this.priority=e}return e.prototype.getDescription=function(){return""},e.prototype.apply=function(e,t){return!0},e}(),l=function(e){function t(t,r,n){void 0===t&&(t=0),void 0===r&&(r=1024),void 0===n&&(n=.5);var i=e.call(this,t)||this;return i.priority=t,i.maximumSize=r,i.step=n,i}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,t){for(var r=!0,n=0;n<e.textures.length;n++){var i=e.textures[n];if(i.canRescale&&!i.getContext){var o=i.getSize();Math.max(o.width,o.height)>this.maximumSize&&(i.scale(this.step),r=!1)}}return r},t}(a),c=function(e){function t(t,r,n){void 0===t&&(t=0),void 0===r&&(r=2),void 0===n&&(n=.25);var i=e.call(this,t)||this;return i.priority=t,i.maximumScale=r,i.step=n,i._currentScale=-1,i._directionOffset=1,i}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Setting hardware scaling level to "+this._currentScale},t.prototype.apply=function(e,t){return-1===this._currentScale&&(this._currentScale=e.getEngine().getHardwareScalingLevel(),this._currentScale>this.maximumScale&&(this._directionOffset=-1)),this._currentScale+=this._directionOffset*this.step,e.getEngine().setHardwareScalingLevel(this._currentScale),1===this._directionOffset?this._currentScale>=this.maximumScale:this._currentScale<=this.maximumScale},t}(a),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,t){return e.shadowsEnabled=t.isInImprovementMode,!0},t}(a),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning post-processes on/off"},t.prototype.apply=function(e,t){return e.postProcessesEnabled=t.isInImprovementMode,!0},t}(a),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning lens flares on/off"},t.prototype.apply=function(e,t){return e.lensFlaresEnabled=t.isInImprovementMode,!0},t}(a),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return this.onGetDescription?this.onGetDescription():"Running user defined callback"},t.prototype.apply=function(e,t){return!this.onApply||this.onApply(e,t)},t}(a),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,t){return e.particlesEnabled=t.isInImprovementMode,!0},t}(a),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,t){return e.renderTargetsEnabled=t.isInImprovementMode,!0},t}(a),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._canBeMerged=function(e){if(!(e instanceof o.Mesh))return!1;var t=e;return!(t.isDisposed()||!t.isVisible||!t.isEnabled()||t.instances.length>0||t.skeleton||t.hasLODLevels)},t}return Object(n.__extends)(t,e),Object.defineProperty(t,"UpdateSelectionTree",{get:function(){return t._UpdateSelectionTree},set:function(e){t._UpdateSelectionTree=e},enumerable:!1,configurable:!0}),t.prototype.getDescription=function(){return"Merging similar meshes together"},t.prototype.apply=function(e,r,n){for(var i=e.meshes.slice(0),s=i.length,a=0;a<s;a++){var l=new Array,c=i[a];if(this._canBeMerged(c)){l.push(c);for(var u=a+1;u<s;u++){var d=i[u];this._canBeMerged(d)&&d.material===c.material&&d.checkCollisions===c.checkCollisions&&(l.push(d),s--,i.splice(u,1),u--)}l.length<2||o.Mesh.MergeMeshes(l,void 0,!0)}}var h=e;return h.createOrUpdateSelectionOctree&&(null!=n?n&&h.createOrUpdateSelectionOctree():t.UpdateSelectionTree&&h.createOrUpdateSelectionOctree()),!0},t._UpdateSelectionTree=!1,t}(a),_=function(){function e(e,t){void 0===e&&(e=60),void 0===t&&(t=2e3),this.targetFrameRate=e,this.trackerDuration=t,this.optimizations=new Array}return e.prototype.addOptimization=function(e){return this.optimizations.push(e),this},e.prototype.addCustomOptimization=function(e,t,r){void 0===r&&(r=0);var n=new f(r);return n.onApply=e,n.onGetDescription=t,this.optimizations.push(n),this},e.LowDegradationAllowed=function(t){var r=new e(t),n=0;return r.addOptimization(new g(n)),r.addOptimization(new u(n)),r.addOptimization(new h(n)),n++,r.addOptimization(new d(n)),r.addOptimization(new p(n)),n++,r.addOptimization(new l(n,1024)),r},e.ModerateDegradationAllowed=function(t){var r=new e(t),n=0;return r.addOptimization(new g(n)),r.addOptimization(new u(n)),r.addOptimization(new h(n)),n++,r.addOptimization(new d(n)),r.addOptimization(new p(n)),n++,r.addOptimization(new l(n,512)),n++,r.addOptimization(new m(n)),n++,r.addOptimization(new c(n,2)),r},e.HighDegradationAllowed=function(t){var r=new e(t),n=0;return r.addOptimization(new g(n)),r.addOptimization(new u(n)),r.addOptimization(new h(n)),n++,r.addOptimization(new d(n)),r.addOptimization(new p(n)),n++,r.addOptimization(new l(n,256)),n++,r.addOptimization(new m(n)),n++,r.addOptimization(new c(n,4)),r},e}(),v=function(){function e(e,t,r,n){var o=this;if(void 0===r&&(r=!0),void 0===n&&(n=!1),this._isRunning=!1,this._currentPriorityLevel=0,this._targetFrameRate=60,this._trackerDuration=2e3,this._currentFrameRate=0,this._improvementMode=!1,this.onSuccessObservable=new s.Observable,this.onNewOptimizationAppliedObservable=new s.Observable,this.onFailureObservable=new s.Observable,this._options=t||new _,this._options.targetFrameRate&&(this._targetFrameRate=this._options.targetFrameRate),this._options.trackerDuration&&(this._trackerDuration=this._options.trackerDuration),r)for(var a=0,l=0,c=this._options.optimizations;l<c.length;l++)c[l].priority=a++;this._improvementMode=n,this._scene=e||i.EngineStore.LastCreatedScene,this._sceneDisposeObserver=this._scene.onDisposeObservable.add((function(){o._sceneDisposeObserver=null,o.dispose()}))}return Object.defineProperty(e.prototype,"isInImprovementMode",{get:function(){return this._improvementMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentPriorityLevel",{get:function(){return this._currentPriorityLevel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrameRate",{get:function(){return this._currentFrameRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetFrameRate",{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackerDuration",{get:function(){return this._trackerDuration},set:function(e){this._trackerDuration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optimizations",{get:function(){return this._options.optimizations},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this._isRunning=!1},e.prototype.reset=function(){this._currentPriorityLevel=0},e.prototype.start=function(){var e=this;this._isRunning||(this._isRunning=!0,this._scene.executeWhenReady((function(){setTimeout((function(){e._checkCurrentState()}),e._trackerDuration)})))},e.prototype._checkCurrentState=function(){var e=this;if(this._isRunning){var t=this._scene,r=this._options;if(this._currentFrameRate=Math.round(t.getEngine().getFps()),this._improvementMode&&this._currentFrameRate<=this._targetFrameRate||!this._improvementMode&&this._currentFrameRate>=this._targetFrameRate)return this._isRunning=!1,void this.onSuccessObservable.notifyObservers(this);for(var n=!0,i=!0,o=0;o<r.optimizations.length;o++){var s=r.optimizations[o];s.priority===this._currentPriorityLevel&&(i=!1,n=n&&s.apply(t,this),this.onNewOptimizationAppliedObservable.notifyObservers(s))}if(i)return this._isRunning=!1,void this.onFailureObservable.notifyObservers(this);n&&this._currentPriorityLevel++,t.executeWhenReady((function(){setTimeout((function(){e._checkCurrentState()}),e._trackerDuration)}))}},e.prototype.dispose=function(){this.stop(),this.onSuccessObservable.clear(),this.onFailureObservable.clear(),this.onNewOptimizationAppliedObservable.clear(),this._sceneDisposeObserver&&this._scene.onDisposeObservable.remove(this._sceneDisposeObserver)},e.OptimizeAsync=function(t,r,n,i){var o=new e(t,r||_.ModerateDegradationAllowed(),!1);return n&&o.onSuccessObservable.add((function(){n()})),i&&o.onFailureObservable.add((function(){i()})),o.start(),o},e}()},"./Misc/sceneRecorder.ts":
- /*!*******************************!*\
- !*** ./Misc/sceneRecorder.ts ***!
- \*******************************/
- /*! exports provided: SceneRecorder */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneRecorder",(function(){return f}));var n=r(/*! ./sceneSerializer */"./Misc/sceneSerializer.ts"),i=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),o=r(/*! ../Lights/light */"./Lights/light.ts"),s=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),a=r(/*! ../Bones/skeleton */"./Bones/skeleton.ts"),l=r(/*! ../Materials/material */"./Materials/material.ts"),c=r(/*! ../Materials/multiMaterial */"./Materials/multiMaterial.ts"),u=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),d=r(/*! ../Particles/particleSystem */"./Particles/particleSystem.ts"),h=r(/*! ../Morph/morphTargetManager */"./Morph/morphTargetManager.ts"),f=function(){function e(){this._trackedScene=null}return e.prototype.track=function(e){this._trackedScene=e,this._savedJSON=n.SceneSerializer.Serialize(e)},e.prototype.getDelta=function(){if(!this._trackedScene)return null;var e=n.SceneSerializer.Serialize(this._trackedScene),t={};for(var r in e)console.log("Processing "+r),this._compareCollections(r,this._savedJSON[r],e[r],t);return t},e.prototype._compareArray=function(e,t,r,n){if(0===t.length&&0===r.length)return!0;if(t.length&&!isNaN(t[0])||r.length&&!isNaN(r[0])){if(t.length!==r.length)return!1;if(0===t.length)return!0;for(var i=0;i<t.length;i++)if(t[i]!==r[i])return n[e]=r,!1;return!0}var o=[],s=function(){var s=t[i],l=s.uniqueId;o.push(l);var c=r.filter((function(e){return e.uniqueId===l}));if(c.length){var u=c[0],d={};a._compareObjects(s,u,d)||(n[e]||(n[e]=[]),d.__state={id:u.id},n[e].push(d))}else d={__state:{deleteId:s.id}},n[e].push(d)},a=this;for(i=0;i<t.length;i++)s();for(i=0;i<r.length;i++){var l=r[i],c=l.uniqueId;-1===o.indexOf(c)&&(n[e]||(n[e]=[]),n[e].push(l))}return!0},e.prototype._compareObjects=function(e,t,r){var n=!1;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i],s=t[i],a=!1;Array.isArray(o)?a=JSON.stringify(o)!==JSON.stringify(s):isNaN(o)&&"[object String]"!=Object.prototype.toString.call(o)||(a=o!==s),a&&(n=!0,r[i]=s)}return!n},e.prototype._compareCollections=function(e,t,r,n){if(console.log(t,typeof t),console.log(r,typeof r),t!==r&&t&&r)if(Array.isArray(t)&&Array.isArray(r)){if(this._compareArray(e,t,r,n))return}else if("object"==typeof t&&"object"==typeof r){var i={};return void(this._compareObjects(t,r,i)||(n[e]=i))}},e.ApplyDelta=function(e,t){e.toString&&(e=JSON.parse(e));var r=t;for(var n in e){var f=e[n],p=r[n];if(Array.isArray(p))switch(n){case"cameras":this._ApplyDeltaForEntity(f,t,t.getCameraByID.bind(t),(function(e){return s.Camera.Parse(e,t)}));break;case"lights":this._ApplyDeltaForEntity(f,t,t.getLightByID.bind(t),(function(e){return o.Light.Parse(e,t)}));break;case"meshes":this._ApplyDeltaForEntity(f,t,t.getMeshByID.bind(t),(function(e){return i.Mesh.Parse(e,t,"")}));break;case"skeletons":this._ApplyDeltaForEntity(f,t,t.getSkeletonById.bind(t),(function(e){return a.Skeleton.Parse(e,t)}));break;case"materials":this._ApplyDeltaForEntity(f,t,t.getMaterialByID.bind(t),(function(e){return l.Material.Parse(e,t,"")}));break;case"multiMaterials":this._ApplyDeltaForEntity(f,t,t.getMaterialByID.bind(t),(function(e){return c.MultiMaterial.Parse(e,t,"")}));break;case"transformNodes":this._ApplyDeltaForEntity(f,t,t.getTransformNodeByID.bind(t),(function(e){return u.TransformNode.Parse(e,t,"")}));break;case"particleSystems":this._ApplyDeltaForEntity(f,t,t.getParticleSystemByID.bind(t),(function(e){return d.ParticleSystem.Parse(e,t,"")}));break;case"morphTargetManagers":this._ApplyDeltaForEntity(f,t,t.getMorphTargetById.bind(t),(function(e){return h.MorphTargetManager.Parse(e,t)}))}else isNaN(p)?p.fromArray&&p.fromArray(f):r[n]=f}},e._ApplyPropertiesToEntity=function(e,t){for(var r in e){var n=e[r],i=t[r];void 0!==i&&(!isNaN(i)||Array.isArray(i)?t[r]=n:i.fromArray&&i.fromArray(n))}},e._ApplyDeltaForEntity=function(e,t,r,n){for(var i=0,o=e;i<o.length;i++){var s=o[i];if(s.__state&&void 0!==s.__state.id){var a=r(s.__state.id);a&&this._ApplyPropertiesToEntity(s,a)}else if(s.__state&&void 0!==s.__state.deleteId){var l=r(s.__state.deleteId);null==l||l.dispose()}else n(s)}},e}()},"./Misc/sceneSerializer.ts":
- /*!*********************************!*\
- !*** ./Misc/sceneSerializer.ts ***!
- \*********************************/
- /*! exports provided: SceneSerializer */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneSerializer",(function(){return u}));var n=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ../Materials/multiMaterial */"./Materials/multiMaterial.ts"),s=r(/*! ./decorators */"./Misc/decorators.ts"),a=[],l=function(e,t){a[e.id]||e.doNotSerialize||(t.vertexData.push(e.serializeVerticeData()),a[e.id]=!0)},c=function(e,t){var r={},n=e._geometry;return n&&(e.getScene().getGeometryByID(n.id)||l(n,t.geometries)),e.serialize&&e.serialize(r),r},u=function(){function e(){}return e.ClearCache=function(){a=[]},e.Serialize=function(t){var r,o,u,d={};if(e.ClearCache(),d.useDelayedTextureLoading=t.useDelayedTextureLoading,d.autoClear=t.autoClear,d.clearColor=t.clearColor.asArray(),d.ambientColor=t.ambientColor.asArray(),d.gravity=t.gravity.asArray(),d.collisionsEnabled=t.collisionsEnabled,t.fogMode&&0!==t.fogMode&&(d.fogMode=t.fogMode,d.fogColor=t.fogColor.asArray(),d.fogStart=t.fogStart,d.fogEnd=t.fogEnd,d.fogDensity=t.fogDensity),t.isPhysicsEnabled()){var h=t.getPhysicsEngine();h&&(d.physicsEnabled=!0,d.physicsGravity=h.gravity.asArray(),d.physicsEngine=h.getPhysicsPluginName())}t.metadata&&(d.metadata=t.metadata),d.morphTargetManagers=[];for(var f=0,p=t.meshes;f<p.length;f++){var m=(P=p[f]).morphTargetManager;m&&d.morphTargetManagers.push(m.serialize())}for(d.lights=[],r=0;r<t.lights.length;r++)(o=t.lights[r]).doNotSerialize||d.lights.push(o.serialize());for(d.cameras=[],r=0;r<t.cameras.length;r++){var g=t.cameras[r];g.doNotSerialize||d.cameras.push(g.serialize())}if(t.activeCamera&&(d.activeCameraID=t.activeCamera.id),s.SerializationHelper.AppendSerializedAnimations(t,d),t.animationGroups&&t.animationGroups.length>0){d.animationGroups=[];for(var _=0;_<t.animationGroups.length;_++){var v=t.animationGroups[_];d.animationGroups.push(v.serialize())}}if(t.reflectionProbes&&t.reflectionProbes.length>0)for(d.reflectionProbes=[],r=0;r<t.reflectionProbes.length;r++){var y=t.reflectionProbes[r];d.reflectionProbes.push(y.serialize())}for(d.materials=[],d.multiMaterials=[],r=0;r<t.materials.length;r++)(u=t.materials[r]).doNotSerialize||d.materials.push(u.serialize());for(d.multiMaterials=[],r=0;r<t.multiMaterials.length;r++){var b=t.multiMaterials[r];d.multiMaterials.push(b.serialize())}for(t.environmentTexture&&(d.environmentTexture=t.environmentTexture.name),d.environmentIntensity=t.environmentIntensity,d.skeletons=[],r=0;r<t.skeletons.length;r++){var A=t.skeletons[r];A.doNotSerialize||d.skeletons.push(A.serialize())}for(d.transformNodes=[],r=0;r<t.transformNodes.length;r++)t.transformNodes[r].doNotSerialize||d.transformNodes.push(t.transformNodes[r].serialize());d.geometries={},d.geometries.boxes=[],d.geometries.spheres=[],d.geometries.cylinders=[],d.geometries.toruses=[],d.geometries.grounds=[],d.geometries.planes=[],d.geometries.torusKnots=[],d.geometries.vertexData=[],a=[];var T=t.getGeometries();for(r=0;r<T.length;r++){var M=T[r];M.isReady()&&l(M,d.geometries)}for(d.meshes=[],r=0;r<t.meshes.length;r++){var P;if((P=t.meshes[r])instanceof n.Mesh){var S=P;S.doNotSerialize||S.delayLoadState!==i.Constants.DELAYLOADSTATE_LOADED&&S.delayLoadState!==i.Constants.DELAYLOADSTATE_NONE||d.meshes.push(c(S,d))}}for(d.particleSystems=[],r=0;r<t.particleSystems.length;r++)d.particleSystems.push(t.particleSystems[r].serialize(!1));t.actionManager&&(d.actions=t.actionManager.serialize("scene"));for(var E=0,C=t._serializableComponents;E<C.length;E++)C[E].serialize(d);return d},e.SerializeMesh=function(t,r,s){void 0===r&&(r=!1),void 0===s&&(s=!1);var a={};if(e.ClearCache(),t=t instanceof Array?t:[t],r||s)for(var u=0;u<t.length;++u)s&&t[u].getDescendants().forEach((function(e){e instanceof n.Mesh&&t.indexOf(e)<0&&!e.doNotSerialize&&t.push(e)})),r&&t[u].parent&&t.indexOf(t[u].parent)<0&&!t[u].parent.doNotSerialize&&t.push(t[u].parent);return t.forEach((function(e){!function(e,t){if(e.delayLoadState===i.Constants.DELAYLOADSTATE_LOADED||e.delayLoadState===i.Constants.DELAYLOADSTATE_NONE){if(e.material&&!e.material.doNotSerialize)if(e.material instanceof o.MultiMaterial){if(t.multiMaterials=t.multiMaterials||[],t.materials=t.materials||[],!t.multiMaterials.some((function(t){return t.id===e.material.id}))){t.multiMaterials.push(e.material.serialize());for(var r=function(e){e&&(t.materials.some((function(t){return t.id===e.id}))||t.materials.push(e.serialize()))},n=0,s=e.material.subMaterials;n<s.length;n++)r(s[n])}}else t.materials=t.materials||[],t.materials.some((function(t){return t.id===e.material.id}))||t.materials.push(e.material.serialize());var a=e._geometry;a&&(t.geometries||(t.geometries={},t.geometries.boxes=[],t.geometries.spheres=[],t.geometries.cylinders=[],t.geometries.toruses=[],t.geometries.grounds=[],t.geometries.planes=[],t.geometries.torusKnots=[],t.geometries.vertexData=[]),l(a,t.geometries)),e.skeleton&&!e.skeleton.doNotSerialize&&(t.skeletons=t.skeletons||[],t.skeletons.push(e.skeleton.serialize())),t.meshes=t.meshes||[],t.meshes.push(c(e,t))}}(e,a)})),a},e}()},"./Misc/screenshotTools.ts":
- /*!*********************************!*\
- !*** ./Misc/screenshotTools.ts ***!
- \*********************************/
- /*! exports provided: ScreenshotTools */function(e,t,r){"use strict";r.r(t),r.d(t,"ScreenshotTools",(function(){return c}));var n=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),i=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),o=r(/*! ../PostProcesses/fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ./logger */"./Misc/logger.ts"),l=r(/*! ./tools */"./Misc/tools.ts"),c=function(){function e(){}return e.CreateScreenshot=function(t,r,n,i,o){void 0===o&&(o="image/png");var s=e._getScreenshotSize(t,r,n),c=s.height,u=s.width;if(c&&u){l.Tools._ScreenshotCanvas||(l.Tools._ScreenshotCanvas=document.createElement("canvas")),l.Tools._ScreenshotCanvas.width=u,l.Tools._ScreenshotCanvas.height=c;var d=l.Tools._ScreenshotCanvas.getContext("2d"),h=t.getRenderWidth()/t.getRenderHeight(),f=u,p=f/h;p>c&&(f=(p=c)*h);var m=Math.max(0,u-f)/2,g=Math.max(0,c-p)/2,_=t.getRenderingCanvas();d&&_&&d.drawImage(_,m,g,f,p),l.Tools.EncodeScreenshotCanvasData(i,o)}else a.Logger.Error("Invalid 'size' parameter !")},e.CreateScreenshotAsync=function(t,r,n,i){return void 0===i&&(i="image/png"),new Promise((function(o,s){e.CreateScreenshot(t,r,n,(function(e){void 0!==e?o(e):s(new Error("Data is undefined"))}),i)}))},e.CreateScreenshotUsingRenderTarget=function(t,r,c,u,d,h,f,p,m){void 0===d&&(d="image/png"),void 0===h&&(h=1),void 0===f&&(f=!1),void 0===m&&(m=!1);var g=e._getScreenshotSize(t,r,c),_=g.height,v=g.width,y={width:v,height:_};if(_&&v){var b=r.getScene(),A=null;b.activeCamera!==r&&(A=b.activeCamera,b.activeCamera=r);var T=t.getRenderingCanvas();if(T){var M={width:T.width,height:T.height};t.setSize(v,_),b.render();var P=new i.RenderTargetTexture("screenShot",y,b,!1,!1,s.Constants.TEXTURETYPE_UNSIGNED_INT,!1,n.Texture.NEAREST_SAMPLINGMODE);P.renderList=null,P.samples=h,P.renderSprites=m,P.onAfterRenderObservable.add((function(){l.Tools.DumpFramebuffer(v,_,t,u,d,p)}));var S=function(){b.incrementRenderId(),b.resetCachedMaterial(),P.render(!0),P.dispose(),A&&(b.activeCamera=A),t.setSize(M.width,M.height),r.getProjectionMatrix(!0)};if(f){var E=new o.FxaaPostProcess("antialiasing",1,b.activeCamera);P.addPostProcess(E),E.getEffect().isReady()?S():E.getEffect().onCompiled=function(){S()}}else S()}else a.Logger.Error("No rendering canvas found !")}else a.Logger.Error("Invalid 'size' parameter !")},e.CreateScreenshotUsingRenderTargetAsync=function(t,r,n,i,o,s,a,l){return void 0===i&&(i="image/png"),void 0===o&&(o=1),void 0===s&&(s=!1),void 0===l&&(l=!1),new Promise((function(c,u){e.CreateScreenshotUsingRenderTarget(t,r,n,(function(e){void 0!==e?c(e):u(new Error("Data is undefined"))}),i,o,s,a,l)}))},e._getScreenshotSize=function(e,t,r){var n=0,i=0;if("object"==typeof r){var o=r.precision?Math.abs(r.precision):1;r.width&&r.height?(n=r.height*o,i=r.width*o):r.width&&!r.height?(i=r.width*o,n=Math.round(i/e.getAspectRatio(t))):r.height&&!r.width?(n=r.height*o,i=Math.round(n*e.getAspectRatio(t))):(i=Math.round(e.getRenderWidth()*o),n=Math.round(i/e.getAspectRatio(t)))}else isNaN(r)||(n=r,i=r);return i&&(i=Math.floor(i)),n&&(n=Math.floor(n)),{height:0|n,width:0|i}},e}();l.Tools.CreateScreenshot=c.CreateScreenshot,l.Tools.CreateScreenshotAsync=c.CreateScreenshotAsync,l.Tools.CreateScreenshotUsingRenderTarget=c.CreateScreenshotUsingRenderTarget,l.Tools.CreateScreenshotUsingRenderTargetAsync=c.CreateScreenshotUsingRenderTargetAsync},"./Misc/smartArray.ts":
- /*!****************************!*\
- !*** ./Misc/smartArray.ts ***!
- \****************************/
- /*! exports provided: SmartArray, SmartArrayNoDuplicate */function(e,t,r){"use strict";r.r(t),r.d(t,"SmartArray",(function(){return i})),r.d(t,"SmartArrayNoDuplicate",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(){function e(t){this.length=0,this.data=new Array(t),this._id=e._GlobalId++}return e.prototype.push=function(e){this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)},e.prototype.forEach=function(e){for(var t=0;t<this.length;t++)e(this.data[t])},e.prototype.sort=function(e){this.data.sort(e)},e.prototype.reset=function(){this.length=0},e.prototype.dispose=function(){this.reset(),this.data&&(this.data.length=0,this.data=[])},e.prototype.concat=function(e){if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(var t=0;t<e.length;t++)this.data[this.length++]=(e.data||e)[t]}},e.prototype.indexOf=function(e){var t=this.data.indexOf(e);return t>=this.length?-1:t},e.prototype.contains=function(e){return-1!==this.indexOf(e)},e._GlobalId=0,e}(),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._duplicateId=0,t}return Object(n.__extends)(t,e),t.prototype.push=function(t){e.prototype.push.call(this,t),t.__smartArrayFlags||(t.__smartArrayFlags={}),t.__smartArrayFlags[this._id]=this._duplicateId},t.prototype.pushNoDuplicate=function(e){return!(e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId||(this.push(e),0))},t.prototype.reset=function(){e.prototype.reset.call(this),this._duplicateId++},t.prototype.concatWithNoDuplicate=function(e){if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(var t=0;t<e.length;t++){var r=(e.data||e)[t];this.pushNoDuplicate(r)}}},t}(i)},"./Misc/stringDictionary.ts":
- /*!**********************************!*\
- !*** ./Misc/stringDictionary.ts ***!
- \**********************************/
- /*! exports provided: StringDictionary */function(e,t,r){"use strict";r.r(t),r.d(t,"StringDictionary",(function(){return n}));var n=function(){function e(){this._count=0,this._data={}}return e.prototype.copyFrom=function(e){var t=this;this.clear(),e.forEach((function(e,r){return t.add(e,r)}))},e.prototype.get=function(e){var t=this._data[e];if(void 0!==t)return t},e.prototype.getOrAddWithFactory=function(e,t){var r=this.get(e);return void 0!==r||(r=t(e))&&this.add(e,r),r},e.prototype.getOrAdd=function(e,t){var r=this.get(e);return void 0!==r?r:(this.add(e,t),t)},e.prototype.contains=function(e){return void 0!==this._data[e]},e.prototype.add=function(e,t){return void 0===this._data[e]&&(this._data[e]=t,++this._count,!0)},e.prototype.set=function(e,t){return void 0!==this._data[e]&&(this._data[e]=t,!0)},e.prototype.getAndRemove=function(e){var t=this.get(e);return void 0!==t?(delete this._data[e],--this._count,t):null},e.prototype.remove=function(e){return!!this.contains(e)&&(delete this._data[e],--this._count,!0)},e.prototype.clear=function(){this._data={},this._count=0},Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){for(var t in this._data)e(t,this._data[t])},e.prototype.first=function(e){for(var t in this._data){var r=e(t,this._data[t]);if(r)return r}return null},e}()},"./Misc/stringTools.ts":
- /*!*****************************!*\
- !*** ./Misc/stringTools.ts ***!
- \*****************************/
- /*! exports provided: StringTools */function(e,t,r){"use strict";r.r(t),r.d(t,"StringTools",(function(){return n}));var n=function(){function e(){}return e.EndsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.StartsWith=function(e,t){return!!e&&0===e.indexOf(t)},e.Decode=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0;r<e.byteLength;r++)t+=String.fromCharCode(e[r]);return t},e.EncodeArrayBufferToBase64=function(e){for(var t,r,n,i,o,s,a,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",u=0,d=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);u<d.length;)i=(t=d[u++])>>2,o=(3&t)<<4|(r=u<d.length?d[u++]:Number.NaN)>>4,s=(15&r)<<2|(n=u<d.length?d[u++]:Number.NaN)>>6,a=63&n,isNaN(r)?s=a=64:isNaN(n)&&(a=64),c+=l.charAt(i)+l.charAt(o)+l.charAt(s)+l.charAt(a);return c},e.PadNumber=function(e,t){for(var r=String(e);r.length<t;)r="0"+r;return r},e}()},"./Misc/tags.ts":
- /*!**********************!*\
- !*** ./Misc/tags.ts ***!
- \**********************/
- /*! exports provided: Tags */function(e,t,r){"use strict";r.r(t),r.d(t,"Tags",(function(){return i}));var n=r(/*! ./andOrNotEvaluator */"./Misc/andOrNotEvaluator.ts"),i=function(){function e(){}return e.EnableFor=function(t){t._tags=t._tags||{},t.hasTags=function(){return e.HasTags(t)},t.addTags=function(r){return e.AddTagsTo(t,r)},t.removeTags=function(r){return e.RemoveTagsFrom(t,r)},t.matchesTagsQuery=function(r){return e.MatchesQuery(t,r)}},e.DisableFor=function(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery},e.HasTags=function(e){if(!e._tags)return!1;var t=e._tags;for(var r in t)if(t.hasOwnProperty(r))return!0;return!1},e.GetTags=function(e,t){if(void 0===t&&(t=!0),!e._tags)return null;if(t){var r=[];for(var n in e._tags)e._tags.hasOwnProperty(n)&&!0===e._tags[n]&&r.push(n);return r.join(" ")}return e._tags},e.AddTagsTo=function(t,r){r&&"string"==typeof r&&r.split(" ").forEach((function(r,n,i){e._AddTagTo(t,r)}))},e._AddTagTo=function(t,r){""!==(r=r.trim())&&"true"!==r&&"false"!==r&&(r.match(/[\s]/)||r.match(/^([!]|([|]|[&]){2})/)||(e.EnableFor(t),t._tags[r]=!0))},e.RemoveTagsFrom=function(t,r){if(e.HasTags(t)){var n=r.split(" ");for(var i in n)e._RemoveTagFrom(t,n[i])}},e._RemoveTagFrom=function(e,t){delete e._tags[t]},e.MatchesQuery=function(t,r){return void 0===r||(""===r?e.HasTags(t):n.AndOrNotEvaluator.Eval(r,(function(r){return e.HasTags(t)&&t._tags[r]})))},e}()},"./Misc/textureTools.ts":
- /*!******************************!*\
- !*** ./Misc/textureTools.ts ***!
- \******************************/
- /*! exports provided: TextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"TextureTools",(function(){return a}));var n=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),i=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),o=r(/*! ../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=function(){function e(){}return e.CreateResizedCopy=function(e,t,r,a){void 0===a&&(a=!0);var l=e.getScene(),c=l.getEngine(),u=new i.RenderTargetTexture("resized"+e.name,{width:t,height:r},l,!e.noMipmap,!0,e._texture.type,!1,e.samplingMode,!1);u.wrapU=e.wrapU,u.wrapV=e.wrapV,u.uOffset=e.uOffset,u.vOffset=e.vOffset,u.uScale=e.uScale,u.vScale=e.vScale,u.uAng=e.uAng,u.vAng=e.vAng,u.wAng=e.wAng,u.coordinatesIndex=e.coordinatesIndex,u.level=e.level,u.anisotropicFilteringLevel=e.anisotropicFilteringLevel,u._texture.isReady=!1,e.wrapU=n.Texture.CLAMP_ADDRESSMODE,e.wrapV=n.Texture.CLAMP_ADDRESSMODE;var d=new o.PassPostProcess("pass",1,null,a?n.Texture.BILINEAR_SAMPLINGMODE:n.Texture.NEAREST_SAMPLINGMODE,c,!1,s.Constants.TEXTURETYPE_UNSIGNED_INT);return d.getEffect().executeWhenCompiled((function(){d.onApply=function(t){t.setTexture("textureSampler",e)};var t=u.getInternalTexture();t&&(l.postProcessManager.directRender([d],t),c.unBindFramebuffer(t),u.disposeFramebufferObjects(),d.dispose(),t.isReady=!0)})),u},e}()},"./Misc/tga.ts":
- /*!*********************!*\
- !*** ./Misc/tga.ts ***!
- \*********************/
- /*! exports provided: TGATools */function(e,t,r){"use strict";r.r(t),r.d(t,"TGATools",(function(){return i}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=function(){function e(){}return e.GetTGAHeader=function(e){var t=0;return{id_length:e[t++],colormap_type:e[t++],image_type:e[t++],colormap_index:e[t++]|e[t++]<<8,colormap_length:e[t++]|e[t++]<<8,colormap_size:e[t++],origin:[e[t++]|e[t++]<<8,e[t++]|e[t++]<<8],width:e[t++]|e[t++]<<8,height:e[t++]|e[t++]<<8,pixel_size:e[t++],flags:e[t++]}},e.UploadContent=function(t,r){if(r.length<19)n.Logger.Error("Unable to load TGA file - Not enough data to contain header");else{var i=18,o=e.GetTGAHeader(r);if(o.id_length+i>r.length)n.Logger.Error("Unable to load TGA file - Not enough data");else{i+=o.id_length;var s,a=!1,l=!1,c=!1;switch(o.image_type){case e._TYPE_RLE_INDEXED:a=!0;case e._TYPE_INDEXED:l=!0;break;case e._TYPE_RLE_RGB:a=!0;case e._TYPE_RGB:break;case e._TYPE_RLE_GREY:a=!0;case e._TYPE_GREY:c=!0}var u,d,h,f,p,m,g,_=o.pixel_size>>3,v=o.width*o.height*_;if(l&&(u=r.subarray(i,i+=o.colormap_length*(o.colormap_size>>3))),a){var y,b,A;s=new Uint8Array(v);for(var T=0,M=new Uint8Array(_);i<v&&T<v;)if(b=1+(127&(y=r[i++])),128&y){for(A=0;A<_;++A)M[A]=r[i++];for(A=0;A<b;++A)s.set(M,T+A*_);T+=_*b}else{for(b*=_,A=0;A<b;++A)s[T+A]=r[i++];T+=b}}else s=r.subarray(i,i+=l?o.width*o.height:v);switch((o.flags&e._ORIGIN_MASK)>>e._ORIGIN_SHIFT){default:case e._ORIGIN_UL:d=0,f=1,g=o.width,h=0,p=1,m=o.height;break;case e._ORIGIN_BL:d=0,f=1,g=o.width,h=o.height-1,p=-1,m=-1;break;case e._ORIGIN_UR:d=o.width-1,f=-1,g=-1,h=0,p=1,m=o.height;break;case e._ORIGIN_BR:d=o.width-1,f=-1,g=-1,h=o.height-1,p=-1,m=-1}var P=e["_getImageData"+(c?"Grey":"")+o.pixel_size+"bits"](o,u,s,h,p,m,d,f,g);t.getEngine()._uploadDataToTextureDirectly(t,P)}}},e._getImageData8bits=function(e,t,r,n,i,o,s,a,l){var c,u,d,h=r,f=t,p=e.width,m=e.height,g=0,_=new Uint8Array(p*m*4);for(d=n;d!==o;d+=i)for(u=s;u!==l;u+=a,g++)c=h[g],_[4*(u+p*d)+3]=255,_[4*(u+p*d)+2]=f[3*c+0],_[4*(u+p*d)+1]=f[3*c+1],_[4*(u+p*d)+0]=f[3*c+2];return _},e._getImageData16bits=function(e,t,r,n,i,o,s,a,l){var c,u,d,h=r,f=e.width,p=e.height,m=0,g=new Uint8Array(f*p*4);for(d=n;d!==o;d+=i)for(u=s;u!==l;u+=a,m+=2){var _=255*((31744&(c=h[m+0]+(h[m+1]<<8)))>>10)/31|0,v=255*((992&c)>>5)/31|0,y=255*(31&c)/31|0;g[4*(u+f*d)+0]=_,g[4*(u+f*d)+1]=v,g[4*(u+f*d)+2]=y,g[4*(u+f*d)+3]=32768&c?0:255}return g},e._getImageData24bits=function(e,t,r,n,i,o,s,a,l){var c,u,d=r,h=e.width,f=e.height,p=0,m=new Uint8Array(h*f*4);for(u=n;u!==o;u+=i)for(c=s;c!==l;c+=a,p+=3)m[4*(c+h*u)+3]=255,m[4*(c+h*u)+2]=d[p+0],m[4*(c+h*u)+1]=d[p+1],m[4*(c+h*u)+0]=d[p+2];return m},e._getImageData32bits=function(e,t,r,n,i,o,s,a,l){var c,u,d=r,h=e.width,f=e.height,p=0,m=new Uint8Array(h*f*4);for(u=n;u!==o;u+=i)for(c=s;c!==l;c+=a,p+=4)m[4*(c+h*u)+2]=d[p+0],m[4*(c+h*u)+1]=d[p+1],m[4*(c+h*u)+0]=d[p+2],m[4*(c+h*u)+3]=d[p+3];return m},e._getImageDataGrey8bits=function(e,t,r,n,i,o,s,a,l){var c,u,d,h=r,f=e.width,p=e.height,m=0,g=new Uint8Array(f*p*4);for(d=n;d!==o;d+=i)for(u=s;u!==l;u+=a,m++)c=h[m],g[4*(u+f*d)+0]=c,g[4*(u+f*d)+1]=c,g[4*(u+f*d)+2]=c,g[4*(u+f*d)+3]=255;return g},e._getImageDataGrey16bits=function(e,t,r,n,i,o,s,a,l){var c,u,d=r,h=e.width,f=e.height,p=0,m=new Uint8Array(h*f*4);for(u=n;u!==o;u+=i)for(c=s;c!==l;c+=a,p+=2)m[4*(c+h*u)+0]=d[p+0],m[4*(c+h*u)+1]=d[p+0],m[4*(c+h*u)+2]=d[p+0],m[4*(c+h*u)+3]=d[p+1];return m},e._TYPE_INDEXED=1,e._TYPE_RGB=2,e._TYPE_GREY=3,e._TYPE_RLE_INDEXED=9,e._TYPE_RLE_RGB=10,e._TYPE_RLE_GREY=11,e._ORIGIN_MASK=48,e._ORIGIN_SHIFT=4,e._ORIGIN_BL=0,e._ORIGIN_BR=1,e._ORIGIN_UL=2,e._ORIGIN_UR=3,e}()},"./Misc/timer.ts":
- /*!***********************!*\
- !*** ./Misc/timer.ts ***!
- \***********************/
- /*! exports provided: TimerState, setAndStartTimer, AdvancedTimer */function(e,t,r){"use strict";r.r(t),r.d(t,"TimerState",(function(){return n})),r.d(t,"setAndStartTimer",(function(){return o})),r.d(t,"AdvancedTimer",(function(){return s}));var n,i=r(/*! ../Misc/observable */"./Misc/observable.ts");function o(e){var t,r=0,n=Date.now();e.observableParameters=null!==(t=e.observableParameters)&&void 0!==t?t:{};var i=e.contextObservable.add((function(t){var o=Date.now(),s={startTime:n,currentTime:o,deltaTime:r=o-n,completeRate:r/e.timeout,payload:t};e.onTick&&e.onTick(s),e.breakCondition&&e.breakCondition()&&(e.contextObservable.remove(i),e.onAborted&&e.onAborted(s)),r>=e.timeout&&(e.contextObservable.remove(i),e.onEnded&&e.onEnded(s))}),e.observableParameters.mask,e.observableParameters.insertFirst,e.observableParameters.scope);return i}!function(e){e[e.INIT=0]="INIT",e[e.STARTED=1]="STARTED",e[e.ENDED=2]="ENDED"}(n||(n={}));var s=function(){function e(e){var t,r,o=this;this.onEachCountObservable=new i.Observable,this.onTimerAbortedObservable=new i.Observable,this.onTimerEndedObservable=new i.Observable,this.onStateChangedObservable=new i.Observable,this._observer=null,this._breakOnNextTick=!1,this._tick=function(e){var t=Date.now();o._timer=t-o._startTime;var r={startTime:o._startTime,currentTime:t,deltaTime:o._timer,completeRate:o._timer/o._timeToEnd,payload:e},n=o._breakOnNextTick||o._breakCondition(r);n||o._timer>=o._timeToEnd?o._stop(r,n):o.onEachCountObservable.notifyObservers(r)},this._setState(n.INIT),this._contextObservable=e.contextObservable,this._observableParameters=null!==(t=e.observableParameters)&&void 0!==t?t:{},this._breakCondition=null!==(r=e.breakCondition)&&void 0!==r?r:function(){return!1},e.onEnded&&this.onTimerEndedObservable.add(e.onEnded),e.onTick&&this.onEachCountObservable.add(e.onTick),e.onAborted&&this.onTimerAbortedObservable.add(e.onAborted)}return Object.defineProperty(e.prototype,"breakCondition",{set:function(e){this._breakCondition=e},enumerable:!1,configurable:!0}),e.prototype.clearObservables=function(){this.onEachCountObservable.clear(),this.onTimerAbortedObservable.clear(),this.onTimerEndedObservable.clear(),this.onStateChangedObservable.clear()},e.prototype.start=function(e){if(void 0===e&&(e=this._timeToEnd),this._state===n.STARTED)throw new Error("Timer already started. Please stop it before starting again");this._timeToEnd=e,this._startTime=Date.now(),this._timer=0,this._observer=this._contextObservable.add(this._tick,this._observableParameters.mask,this._observableParameters.insertFirst,this._observableParameters.scope),this._setState(n.STARTED)},e.prototype.stop=function(){this._state===n.STARTED&&(this._breakOnNextTick=!0)},e.prototype.dispose=function(){this._observer&&this._contextObservable.remove(this._observer),this.clearObservables()},e.prototype._setState=function(e){this._state=e,this.onStateChangedObservable.notifyObservers(this._state)},e.prototype._stop=function(e,t){void 0===t&&(t=!1),this._contextObservable.remove(this._observer),this._setState(n.ENDED),t?this.onTimerAbortedObservable.notifyObservers(e):this.onTimerEndedObservable.notifyObservers(e)},e}()},"./Misc/timingTools.ts":
- /*!*****************************!*\
- !*** ./Misc/timingTools.ts ***!
- \*****************************/
- /*! exports provided: TimingTools */function(e,t,r){"use strict";r.r(t),r.d(t,"TimingTools",(function(){return i}));var n=r(/*! ./domManagement */"./Misc/domManagement.ts"),i=function(){function e(){}return e.SetImmediate=function(e){n.DomManagement.IsWindowObjectExist()&&window.setImmediate?window.setImmediate(e):setTimeout(e,1)},e}()},"./Misc/tools.ts":
- /*!***********************!*\
- !*** ./Misc/tools.ts ***!
- \***********************/
- /*! exports provided: Tools, className, AsyncLoop */function(e,t,r){"use strict";r.r(t),r.d(t,"Tools",(function(){return g})),r.d(t,"className",(function(){return _})),r.d(t,"AsyncLoop",(function(){return v}));var n=r(/*! ./observable */"./Misc/observable.ts"),i=r(/*! ./domManagement */"./Misc/domManagement.ts"),o=r(/*! ./logger */"./Misc/logger.ts"),s=r(/*! ./deepCopier */"./Misc/deepCopier.ts"),a=r(/*! ./precisionDate */"./Misc/precisionDate.ts"),l=r(/*! ./devTools */"./Misc/devTools.ts"),c=r(/*! ./webRequest */"./Misc/webRequest.ts"),u=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),d=r(/*! ./fileTools */"./Misc/fileTools.ts"),h=r(/*! ./promise */"./Misc/promise.ts"),f=r(/*! ./timingTools */"./Misc/timingTools.ts"),p=r(/*! ./instantiationTools */"./Misc/instantiationTools.ts"),m=r(/*! ./guid */"./Misc/guid.ts"),g=function(){function e(){}return Object.defineProperty(e,"BaseUrl",{get:function(){return d.FileTools.BaseUrl},set:function(e){d.FileTools.BaseUrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DefaultRetryStrategy",{get:function(){return d.FileTools.DefaultRetryStrategy},set:function(e){d.FileTools.DefaultRetryStrategy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CorsBehavior",{get:function(){return d.FileTools.CorsBehavior},set:function(e){d.FileTools.CorsBehavior=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"UseFallbackTexture",{get:function(){return u.EngineStore.UseFallbackTexture},set:function(e){u.EngineStore.UseFallbackTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RegisteredExternalClasses",{get:function(){return p.InstantiationTools.RegisteredExternalClasses},set:function(e){p.InstantiationTools.RegisteredExternalClasses=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fallbackTexture",{get:function(){return u.EngineStore.FallbackTexture},set:function(e){u.EngineStore.FallbackTexture=e},enumerable:!1,configurable:!0}),e.FetchToRef=function(e,t,r,n,i,o){var s=4*((Math.abs(e)*r%r|0)+(Math.abs(t)*n%n|0)*r);o.r=i[s]/255,o.g=i[s+1]/255,o.b=i[s+2]/255,o.a=i[s+3]/255},e.Mix=function(e,t,r){return e*(1-r)+t*r},e.Instantiate=function(e){return p.InstantiationTools.Instantiate(e)},e.Slice=function(e,t,r){return e.slice?e.slice(t,r):Array.prototype.slice.call(e,t,r)},e.SetImmediate=function(e){f.TimingTools.SetImmediate(e)},e.IsExponentOfTwo=function(e){var t=1;do{t*=2}while(t<e);return t===e},e.FloatRound=function(t){return Math.fround?Math.fround(t):e._tmpFloatArray[0]=t},e.GetFilename=function(e){var t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)},e.GetFolderPath=function(e,t){void 0===t&&(t=!1);var r=e.lastIndexOf("/");return r<0?t?e:"":e.substring(0,r+1)},e.ToDegrees=function(e){return 180*e/Math.PI},e.ToRadians=function(e){return e*Math.PI/180},e.MakeArray=function(e,t){return!0===t||void 0!==e&&null!=e?Array.isArray(e)?e:[e]:null},e.GetPointerPrefix=function(e){var t="pointer";return i.DomManagement.IsWindowObjectExist()&&!window.PointerEvent&&i.DomManagement.IsNavigatorAvailable()&&!navigator.pointerEnabled&&(t="mouse"),!e._badDesktopOS||e._badOS||document&&"ontouchend"in document||(t="mouse"),t},e.SetCorsBehavior=function(e,t){d.FileTools.SetCorsBehavior(e,t)},e.CleanUrl=function(e){return e=e.replace(/#/gm,"%23")},Object.defineProperty(e,"PreprocessUrl",{get:function(){return d.FileTools.PreprocessUrl},set:function(e){d.FileTools.PreprocessUrl=e},enumerable:!1,configurable:!0}),e.LoadImage=function(e,t,r,n,i){return d.FileTools.LoadImage(e,t,r,n,i)},e.LoadFile=function(e,t,r,n,i,o){return d.FileTools.LoadFile(e,t,r,n,i,o)},e.LoadFileAsync=function(e,t){return void 0===t&&(t=!0),new Promise((function(r,n){d.FileTools.LoadFile(e,(function(e){r(e)}),void 0,void 0,t,(function(e,t){n(t)}))}))},e.LoadScript=function(e,t,r,n){if(i.DomManagement.IsWindowObjectExist()){var o=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",e),n&&(s.id=n),s.onload=function(){t&&t()},s.onerror=function(t){r&&r("Unable to load script '"+e+"'",t)},o.appendChild(s)}},e.LoadScriptAsync=function(e,t){var r=this;return new Promise((function(t,n){r.LoadScript(e,(function(){t()}),(function(e,t){n(t)}))}))},e.ReadFileAsDataURL=function(e,t,r){var i=new FileReader,o={onCompleteObservable:new n.Observable,abort:function(){return i.abort()}};return i.onloadend=function(e){o.onCompleteObservable.notifyObservers(o)},i.onload=function(e){t(e.target.result)},i.onprogress=r,i.readAsDataURL(e),o},e.ReadFile=function(e,t,r,n,i){return d.FileTools.ReadFile(e,t,r,n,i)},e.FileAsURL=function(e){var t=new Blob([e]);return(window.URL||window.webkitURL).createObjectURL(t)},e.Format=function(e,t){return void 0===t&&(t=2),e.toFixed(t)},e.DeepCopy=function(e,t,r,n){s.DeepCopier.DeepCopy(e,t,r,n)},e.IsEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},e.RegisterTopRootEvents=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e.addEventListener(n.name,n.handler,!1);try{window.parent&&window.parent.addEventListener(n.name,n.handler,!1)}catch(e){}}},e.UnregisterTopRootEvents=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e.removeEventListener(n.name,n.handler);try{e.parent&&e.parent.removeEventListener(n.name,n.handler)}catch(e){}}},e.DumpFramebuffer=function(t,r,n,i,o,s){void 0===o&&(o="image/png");for(var a=4*t,l=r/2,c=n.readPixels(0,0,t,r),u=0;u<l;u++)for(var d=0;d<a;d++){var h=d+u*a,f=d+(r-u-1)*a,p=c[h];c[h]=c[f],c[f]=p}e._ScreenshotCanvas||(e._ScreenshotCanvas=document.createElement("canvas")),e._ScreenshotCanvas.width=t,e._ScreenshotCanvas.height=r;var m=e._ScreenshotCanvas.getContext("2d");if(m){var g=m.createImageData(t,r);g.data.set(c),m.putImageData(g,0,0),e.EncodeScreenshotCanvasData(i,o,s)}},e.ToBlob=function(e,t,r){void 0===r&&(r="image/png"),e.toBlob||(e.toBlob=function(e,t,r){var n=this;setTimeout((function(){for(var i=atob(n.toDataURL(t,r).split(",")[1]),o=i.length,s=new Uint8Array(o),a=0;a<o;a++)s[a]=i.charCodeAt(a);e(new Blob([s]))}))}),e.toBlob((function(e){t(e)}),r)},e.EncodeScreenshotCanvasData=function(t,r,n){void 0===r&&(r="image/png"),t?t(e._ScreenshotCanvas.toDataURL(r)):this.ToBlob(e._ScreenshotCanvas,(function(t){if("download"in document.createElement("a")){if(!n){var r=new Date,i=(r.getFullYear()+"-"+(r.getMonth()+1)).slice(2)+"-"+r.getDate()+"_"+r.getHours()+"-"+("0"+r.getMinutes()).slice(-2);n="screenshot_"+i+".png"}e.Download(t,n)}else{var o=URL.createObjectURL(t),s=window.open("");if(!s)return;var a=s.document.createElement("img");a.onload=function(){URL.revokeObjectURL(o)},a.src=o,s.document.body.appendChild(a)}}),r)},e.Download=function(e,t){if(navigator&&navigator.msSaveBlob)navigator.msSaveBlob(e,t);else{var r=window.URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=r,n.download=t,n.addEventListener("click",(function(){n.parentElement&&n.parentElement.removeChild(n)})),n.click(),window.URL.revokeObjectURL(r)}},e.CreateScreenshot=function(e,t,r,n,i){throw void 0===i&&(i="image/png"),l._DevTools.WarnImport("ScreenshotTools")},e.CreateScreenshotAsync=function(e,t,r,n){throw void 0===n&&(n="image/png"),l._DevTools.WarnImport("ScreenshotTools")},e.CreateScreenshotUsingRenderTarget=function(e,t,r,n,i,o,s,a){throw void 0===i&&(i="image/png"),void 0===o&&(o=1),void 0===s&&(s=!1),l._DevTools.WarnImport("ScreenshotTools")},e.CreateScreenshotUsingRenderTargetAsync=function(e,t,r,n,i,o,s){throw void 0===n&&(n="image/png"),void 0===i&&(i=1),void 0===o&&(o=!1),l._DevTools.WarnImport("ScreenshotTools")},e.RandomId=function(){return m.GUID.RandomId()},e.IsBase64=function(e){return!(e.length<5)&&"data:"===e.substr(0,5)},e.DecodeBase64=function(e){for(var t=atob(e.split(",")[1]),r=t.length,n=new Uint8Array(new ArrayBuffer(r)),i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer},e.GetAbsoluteUrl=function(e){var t=document.createElement("a");return t.href=e,t.href},Object.defineProperty(e,"errorsCount",{get:function(){return o.Logger.errorsCount},enumerable:!1,configurable:!0}),e.Log=function(e){o.Logger.Log(e)},e.Warn=function(e){o.Logger.Warn(e)},e.Error=function(e){o.Logger.Error(e)},Object.defineProperty(e,"LogCache",{get:function(){return o.Logger.LogCache},enumerable:!1,configurable:!0}),e.ClearLogCache=function(){o.Logger.ClearLogCache()},Object.defineProperty(e,"LogLevels",{set:function(e){o.Logger.LogLevels=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"PerformanceLogLevel",{set:function(t){return(t&e.PerformanceUserMarkLogLevel)===e.PerformanceUserMarkLogLevel?(e.StartPerformanceCounter=e._StartUserMark,void(e.EndPerformanceCounter=e._EndUserMark)):(t&e.PerformanceConsoleLogLevel)===e.PerformanceConsoleLogLevel?(e.StartPerformanceCounter=e._StartPerformanceConsole,void(e.EndPerformanceCounter=e._EndPerformanceConsole)):(e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,void(e.EndPerformanceCounter=e._EndPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),e._StartPerformanceCounterDisabled=function(e,t){},e._EndPerformanceCounterDisabled=function(e,t){},e._StartUserMark=function(t,r){if(void 0===r&&(r=!0),!e._performance){if(!i.DomManagement.IsWindowObjectExist())return;e._performance=window.performance}r&&e._performance.mark&&e._performance.mark(t+"-Begin")},e._EndUserMark=function(t,r){void 0===r&&(r=!0),r&&e._performance.mark&&(e._performance.mark(t+"-End"),e._performance.measure(t,t+"-Begin",t+"-End"))},e._StartPerformanceConsole=function(t,r){void 0===r&&(r=!0),r&&(e._StartUserMark(t,r),console.time&&console.time(t))},e._EndPerformanceConsole=function(t,r){void 0===r&&(r=!0),r&&(e._EndUserMark(t,r),console.timeEnd(t))},Object.defineProperty(e,"Now",{get:function(){return a.PrecisionDate.Now},enumerable:!1,configurable:!0}),e.GetClassName=function(e,t){void 0===t&&(t=!1);var r=null;return!t&&e.getClassName?r=e.getClassName():(e instanceof Object&&(r=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),r||(r=typeof e)),r},e.First=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(t(i))return i}return null},e.getFullClassName=function(e,t){void 0===t&&(t=!1);var r=null,n=null;if(!t&&e.getClassName)r=e.getClassName();else{if(e instanceof Object){var i=t?e:Object.getPrototypeOf(e);r=i.constructor.__bjsclassName__,n=i.constructor.__bjsmoduleName__}r||(r=typeof e)}return r?(null!=n?n+".":"")+r:null},e.DelayAsync=function(e){return new Promise((function(t){setTimeout((function(){t()}),e)}))},e.IsSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},e.UseCustomRequestHeaders=!1,e.CustomRequestHeaders=c.WebRequest.CustomRequestHeaders,e._tmpFloatArray=new Float32Array(1),e.GetDOMTextContent=i.DomManagement.GetDOMTextContent,e.NoneLogLevel=o.Logger.NoneLogLevel,e.MessageLogLevel=o.Logger.MessageLogLevel,e.WarningLogLevel=o.Logger.WarningLogLevel,e.ErrorLogLevel=o.Logger.ErrorLogLevel,e.AllLogLevel=o.Logger.AllLogLevel,e.IsWindowObjectExist=i.DomManagement.IsWindowObjectExist,e.PerformanceNoneLogLevel=0,e.PerformanceUserMarkLogLevel=1,e.PerformanceConsoleLogLevel=2,e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,e.EndPerformanceCounter=e._EndPerformanceCounterDisabled,e}();function _(e,t){return function(r){r.__bjsclassName__=e,r.__bjsmoduleName__=null!=t?t:null}}var v=function(){function e(e,t,r,n){void 0===n&&(n=0),this.iterations=e,this.index=n-1,this._done=!1,this._fn=t,this._successCallback=r}return e.prototype.executeNext=function(){this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())},e.prototype.breakLoop=function(){this._done=!0,this._successCallback()},e.Run=function(t,r,n,i){void 0===i&&(i=0);var o=new e(t,r,n,i);return o.executeNext(),o},e.SyncAsyncForLoop=function(t,r,n,i,o,s){return void 0===s&&(s=0),e.Run(Math.ceil(t/r),(function(e){o&&o()?e.breakLoop():setTimeout((function(){for(var i=0;i<r;++i){var s=e.index*r+i;if(s>=t)break;if(n(s),o&&o()){e.breakLoop();break}}e.executeNext()}),s)}),i)},e}();u.EngineStore.FallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z",h.PromisePolyfill.Apply()},"./Misc/typeStore.ts":
- /*!***************************!*\
- !*** ./Misc/typeStore.ts ***!
- \***************************/
- /*! exports provided: _TypeStore */function(e,t,r){"use strict";r.r(t),r.d(t,"_TypeStore",(function(){return n}));var n=function(){function e(){}return e.GetClass=function(e){return this.RegisteredTypes&&this.RegisteredTypes[e]?this.RegisteredTypes[e]:null},e.RegisteredTypes={},e}()},"./Misc/uniqueIdGenerator.ts":
- /*!***********************************!*\
- !*** ./Misc/uniqueIdGenerator.ts ***!
- \***********************************/
- /*! exports provided: UniqueIdGenerator */function(e,t,r){"use strict";r.r(t),r.d(t,"UniqueIdGenerator",(function(){return n}));var n=function(){function e(){}return Object.defineProperty(e,"UniqueId",{get:function(){var e=this._UniqueIdCounter;return this._UniqueIdCounter++,e},enumerable:!1,configurable:!0}),e._UniqueIdCounter=0,e}()},"./Misc/videoRecorder.ts":
- /*!*******************************!*\
- !*** ./Misc/videoRecorder.ts ***!
- \*******************************/
- /*! exports provided: VideoRecorder */function(e,t,r){"use strict";r.r(t),r.d(t,"VideoRecorder",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./tools */"./Misc/tools.ts"),o=function(){function e(t,r){if(void 0===r&&(r=null),!e.IsSupported(t))throw"Your browser does not support recording so far.";var i=t.getRenderingCanvas();if(!i)throw"The babylon engine must have a canvas to be recorded";this._canvas=i,this._canvas.isRecording=!1,this._options=Object(n.__assign)(Object(n.__assign)({},e._defaultOptions),r);var o=this._canvas.captureStream(this._options.fps);if(this._options.audioTracks)for(var s=0,a=this._options.audioTracks;s<a.length;s++){var l=a[s];o.addTrack(l)}this._mediaRecorder=new MediaRecorder(o,{mimeType:this._options.mimeType}),this._mediaRecorder.ondataavailable=this._handleDataAvailable.bind(this),this._mediaRecorder.onerror=this._handleError.bind(this),this._mediaRecorder.onstop=this._handleStop.bind(this)}return e.IsSupported=function(e){var t=e.getRenderingCanvas();return!!t&&"function"==typeof t.captureStream},Object.defineProperty(e.prototype,"isRecording",{get:function(){return!!this._canvas&&this._canvas.isRecording},enumerable:!1,configurable:!0}),e.prototype.stopRecording=function(){this._canvas&&this._mediaRecorder&&this.isRecording&&(this._canvas.isRecording=!1,this._mediaRecorder.stop())},e.prototype.startRecording=function(e,t){var r=this;if(void 0===e&&(e="babylonjs.webm"),void 0===t&&(t=7),!this._canvas||!this._mediaRecorder)throw"Recorder has already been disposed";if(this.isRecording)throw"Recording already in progress";return t>0&&setTimeout((function(){r.stopRecording()}),1e3*t),this._fileName=e,this._recordedChunks=[],this._resolve=null,this._reject=null,this._canvas.isRecording=!0,this._mediaRecorder.start(this._options.recordChunckSize),new Promise((function(e,t){r._resolve=e,r._reject=t}))},e.prototype.dispose=function(){this._canvas=null,this._mediaRecorder=null,this._recordedChunks=[],this._fileName=null,this._resolve=null,this._reject=null},e.prototype._handleDataAvailable=function(e){e.data.size>0&&this._recordedChunks.push(e.data)},e.prototype._handleError=function(e){if(this.stopRecording(),!this._reject)throw new e.error;this._reject(e.error)},e.prototype._handleStop=function(){this.stopRecording();var e=new Blob(this._recordedChunks);this._resolve&&this._resolve(e),window.URL.createObjectURL(e),this._fileName&&i.Tools.Download(e,this._fileName)},e._defaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3},e}()},"./Misc/virtualJoystick.ts":
- /*!*********************************!*\
- !*** ./Misc/virtualJoystick.ts ***!
- \*********************************/
- /*! exports provided: JoystickAxis, VirtualJoystick */function(e,t,r){"use strict";r.r(t),r.d(t,"JoystickAxis",(function(){return n})),r.d(t,"VirtualJoystick",(function(){return a}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ./stringDictionary */"./Misc/stringDictionary.ts");!function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(n||(n={}));var a=function(){function e(t,r){var a=this,l=Object(i.__assign)(Object(i.__assign)({},e._GetDefaultOptions()),r);if(this._leftJoystick=!!t,e._globalJoystickIndex++,this._axisTargetedByLeftAndRight=n.X,this._axisTargetedByUpAndDown=n.Y,this.reverseLeftRight=!1,this.reverseUpDown=!1,this._touches=new s.StringDictionary,this.deltaPosition=o.Vector3.Zero(),this._joystickSensibility=25,this._inversedSensibility=1/(this._joystickSensibility/1e3),this._onResize=function(t){e.vjCanvasWidth=window.innerWidth,e.vjCanvasHeight=window.innerHeight,e.Canvas&&(e.Canvas.width=e.vjCanvasWidth,e.Canvas.height=e.vjCanvasHeight),e.halfWidth=e.vjCanvasWidth/2},!e.Canvas){window.addEventListener("resize",this._onResize,!1),e.Canvas=document.createElement("canvas"),e.vjCanvasWidth=window.innerWidth,e.vjCanvasHeight=window.innerHeight,e.Canvas.width=window.innerWidth,e.Canvas.height=window.innerHeight,e.Canvas.style.width="100%",e.Canvas.style.height="100%",e.Canvas.style.position="absolute",e.Canvas.style.backgroundColor="transparent",e.Canvas.style.top="0px",e.Canvas.style.left="0px",e.Canvas.style.zIndex="5",e.Canvas.style.msTouchAction="none",e.Canvas.style.touchAction="none",e.Canvas.setAttribute("touch-action","none");var c=e.Canvas.getContext("2d");if(!c)throw new Error("Unable to create canvas for virtual joystick");e.vjCanvasContext=c,e.vjCanvasContext.strokeStyle="#ffffff",e.vjCanvasContext.lineWidth=2,document.body.appendChild(e.Canvas)}e.halfWidth=e.Canvas.width/2,this.pressed=!1,this.limitToContainer=l.limitToContainer,this._joystickColor=l.color,this.containerSize=l.containerSize,this.puckSize=l.puckSize,l.position&&this.setPosition(l.position.x,l.position.y),l.puckImage&&this.setPuckImage(l.puckImage),l.containerImage&&this.setContainerImage(l.containerImage),l.alwaysVisible&&e._alwaysVisibleSticks++,this.alwaysVisible=l.alwaysVisible,this._joystickPointerID=-1,this._joystickPointerPos=new o.Vector2(0,0),this._joystickPreviousPointerPos=new o.Vector2(0,0),this._joystickPointerStartPos=new o.Vector2(0,0),this._deltaJoystickVector=new o.Vector2(0,0),this._onPointerDownHandlerRef=function(e){a._onPointerDown(e)},this._onPointerMoveHandlerRef=function(e){a._onPointerMove(e)},this._onPointerUpHandlerRef=function(e){a._onPointerUp(e)},e.Canvas.addEventListener("pointerdown",this._onPointerDownHandlerRef,!1),e.Canvas.addEventListener("pointermove",this._onPointerMoveHandlerRef,!1),e.Canvas.addEventListener("pointerup",this._onPointerUpHandlerRef,!1),e.Canvas.addEventListener("pointerout",this._onPointerUpHandlerRef,!1),e.Canvas.addEventListener("contextmenu",(function(e){e.preventDefault()}),!1),requestAnimationFrame((function(){a._drawVirtualJoystick()}))}return e._GetDefaultOptions=function(){return{puckSize:40,containerSize:60,color:"cyan",puckImage:void 0,containerImage:void 0,position:void 0,alwaysVisible:!1,limitToContainer:!1}},e.prototype.setJoystickSensibility=function(e){this._joystickSensibility=e,this._inversedSensibility=1/(this._joystickSensibility/1e3)},e.prototype._onPointerDown=function(t){t.preventDefault(),(!0===this._leftJoystick?t.clientX<e.halfWidth:t.clientX>e.halfWidth)&&this._joystickPointerID<0?(this._joystickPointerID=t.pointerId,this._joystickPosition?(this._joystickPointerStartPos=this._joystickPosition.clone(),this._joystickPointerPos=this._joystickPosition.clone(),this._joystickPreviousPointerPos=this._joystickPosition.clone(),this._onPointerMove(t)):(this._joystickPointerStartPos.x=t.clientX,this._joystickPointerStartPos.y=t.clientY,this._joystickPointerPos=this._joystickPointerStartPos.clone(),this._joystickPreviousPointerPos=this._joystickPointerStartPos.clone()),this._deltaJoystickVector.x=0,this._deltaJoystickVector.y=0,this.pressed=!0,this._touches.add(t.pointerId.toString(),t)):e._globalJoystickIndex<2&&this._action&&(this._action(),this._touches.add(t.pointerId.toString(),{x:t.clientX,y:t.clientY,prevX:t.clientX,prevY:t.clientY}))},e.prototype._onPointerMove=function(t){if(this._joystickPointerID==t.pointerId){if(this.limitToContainer){var r=new o.Vector2(t.clientX-this._joystickPointerStartPos.x,t.clientY-this._joystickPointerStartPos.y),i=r.length();i>this.containerSize&&r.scaleInPlace(this.containerSize/i),this._joystickPointerPos.x=this._joystickPointerStartPos.x+r.x,this._joystickPointerPos.y=this._joystickPointerStartPos.y+r.y}else this._joystickPointerPos.x=t.clientX,this._joystickPointerPos.y=t.clientY;this._deltaJoystickVector=this._joystickPointerPos.clone(),this._deltaJoystickVector=this._deltaJoystickVector.subtract(this._joystickPointerStartPos),0<e._alwaysVisibleSticks&&(this._leftJoystick?this._joystickPointerPos.x=Math.min(e.halfWidth,this._joystickPointerPos.x):this._joystickPointerPos.x=Math.max(e.halfWidth,this._joystickPointerPos.x));var s=(this.reverseLeftRight?-1:1)*this._deltaJoystickVector.x/this._inversedSensibility;switch(this._axisTargetedByLeftAndRight){case n.X:this.deltaPosition.x=Math.min(1,Math.max(-1,s));break;case n.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,s));break;case n.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,s))}var a=(this.reverseUpDown?1:-1)*this._deltaJoystickVector.y/this._inversedSensibility;switch(this._axisTargetedByUpAndDown){case n.X:this.deltaPosition.x=Math.min(1,Math.max(-1,a));break;case n.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,a));break;case n.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,a))}}else{var l=this._touches.get(t.pointerId.toString());l&&(l.x=t.clientX,l.y=t.clientY)}},e.prototype._onPointerUp=function(t){if(this._joystickPointerID==t.pointerId)this._clearPreviousDraw(),this._joystickPointerID=-1,this.pressed=!1;else{var r=this._touches.get(t.pointerId.toString());r&&e.vjCanvasContext.clearRect(r.prevX-44,r.prevY-44,88,88)}this._deltaJoystickVector.x=0,this._deltaJoystickVector.y=0,this._touches.remove(t.pointerId.toString())},e.prototype.setJoystickColor=function(e){this._joystickColor=e},Object.defineProperty(e.prototype,"containerSize",{get:function(){return this._joystickContainerSize},set:function(e){this._joystickContainerSize=e,this._clearContainerSize=~~(2.1*this._joystickContainerSize),this._clearContainerSizeOffset=~~(this._clearContainerSize/2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"puckSize",{get:function(){return this._joystickPuckSize},set:function(e){this._joystickPuckSize=e,this._clearPuckSize=~~(2.1*this._joystickPuckSize),this._clearPuckSizeOffset=~~(this._clearPuckSize/2)},enumerable:!1,configurable:!0}),e.prototype.clearPosition=function(){this.alwaysVisible=!1,delete this._joystickPosition},Object.defineProperty(e.prototype,"alwaysVisible",{get:function(){return this._alwaysVisible},set:function(t){this._alwaysVisible!==t&&(t&&this._joystickPosition?(e._alwaysVisibleSticks++,this._alwaysVisible=!0):(e._alwaysVisibleSticks--,this._alwaysVisible=!1))},enumerable:!1,configurable:!0}),e.prototype.setPosition=function(e,t){this._joystickPointerStartPos&&this._clearPreviousDraw(),this._joystickPosition=new o.Vector2(e,t)},e.prototype.setActionOnTouch=function(e){this._action=e},e.prototype.setAxisForLeftRight=function(e){switch(e){case n.X:case n.Y:case n.Z:this._axisTargetedByLeftAndRight=e;break;default:this._axisTargetedByLeftAndRight=n.X}},e.prototype.setAxisForUpDown=function(e){switch(e){case n.X:case n.Y:case n.Z:this._axisTargetedByUpAndDown=e;break;default:this._axisTargetedByUpAndDown=n.Y}},e.prototype._clearPreviousDraw=function(){var t=this._joystickPosition||this._joystickPointerStartPos;e.vjCanvasContext.clearRect(t.x-this._clearContainerSizeOffset,t.y-this._clearContainerSizeOffset,this._clearContainerSize,this._clearContainerSize),e.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x-this._clearPuckSizeOffset,this._joystickPreviousPointerPos.y-this._clearPuckSizeOffset,this._clearPuckSize,this._clearPuckSize)},e.prototype.setContainerImage=function(e){var t=this,r=new Image;r.src=e,r.onload=function(){return t._containerImage=r}},e.prototype.setPuckImage=function(e){var t=this,r=new Image;r.src=e,r.onload=function(){return t._puckImage=r}},e.prototype._drawContainer=function(){var t=this._joystickPosition||this._joystickPointerStartPos;this._clearPreviousDraw(),this._containerImage?e.vjCanvasContext.drawImage(this._containerImage,t.x-this.containerSize,t.y-this.containerSize,2*this.containerSize,2*this.containerSize):(e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle=this._joystickColor,e.vjCanvasContext.lineWidth=2,e.vjCanvasContext.arc(t.x,t.y,this.containerSize,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),e.vjCanvasContext.beginPath(),e.vjCanvasContext.lineWidth=6,e.vjCanvasContext.strokeStyle=this._joystickColor,e.vjCanvasContext.arc(t.x,t.y,this.puckSize,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath())},e.prototype._drawPuck=function(){this._puckImage?e.vjCanvasContext.drawImage(this._puckImage,this._joystickPointerPos.x-this.puckSize,this._joystickPointerPos.y-this.puckSize,2*this.puckSize,2*this.puckSize):(e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle=this._joystickColor,e.vjCanvasContext.lineWidth=2,e.vjCanvasContext.arc(this._joystickPointerPos.x,this._joystickPointerPos.y,this.puckSize,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath())},e.prototype._drawVirtualJoystick=function(){var t=this;this.alwaysVisible&&this._drawContainer(),this.pressed&&this._touches.forEach((function(r,n){n.pointerId===t._joystickPointerID?(t.alwaysVisible||t._drawContainer(),t._drawPuck(),t._joystickPreviousPointerPos=t._joystickPointerPos.clone()):(e.vjCanvasContext.clearRect(n.prevX-44,n.prevY-44,88,88),e.vjCanvasContext.beginPath(),e.vjCanvasContext.fillStyle="white",e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle="red",e.vjCanvasContext.lineWidth=6,e.vjCanvasContext.arc(n.x,n.y,40,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),n.prevX=n.x,n.prevY=n.y)})),requestAnimationFrame((function(){t._drawVirtualJoystick()}))},e.prototype.releaseCanvas=function(){e.Canvas&&(e.Canvas.removeEventListener("pointerdown",this._onPointerDownHandlerRef),e.Canvas.removeEventListener("pointermove",this._onPointerMoveHandlerRef),e.Canvas.removeEventListener("pointerup",this._onPointerUpHandlerRef),e.Canvas.removeEventListener("pointerout",this._onPointerUpHandlerRef),window.removeEventListener("resize",this._onResize),document.body.removeChild(e.Canvas),e.Canvas=null)},e._globalJoystickIndex=0,e._alwaysVisibleSticks=0,e}()},"./Misc/webRequest.ts":
- /*!****************************!*\
- !*** ./Misc/webRequest.ts ***!
- \****************************/
- /*! exports provided: WebRequest */function(e,t,r){"use strict";r.r(t),r.d(t,"WebRequest",(function(){return n}));var n=function(){function e(){this._xhr=new XMLHttpRequest}return e.prototype._injectCustomRequestHeaders=function(){for(var t in e.CustomRequestHeaders){var r=e.CustomRequestHeaders[t];r&&this._xhr.setRequestHeader(t,r)}},Object.defineProperty(e.prototype,"onprogress",{get:function(){return this._xhr.onprogress},set:function(e){this._xhr.onprogress=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._xhr.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._xhr.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statusText",{get:function(){return this._xhr.statusText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"response",{get:function(){return this._xhr.response},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseURL",{get:function(){return this._xhr.responseURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseText",{get:function(){return this._xhr.responseText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseType",{get:function(){return this._xhr.responseType},set:function(e){this._xhr.responseType=e},enumerable:!1,configurable:!0}),e.prototype.addEventListener=function(e,t,r){this._xhr.addEventListener(e,t,r)},e.prototype.removeEventListener=function(e,t,r){this._xhr.removeEventListener(e,t,r)},e.prototype.abort=function(){this._xhr.abort()},e.prototype.send=function(t){e.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(t)},e.prototype.open=function(t,r){for(var n=0,i=e.CustomRequestModifiers;n<i.length;n++)(0,i[n])(this._xhr,r);return r=(r=r.replace("file:http:","http:")).replace("file:https:","https:"),this._xhr.open(t,r,!0)},e.prototype.setRequestHeader=function(e,t){this._xhr.setRequestHeader(e,t)},e.prototype.getResponseHeader=function(e){return this._xhr.getResponseHeader(e)},e.CustomRequestHeaders={},e.CustomRequestModifiers=new Array,e}()},"./Misc/workerPool.ts":
- /*!****************************!*\
- !*** ./Misc/workerPool.ts ***!
- \****************************/
- /*! exports provided: WorkerPool */function(e,t,r){"use strict";r.r(t),r.d(t,"WorkerPool",(function(){return n}));var n=function(){function e(e){this._pendingActions=new Array,this._workerInfos=e.map((function(e){return{worker:e,active:!1}}))}return e.prototype.dispose=function(){for(var e=0,t=this._workerInfos;e<t.length;e++)t[e].worker.terminate();delete this._workerInfos,delete this._pendingActions},e.prototype.push=function(e){for(var t=0,r=this._workerInfos;t<r.length;t++){var n=r[t];if(!n.active)return void this._execute(n,e)}this._pendingActions.push(e)},e.prototype._execute=function(e,t){var r=this;e.active=!0,t(e.worker,(function(){e.active=!1;var t=r._pendingActions.shift();t&&r._execute(e,t)}))},e}()},"./Morph/index.ts":
- /*!************************!*\
- !*** ./Morph/index.ts ***!
- \************************/
- /*! exports provided: MorphTarget, MorphTargetManager */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./morphTarget */"./Morph/morphTarget.ts");r.d(t,"MorphTarget",(function(){return n.MorphTarget}));var i=r(/*! ./morphTargetManager */"./Morph/morphTargetManager.ts");r.d(t,"MorphTargetManager",(function(){return i.MorphTargetManager}))},"./Morph/morphTarget.ts":
- /*!******************************!*\
- !*** ./Morph/morphTarget.ts ***!
- \******************************/
- /*! exports provided: MorphTarget */function(e,t,r){"use strict";r.r(t),r.d(t,"MorphTarget",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),l=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),c=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=null),this.name=e,this.animations=new Array,this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uniqueId=0,this.onInfluenceChanged=new i.Observable,this._onDataLayoutChanged=new i.Observable,this._animationPropertiesOverride=null,this._scene=r||o.EngineStore.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}return Object.defineProperty(e.prototype,"influence",{get:function(){return this._influence},set:function(e){if(this._influence!==e){var t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPositions",{get:function(){return!!this._positions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNormals",{get:function(){return!!this._normals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTangents",{get:function(){return!!this._tangents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasUVs",{get:function(){return!!this._uvs},enumerable:!1,configurable:!0}),e.prototype.setPositions=function(e){var t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getPositions=function(){return this._positions},e.prototype.setNormals=function(e){var t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getNormals=function(){return this._normals},e.prototype.setTangents=function(e){var t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getTangents=function(){return this._tangents},e.prototype.setUVs=function(e){var t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getUVs=function(){return this._uvs},e.prototype.clone=function(){var t=this,r=a.SerializationHelper.Clone((function(){return new e(t.name,t.influence,t._scene)}),this);return r._positions=this._positions,r._normals=this._normals,r._tangents=this._tangents,r._uvs=this._uvs,r},e.prototype.serialize=function(){var e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),a.SerializationHelper.AppendSerializedAnimations(this,e),e},e.prototype.getClassName=function(){return"MorphTarget"},e.Parse=function(t){var r=new e(t.name,t.influence);if(r.setPositions(t.positions),null!=t.id&&(r.id=t.id),t.normals&&r.setNormals(t.normals),t.tangents&&r.setTangents(t.tangents),t.uvs&&r.setUVs(t.uvs),t.animations)for(var n=0;n<t.animations.length;n++){var i=t.animations[n],o=l._TypeStore.GetClass("BABYLON.Animation");o&&r.animations.push(o.Parse(i))}return r},e.FromMesh=function(t,r,n){r||(r=t.name);var i=new e(r,n,t.getScene());return i.setPositions(t.getVerticesData(s.VertexBuffer.PositionKind)),t.isVerticesDataPresent(s.VertexBuffer.NormalKind)&&i.setNormals(t.getVerticesData(s.VertexBuffer.NormalKind)),t.isVerticesDataPresent(s.VertexBuffer.TangentKind)&&i.setTangents(t.getVerticesData(s.VertexBuffer.TangentKind)),t.isVerticesDataPresent(s.VertexBuffer.UVKind)&&i.setUVs(t.getVerticesData(s.VertexBuffer.UVKind)),i},Object(n.__decorate)([Object(a.serialize)()],e.prototype,"id",void 0),e}()},"./Morph/morphTargetManager.ts":
- /*!*************************************!*\
- !*** ./Morph/morphTargetManager.ts ***!
- \*************************************/
- /*! exports provided: MorphTargetManager */function(e,t,r){"use strict";r.r(t),r.d(t,"MorphTargetManager",(function(){return a}));var n=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),s=r(/*! ./morphTarget */"./Morph/morphTarget.ts"),a=function(){function e(e){void 0===e&&(e=null),this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new n.SmartArray(16),this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,e||(e=o.EngineStore.LastCreatedScene),this._scene=e,this._scene&&(this._scene.morphTargetManagers.push(this),this._uniqueId=this._scene.getUniqueId())}return Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vertexCount",{get:function(){return this._vertexCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsNormals",{get:function(){return this._supportsNormals&&this.enableNormalMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsTangents",{get:function(){return this._supportsTangents&&this.enableTangentMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsUVs",{get:function(){return this._supportsUVs&&this.enableUVMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numTargets",{get:function(){return this._targets.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numInfluencers",{get:function(){return this._activeTargets.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"influences",{get:function(){return this._influences},enumerable:!1,configurable:!0}),e.prototype.getActiveTarget=function(e){return this._activeTargets.data[e]},e.prototype.getTarget=function(e){return this._targets[e]},e.prototype.addTarget=function(e){var t=this;this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add((function(e){t._syncActiveTargets(e)}))),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add((function(){t._syncActiveTargets(!0)}))),this._syncActiveTargets(!0)},e.prototype.removeTarget=function(e){var t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0))},e.prototype.clone=function(){for(var t=new e(this._scene),r=0,n=this._targets;r<n.length;r++){var i=n[r];t.addTarget(i.clone())}return t.enableNormalMorphing=this.enableNormalMorphing,t.enableTangentMorphing=this.enableTangentMorphing,t.enableUVMorphing=this.enableUVMorphing,t},e.prototype.serialize=function(){var e={};e.id=this.uniqueId,e.targets=[];for(var t=0,r=this._targets;t<r.length;t++){var n=r[t];e.targets.push(n.serialize())}return e},e.prototype._syncActiveTargets=function(e){var t=0;this._activeTargets.reset(),this._supportsNormals=!0,this._supportsTangents=!0,this._supportsUVs=!0,this._vertexCount=0;for(var r=0,n=this._targets;r<n.length;r++){var o=n[r];if(0!==o.influence){this._activeTargets.push(o),this._tempInfluences[t++]=o.influence,this._supportsNormals=this._supportsNormals&&o.hasNormals,this._supportsTangents=this._supportsTangents&&o.hasTangents,this._supportsUVs=this._supportsUVs&&o.hasUVs;var s=o.getPositions();if(s){var a=s.length/3;if(0===this._vertexCount)this._vertexCount=a;else if(this._vertexCount!==a)return void i.Logger.Error("Incompatible target. Targets must all have the same vertices count.")}}}this._influences&&this._influences.length===t||(this._influences=new Float32Array(t));for(var l=0;l<t;l++)this._influences[l]=this._tempInfluences[l];e&&this.synchronize()},e.prototype.synchronize=function(){if(this._scene)for(var e=0,t=this._scene.meshes;e<t.length;e++){var r=t[e];r.morphTargetManager===this&&r._syncGeometryWithMorphTargetManager()}},e.Parse=function(t,r){var n=new e(r);n._uniqueId=t.id;for(var i=0,o=t.targets;i<o.length;i++){var a=o[i];n.addTarget(s.MorphTarget.Parse(a))}return n},e}()},"./Navigation/INavigationEngine.ts":
- /*!*****************************************!*\
- !*** ./Navigation/INavigationEngine.ts ***!
- \*****************************************/
- /*! no static exports found */function(e,t){},"./Navigation/Plugins/index.ts":
- /*!*************************************!*\
- !*** ./Navigation/Plugins/index.ts ***!
- \*************************************/
- /*! exports provided: RecastJSPlugin, RecastJSCrowd */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./recastJSPlugin */"./Navigation/Plugins/recastJSPlugin.ts");r.d(t,"RecastJSPlugin",(function(){return n.RecastJSPlugin})),r.d(t,"RecastJSCrowd",(function(){return n.RecastJSCrowd}))},"./Navigation/Plugins/recastJSPlugin.ts":
- /*!**********************************************!*\
- !*** ./Navigation/Plugins/recastJSPlugin.ts ***!
- \**********************************************/
- /*! exports provided: RecastJSPlugin, RecastJSCrowd */function(e,t,r){"use strict";r.r(t),r.d(t,"RecastJSPlugin",(function(){return l})),r.d(t,"RecastJSCrowd",(function(){return c}));var n=r(/*! ../../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),o=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../../Maths/math */"./Maths/math.ts"),a=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),l=function(){function e(e){void 0===e&&(e=Recast),this.bjsRECAST={},this.name="RecastJSPlugin","function"==typeof e?e(this.bjsRECAST):this.bjsRECAST=e,this.isSupported()||n.Logger.Error("RecastJS is not available. Please make sure you included the js file.")}return e.prototype.createNavMesh=function(e,t){var r,n,i,o=new this.bjsRECAST.rcConfig;o.cs=t.cs,o.ch=t.ch,o.borderSize=0,o.tileSize=0,o.walkableSlopeAngle=t.walkableSlopeAngle,o.walkableHeight=t.walkableHeight,o.walkableClimb=t.walkableClimb,o.walkableRadius=t.walkableRadius,o.maxEdgeLen=t.maxEdgeLen,o.maxSimplificationError=t.maxSimplificationError,o.minRegionArea=t.minRegionArea,o.mergeRegionArea=t.mergeRegionArea,o.maxVertsPerPoly=t.maxVertsPerPoly,o.detailSampleDist=t.detailSampleDist,o.detailSampleMaxError=t.detailSampleMaxError,this.navMesh=new this.bjsRECAST.NavMesh;var l=[],c=[],u=0;for(r=0;r<e.length;r++)if(e[r]){var d=e[r],h=d.getIndices();if(!h)continue;var f=d.getVerticesData(a.VertexBuffer.PositionKind,!1,!1);if(!f)continue;var p=d.computeWorldMatrix(!1);for(n=0;n<h.length;n++)l.push(h[n]+u);var m=s.Vector3.Zero(),g=s.Vector3.Zero();for(i=0;i<f.length;i+=3)s.Vector3.FromArrayToRef(f,i,g),s.Vector3.TransformCoordinatesToRef(g,p,m),c.push(m.x,m.y,m.z);u+=f.length/3}this.navMesh.build(c,u,l,l.length,o)},e.prototype.createDebugNavMesh=function(e){var t,r,n=this.navMesh.getDebugNavMesh(),s=n.getTriangleCount(),a=[],l=[];for(t=0;t<3*s;t++)a.push(t);for(t=0;t<s;t++)for(r=0;r<3;r++){var c=n.getTriangle(t).getPoint(r);l.push(c.x,c.y,c.z)}var u=new o.Mesh("NavMeshDebug",e),d=new i.VertexData;return d.indices=a,d.positions=l,d.applyToMesh(u,!1),u},e.prototype.getClosestPoint=function(e){var t=new this.bjsRECAST.Vec3(e.x,e.y,e.z),r=this.navMesh.getClosestPoint(t);return new s.Vector3(r.x,r.y,r.z)},e.prototype.getClosestPointToRef=function(e,t){var r=new this.bjsRECAST.Vec3(e.x,e.y,e.z),n=this.navMesh.getClosestPoint(r);t.set(n.x,n.y,n.z)},e.prototype.getRandomPointAround=function(e,t){var r=new this.bjsRECAST.Vec3(e.x,e.y,e.z),n=this.navMesh.getRandomPointAround(r,t);return new s.Vector3(n.x,n.y,n.z)},e.prototype.getRandomPointAroundToRef=function(e,t,r){var n=new this.bjsRECAST.Vec3(e.x,e.y,e.z),i=this.navMesh.getRandomPointAround(n,t);r.set(i.x,i.y,i.z)},e.prototype.moveAlong=function(e,t){var r=new this.bjsRECAST.Vec3(e.x,e.y,e.z),n=new this.bjsRECAST.Vec3(t.x,t.y,t.z),i=this.navMesh.moveAlong(r,n);return new s.Vector3(i.x,i.y,i.z)},e.prototype.moveAlongToRef=function(e,t,r){var n=new this.bjsRECAST.Vec3(e.x,e.y,e.z),i=new this.bjsRECAST.Vec3(t.x,t.y,t.z),o=this.navMesh.moveAlong(n,i);r.set(o.x,o.y,o.z)},e.prototype.computePath=function(e,t){var r,n=new this.bjsRECAST.Vec3(e.x,e.y,e.z),i=new this.bjsRECAST.Vec3(t.x,t.y,t.z),o=this.navMesh.computePath(n,i),a=o.getPointCount(),l=[];for(r=0;r<a;r++){var c=o.getPoint(r);l.push(new s.Vector3(c.x,c.y,c.z))}return l},e.prototype.createCrowd=function(e,t,r){return new c(this,e,t,r)},e.prototype.setDefaultQueryExtent=function(e){var t=new this.bjsRECAST.Vec3(e.x,e.y,e.z);this.navMesh.setDefaultQueryExtent(t)},e.prototype.getDefaultQueryExtent=function(){var e=this.navMesh.getDefaultQueryExtent();return new s.Vector3(e.x,e.y,e.z)},e.prototype.buildFromNavmeshData=function(e){var t=e.length*e.BYTES_PER_ELEMENT,r=this.bjsRECAST._malloc(t),n=new Uint8Array(this.bjsRECAST.HEAPU8.buffer,r,t);n.set(e);var i=new this.bjsRECAST.NavmeshData;i.dataPointer=n.byteOffset,i.size=e.length,this.navMesh=new this.bjsRECAST.NavMesh,this.navMesh.buildFromNavmeshData(i),this.bjsRECAST._free(n.byteOffset)},e.prototype.getNavmeshData=function(){var e=this.navMesh.getNavmeshData(),t=new Uint8Array(this.bjsRECAST.HEAPU8.buffer,e.dataPointer,e.size),r=new Uint8Array(e.size);return r.set(t),this.navMesh.freeNavmeshData(e),r},e.prototype.getDefaultQueryExtentToRef=function(e){var t=this.navMesh.getDefaultQueryExtent();e.set(t.x,t.y,t.z)},e.prototype.dispose=function(){},e.prototype.isSupported=function(){return void 0!==this.bjsRECAST},e}(),c=function(){function e(e,t,r,n){var i=this;this.recastCrowd={},this.transforms=new Array,this.agents=new Array,this._onBeforeAnimationsObserver=null,this.bjsRECASTPlugin=e,this.recastCrowd=new this.bjsRECASTPlugin.bjsRECAST.Crowd(t,r,this.bjsRECASTPlugin.navMesh.getNavMesh()),this._scene=n,this._onBeforeAnimationsObserver=n.onBeforeAnimationsObservable.add((function(){i.update(.001*n.getEngine().getDeltaTime())}))}return e.prototype.addAgent=function(e,t,r){var n=new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams;n.radius=t.radius,n.height=t.height,n.maxAcceleration=t.maxAcceleration,n.maxSpeed=t.maxSpeed,n.collisionQueryRange=t.collisionQueryRange,n.pathOptimizationRange=t.pathOptimizationRange,n.separationWeight=t.separationWeight,n.updateFlags=7,n.obstacleAvoidanceType=0,n.queryFilterType=0,n.userData=0;var i=this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x,e.y,e.z),n);return this.transforms.push(r),this.agents.push(i),i},e.prototype.getAgentPosition=function(e){var t=this.recastCrowd.getAgentPosition(e);return new s.Vector3(t.x,t.y,t.z)},e.prototype.getAgentPositionToRef=function(e,t){var r=this.recastCrowd.getAgentPosition(e);t.set(r.x,r.y,r.z)},e.prototype.getAgentVelocity=function(e){var t=this.recastCrowd.getAgentVelocity(e);return new s.Vector3(t.x,t.y,t.z)},e.prototype.getAgentVelocityToRef=function(e,t){var r=this.recastCrowd.getAgentVelocity(e);t.set(r.x,r.y,r.z)},e.prototype.agentGoto=function(e,t){this.recastCrowd.agentGoto(e,new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x,t.y,t.z))},e.prototype.agentTeleport=function(e,t){this.recastCrowd.agentTeleport(e,new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x,t.y,t.z))},e.prototype.updateAgentParameters=function(e,t){var r=this.recastCrowd.getAgentParameters(e);void 0!==t.radius&&(r.radius=t.radius),void 0!==t.height&&(r.height=t.height),void 0!==t.maxAcceleration&&(r.maxAcceleration=t.maxAcceleration),void 0!==t.maxSpeed&&(r.maxSpeed=t.maxSpeed),void 0!==t.collisionQueryRange&&(r.collisionQueryRange=t.collisionQueryRange),void 0!==t.pathOptimizationRange&&(r.pathOptimizationRange=t.pathOptimizationRange),void 0!==t.separationWeight&&(r.separationWeight=t.separationWeight),this.recastCrowd.setAgentParameters(e,r)},e.prototype.removeAgent=function(e){this.recastCrowd.removeAgent(e);var t=this.agents.indexOf(e);t>-1&&(this.agents.splice(t,1),this.transforms.splice(t,1))},e.prototype.getAgents=function(){return this.agents},e.prototype.update=function(e){this.recastCrowd.update(e);for(var t=0;t<this.agents.length;t++)this.transforms[t].position=this.getAgentPosition(this.agents[t])},e.prototype.setDefaultQueryExtent=function(e){var t=new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x,e.y,e.z);this.recastCrowd.setDefaultQueryExtent(t)},e.prototype.getDefaultQueryExtent=function(){var e=this.recastCrowd.getDefaultQueryExtent();return new s.Vector3(e.x,e.y,e.z)},e.prototype.getDefaultQueryExtentToRef=function(e){var t=this.recastCrowd.getDefaultQueryExtent();e.set(t.x,t.y,t.z)},e.prototype.dispose=function(){this.recastCrowd.destroy(),this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null},e}()},"./Navigation/index.ts":
- /*!*****************************!*\
- !*** ./Navigation/index.ts ***!
- \*****************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./INavigationEngine */"./Navigation/INavigationEngine.ts");for(var i in n)"default"!==i&&function(e){r.d(t,e,(function(){return n[e]}))}(i);var o=r(/*! ./Plugins/index */"./Navigation/Plugins/index.ts");r.d(t,"RecastJSPlugin",(function(){return o.RecastJSPlugin})),r.d(t,"RecastJSCrowd",(function(){return o.RecastJSCrowd}))},"./Offline/IOfflineProvider.ts":
- /*!*************************************!*\
- !*** ./Offline/IOfflineProvider.ts ***!
- \*************************************/
- /*! no static exports found */function(e,t){},"./Offline/database.ts":
- /*!*****************************!*\
- !*** ./Offline/database.ts ***!
- \*****************************/
- /*! exports provided: Database */function(e,t,r){"use strict";r.r(t),r.d(t,"Database",(function(){return l}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/tga */"./Misc/tga.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ../Misc/webRequest */"./Misc/webRequest.ts");s.Engine.OfflineProviderFactory=function(e,t,r){return void 0===r&&(r=!1),new l(e,t,r)};var l=function(){function e(t,r,i){var o=this;void 0===i&&(i=!1),this._idbFactory="undefined"!=typeof window?window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB:indexedDB,this._callbackManifestChecked=r,this._currentSceneUrl=e._ReturnFullUrlLocation(t),this._db=null,this._enableSceneOffline=!1,this._enableTexturesOffline=!1,this._manifestVersionFound=0,this._mustUpdateRessources=!1,this._hasReachedQuota=!1,e.IDBStorageEnabled?i?(this._enableSceneOffline=!0,this._enableTexturesOffline=!0,this._manifestVersionFound=1,n.Tools.SetImmediate((function(){o._callbackManifestChecked(!0)}))):this._checkManifestFile():this._callbackManifestChecked(!0)}return Object.defineProperty(e.prototype,"enableSceneOffline",{get:function(){return this._enableSceneOffline},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableTexturesOffline",{get:function(){return this._enableTexturesOffline},enumerable:!1,configurable:!0}),e.prototype._checkManifestFile=function(){var t=this,r=function(){t._enableSceneOffline=!1,t._enableTexturesOffline=!1,t._callbackManifestChecked(!1)},n=!1,o=this._currentSceneUrl+".manifest",s=new a.WebRequest;navigator.onLine&&(n=!0,o=o+(null==o.match(/\?/)?"?":"&")+Date.now()),s.open("GET",o),s.addEventListener("load",(function(){if(200===s.status||e._ValidateXHRData(s,1))try{var n=JSON.parse(s.response);t._enableSceneOffline=n.enableSceneOffline,t._enableTexturesOffline=n.enableTexturesOffline&&e.IsUASupportingBlobStorage,n.version&&!isNaN(parseInt(n.version))&&(t._manifestVersionFound=n.version),t._callbackManifestChecked&&t._callbackManifestChecked(!0)}catch(e){r()}else r()}),!1),s.addEventListener("error",(function(){if(n){n=!1;var e=t._currentSceneUrl+".manifest";s.open("GET",e),s.send()}else r()}),!1);try{s.send()}catch(e){i.Logger.Error("Error on XHR send request."),this._callbackManifestChecked(!1)}},e.prototype.open=function(e,t){var r=this,n=function(){r._isSupported=!1,t&&t()};if(this._idbFactory&&(this._enableSceneOffline||this._enableTexturesOffline))if(this._db)e&&e();else{this._hasReachedQuota=!1,this._isSupported=!0;var o=this._idbFactory.open("babylonjs",1);o.onerror=function(){n()},o.onblocked=function(){i.Logger.Error("IDB request blocked. Please reload the page."),n()},o.onsuccess=function(){r._db=o.result,e()},o.onupgradeneeded=function(e){if(r._db=e.target.result,r._db)try{r._db.createObjectStore("scenes",{keyPath:"sceneUrl"}),r._db.createObjectStore("versions",{keyPath:"sceneUrl"}),r._db.createObjectStore("textures",{keyPath:"textureUrl"})}catch(e){i.Logger.Error("Error while creating object stores. Exception: "+e.message),n()}}}else this._isSupported=!1,t&&t()},e.prototype.loadImage=function(t,r){var n=this,i=e._ReturnFullUrlLocation(t),o=function(){n._hasReachedQuota||null===n._db?r.src=t:n._saveImageIntoDBAsync(i,r)};this._mustUpdateRessources?o():this._loadImageFromDBAsync(i,r,o)},e.prototype._loadImageFromDBAsync=function(e,t,r){if(this._isSupported&&null!==this._db){var n,o=this._db.transaction(["textures"]);o.onabort=function(){t.src=e},o.oncomplete=function(){var o;if(n){var s=window.URL||window.webkitURL;o=s.createObjectURL(n.data),t.onerror=function(){i.Logger.Error("Error loading image from blob URL: "+o+" switching back to web url: "+e),t.src=e},t.src=o}else r()};var s=o.objectStore("textures").get(e);s.onsuccess=function(e){n=e.target.result},s.onerror=function(){i.Logger.Error("Error loading texture "+e+" from DB."),t.src=e}}else i.Logger.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."),t.src=e},e.prototype._saveImageIntoDBAsync=function(t,r){var n=this;if(this._isSupported){var o=function(){var e;if(s){var t=window.URL||window.webkitURL;try{e=t.createObjectURL(s)}catch(r){e=t.createObjectURL(s)}}e&&(r.src=e)};if(e.IsUASupportingBlobStorage){var s,l=new a.WebRequest;l.open("GET",t),l.responseType="blob",l.addEventListener("load",(function(){if(200===l.status&&n._db){s=l.response;var i=n._db.transaction(["textures"],"readwrite");i.onabort=function(e){try{var t=(e.srcElement||e.target).error;t&&"QuotaExceededError"===t.name&&(n._hasReachedQuota=!0)}catch(e){}o()},i.oncomplete=function(){o()};var a={textureUrl:t,data:s};try{var c=i.objectStore("textures").put(a);c.onsuccess=function(){},c.onerror=function(){o()}}catch(i){25===i.code&&(e.IsUASupportingBlobStorage=!1,n._enableTexturesOffline=!1),r.src=t}}else r.src=t}),!1),l.addEventListener("error",(function(){i.Logger.Error("Error in XHR request in BABYLON.Database."),r.src=t}),!1),l.send()}else r.src=t}else i.Logger.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),r.src=t},e.prototype._checkVersionFromDB=function(e,t){var r=this;this._loadVersionFromDBAsync(e,t,(function(){r._saveVersionIntoDBAsync(e,t)}))},e.prototype._loadVersionFromDBAsync=function(e,t,r){var n,o=this;if(this._isSupported&&this._db)try{var s=this._db.transaction(["versions"]);s.oncomplete=function(){n?o._manifestVersionFound!==n.data?(o._mustUpdateRessources=!0,r()):t(n.data):(o._mustUpdateRessources=!0,r())},s.onabort=function(){t(-1)};var a=s.objectStore("versions").get(e);a.onsuccess=function(e){n=e.target.result},a.onerror=function(){i.Logger.Error("Error loading version for scene "+e+" from DB."),t(-1)}}catch(e){i.Logger.Error("Error while accessing 'versions' object store (READ OP). Exception: "+e.message),t(-1)}else i.Logger.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),t(-1)},e.prototype._saveVersionIntoDBAsync=function(e,t){var r=this;if(this._isSupported&&!this._hasReachedQuota&&this._db)try{var n=this._db.transaction(["versions"],"readwrite");n.onabort=function(e){try{var n=e.srcElement.error;n&&"QuotaExceededError"===n.name&&(r._hasReachedQuota=!0)}catch(e){}t(-1)},n.oncomplete=function(){t(r._manifestVersionFound)};var o={sceneUrl:e,data:this._manifestVersionFound},s=n.objectStore("versions").put(o);s.onsuccess=function(){},s.onerror=function(){i.Logger.Error("Error in DB add version request in BABYLON.Database.")}}catch(e){i.Logger.Error("Error while accessing 'versions' object store (WRITE OP). Exception: "+e.message),t(-1)}else t(-1)},e.prototype.loadFile=function(t,r,n,i,o){var s=this,a=e._ReturnFullUrlLocation(t),l=function(){s._saveFileAsync(a,r,n,o,i)};this._checkVersionFromDB(a,(function(e){-1!==e?s._mustUpdateRessources?s._saveFileAsync(a,r,n,o,i):s._loadFileAsync(a,r,l):i&&i()}))},e.prototype._loadFileAsync=function(e,t,r){if(this._isSupported&&this._db){var n,o;n=-1!==e.indexOf(".babylon")?"scenes":"textures";var s=this._db.transaction([n]);s.oncomplete=function(){o?t(o.data):r()},s.onabort=function(){r()};var a=s.objectStore(n).get(e);a.onsuccess=function(e){o=e.target.result},a.onerror=function(){i.Logger.Error("Error loading file "+e+" from DB."),r()}}else i.Logger.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."),t()},e.prototype._saveFileAsync=function(t,r,n,o,s){var l=this;if(this._isSupported){var c;c=-1!==t.indexOf(".babylon")?"scenes":"textures";var u,d=new a.WebRequest;d.open("GET",t+"?"+Date.now()),o&&(d.responseType="arraybuffer"),n&&(d.onprogress=n),d.addEventListener("load",(function(){if(200===d.status||d.status<400&&e._ValidateXHRData(d,o?6:1))if(u=o?d.response:d.responseText,!l._hasReachedQuota&&l._db){var n,a=l._db.transaction([c],"readwrite");a.onabort=function(e){try{var t=e.srcElement.error;t&&"QuotaExceededError"===t.name&&(l._hasReachedQuota=!0)}catch(e){}r(u)},a.oncomplete=function(){r(u)},n="scenes"===c?{sceneUrl:t,data:u,version:l._manifestVersionFound}:{textureUrl:t,data:u};try{var h=a.objectStore(c).put(n);h.onsuccess=function(){},h.onerror=function(){i.Logger.Error("Error in DB add file request in BABYLON.Database.")}}catch(e){r(u)}}else r(u);else d.status>=400&&s?s(d):r()}),!1),d.addEventListener("error",(function(){i.Logger.Error("error on XHR request."),r()}),!1),d.send()}else i.Logger.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open."),r()},e._ValidateXHRData=function(e,t){void 0===t&&(t=7);try{if(1&t){if(e.responseText&&e.responseText.length>0)return!0;if(1===t)return!1}if(2&t){var r=o.TGATools.GetTGAHeader(e.response);if(r.width&&r.height&&r.width>0&&r.height>0)return!0;if(2===t)return!1}if(4&t){var n=new Uint8Array(e.response,0,3);return 68===n[0]&&68===n[1]&&83===n[2]}}catch(e){}return!1},e.IsUASupportingBlobStorage=!0,e.IDBStorageEnabled=!1,e._ParseURL=function(e){document.createElement("a").href=e;var t=e.substring(0,e.lastIndexOf("#")),r=e.substring(t.lastIndexOf("/")+1,e.length);return e.substring(0,e.indexOf(r,0))},e._ReturnFullUrlLocation=function(t){return-1===t.indexOf("http:/")&&-1===t.indexOf("https:/")&&"undefined"!=typeof window?e._ParseURL(window.location.href)+t:t},e}()},"./Offline/index.ts":
- /*!**************************!*\
- !*** ./Offline/index.ts ***!
- \**************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./database */"./Offline/database.ts");r.d(t,"Database",(function(){return n.Database}));var i=r(/*! ./IOfflineProvider */"./Offline/IOfflineProvider.ts");for(var o in i)["Database","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(o)},"./Particles/EmitterTypes/IParticleEmitterType.ts":
- /*!********************************************************!*\
- !*** ./Particles/EmitterTypes/IParticleEmitterType.ts ***!
- \********************************************************/
- /*! no static exports found */function(e,t){},"./Particles/EmitterTypes/boxParticleEmitter.ts":
- /*!******************************************************!*\
- !*** ./Particles/EmitterTypes/boxParticleEmitter.ts ***!
- \******************************************************/
- /*! exports provided: BoxParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"BoxParticleEmitter",(function(){return s}));var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(){this.direction1=new i.Vector3(0,1,0),this.direction2=new i.Vector3(0,1,0),this.minEmitBox=new i.Vector3(-.5,-.5,-.5),this.maxEmitBox=new i.Vector3(.5,.5,.5)}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),a=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),l=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);if(n)return t.x=s,t.y=a,void(t.z=l);i.Vector3.TransformNormalFromFloatsToRef(s,a,l,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(this.minEmitBox.x,this.maxEmitBox.x),a=o.Scalar.RandomRange(this.minEmitBox.y,this.maxEmitBox.y),l=o.Scalar.RandomRange(this.minEmitBox.z,this.maxEmitBox.z);if(n)return t.x=s,t.y=a,void(t.z=l);i.Vector3.TransformCoordinatesFromFloatsToRef(s,a,l,e,t)},e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2),e.setVector3("minEmitBox",this.minEmitBox),e.setVector3("maxEmitBox",this.maxEmitBox)},e.prototype.getEffectDefines=function(){return"#define BOXEMITTER"},e.prototype.getClassName=function(){return"BoxParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e.minEmitBox=this.minEmitBox.asArray(),e.maxEmitBox=this.maxEmitBox.asArray(),e},e.prototype.parse=function(e){i.Vector3.FromArrayToRef(e.direction1,0,this.direction1),i.Vector3.FromArrayToRef(e.direction2,0,this.direction2),i.Vector3.FromArrayToRef(e.minEmitBox,0,this.minEmitBox),i.Vector3.FromArrayToRef(e.maxEmitBox,0,this.maxEmitBox)},e}()},"./Particles/EmitterTypes/coneParticleEmitter.ts":
- /*!*******************************************************!*\
- !*** ./Particles/EmitterTypes/coneParticleEmitter.ts ***!
- \*******************************************************/
- /*! exports provided: ConeParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"ConeParticleEmitter",(function(){return s}));var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(e,t,r){void 0===e&&(e=1),void 0===t&&(t=Math.PI),void 0===r&&(r=0),this.directionRandomizer=r,this.radiusRange=1,this.heightRange=1,this.emitFromSpawnPointOnly=!1,this.angle=t,this.radius=e}return Object.defineProperty(e.prototype,"radius",{get:function(){return this._radius},set:function(e){this._radius=e,this._buildHeight()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._buildHeight()},enumerable:!1,configurable:!0}),e.prototype._buildHeight=function(){0!==this._angle?this._height=this._radius/Math.tan(this._angle/2):this._height=1},e.prototype.startDirectionFunction=function(e,t,r,n){n?i.TmpVectors.Vector3[0].copyFrom(r._localPosition).normalize():r.position.subtractToRef(e.getTranslation(),i.TmpVectors.Vector3[0]).normalize();var s=o.Scalar.RandomRange(0,this.directionRandomizer),a=o.Scalar.RandomRange(0,this.directionRandomizer),l=o.Scalar.RandomRange(0,this.directionRandomizer);t.x=i.TmpVectors.Vector3[0].x+s,t.y=i.TmpVectors.Vector3[0].y+a,t.z=i.TmpVectors.Vector3[0].z+l,t.normalize()},e.prototype.startPositionFunction=function(e,t,r,n){var s,a=o.Scalar.RandomRange(0,2*Math.PI);s=this.emitFromSpawnPointOnly?1e-4:1-(s=o.Scalar.RandomRange(0,this.heightRange))*s;var l=this._radius-o.Scalar.RandomRange(0,this._radius*this.radiusRange),c=(l*=s)*Math.sin(a),u=l*Math.cos(a),d=s*this._height;if(n)return t.x=c,t.y=d,void(t.z=u);i.Vector3.TransformCoordinatesFromFloatsToRef(c,d,u,e,t)},e.prototype.clone=function(){var t=new e(this._radius,this._angle,this.directionRandomizer);return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat2("radius",this._radius,this.radiusRange),e.setFloat("coneAngle",this._angle),e.setFloat2("height",this._height,this.heightRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){var e="#define CONEEMITTER";return this.emitFromSpawnPointOnly&&(e+="\n#define CONEEMITTERSPAWNPOINT"),e},e.prototype.getClassName=function(){return"ConeParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this._radius,e.angle=this._angle,e.directionRandomizer=this.directionRandomizer,e.radiusRange=this.radiusRange,e.heightRange=this.heightRange,e.emitFromSpawnPointOnly=this.emitFromSpawnPointOnly,e},e.prototype.parse=function(e){this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer,this.radiusRange=void 0!==e.radiusRange?e.radiusRange:1,this.heightRange=void 0!==e.radiusRange?e.heightRange:1,this.emitFromSpawnPointOnly=void 0!==e.emitFromSpawnPointOnly&&e.emitFromSpawnPointOnly},e}()},"./Particles/EmitterTypes/customParticleEmitter.ts":
- /*!*********************************************************!*\
- !*** ./Particles/EmitterTypes/customParticleEmitter.ts ***!
- \*********************************************************/
- /*! exports provided: CustomParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"CustomParticleEmitter",(function(){return o}));var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=function(){function e(){this.particlePositionGenerator=function(){},this.particleDestinationGenerator=function(){}}return e.prototype.startDirectionFunction=function(e,t,r,n){var o=i.TmpVectors.Vector3[0];if(this.particleDestinationGenerator){this.particleDestinationGenerator(-1,r,o);var s=i.TmpVectors.Vector3[1];o.subtractToRef(r.position,s),s.scaleToRef(1/r.lifeTime,o)}else o.set(0,0,0);n?t.copyFrom(o):i.Vector3.TransformNormalToRef(o,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var o=i.TmpVectors.Vector3[0];this.particlePositionGenerator?this.particlePositionGenerator(-1,r,o):o.set(0,0,0),n?t.copyFrom(o):i.Vector3.TransformCoordinatesToRef(o,e,t)},e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){},e.prototype.getEffectDefines=function(){return"#define CUSTOMEMITTER"},e.prototype.getClassName=function(){return"CustomParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e},e.prototype.parse=function(e){},e}()},"./Particles/EmitterTypes/cylinderParticleEmitter.ts":
- /*!***********************************************************!*\
- !*** ./Particles/EmitterTypes/cylinderParticleEmitter.ts ***!
- \***********************************************************/
- /*! exports provided: CylinderParticleEmitter, CylinderDirectedParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"CylinderParticleEmitter",(function(){return a})),r.d(t,"CylinderDirectedParticleEmitter",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),a=function(){function e(e,t,r,n){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=0),this.radius=e,this.height=t,this.radiusRange=r,this.directionRandomizer=n}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(-this.directionRandomizer/2,this.directionRandomizer/2),l=Math.atan2(s.x,s.z);l+=o.Scalar.RandomRange(-Math.PI/2,Math.PI/2)*this.directionRandomizer,s.y=a,s.x=Math.sin(l),s.z=Math.cos(l),s.normalize(),n?t.copyFrom(s):i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(-this.height/2,this.height/2),a=o.Scalar.RandomRange(0,2*Math.PI),l=o.Scalar.RandomRange((1-this.radiusRange)*(1-this.radiusRange),1),c=Math.sqrt(l)*this.radius,u=c*Math.cos(a),d=c*Math.sin(a);n?t.copyFromFloats(u,s,d):i.Vector3.TransformCoordinatesFromFloatsToRef(u,s,d,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return s.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){return"#define CYLINDEREMITTER"},e.prototype.getClassName=function(){return"CylinderParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this.radius,e.height=this.height,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.height=e.height,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer},e}(),l=function(e){function t(t,r,n,o,s){void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=1),void 0===o&&(o=new i.Vector3(0,1,0)),void 0===s&&(s=new i.Vector3(0,1,0));var a=e.call(this,t,r,n)||this;return a.direction1=o,a.direction2=s,a}return Object(n.__extends)(t,e),t.prototype.startDirectionFunction=function(e,t,r){var n=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),s=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),a=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);i.Vector3.TransformNormalFromFloatsToRef(n,s,a,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.height,this.radiusRange,this.direction1,this.direction2);return s.DeepCopier.DeepCopy(this,e),e},t.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},t.prototype.getEffectDefines=function(){return"#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER"},t.prototype.getClassName=function(){return"CylinderDirectedParticleEmitter"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this.direction1.copyFrom(t.direction1),this.direction2.copyFrom(t.direction2)},t}(a)},"./Particles/EmitterTypes/hemisphericParticleEmitter.ts":
- /*!**************************************************************!*\
- !*** ./Particles/EmitterTypes/hemisphericParticleEmitter.ts ***!
- \**************************************************************/
- /*! exports provided: HemisphericParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"HemisphericParticleEmitter",(function(){return s}));var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(e,t,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=r}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(0,this.directionRandomizer),l=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer);s.x+=a,s.y+=l,s.z+=c,s.normalize(),n?t.copyFrom(s):i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=this.radius-o.Scalar.RandomRange(0,this.radius*this.radiusRange),a=o.Scalar.RandomRange(0,1),l=o.Scalar.RandomRange(0,2*Math.PI),c=Math.acos(2*a-1),u=s*Math.cos(l)*Math.sin(c),d=s*Math.cos(c),h=s*Math.sin(l)*Math.sin(c);n?t.copyFromFloats(u,Math.abs(d),h):i.Vector3.TransformCoordinatesFromFloatsToRef(u,Math.abs(d),h,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){return"#define HEMISPHERICEMITTER"},e.prototype.getClassName=function(){return"HemisphericParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this.radius,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer},e}()},"./Particles/EmitterTypes/index.ts":
- /*!*****************************************!*\
- !*** ./Particles/EmitterTypes/index.ts ***!
- \*****************************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./boxParticleEmitter */"./Particles/EmitterTypes/boxParticleEmitter.ts");r.d(t,"BoxParticleEmitter",(function(){return n.BoxParticleEmitter}));var i=r(/*! ./coneParticleEmitter */"./Particles/EmitterTypes/coneParticleEmitter.ts");r.d(t,"ConeParticleEmitter",(function(){return i.ConeParticleEmitter}));var o=r(/*! ./cylinderParticleEmitter */"./Particles/EmitterTypes/cylinderParticleEmitter.ts");r.d(t,"CylinderParticleEmitter",(function(){return o.CylinderParticleEmitter})),r.d(t,"CylinderDirectedParticleEmitter",(function(){return o.CylinderDirectedParticleEmitter}));var s=r(/*! ./hemisphericParticleEmitter */"./Particles/EmitterTypes/hemisphericParticleEmitter.ts");r.d(t,"HemisphericParticleEmitter",(function(){return s.HemisphericParticleEmitter}));var a=r(/*! ./IParticleEmitterType */"./Particles/EmitterTypes/IParticleEmitterType.ts");for(var l in a)["BoxParticleEmitter","ConeParticleEmitter","CylinderParticleEmitter","CylinderDirectedParticleEmitter","HemisphericParticleEmitter","default"].indexOf(l)<0&&function(e){r.d(t,e,(function(){return a[e]}))}(l);var c=r(/*! ./pointParticleEmitter */"./Particles/EmitterTypes/pointParticleEmitter.ts");r.d(t,"PointParticleEmitter",(function(){return c.PointParticleEmitter}));var u=r(/*! ./sphereParticleEmitter */"./Particles/EmitterTypes/sphereParticleEmitter.ts");r.d(t,"SphereParticleEmitter",(function(){return u.SphereParticleEmitter})),r.d(t,"SphereDirectedParticleEmitter",(function(){return u.SphereDirectedParticleEmitter}));var d=r(/*! ./customParticleEmitter */"./Particles/EmitterTypes/customParticleEmitter.ts");r.d(t,"CustomParticleEmitter",(function(){return d.CustomParticleEmitter}));var h=r(/*! ./meshParticleEmitter */"./Particles/EmitterTypes/meshParticleEmitter.ts");r.d(t,"MeshParticleEmitter",(function(){return h.MeshParticleEmitter}))},"./Particles/EmitterTypes/meshParticleEmitter.ts":
- /*!*******************************************************!*\
- !*** ./Particles/EmitterTypes/meshParticleEmitter.ts ***!
- \*******************************************************/
- /*! exports provided: MeshParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"MeshParticleEmitter",(function(){return a}));var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),a=function(){function e(e){void 0===e&&(e=null),this._indices=null,this._positions=null,this._normals=null,this._storedNormal=i.Vector3.Zero(),this._mesh=null,this.direction1=new i.Vector3(0,1,0),this.direction2=new i.Vector3(0,1,0),this.useMeshNormalsForDirection=!0,this.mesh=e}return Object.defineProperty(e.prototype,"mesh",{get:function(){return this._mesh},set:function(e){this._mesh!==e&&(this._mesh=e,e?(this._indices=e.getIndices(),this._positions=e.getVerticesData(s.VertexBuffer.PositionKind),this._normals=e.getVerticesData(s.VertexBuffer.NormalKind)):(this._indices=null,this._positions=null,this._normals=null))},enumerable:!1,configurable:!0}),e.prototype.startDirectionFunction=function(e,t,r,n){if(this.useMeshNormalsForDirection&&this._normals)i.Vector3.TransformNormalToRef(this._storedNormal,e,t);else{var s=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),a=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),l=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);n?t.copyFromFloats(s,a,l):i.Vector3.TransformNormalFromFloatsToRef(s,a,l,e,t)}},e.prototype.startPositionFunction=function(e,t,r,n){if(this._indices&&this._positions){var o=3*Math.random()*(this._indices.length/3)|0,s=Math.random(),a=Math.random()*(1-s),l=1-s-a,c=this._indices[o],u=this._indices[o+1],d=this._indices[o+2],h=i.TmpVectors.Vector3[0],f=i.TmpVectors.Vector3[1],p=i.TmpVectors.Vector3[2],m=i.TmpVectors.Vector3[3];i.Vector3.FromArrayToRef(this._positions,3*c,h),i.Vector3.FromArrayToRef(this._positions,3*u,f),i.Vector3.FromArrayToRef(this._positions,3*d,p),m.x=s*h.x+a*f.x+l*p.x,m.y=s*h.y+a*f.y+l*p.y,m.z=s*h.z+a*f.z+l*p.z,n?t.copyFromFloats(m.x,m.y,m.z):i.Vector3.TransformCoordinatesFromFloatsToRef(m.x,m.y,m.z,e,t),this.useMeshNormalsForDirection&&this._normals&&(i.Vector3.FromArrayToRef(this._normals,3*c,h),i.Vector3.FromArrayToRef(this._normals,3*u,f),i.Vector3.FromArrayToRef(this._normals,3*d,p),this._storedNormal.x=s*h.x+a*f.x+l*p.x,this._storedNormal.y=s*h.y+a*f.y+l*p.y,this._storedNormal.z=s*h.z+a*f.z+l*p.z)}},e.prototype.clone=function(){var t=new e(this.mesh);return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},e.prototype.getEffectDefines=function(){return""},e.prototype.getClassName=function(){return"MeshParticleEmitter"},e.prototype.serialize=function(){var e,t={};return t.type=this.getClassName(),t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t.meshId=null===(e=this.mesh)||void 0===e?void 0:e.id,t.useMeshNormalsForDirection=this.useMeshNormalsForDirection,t},e.prototype.parse=function(e,t){i.Vector3.FromArrayToRef(e.direction1,0,this.direction1),i.Vector3.FromArrayToRef(e.direction2,0,this.direction2),e.meshId&&(this.mesh=t.getLastMeshByID(e.meshId)),this.useMeshNormalsForDirection=e.useMeshNormalsForDirection},e}()},"./Particles/EmitterTypes/pointParticleEmitter.ts":
- /*!********************************************************!*\
- !*** ./Particles/EmitterTypes/pointParticleEmitter.ts ***!
- \********************************************************/
- /*! exports provided: PointParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"PointParticleEmitter",(function(){return s}));var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(){this.direction1=new i.Vector3(0,1,0),this.direction2=new i.Vector3(0,1,0)}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),a=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),l=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);n?t.copyFromFloats(s,a,l):i.Vector3.TransformNormalFromFloatsToRef(s,a,l,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){n?t.copyFromFloats(0,0,0):i.Vector3.TransformCoordinatesFromFloatsToRef(0,0,0,e,t)},e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},e.prototype.getEffectDefines=function(){return"#define POINTEMITTER"},e.prototype.getClassName=function(){return"PointParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e},e.prototype.parse=function(e){i.Vector3.FromArrayToRef(e.direction1,0,this.direction1),i.Vector3.FromArrayToRef(e.direction2,0,this.direction2)},e}()},"./Particles/EmitterTypes/sphereParticleEmitter.ts":
- /*!*********************************************************!*\
- !*** ./Particles/EmitterTypes/sphereParticleEmitter.ts ***!
- \*********************************************************/
- /*! exports provided: SphereParticleEmitter, SphereDirectedParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"SphereParticleEmitter",(function(){return a})),r.d(t,"SphereDirectedParticleEmitter",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),a=function(){function e(e,t,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=r}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(0,this.directionRandomizer),l=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer);s.x+=a,s.y+=l,s.z+=c,s.normalize(),n?t.copyFrom(s):i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=this.radius-o.Scalar.RandomRange(0,this.radius*this.radiusRange),a=o.Scalar.RandomRange(0,1),l=o.Scalar.RandomRange(0,2*Math.PI),c=Math.acos(2*a-1),u=s*Math.cos(l)*Math.sin(c),d=s*Math.cos(c),h=s*Math.sin(l)*Math.sin(c);n?t.copyFromFloats(u,d,h):i.Vector3.TransformCoordinatesFromFloatsToRef(u,d,h,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return s.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){return"#define SPHEREEMITTER"},e.prototype.getClassName=function(){return"SphereParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this.radius,e.radiusRange=this.radiusRange,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.radiusRange=e.radiusRange,this.directionRandomizer=e.directionRandomizer},e}(),l=function(e){function t(t,r,n){void 0===t&&(t=1),void 0===r&&(r=new i.Vector3(0,1,0)),void 0===n&&(n=new i.Vector3(0,1,0));var o=e.call(this,t)||this;return o.direction1=r,o.direction2=n,o}return Object(n.__extends)(t,e),t.prototype.startDirectionFunction=function(e,t,r){var n=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),s=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),a=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);i.Vector3.TransformNormalFromFloatsToRef(n,s,a,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.direction1,this.direction2);return s.DeepCopier.DeepCopy(this,e),e},t.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},t.prototype.getEffectDefines=function(){return"#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER"},t.prototype.getClassName=function(){return"SphereDirectedParticleEmitter"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this.direction1.copyFrom(t.direction1),this.direction2.copyFrom(t.direction2)},t}(a)},"./Particles/IParticleSystem.ts":
- /*!**************************************!*\
- !*** ./Particles/IParticleSystem.ts ***!
- \**************************************/
- /*! no static exports found */function(e,t){},"./Particles/baseParticleSystem.ts":
- /*!*****************************************!*\
- !*** ./Particles/baseParticleSystem.ts ***!
- \*****************************************/
- /*! exports provided: BaseParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseParticleSystem",(function(){return l}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),o=r(/*! ../Particles/EmitterTypes/index */"./Particles/EmitterTypes/index.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=function(){function e(t){this.animations=[],this.renderingGroupId=0,this.emitter=n.Vector3.Zero(),this.emitRate=10,this.manualEmitCount=-1,this.updateSpeed=.01,this.targetStopDuration=0,this.disposeOnStop=!1,this.minEmitPower=1,this.maxEmitPower=1,this.minLifeTime=1,this.maxLifeTime=1,this.minSize=1,this.maxSize=1,this.minScaleX=1,this.maxScaleX=1,this.minScaleY=1,this.maxScaleY=1,this.minInitialRotation=0,this.maxInitialRotation=0,this.minAngularSpeed=0,this.maxAngularSpeed=0,this.layerMask=268435455,this.customShader=null,this.preventAutoStart=!1,this.noiseStrength=new n.Vector3(10,10,10),this.onAnimationEnd=null,this.blendMode=e.BLENDMODE_ONEONE,this.forceDepthWrite=!1,this.preWarmCycles=0,this.preWarmStepOffset=1,this.spriteCellChangeSpeed=1,this.startSpriteCellID=0,this.endSpriteCellID=0,this.spriteCellWidth=0,this.spriteCellHeight=0,this.spriteRandomStartCell=!1,this.translationPivot=new n.Vector2(0,0),this.beginAnimationOnStart=!1,this.beginAnimationFrom=0,this.beginAnimationTo=60,this.beginAnimationLoop=!1,this.worldOffset=new n.Vector3(0,0,0),this.gravity=n.Vector3.Zero(),this._colorGradients=null,this._sizeGradients=null,this._lifeTimeGradients=null,this._angularSpeedGradients=null,this._velocityGradients=null,this._limitVelocityGradients=null,this._dragGradients=null,this._emitRateGradients=null,this._startSizeGradients=null,this._rampGradients=null,this._colorRemapGradients=null,this._alphaRemapGradients=null,this.startDelay=0,this.limitVelocityDamping=.4,this.color1=new a.Color4(1,1,1,1),this.color2=new a.Color4(1,1,1,1),this.colorDead=new a.Color4(0,0,0,1),this.textureMask=new a.Color4(1,1,1,1),this._isSubEmitter=!1,this.billboardMode=s.Constants.PARTICLES_BILLBOARDMODE_ALL,this._isBillboardBased=!0,this._imageProcessingConfigurationDefines=new i.ImageProcessingConfigurationDefines,this.id=t,this.name=t}return Object.defineProperty(e.prototype,"noiseTexture",{get:function(){return this._noiseTexture},set:function(e){this._noiseTexture!==e&&(this._noiseTexture=e,this._reset())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAnimationSheetEnabled",{get:function(){return this._isAnimationSheetEnabled},set:function(e){this._isAnimationSheetEnabled!=e&&(this._isAnimationSheetEnabled=e,this._reset())},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype._hasTargetStopDurationDependantGradient=function(){return this._startSizeGradients&&this._startSizeGradients.length>0||this._emitRateGradients&&this._emitRateGradients.length>0||this._lifeTimeGradients&&this._lifeTimeGradients.length>0},e.prototype.getDragGradients=function(){return this._dragGradients},e.prototype.getLimitVelocityGradients=function(){return this._limitVelocityGradients},e.prototype.getColorGradients=function(){return this._colorGradients},e.prototype.getSizeGradients=function(){return this._sizeGradients},e.prototype.getColorRemapGradients=function(){return this._colorRemapGradients},e.prototype.getAlphaRemapGradients=function(){return this._alphaRemapGradients},e.prototype.getLifeTimeGradients=function(){return this._lifeTimeGradients},e.prototype.getAngularSpeedGradients=function(){return this._angularSpeedGradients},e.prototype.getVelocityGradients=function(){return this._velocityGradients},e.prototype.getStartSizeGradients=function(){return this._startSizeGradients},e.prototype.getEmitRateGradients=function(){return this._emitRateGradients},Object.defineProperty(e.prototype,"direction1",{get:function(){return this.particleEmitterType.direction1?this.particleEmitterType.direction1:n.Vector3.Zero()},set:function(e){this.particleEmitterType.direction1&&(this.particleEmitterType.direction1=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"direction2",{get:function(){return this.particleEmitterType.direction2?this.particleEmitterType.direction2:n.Vector3.Zero()},set:function(e){this.particleEmitterType.direction2&&(this.particleEmitterType.direction2=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minEmitBox",{get:function(){return this.particleEmitterType.minEmitBox?this.particleEmitterType.minEmitBox:n.Vector3.Zero()},set:function(e){this.particleEmitterType.minEmitBox&&(this.particleEmitterType.minEmitBox=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxEmitBox",{get:function(){return this.particleEmitterType.maxEmitBox?this.particleEmitterType.maxEmitBox:n.Vector3.Zero()},set:function(e){this.particleEmitterType.maxEmitBox&&(this.particleEmitterType.maxEmitBox=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBillboardBased",{get:function(){return this._isBillboardBased},set:function(e){this._isBillboardBased!==e&&(this._isBillboardBased=e,this._reset())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e)},enumerable:!1,configurable:!0}),e.prototype._attachImageProcessingConfiguration=function(e){e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration=e||this._scene.imageProcessingConfiguration)},e.prototype._reset=function(){},e.prototype._removeGradientAndTexture=function(e,t,r){if(!t)return this;for(var n=0,i=0,o=t;i<o.length;i++){if(o[i].gradient===e){t.splice(n,1);break}n++}return r&&r.dispose(),this},e.prototype.createPointEmitter=function(e,t){var r=new o.PointParticleEmitter;return r.direction1=e,r.direction2=t,this.particleEmitterType=r,r},e.prototype.createHemisphericEmitter=function(e,t){void 0===e&&(e=1),void 0===t&&(t=1);var r=new o.HemisphericParticleEmitter(e,t);return this.particleEmitterType=r,r},e.prototype.createSphereEmitter=function(e,t){void 0===e&&(e=1),void 0===t&&(t=1);var r=new o.SphereParticleEmitter(e,t);return this.particleEmitterType=r,r},e.prototype.createDirectedSphereEmitter=function(e,t,r){void 0===e&&(e=1),void 0===t&&(t=new n.Vector3(0,1,0)),void 0===r&&(r=new n.Vector3(0,1,0));var i=new o.SphereDirectedParticleEmitter(e,t,r);return this.particleEmitterType=i,i},e.prototype.createCylinderEmitter=function(e,t,r,n){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=0);var i=new o.CylinderParticleEmitter(e,t,r,n);return this.particleEmitterType=i,i},e.prototype.createDirectedCylinderEmitter=function(e,t,r,i,s){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=1),void 0===i&&(i=new n.Vector3(0,1,0)),void 0===s&&(s=new n.Vector3(0,1,0));var a=new o.CylinderDirectedParticleEmitter(e,t,r,i,s);return this.particleEmitterType=a,a},e.prototype.createConeEmitter=function(e,t){void 0===e&&(e=1),void 0===t&&(t=Math.PI/4);var r=new o.ConeParticleEmitter(e,t);return this.particleEmitterType=r,r},e.prototype.createBoxEmitter=function(e,t,r,n){var i=new o.BoxParticleEmitter;return this.particleEmitterType=i,this.direction1=e,this.direction2=t,this.minEmitBox=r,this.maxEmitBox=n,i},e.BLENDMODE_ONEONE=0,e.BLENDMODE_STANDARD=1,e.BLENDMODE_ADD=2,e.BLENDMODE_MULTIPLY=3,e.BLENDMODE_MULTIPLYADD=4,e}()},"./Particles/cloudPoint.ts":
- /*!*********************************!*\
- !*** ./Particles/cloudPoint.ts ***!
- \*********************************/
- /*! exports provided: CloudPoint, PointsGroup */function(e,t,r){"use strict";r.r(t),r.d(t,"CloudPoint",(function(){return i})),r.d(t,"PointsGroup",(function(){return o}));var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=function(){function e(e,t,r,i,o){this.idx=0,this.color=new n.Color4(1,1,1,1),this.position=n.Vector3.Zero(),this.rotation=n.Vector3.Zero(),this.uv=new n.Vector2(0,0),this.velocity=n.Vector3.Zero(),this.pivot=n.Vector3.Zero(),this.translateFromPivot=!1,this._pos=0,this._ind=0,this.groupId=0,this.idxInGroup=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this._globalPosition=n.Vector3.Zero(),this.idx=e,this._group=t,this.groupId=r,this.idxInGroup=i,this._pcs=o}return Object.defineProperty(e.prototype,"size",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quaternion",{get:function(){return this.rotationQuaternion},set:function(e){this.rotationQuaternion=e},enumerable:!1,configurable:!0}),e.prototype.intersectsMesh=function(e,t){if(!e._boundingInfo)return!1;if(t=t||!1)return e.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));var r,n,i,o,s,a;r=e.getBoundingInfo().boundingBox.maximumWorld.x,n=e.getBoundingInfo().boundingBox.minimumWorld.x,i=e.getBoundingInfo().boundingBox.maximumWorld.y,o=e.getBoundingInfo().boundingBox.minimumWorld.y,s=e.getBoundingInfo().boundingBox.maximumWorld.z,a=e.getBoundingInfo().boundingBox.minimumWorld.z;var l=this.position.x+this._pcs.mesh.position.x,c=this.position.y+this._pcs.mesh.position.y,u=this.position.z+this._pcs.mesh.position.z;return n<=l&&l<=r&&o<=c&&c<=i&&a<=u&&u<=s},e.prototype.getRotationMatrix=function(e){var t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=n.TmpVectors.Quaternion[0];var r=this.rotation;n.Quaternion.RotationYawPitchRollToRef(r.y,r.x,r.z,t)}t.toRotationMatrix(e)},e}(),o=function(e,t){this.groupID=e,this._positionFunction=t}},"./Particles/gpuParticleSystem.ts":
- /*!****************************************!*\
- !*** ./Particles/gpuParticleSystem.ts ***!
- \****************************************/
- /*! exports provided: GPUParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"GPUParticleSystem",(function(){return T}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/gradients */"./Misc/gradients.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),u=r(/*! ./baseParticleSystem */"./Particles/baseParticleSystem.ts"),d=r(/*! ./particleSystem */"./Particles/particleSystem.ts"),h=r(/*! ../Particles/EmitterTypes/boxParticleEmitter */"./Particles/EmitterTypes/boxParticleEmitter.ts"),f=r(/*! ../Materials/effect */"./Materials/effect.ts"),p=r(/*! ../Materials/material */"./Materials/material.ts"),m=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),g=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),_=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),v=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),y=r(/*! ../Engines/constants */"./Engines/constants.ts"),b=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),A=r(/*! ./EmitterTypes/customParticleEmitter */"./Particles/EmitterTypes/customParticleEmitter.ts"),T=(r(/*! ../Shaders/gpuUpdateParticles.fragment */"./Shaders/gpuUpdateParticles.fragment.ts"),r(/*! ../Shaders/gpuUpdateParticles.vertex */"./Shaders/gpuUpdateParticles.vertex.ts"),r(/*! ../Shaders/gpuRenderParticles.fragment */"./Shaders/gpuRenderParticles.fragment.ts"),r(/*! ../Shaders/gpuRenderParticles.vertex */"./Shaders/gpuRenderParticles.vertex.ts"),function(e){function t(t,r,i,s,a){void 0===s&&(s=!1),void 0===a&&(a=null);var l=e.call(this,t)||this;l.layerMask=268435455,l._accumulatedCount=0,l._targetIndex=0,l._currentRenderId=-1,l._started=!1,l._stopped=!1,l._timeDelta=0,l._actualFrame=0,l._rawTextureWidth=256,l.onDisposeObservable=new o.Observable,l.forceDepthWrite=!1,l._preWarmDone=!1,l.isLocal=!1,l._onBeforeDrawParticlesObservable=null,l._scene=i||b.EngineStore.LastCreatedScene,l.uniqueId=l._scene.getUniqueId(),l._customEffect={0:a},l._attachImageProcessingConfiguration(null),l._engine=l._scene.getEngine(),r.randomTextureSize||delete r.randomTextureSize;var c=Object(n.__assign)({capacity:5e4,randomTextureSize:l._engine.getCaps().maxTextureSize},r),u=r;isFinite(u)&&(c.capacity=u),l._capacity=c.capacity,l._activeCount=c.capacity,l._currentActiveCount=0,l._isAnimationSheetEnabled=s,l._scene.particleSystems.push(l),l._updateEffectOptions={attributes:["position","initialPosition","age","life","seed","size","color","direction","initialDirection","angle","cellIndex","cellStartOffset","noiseCoordinates1","noiseCoordinates2"],uniformsNames:["currentCount","timeDelta","emitterWM","lifeTime","color1","color2","sizeRange","scaleRange","gravity","emitPower","direction1","direction2","minEmitBox","maxEmitBox","radius","directionRandomizer","height","coneAngle","stopFactor","angleRange","radiusRange","cellInfos","noiseStrength","limitVelocityDamping"],uniformBuffersNames:[],samplers:["randomSampler","randomSampler2","sizeGradientSampler","angularSpeedGradientSampler","velocityGradientSampler","limitVelocityGradientSampler","noiseSampler","dragGradientSampler"],defines:"",fallbacks:null,onCompiled:null,onError:null,indexParameters:null,maxSimultaneousLights:0,transformFeedbackVaryings:[]},l.particleEmitterType=new h.BoxParticleEmitter;for(var d=Math.min(l._engine.getCaps().maxTextureSize,c.randomTextureSize),f=[],p=0;p<d;++p)f.push(Math.random()),f.push(Math.random()),f.push(Math.random()),f.push(Math.random());for(l._randomTexture=new v.RawTexture(new Float32Array(f),d,1,y.Constants.TEXTUREFORMAT_RGBA,l._scene,!1,!1,y.Constants.TEXTURE_NEAREST_SAMPLINGMODE,y.Constants.TEXTURETYPE_FLOAT),l._randomTexture.wrapU=_.Texture.WRAP_ADDRESSMODE,l._randomTexture.wrapV=_.Texture.WRAP_ADDRESSMODE,f=[],p=0;p<d;++p)f.push(Math.random()),f.push(Math.random()),f.push(Math.random()),f.push(Math.random());return l._randomTexture2=new v.RawTexture(new Float32Array(f),d,1,y.Constants.TEXTUREFORMAT_RGBA,l._scene,!1,!1,y.Constants.TEXTURE_NEAREST_SAMPLINGMODE,y.Constants.TEXTURETYPE_FLOAT),l._randomTexture2.wrapU=_.Texture.WRAP_ADDRESSMODE,l._randomTexture2.wrapV=_.Texture.WRAP_ADDRESSMODE,l._randomTextureSize=d,l}return Object(n.__extends)(t,e),Object.defineProperty(t,"IsSupported",{get:function(){return!!b.EngineStore.LastCreatedEngine&&b.EngineStore.LastCreatedEngine.webGLVersion>1},enumerable:!1,configurable:!0}),t.prototype.getCapacity=function(){return this._capacity},Object.defineProperty(t.prototype,"activeParticleCount",{get:function(){return this._activeCount},set:function(e){this._activeCount=Math.min(e,this._capacity)},enumerable:!1,configurable:!0}),t.prototype.isReady=function(){return this._updateEffect?!!(this.emitter&&this._updateEffect.isReady()&&this._imageProcessingConfiguration.isReady()&&this._getEffect().isReady()&&this.particleTexture&&this.particleTexture.isReady()):(this._recreateUpdateEffect(),this._recreateRenderEffect(),!1)},t.prototype.isStarted=function(){return this._started},t.prototype.isStopped=function(){return this._stopped},t.prototype.isStopping=function(){return!1},t.prototype.getActiveCount=function(){return this._currentActiveCount},t.prototype.start=function(e){var t=this;if(void 0===e&&(e=this.startDelay),!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";e?setTimeout((function(){t.start(0)}),e):(this._started=!0,this._stopped=!1,this._preWarmDone=!1,this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this.getScene().beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop))},t.prototype.stop=function(){this._stopped=!0},t.prototype.reset=function(){this._releaseBuffers(),this._releaseVAOs(),this._currentActiveCount=0,this._targetIndex=0},t.prototype.getClassName=function(){return"GPUParticleSystem"},t.prototype.getCustomEffect=function(e){var t;return void 0===e&&(e=0),null!==(t=this._customEffect[e])&&void 0!==t?t:this._customEffect[0]},t.prototype.setCustomEffect=function(e,t){void 0===t&&(t=0),this._customEffect[t]=e},Object.defineProperty(t.prototype,"onBeforeDrawParticlesObservable",{get:function(){return this._onBeforeDrawParticlesObservable||(this._onBeforeDrawParticlesObservable=new o.Observable),this._onBeforeDrawParticlesObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexShaderName",{get:function(){return"gpuRenderParticles"},enumerable:!1,configurable:!0}),t.prototype._removeGradientAndTexture=function(t,r,n){return e.prototype._removeGradientAndTexture.call(this,t,r,n),this._releaseBuffers(),this},t.prototype.addColorGradient=function(e,t,r){this._colorGradients||(this._colorGradients=[]);var n=new i.ColorGradient(e,t);return this._colorGradients.push(n),this._refreshColorGradient(!0),this._releaseBuffers(),this},t.prototype._refreshColorGradient=function(e){void 0===e&&(e=!1),this._colorGradients&&(e&&this._colorGradients.sort((function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0})),this._colorGradientsTexture&&(this._colorGradientsTexture.dispose(),this._colorGradientsTexture=null))},t.prototype.forceRefreshGradients=function(){this._refreshColorGradient(),this._refreshFactorGradient(this._sizeGradients,"_sizeGradientsTexture"),this._refreshFactorGradient(this._angularSpeedGradients,"_angularSpeedGradientsTexture"),this._refreshFactorGradient(this._velocityGradients,"_velocityGradientsTexture"),this._refreshFactorGradient(this._limitVelocityGradients,"_limitVelocityGradientsTexture"),this._refreshFactorGradient(this._dragGradients,"_dragGradientsTexture"),this.reset()},t.prototype.removeColorGradient=function(e){return this._removeGradientAndTexture(e,this._colorGradients,this._colorGradientsTexture),this._colorGradientsTexture=null,this},t.prototype._addFactorGradient=function(e,t,r){var n=new i.FactorGradient(t,r);e.push(n),this._releaseBuffers()},t.prototype.addSizeGradient=function(e,t){return this._sizeGradients||(this._sizeGradients=[]),this._addFactorGradient(this._sizeGradients,e,t),this._refreshFactorGradient(this._sizeGradients,"_sizeGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeSizeGradient=function(e){return this._removeGradientAndTexture(e,this._sizeGradients,this._sizeGradientsTexture),this._sizeGradientsTexture=null,this},t.prototype._refreshFactorGradient=function(e,t,r){void 0===r&&(r=!1),e&&(r&&e.sort((function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0})),this[t]&&(this[t].dispose(),this[t]=null))},t.prototype.addAngularSpeedGradient=function(e,t){return this._angularSpeedGradients||(this._angularSpeedGradients=[]),this._addFactorGradient(this._angularSpeedGradients,e,t),this._refreshFactorGradient(this._angularSpeedGradients,"_angularSpeedGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeAngularSpeedGradient=function(e){return this._removeGradientAndTexture(e,this._angularSpeedGradients,this._angularSpeedGradientsTexture),this._angularSpeedGradientsTexture=null,this},t.prototype.addVelocityGradient=function(e,t){return this._velocityGradients||(this._velocityGradients=[]),this._addFactorGradient(this._velocityGradients,e,t),this._refreshFactorGradient(this._velocityGradients,"_velocityGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeVelocityGradient=function(e){return this._removeGradientAndTexture(e,this._velocityGradients,this._velocityGradientsTexture),this._velocityGradientsTexture=null,this},t.prototype.addLimitVelocityGradient=function(e,t){return this._limitVelocityGradients||(this._limitVelocityGradients=[]),this._addFactorGradient(this._limitVelocityGradients,e,t),this._refreshFactorGradient(this._limitVelocityGradients,"_limitVelocityGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeLimitVelocityGradient=function(e){return this._removeGradientAndTexture(e,this._limitVelocityGradients,this._limitVelocityGradientsTexture),this._limitVelocityGradientsTexture=null,this},t.prototype.addDragGradient=function(e,t){return this._dragGradients||(this._dragGradients=[]),this._addFactorGradient(this._dragGradients,e,t),this._refreshFactorGradient(this._dragGradients,"_dragGradientsTexture",!0),this._releaseBuffers(),this},t.prototype.removeDragGradient=function(e){return this._removeGradientAndTexture(e,this._dragGradients,this._dragGradientsTexture),this._dragGradientsTexture=null,this},t.prototype.addEmitRateGradient=function(e,t,r){return this},t.prototype.removeEmitRateGradient=function(e){return this},t.prototype.addStartSizeGradient=function(e,t,r){return this},t.prototype.removeStartSizeGradient=function(e){return this},t.prototype.addColorRemapGradient=function(e,t,r){return this},t.prototype.removeColorRemapGradient=function(){return this},t.prototype.addAlphaRemapGradient=function(e,t,r){return this},t.prototype.removeAlphaRemapGradient=function(){return this},t.prototype.addRampGradient=function(e,t){return this},t.prototype.removeRampGradient=function(){return this},t.prototype.getRampGradients=function(){return null},Object.defineProperty(t.prototype,"useRampGradients",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.prototype.addLifeTimeGradient=function(e,t,r){return this},t.prototype.removeLifeTimeGradient=function(e){return this},t.prototype._reset=function(){this._releaseBuffers()},t.prototype._createUpdateVAO=function(e){var t={};t.position=e.createVertexBuffer("position",0,3);var r=3;this.particleEmitterType instanceof A.CustomParticleEmitter&&(t.initialPosition=e.createVertexBuffer("initialPosition",r,3),r+=3),t.age=e.createVertexBuffer("age",r,1),r+=1,t.life=e.createVertexBuffer("life",r,1),r+=1,t.seed=e.createVertexBuffer("seed",r,4),r+=4,t.size=e.createVertexBuffer("size",r,3),r+=3,this._colorGradientsTexture||(t.color=e.createVertexBuffer("color",r,4),r+=4),t.direction=e.createVertexBuffer("direction",r,3),r+=3,this._isBillboardBased||(t.initialDirection=e.createVertexBuffer("initialDirection",r,3),r+=3),this._angularSpeedGradientsTexture?(t.angle=e.createVertexBuffer("angle",r,1),r+=1):(t.angle=e.createVertexBuffer("angle",r,2),r+=2),this._isAnimationSheetEnabled&&(t.cellIndex=e.createVertexBuffer("cellIndex",r,1),r+=1,this.spriteRandomStartCell&&(t.cellStartOffset=e.createVertexBuffer("cellStartOffset",r,1),r+=1)),this.noiseTexture&&(t.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",r,3),r+=3,t.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",r,3),r+=3);var n=this._engine.recordVertexArrayObject(t,null,this._updateEffect);return this._engine.bindArrayBuffer(null),n},t.prototype._createRenderVAO=function(e,t){var r={};r.position=e.createVertexBuffer("position",0,3,this._attributesStrideSize,!0);var n=3;this.particleEmitterType instanceof A.CustomParticleEmitter&&(n+=3),r.age=e.createVertexBuffer("age",n,1,this._attributesStrideSize,!0),n+=1,r.life=e.createVertexBuffer("life",n,1,this._attributesStrideSize,!0),n+=5,r.size=e.createVertexBuffer("size",n,3,this._attributesStrideSize,!0),n+=3,this._colorGradientsTexture||(r.color=e.createVertexBuffer("color",n,4,this._attributesStrideSize,!0),n+=4),this.billboardMode===d.ParticleSystem.BILLBOARDMODE_STRETCHED&&(r.direction=e.createVertexBuffer("direction",n,3,this._attributesStrideSize,!0)),n+=3,this._isBillboardBased||(r.initialDirection=e.createVertexBuffer("initialDirection",n,3,this._attributesStrideSize,!0),n+=3),r.angle=e.createVertexBuffer("angle",n,1,this._attributesStrideSize,!0),this._angularSpeedGradientsTexture?n++:n+=2,this._isAnimationSheetEnabled&&(r.cellIndex=e.createVertexBuffer("cellIndex",n,1,this._attributesStrideSize,!0),n+=1,this.spriteRandomStartCell&&(r.cellStartOffset=e.createVertexBuffer("cellStartOffset",n,1,this._attributesStrideSize,!0),n+=1)),this.noiseTexture&&(r.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",n,3,this._attributesStrideSize,!0),n+=3,r.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",n,3,this._attributesStrideSize,!0),n+=3),r.offset=t.createVertexBuffer("offset",0,2),r.uv=t.createVertexBuffer("uv",2,2);var i=this._engine.recordVertexArrayObject(r,null,this._getEffect());return this._engine.bindArrayBuffer(null),i},t.prototype._initialize=function(e){if(void 0===e&&(e=!1),!this._buffer0||e){var t=this._scene.getEngine(),r=new Array;this._attributesStrideSize=21,this._targetIndex=0,this.particleEmitterType instanceof A.CustomParticleEmitter&&(this._attributesStrideSize+=3),this.isBillboardBased||(this._attributesStrideSize+=3),this._colorGradientsTexture&&(this._attributesStrideSize-=4),this._angularSpeedGradientsTexture&&(this._attributesStrideSize-=1),this._isAnimationSheetEnabled&&(this._attributesStrideSize+=1,this.spriteRandomStartCell&&(this._attributesStrideSize+=1)),this.noiseTexture&&(this._attributesStrideSize+=6);for(var n=this.particleEmitterType instanceof A.CustomParticleEmitter,i=s.TmpVectors.Vector3[0],o=0;o<this._capacity;o++)r.push(0),r.push(0),r.push(0),n&&(this.particleEmitterType.particlePositionGenerator(o,null,i),r.push(i.x),r.push(i.y),r.push(i.z)),r.push(0),r.push(0),r.push(Math.random()),r.push(Math.random()),r.push(Math.random()),r.push(Math.random()),r.push(0),r.push(0),r.push(0),this._colorGradientsTexture||(r.push(0),r.push(0),r.push(0),r.push(0)),n?(this.particleEmitterType.particleDestinationGenerator(o,null,i),r.push(i.x),r.push(i.y),r.push(i.z)):(r.push(0),r.push(0),r.push(0)),this.isBillboardBased||(r.push(0),r.push(0),r.push(0)),r.push(0),this._angularSpeedGradientsTexture||r.push(0),this._isAnimationSheetEnabled&&(r.push(0),this.spriteRandomStartCell&&r.push(0)),this.noiseTexture&&(r.push(Math.random()),r.push(Math.random()),r.push(Math.random()),r.push(Math.random()),r.push(Math.random()),r.push(Math.random()));var a=new Float32Array([.5,.5,1,1,-.5,.5,0,1,-.5,-.5,0,0,.5,-.5,1,0]);this._buffer0=new c.Buffer(t,r,!1,this._attributesStrideSize),this._buffer1=new c.Buffer(t,r,!1,this._attributesStrideSize),this._spriteBuffer=new c.Buffer(t,a,!1,4),this._updateVAO=[],this._updateVAO.push(this._createUpdateVAO(this._buffer0)),this._updateVAO.push(this._createUpdateVAO(this._buffer1)),this._renderVAO=[],this._renderVAO.push(this._createRenderVAO(this._buffer1,this._spriteBuffer)),this._renderVAO.push(this._createRenderVAO(this._buffer0,this._spriteBuffer)),this._sourceBuffer=this._buffer0,this._targetBuffer=this._buffer1}},t.prototype._recreateUpdateEffect=function(){var e=this.particleEmitterType?this.particleEmitterType.getEffectDefines():"";this._isBillboardBased&&(e+="\n#define BILLBOARD"),this._colorGradientsTexture&&(e+="\n#define COLORGRADIENTS"),this._sizeGradientsTexture&&(e+="\n#define SIZEGRADIENTS"),this._angularSpeedGradientsTexture&&(e+="\n#define ANGULARSPEEDGRADIENTS"),this._velocityGradientsTexture&&(e+="\n#define VELOCITYGRADIENTS"),this._limitVelocityGradientsTexture&&(e+="\n#define LIMITVELOCITYGRADIENTS"),this._dragGradientsTexture&&(e+="\n#define DRAGGRADIENTS"),this.isAnimationSheetEnabled&&(e+="\n#define ANIMATESHEET",this.spriteRandomStartCell&&(e+="\n#define ANIMATESHEETRANDOMSTART")),this.noiseTexture&&(e+="\n#define NOISE"),this.isLocal&&(e+="\n#define LOCAL"),this._updateEffect&&this._updateEffectOptions.defines===e||(this._updateEffectOptions.transformFeedbackVaryings=["outPosition"],this.particleEmitterType instanceof A.CustomParticleEmitter&&this._updateEffectOptions.transformFeedbackVaryings.push("outInitialPosition"),this._updateEffectOptions.transformFeedbackVaryings.push("outAge"),this._updateEffectOptions.transformFeedbackVaryings.push("outLife"),this._updateEffectOptions.transformFeedbackVaryings.push("outSeed"),this._updateEffectOptions.transformFeedbackVaryings.push("outSize"),this._colorGradientsTexture||this._updateEffectOptions.transformFeedbackVaryings.push("outColor"),this._updateEffectOptions.transformFeedbackVaryings.push("outDirection"),this._isBillboardBased||this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection"),this._updateEffectOptions.transformFeedbackVaryings.push("outAngle"),this.isAnimationSheetEnabled&&(this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex"),this.spriteRandomStartCell&&this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset")),this.noiseTexture&&(this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1"),this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2")),this._updateEffectOptions.defines=e,this._updateEffect=new f.Effect("gpuUpdateParticles",this._updateEffectOptions,this._scene.getEngine()))},t.prototype._getEffect=function(){var e;return null!==(e=this.getCustomEffect())&&void 0!==e?e:this._renderEffect},t.prototype.fillDefines=function(e,t){if(void 0===t&&(t=0),this._scene.clipPlane&&e.push("#define CLIPPLANE"),this._scene.clipPlane2&&e.push("#define CLIPPLANE2"),this._scene.clipPlane3&&e.push("#define CLIPPLANE3"),this._scene.clipPlane4&&e.push("#define CLIPPLANE4"),this._scene.clipPlane5&&e.push("#define CLIPPLANE5"),this._scene.clipPlane6&&e.push("#define CLIPPLANE6"),this.blendMode===d.ParticleSystem.BLENDMODE_MULTIPLY&&e.push("#define BLENDMULTIPLYMODE"),this.isLocal&&e.push("#define LOCAL"),this._isBillboardBased)switch(e.push("#define BILLBOARD"),this.billboardMode){case d.ParticleSystem.BILLBOARDMODE_Y:e.push("#define BILLBOARDY");break;case d.ParticleSystem.BILLBOARDMODE_STRETCHED:e.push("#define BILLBOARDSTRETCHED");break;case d.ParticleSystem.BILLBOARDMODE_ALL:e.push("#define BILLBOARDMODE_ALL")}this._colorGradientsTexture&&e.push("#define COLORGRADIENTS"),this.isAnimationSheetEnabled&&e.push("#define ANIMATESHEET"),this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e.push(""+this._imageProcessingConfigurationDefines.toString()))},t.prototype.fillUniformsAttributesAndSamplerNames=function(e,t,r){t.push("position","age","life","size","color","offset","uv","direction","initialDirection","angle","cellIndex"),e.push("emitterWM","worldOffset","view","projection","colorDead","invView","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","sheetInfos","translationPivot","eyePosition"),r.push("diffuseSampler","colorGradientSampler"),this._imageProcessingConfiguration&&(g.ImageProcessingConfiguration.PrepareUniforms(e,this._imageProcessingConfigurationDefines),g.ImageProcessingConfiguration.PrepareSamplers(r,this._imageProcessingConfigurationDefines))},t.prototype._recreateRenderEffect=function(){var e=this.getCustomEffect();if(e)return e;var t=[];this.fillDefines(t);var r=t.join("\n");if(this._renderEffect&&this._renderEffect.defines===r)return this._renderEffect;var n=[],i=[],o=[];return this.fillUniformsAttributesAndSamplerNames(i,n,o),this._renderEffect=new f.Effect("gpuRenderParticles",n,i,o,this._scene.getEngine(),r),this._renderEffect},t.prototype.animate=function(e){void 0===e&&(e=!1),this._timeDelta=this.updateSpeed*(e?this.preWarmStepOffset:this._scene.getAnimationRatio()),this._actualFrame+=this._timeDelta,this._stopped||this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()},t.prototype._createFactorGradientTexture=function(e,t){var r=this[t];if(e&&e.length&&!r){for(var n=new Float32Array(this._rawTextureWidth),o=0;o<this._rawTextureWidth;o++){var s=o/this._rawTextureWidth;i.GradientHelper.GetCurrentGradient(s,e,(function(e,t,r){n[o]=l.Scalar.Lerp(e.factor1,t.factor1,r)}))}this[t]=v.RawTexture.CreateRTexture(n,this._rawTextureWidth,1,this._scene,!1,!1,_.Texture.NEAREST_SAMPLINGMODE)}},t.prototype._createSizeGradientTexture=function(){this._createFactorGradientTexture(this._sizeGradients,"_sizeGradientsTexture")},t.prototype._createAngularSpeedGradientTexture=function(){this._createFactorGradientTexture(this._angularSpeedGradients,"_angularSpeedGradientsTexture")},t.prototype._createVelocityGradientTexture=function(){this._createFactorGradientTexture(this._velocityGradients,"_velocityGradientsTexture")},t.prototype._createLimitVelocityGradientTexture=function(){this._createFactorGradientTexture(this._limitVelocityGradients,"_limitVelocityGradientsTexture")},t.prototype._createDragGradientTexture=function(){this._createFactorGradientTexture(this._dragGradients,"_dragGradientsTexture")},t.prototype._createColorGradientTexture=function(){if(this._colorGradients&&this._colorGradients.length&&!this._colorGradientsTexture){for(var e=new Uint8Array(4*this._rawTextureWidth),t=a.TmpColors.Color4[0],r=0;r<this._rawTextureWidth;r++){var n=r/this._rawTextureWidth;i.GradientHelper.GetCurrentGradient(n,this._colorGradients,(function(n,i,o){a.Color4.LerpToRef(n.color1,i.color1,o,t),e[4*r]=255*t.r,e[4*r+1]=255*t.g,e[4*r+2]=255*t.b,e[4*r+3]=255*t.a}))}this._colorGradientsTexture=v.RawTexture.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,_.Texture.NEAREST_SAMPLINGMODE)}},t.prototype.render=function(e){if(void 0===e&&(e=!1),!this._started)return 0;if(this._createColorGradientTexture(),this._createSizeGradientTexture(),this._createAngularSpeedGradientTexture(),this._createVelocityGradientTexture(),this._createLimitVelocityGradientTexture(),this._createDragGradientTexture(),this._recreateUpdateEffect(),this._recreateRenderEffect(),!this.isReady())return 0;if(!e){if(!this._preWarmDone&&this.preWarmCycles){for(var t=0;t<this.preWarmCycles;t++)this.animate(!0),this.render(!0);this._preWarmDone=!0}if(this._currentRenderId===this._scene.getFrameId())return 0;this._currentRenderId=this._scene.getFrameId()}if(this._initialize(),this._accumulatedCount+=this.emitRate*this._timeDelta,this._accumulatedCount>1){var r=0|this._accumulatedCount;this._accumulatedCount-=r,this._currentActiveCount=Math.min(this._activeCount,this._currentActiveCount+r)}if(!this._currentActiveCount)return 0;var n;if(this._engine.enableEffect(this._updateEffect),this._engine.setState(!1),this._updateEffect.setFloat("currentCount",this._currentActiveCount),this._updateEffect.setFloat("timeDelta",this._timeDelta),this._updateEffect.setFloat("stopFactor",this._stopped?0:1),this._updateEffect.setTexture("randomSampler",this._randomTexture),this._updateEffect.setTexture("randomSampler2",this._randomTexture2),this._updateEffect.setFloat2("lifeTime",this.minLifeTime,this.maxLifeTime),this._updateEffect.setFloat2("emitPower",this.minEmitPower,this.maxEmitPower),this._colorGradientsTexture||(this._updateEffect.setDirectColor4("color1",this.color1),this._updateEffect.setDirectColor4("color2",this.color2)),this._updateEffect.setFloat2("sizeRange",this.minSize,this.maxSize),this._updateEffect.setFloat4("scaleRange",this.minScaleX,this.maxScaleX,this.minScaleY,this.maxScaleY),this._updateEffect.setFloat4("angleRange",this.minAngularSpeed,this.maxAngularSpeed,this.minInitialRotation,this.maxInitialRotation),this._updateEffect.setVector3("gravity",this.gravity),this._sizeGradientsTexture&&this._updateEffect.setTexture("sizeGradientSampler",this._sizeGradientsTexture),this._angularSpeedGradientsTexture&&this._updateEffect.setTexture("angularSpeedGradientSampler",this._angularSpeedGradientsTexture),this._velocityGradientsTexture&&this._updateEffect.setTexture("velocityGradientSampler",this._velocityGradientsTexture),this._limitVelocityGradientsTexture&&(this._updateEffect.setTexture("limitVelocityGradientSampler",this._limitVelocityGradientsTexture),this._updateEffect.setFloat("limitVelocityDamping",this.limitVelocityDamping)),this._dragGradientsTexture&&this._updateEffect.setTexture("dragGradientSampler",this._dragGradientsTexture),this.particleEmitterType&&this.particleEmitterType.applyToShader(this._updateEffect),this._isAnimationSheetEnabled&&this._updateEffect.setFloat3("cellInfos",this.startSpriteCellID,this.endSpriteCellID,this.spriteCellChangeSpeed),this.noiseTexture&&(this._updateEffect.setTexture("noiseSampler",this.noiseTexture),this._updateEffect.setVector3("noiseStrength",this.noiseStrength)),this.emitter.position)n=this.emitter.getWorldMatrix();else{var i=this.emitter;n=s.Matrix.Translation(i.x,i.y,i.z)}if(this.isLocal||this._updateEffect.setMatrix("emitterWM",n),this._engine.bindVertexArrayObject(this._updateVAO[this._targetIndex],null),this._engine.bindTransformFeedbackBuffer(this._targetBuffer.getBuffer()),this._engine.setRasterizerState(!1),this._engine.beginTransformFeedback(!0),this._engine.drawArraysType(p.Material.PointListDrawMode,0,this._currentActiveCount),this._engine.endTransformFeedback(),this._engine.setRasterizerState(!0),this._engine.bindTransformFeedbackBuffer(null),!e){var o=this._getEffect();this._engine.enableEffect(o);var a=this._scene.getViewMatrix();if(o.setMatrix("view",a),o.setMatrix("projection",this._scene.getProjectionMatrix()),o.setTexture("diffuseSampler",this.particleTexture),o.setVector2("translationPivot",this.translationPivot),o.setVector3("worldOffset",this.worldOffset),this.isLocal&&o.setMatrix("emitterWM",n),this._colorGradientsTexture?o.setTexture("colorGradientSampler",this._colorGradientsTexture):o.setDirectColor4("colorDead",this.colorDead),this._isAnimationSheetEnabled&&this.particleTexture){var l=this.particleTexture.getBaseSize();o.setFloat3("sheetInfos",this.spriteCellWidth/l.width,this.spriteCellHeight/l.height,l.width/this.spriteCellWidth)}if(this._isBillboardBased){var c=this._scene.activeCamera;o.setVector3("eyePosition",c.globalPosition)}var u=o.defines;if((this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4||this._scene.clipPlane5||this._scene.clipPlane6)&&m.MaterialHelper.BindClipPlane(o,this._scene),u.indexOf("#define BILLBOARDMODE_ALL")>=0){var h=a.clone();h.invert(),o.setMatrix("invView",h)}switch(this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(o),this.blendMode){case d.ParticleSystem.BLENDMODE_ADD:this._engine.setAlphaMode(y.Constants.ALPHA_ADD);break;case d.ParticleSystem.BLENDMODE_ONEONE:this._engine.setAlphaMode(y.Constants.ALPHA_ONEONE);break;case d.ParticleSystem.BLENDMODE_STANDARD:this._engine.setAlphaMode(y.Constants.ALPHA_COMBINE);break;case d.ParticleSystem.BLENDMODE_MULTIPLY:this._engine.setAlphaMode(y.Constants.ALPHA_MULTIPLY)}this.forceDepthWrite&&this._engine.setDepthWrite(!0),this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex],null),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.notifyObservers(o),this._engine.drawArraysType(p.Material.TriangleFanDrawMode,0,4,this._currentActiveCount),this._engine.setAlphaMode(y.Constants.ALPHA_DISABLE)}this._targetIndex++,2===this._targetIndex&&(this._targetIndex=0);var f=this._sourceBuffer;return this._sourceBuffer=this._targetBuffer,this._targetBuffer=f,this._currentActiveCount},t.prototype.rebuild=function(){this._initialize(!0)},t.prototype._releaseBuffers=function(){this._buffer0&&(this._buffer0.dispose(),this._buffer0=null),this._buffer1&&(this._buffer1.dispose(),this._buffer1=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null)},t.prototype._releaseVAOs=function(){if(this._updateVAO){for(var e=0;e<this._updateVAO.length;e++)this._engine.releaseVertexArrayObject(this._updateVAO[e]);for(this._updateVAO=[],e=0;e<this._renderVAO.length;e++)this._engine.releaseVertexArrayObject(this._renderVAO[e]);this._renderVAO=[]}},t.prototype.dispose=function(e){void 0===e&&(e=!0);var t=this._scene.particleSystems.indexOf(this);t>-1&&this._scene.particleSystems.splice(t,1),this._releaseBuffers(),this._releaseVAOs(),this._colorGradientsTexture&&(this._colorGradientsTexture.dispose(),this._colorGradientsTexture=null),this._sizeGradientsTexture&&(this._sizeGradientsTexture.dispose(),this._sizeGradientsTexture=null),this._angularSpeedGradientsTexture&&(this._angularSpeedGradientsTexture.dispose(),this._angularSpeedGradientsTexture=null),this._velocityGradientsTexture&&(this._velocityGradientsTexture.dispose(),this._velocityGradientsTexture=null),this._limitVelocityGradientsTexture&&(this._limitVelocityGradientsTexture.dispose(),this._limitVelocityGradientsTexture=null),this._dragGradientsTexture&&(this._dragGradientsTexture.dispose(),this._dragGradientsTexture=null),this._randomTexture&&(this._randomTexture.dispose(),this._randomTexture=null),this._randomTexture2&&(this._randomTexture2.dispose(),this._randomTexture2=null),e&&this.particleTexture&&(this.particleTexture.dispose(),this.particleTexture=null),e&&this.noiseTexture&&(this.noiseTexture.dispose(),this.noiseTexture=null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},t.prototype.clone=function(e,r){var i=this.serialize(),o=t.Parse(i,this._scene,""),s=Object(n.__assign)({},this._customEffect);return o.name=e,o._customEffect=s,void 0===r&&(r=this.emitter),o.emitter=r,o.noiseTexture=this.noiseTexture,o},t.prototype.serialize=function(e){void 0===e&&(e=!1);var t={};return d.ParticleSystem._Serialize(t,this,e),t.activeParticleCount=this.activeParticleCount,t.randomTextureSize=this._randomTextureSize,t},t.Parse=function(e,r,n,i){void 0===i&&(i=!1);var o=new t(e.name,{capacity:e.capacity,randomTextureSize:e.randomTextureSize},r);return e.activeParticleCount&&(o.activeParticleCount=e.activeParticleCount),d.ParticleSystem._Parse(e,o,r,n),e.preventAutoStart&&(o.preventAutoStart=e.preventAutoStart),i||o.preventAutoStart||o.start(),o},t}(u.BaseParticleSystem))},"./Particles/index.ts":
- /*!****************************!*\
- !*** ./Particles/index.ts ***!
- \****************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./baseParticleSystem */"./Particles/baseParticleSystem.ts");r.d(t,"BaseParticleSystem",(function(){return n.BaseParticleSystem}));var i=r(/*! ./EmitterTypes/index */"./Particles/EmitterTypes/index.ts");for(var o in i)["BaseParticleSystem","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(o);var s=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts");r.d(t,"GPUParticleSystem",(function(){return s.GPUParticleSystem}));var a=r(/*! ./IParticleSystem */"./Particles/IParticleSystem.ts");for(var o in a)["BaseParticleSystem","GPUParticleSystem","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return a[e]}))}(o);var l=r(/*! ./particle */"./Particles/particle.ts");r.d(t,"Particle",(function(){return l.Particle}));var c=r(/*! ./particleHelper */"./Particles/particleHelper.ts");r.d(t,"ParticleHelper",(function(){return c.ParticleHelper}));var u=r(/*! ./particleSystem */"./Particles/particleSystem.ts");r.d(t,"ParticleSystem",(function(){return u.ParticleSystem})),r(/*! ./particleSystemComponent */"./Particles/particleSystemComponent.ts");var d=r(/*! ./particleSystemSet */"./Particles/particleSystemSet.ts");r.d(t,"ParticleSystemSet",(function(){return d.ParticleSystemSet}));var h=r(/*! ./solidParticle */"./Particles/solidParticle.ts");r.d(t,"SolidParticle",(function(){return h.SolidParticle})),r.d(t,"ModelShape",(function(){return h.ModelShape})),r.d(t,"DepthSortedParticle",(function(){return h.DepthSortedParticle})),r.d(t,"SolidParticleVertex",(function(){return h.SolidParticleVertex}));var f=r(/*! ./solidParticleSystem */"./Particles/solidParticleSystem.ts");r.d(t,"SolidParticleSystem",(function(){return f.SolidParticleSystem}));var p=r(/*! ./cloudPoint */"./Particles/cloudPoint.ts");r.d(t,"CloudPoint",(function(){return p.CloudPoint})),r.d(t,"PointsGroup",(function(){return p.PointsGroup}));var m=r(/*! ./pointsCloudSystem */"./Particles/pointsCloudSystem.ts");r.d(t,"PointColor",(function(){return m.PointColor})),r.d(t,"PointsCloudSystem",(function(){return m.PointsCloudSystem}));var g=r(/*! ./subEmitter */"./Particles/subEmitter.ts");r.d(t,"SubEmitterType",(function(){return g.SubEmitterType})),r.d(t,"SubEmitter",(function(){return g.SubEmitter}))},"./Particles/particle.ts":
- /*!*******************************!*\
- !*** ./Particles/particle.ts ***!
- \*******************************/
- /*! exports provided: Particle */function(e,t,r){"use strict";r.r(t),r.d(t,"Particle",(function(){return s}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(t){this.particleSystem=t,this.position=n.Vector3.Zero(),this.direction=n.Vector3.Zero(),this.color=new i.Color4(0,0,0,0),this.colorStep=new i.Color4(0,0,0,0),this.lifeTime=1,this.age=0,this.size=0,this.scale=new n.Vector2(1,1),this.angle=0,this.angularSpeed=0,this.cellIndex=0,this._attachedSubEmitters=null,this._currentColor1=new i.Color4(0,0,0,0),this._currentColor2=new i.Color4(0,0,0,0),this._currentSize1=0,this._currentSize2=0,this._currentAngularSpeed1=0,this._currentAngularSpeed2=0,this._currentVelocity1=0,this._currentVelocity2=0,this._currentLimitVelocity1=0,this._currentLimitVelocity2=0,this._currentDrag1=0,this._currentDrag2=0,this.id=e._Count++,this.particleSystem.isAnimationSheetEnabled&&this.updateCellInfoFromSystem()}return e.prototype.updateCellInfoFromSystem=function(){this.cellIndex=this.particleSystem.startSpriteCellID},e.prototype.updateCellIndex=function(){var e=this.age,t=this.particleSystem.spriteCellChangeSpeed;this.particleSystem.spriteRandomStartCell&&(void 0===this._randomCellOffset&&(this._randomCellOffset=Math.random()*this.lifeTime),0===t?(t=1,e=this._randomCellOffset):e+=this._randomCellOffset);var r=this._initialEndSpriteCellID-this._initialStartSpriteCellID,n=o.Scalar.Clamp(e*t%this.lifeTime/this.lifeTime);this.cellIndex=this._initialStartSpriteCellID+n*r|0},e.prototype._inheritParticleInfoToSubEmitter=function(e){if(e.particleSystem.emitter.position){var t=e.particleSystem.emitter;if(t.position.copyFrom(this.position),e.inheritDirection){var r=n.TmpVectors.Vector3[0];this.direction.normalizeToRef(r),t.setDirection(r,0,Math.PI/2)}}else e.particleSystem.emitter.copyFrom(this.position);this.direction.scaleToRef(e.inheritedVelocityAmount/2,n.TmpVectors.Vector3[0]),e.particleSystem._inheritedVelocityOffset.copyFrom(n.TmpVectors.Vector3[0])},e.prototype._inheritParticleInfoToSubEmitters=function(){var e=this;this._attachedSubEmitters&&this._attachedSubEmitters.length>0&&this._attachedSubEmitters.forEach((function(t){e._inheritParticleInfoToSubEmitter(t)}))},e.prototype._reset=function(){this.age=0,this.id=e._Count++,this._currentColorGradient=null,this._currentSizeGradient=null,this._currentAngularSpeedGradient=null,this._currentVelocityGradient=null,this._currentLimitVelocityGradient=null,this._currentDragGradient=null,this.cellIndex=this.particleSystem.startSpriteCellID,this._randomCellOffset=void 0},e.prototype.copyTo=function(e){e.position.copyFrom(this.position),this._initialDirection?e._initialDirection?e._initialDirection.copyFrom(this._initialDirection):e._initialDirection=this._initialDirection.clone():e._initialDirection=null,e.direction.copyFrom(this.direction),this._localPosition&&(e._localPosition?e._localPosition.copyFrom(this._localPosition):e._localPosition=this._localPosition.clone()),e.color.copyFrom(this.color),e.colorStep.copyFrom(this.colorStep),e.lifeTime=this.lifeTime,e.age=this.age,e._randomCellOffset=this._randomCellOffset,e.size=this.size,e.scale.copyFrom(this.scale),e.angle=this.angle,e.angularSpeed=this.angularSpeed,e.particleSystem=this.particleSystem,e.cellIndex=this.cellIndex,e.id=this.id,e._attachedSubEmitters=this._attachedSubEmitters,this._currentColorGradient&&(e._currentColorGradient=this._currentColorGradient,e._currentColor1.copyFrom(this._currentColor1),e._currentColor2.copyFrom(this._currentColor2)),this._currentSizeGradient&&(e._currentSizeGradient=this._currentSizeGradient,e._currentSize1=this._currentSize1,e._currentSize2=this._currentSize2),this._currentAngularSpeedGradient&&(e._currentAngularSpeedGradient=this._currentAngularSpeedGradient,e._currentAngularSpeed1=this._currentAngularSpeed1,e._currentAngularSpeed2=this._currentAngularSpeed2),this._currentVelocityGradient&&(e._currentVelocityGradient=this._currentVelocityGradient,e._currentVelocity1=this._currentVelocity1,e._currentVelocity2=this._currentVelocity2),this._currentLimitVelocityGradient&&(e._currentLimitVelocityGradient=this._currentLimitVelocityGradient,e._currentLimitVelocity1=this._currentLimitVelocity1,e._currentLimitVelocity2=this._currentLimitVelocity2),this._currentDragGradient&&(e._currentDragGradient=this._currentDragGradient,e._currentDrag1=this._currentDrag1,e._currentDrag2=this._currentDrag2),this.particleSystem.isAnimationSheetEnabled&&(e._initialStartSpriteCellID=this._initialStartSpriteCellID,e._initialEndSpriteCellID=this._initialEndSpriteCellID),this.particleSystem.useRampGradients&&(e.remapData&&this.remapData?e.remapData.copyFrom(this.remapData):e.remapData=new n.Vector4(0,0,0,0)),this._randomNoiseCoordinates1&&(e._randomNoiseCoordinates1?(e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1),e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)):(e._randomNoiseCoordinates1=this._randomNoiseCoordinates1.clone(),e._randomNoiseCoordinates2=this._randomNoiseCoordinates2.clone()))},e._Count=0,e}()},"./Particles/particleHelper.ts":
- /*!*************************************!*\
- !*** ./Particles/particleHelper.ts ***!
- \*************************************/
- /*! exports provided: ParticleHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleHelper",(function(){return d}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts"),l=r(/*! ./particleSystemSet */"./Particles/particleSystemSet.ts"),c=r(/*! ./particleSystem */"./Particles/particleSystem.ts"),u=r(/*! ../Misc/webRequest */"./Misc/webRequest.ts"),d=function(){function e(){}return e.CreateDefault=function(e,t,r,n){var s;return void 0===t&&(t=500),void 0===n&&(n=!1),(s=n?new a.GPUParticleSystem("default system",{capacity:t},r):new c.ParticleSystem("default system",t,r)).emitter=e,s.particleTexture=new o.Texture("https://www.babylonjs.com/assets/Flare.png",s.getScene()),s.createConeEmitter(.1,Math.PI/4),s.color1=new i.Color4(1,1,1,1),s.color2=new i.Color4(1,1,1,1),s.colorDead=new i.Color4(1,1,1,0),s.minSize=.1,s.maxSize=.1,s.minEmitPower=2,s.maxEmitPower=2,s.updateSpeed=1/60,s.emitRate=30,s},e.CreateAsync=function(t,r,i){void 0===i&&(i=!1),r||(r=s.EngineStore.LastCreatedScene);var o={};return r._addPendingData(o),new Promise((function(s,c){if(i&&!a.GPUParticleSystem.IsSupported)return r._removePendingData(o),c("Particle system with GPU is not supported.");n.Tools.LoadFile(e.BaseAssetsUrl+"/systems/"+t+".json",(function(e){r._removePendingData(o);var t=JSON.parse(e.toString());return s(l.ParticleSystemSet.Parse(t,r,i))}),void 0,void 0,void 0,(function(){return r._removePendingData(o),c("An error occured while the creation of your particle system. Check if your type '"+t+"' exists.")}))}))},e.ExportSet=function(e){for(var t=new l.ParticleSystemSet,r=0,n=e;r<n.length;r++){var i=n[r];t.systems.push(i)}return t},e.ParseFromFileAsync=function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=""),new Promise((function(o,s){var l=new u.WebRequest;l.addEventListener("readystatechange",(function(){if(4==l.readyState)if(200==l.status){var t=JSON.parse(l.responseText),u=void 0;u=n?a.GPUParticleSystem.Parse(t,r,i):c.ParticleSystem.Parse(t,r,i),e&&(u.name=e),o(u)}else s("Unable to load the particle system")})),l.open("GET",t),l.send()}))},e.CreateFromSnippetAsync=function(e,t,r,n){var i=this;return void 0===r&&(r=!1),void 0===n&&(n=""),"_BLANK"===e?Promise.resolve(this.CreateDefault(null)):new Promise((function(o,s){var l=new u.WebRequest;l.addEventListener("readystatechange",(function(){if(4==l.readyState)if(200==l.status){var i=JSON.parse(JSON.parse(l.responseText).jsonPayload),u=JSON.parse(i.particleSystem),d=void 0;(d=r?a.GPUParticleSystem.Parse(u,t,n):c.ParticleSystem.Parse(u,t,n)).snippetId=e,o(d)}else s("Unable to load the snippet "+e)})),l.open("GET",i.SnippetUrl+"/"+e.replace(/#/g,"/")),l.send()}))},e.BaseAssetsUrl=l.ParticleSystemSet.BaseAssetsUrl,e.SnippetUrl="https://snippet.babylonjs.com",e}()},"./Particles/particleSystem.ts":
- /*!*************************************!*\
- !*** ./Particles/particleSystem.ts ***!
- \*************************************/
- /*! exports provided: ParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleSystem",(function(){return S}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/gradients */"./Misc/gradients.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),l=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),d=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),h=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),f=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),p=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),m=r(/*! ../Materials/Textures/Procedurals/proceduralTexture */"./Materials/Textures/Procedurals/proceduralTexture.ts"),g=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),_=r(/*! ../Particles/EmitterTypes/index */"./Particles/EmitterTypes/index.ts"),v=r(/*! ./baseParticleSystem */"./Particles/baseParticleSystem.ts"),y=r(/*! ./particle */"./Particles/particle.ts"),b=r(/*! ./subEmitter */"./Particles/subEmitter.ts"),A=r(/*! ../Engines/constants */"./Engines/constants.ts"),T=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),M=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),P=(r(/*! ../Shaders/particles.fragment */"./Shaders/particles.fragment.ts"),r(/*! ../Shaders/particles.vertex */"./Shaders/particles.vertex.ts"),r(/*! ../Maths/math.color */"./Maths/math.color.ts")),S=function(e){function t(t,r,n,l,c,u){void 0===l&&(l=null),void 0===c&&(c=!1),void 0===u&&(u=.01);var d=e.call(this,t)||this;return d._inheritedVelocityOffset=new s.Vector3,d.onDisposeObservable=new o.Observable,d._particles=new Array,d._stockParticles=new Array,d._newPartsExcess=0,d._vertexBuffers={},d._scaledColorStep=new P.Color4(0,0,0,0),d._colorDiff=new P.Color4(0,0,0,0),d._scaledDirection=s.Vector3.Zero(),d._scaledGravity=s.Vector3.Zero(),d._currentRenderId=-1,d._useInstancing=!1,d._started=!1,d._stopped=!1,d._actualFrame=0,d._currentEmitRate1=0,d._currentEmitRate2=0,d._currentStartSize1=0,d._currentStartSize2=0,d._rawTextureWidth=256,d._useRampGradients=!1,d._disposeEmitterOnDispose=!1,d.isLocal=!1,d._onBeforeDrawParticlesObservable=null,d.recycleParticle=function(e){var t=d._particles.pop();t!==e&&t.copyTo(e),d._stockParticles.push(t)},d._createParticle=function(){var e;if(0!==d._stockParticles.length?(e=d._stockParticles.pop())._reset():e=new y.Particle(d),d._subEmitters&&d._subEmitters.length>0){var t=d._subEmitters[Math.floor(Math.random()*d._subEmitters.length)];e._attachedSubEmitters=[],t.forEach((function(t){if(t.type===b.SubEmitterType.ATTACHED){var r=t.clone();e._attachedSubEmitters.push(r),r.particleSystem.start()}}))}return e},d._emitFromParticle=function(e){if(d._subEmitters&&0!==d._subEmitters.length){var t=Math.floor(Math.random()*d._subEmitters.length);d._subEmitters[t].forEach((function(t){if(t.type===b.SubEmitterType.END){var r=t.clone();e._inheritParticleInfoToSubEmitter(r),r.particleSystem._rootParticleSystem=d,d.activeSubSystems.push(r.particleSystem),r.particleSystem.start()}}))}},d._capacity=r,d._epsilon=u,d._isAnimationSheetEnabled=c,d._scene=n||g.EngineStore.LastCreatedScene,d.uniqueId=d._scene.getUniqueId(),d._attachImageProcessingConfiguration(null),d._customEffect={0:l},d._scene.particleSystems.push(d),d._useInstancing=d._scene.getEngine().getCaps().instancedArrays,d._createIndexBuffer(),d._createVertexBuffers(),d.particleEmitterType=new _.BoxParticleEmitter,d.updateFunction=function(e){var t=null,r=null;d.noiseTexture&&(t=d.noiseTexture.getSize(),r=d.noiseTexture.getContent());for(var n,o=function(){n=e[l];var o=d._scaledUpdateSpeed,c=n.age;if(n.age+=o,n.age>n.lifeTime){var u=n.age-c;o=(n.lifeTime-c)*o/u,n.age=n.lifeTime}var h=n.age/n.lifeTime;d._colorGradients&&d._colorGradients.length>0?i.GradientHelper.GetCurrentGradient(h,d._colorGradients,(function(e,t,r){e!==n._currentColorGradient&&(n._currentColor1.copyFrom(n._currentColor2),t.getColorToRef(n._currentColor2),n._currentColorGradient=e),P.Color4.LerpToRef(n._currentColor1,n._currentColor2,r,n.color)})):(n.colorStep.scaleToRef(o,d._scaledColorStep),n.color.addInPlace(d._scaledColorStep),n.color.a<0&&(n.color.a=0)),d._angularSpeedGradients&&d._angularSpeedGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._angularSpeedGradients,(function(e,t,r){e!==n._currentAngularSpeedGradient&&(n._currentAngularSpeed1=n._currentAngularSpeed2,n._currentAngularSpeed2=t.getFactor(),n._currentAngularSpeedGradient=e),n.angularSpeed=a.Scalar.Lerp(n._currentAngularSpeed1,n._currentAngularSpeed2,r)})),n.angle+=n.angularSpeed*o;var f=o;if(d._velocityGradients&&d._velocityGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._velocityGradients,(function(e,t,r){e!==n._currentVelocityGradient&&(n._currentVelocity1=n._currentVelocity2,n._currentVelocity2=t.getFactor(),n._currentVelocityGradient=e),f*=a.Scalar.Lerp(n._currentVelocity1,n._currentVelocity2,r)})),n.direction.scaleToRef(f,d._scaledDirection),d._limitVelocityGradients&&d._limitVelocityGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._limitVelocityGradients,(function(e,t,r){e!==n._currentLimitVelocityGradient&&(n._currentLimitVelocity1=n._currentLimitVelocity2,n._currentLimitVelocity2=t.getFactor(),n._currentLimitVelocityGradient=e);var i=a.Scalar.Lerp(n._currentLimitVelocity1,n._currentLimitVelocity2,r);n.direction.length()>i&&n.direction.scaleInPlace(d.limitVelocityDamping)})),d._dragGradients&&d._dragGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._dragGradients,(function(e,t,r){e!==n._currentDragGradient&&(n._currentDrag1=n._currentDrag2,n._currentDrag2=t.getFactor(),n._currentDragGradient=e);var i=a.Scalar.Lerp(n._currentDrag1,n._currentDrag2,r);d._scaledDirection.scaleInPlace(1-i)})),d.isLocal&&n._localPosition?(n._localPosition.addInPlace(d._scaledDirection),s.Vector3.TransformCoordinatesToRef(n._localPosition,d._emitterWorldMatrix,n.position)):n.position.addInPlace(d._scaledDirection),r&&t&&n._randomNoiseCoordinates1){var p=d._fetchR(n._randomNoiseCoordinates1.x,n._randomNoiseCoordinates1.y,t.width,t.height,r),m=d._fetchR(n._randomNoiseCoordinates1.z,n._randomNoiseCoordinates2.x,t.width,t.height,r),g=d._fetchR(n._randomNoiseCoordinates2.y,n._randomNoiseCoordinates2.z,t.width,t.height,r),_=s.TmpVectors.Vector3[0],v=s.TmpVectors.Vector3[1];_.copyFromFloats((2*p-1)*d.noiseStrength.x,(2*m-1)*d.noiseStrength.y,(2*g-1)*d.noiseStrength.z),_.scaleToRef(o,v),n.direction.addInPlace(v)}if(d.gravity.scaleToRef(o,d._scaledGravity),n.direction.addInPlace(d._scaledGravity),d._sizeGradients&&d._sizeGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._sizeGradients,(function(e,t,r){e!==n._currentSizeGradient&&(n._currentSize1=n._currentSize2,n._currentSize2=t.getFactor(),n._currentSizeGradient=e),n.size=a.Scalar.Lerp(n._currentSize1,n._currentSize2,r)})),d._useRampGradients&&(d._colorRemapGradients&&d._colorRemapGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._colorRemapGradients,(function(e,t,r){var i=a.Scalar.Lerp(e.factor1,t.factor1,r),o=a.Scalar.Lerp(e.factor2,t.factor2,r);n.remapData.x=i,n.remapData.y=o-i})),d._alphaRemapGradients&&d._alphaRemapGradients.length>0&&i.GradientHelper.GetCurrentGradient(h,d._alphaRemapGradients,(function(e,t,r){var i=a.Scalar.Lerp(e.factor1,t.factor1,r),o=a.Scalar.Lerp(e.factor2,t.factor2,r);n.remapData.z=i,n.remapData.w=o-i}))),d._isAnimationSheetEnabled&&n.updateCellIndex(),n._inheritParticleInfoToSubEmitters(),n.age>=n.lifeTime)return d._emitFromParticle(n),n._attachedSubEmitters&&(n._attachedSubEmitters.forEach((function(e){e.particleSystem.disposeOnStop=!0,e.particleSystem.stop()})),n._attachedSubEmitters=null),d.recycleParticle(n),l--,"continue"},l=0;l<e.length;l++)o()},d}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useRampGradients",{get:function(){return this._useRampGradients},set:function(e){this._useRampGradients!==e&&(this._useRampGradients=e,this._resetEffect())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"particles",{get:function(){return this._particles},enumerable:!1,configurable:!0}),t.prototype.getActiveCount=function(){return this._particles.length},t.prototype.getClassName=function(){return"ParticleSystem"},t.prototype.isStopping=function(){return this._stopped&&this.isAlive()},t.prototype.getCustomEffect=function(e){var t;return void 0===e&&(e=0),null!==(t=this._customEffect[e])&&void 0!==t?t:this._customEffect[0]},t.prototype.setCustomEffect=function(e,t){void 0===t&&(t=0),this._customEffect[t]=e},Object.defineProperty(t.prototype,"onBeforeDrawParticlesObservable",{get:function(){return this._onBeforeDrawParticlesObservable||(this._onBeforeDrawParticlesObservable=new o.Observable),this._onBeforeDrawParticlesObservable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexShaderName",{get:function(){return"particles"},enumerable:!1,configurable:!0}),t.prototype._addFactorGradient=function(e,t,r,n){var o=new i.FactorGradient(t,r,n);e.push(o),e.sort((function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0}))},t.prototype._removeFactorGradient=function(e,t){if(e)for(var r=0,n=0,i=e;n<i.length;n++){if(i[n].gradient===t){e.splice(r,1);break}r++}},t.prototype.addLifeTimeGradient=function(e,t,r){return this._lifeTimeGradients||(this._lifeTimeGradients=[]),this._addFactorGradient(this._lifeTimeGradients,e,t,r),this},t.prototype.removeLifeTimeGradient=function(e){return this._removeFactorGradient(this._lifeTimeGradients,e),this},t.prototype.addSizeGradient=function(e,t,r){return this._sizeGradients||(this._sizeGradients=[]),this._addFactorGradient(this._sizeGradients,e,t,r),this},t.prototype.removeSizeGradient=function(e){return this._removeFactorGradient(this._sizeGradients,e),this},t.prototype.addColorRemapGradient=function(e,t,r){return this._colorRemapGradients||(this._colorRemapGradients=[]),this._addFactorGradient(this._colorRemapGradients,e,t,r),this},t.prototype.removeColorRemapGradient=function(e){return this._removeFactorGradient(this._colorRemapGradients,e),this},t.prototype.addAlphaRemapGradient=function(e,t,r){return this._alphaRemapGradients||(this._alphaRemapGradients=[]),this._addFactorGradient(this._alphaRemapGradients,e,t,r),this},t.prototype.removeAlphaRemapGradient=function(e){return this._removeFactorGradient(this._alphaRemapGradients,e),this},t.prototype.addAngularSpeedGradient=function(e,t,r){return this._angularSpeedGradients||(this._angularSpeedGradients=[]),this._addFactorGradient(this._angularSpeedGradients,e,t,r),this},t.prototype.removeAngularSpeedGradient=function(e){return this._removeFactorGradient(this._angularSpeedGradients,e),this},t.prototype.addVelocityGradient=function(e,t,r){return this._velocityGradients||(this._velocityGradients=[]),this._addFactorGradient(this._velocityGradients,e,t,r),this},t.prototype.removeVelocityGradient=function(e){return this._removeFactorGradient(this._velocityGradients,e),this},t.prototype.addLimitVelocityGradient=function(e,t,r){return this._limitVelocityGradients||(this._limitVelocityGradients=[]),this._addFactorGradient(this._limitVelocityGradients,e,t,r),this},t.prototype.removeLimitVelocityGradient=function(e){return this._removeFactorGradient(this._limitVelocityGradients,e),this},t.prototype.addDragGradient=function(e,t,r){return this._dragGradients||(this._dragGradients=[]),this._addFactorGradient(this._dragGradients,e,t,r),this},t.prototype.removeDragGradient=function(e){return this._removeFactorGradient(this._dragGradients,e),this},t.prototype.addEmitRateGradient=function(e,t,r){return this._emitRateGradients||(this._emitRateGradients=[]),this._addFactorGradient(this._emitRateGradients,e,t,r),this},t.prototype.removeEmitRateGradient=function(e){return this._removeFactorGradient(this._emitRateGradients,e),this},t.prototype.addStartSizeGradient=function(e,t,r){return this._startSizeGradients||(this._startSizeGradients=[]),this._addFactorGradient(this._startSizeGradients,e,t,r),this},t.prototype.removeStartSizeGradient=function(e){return this._removeFactorGradient(this._startSizeGradients,e),this},t.prototype._createRampGradientTexture=function(){if(this._rampGradients&&this._rampGradients.length&&!this._rampGradientsTexture){for(var e=new Uint8Array(4*this._rawTextureWidth),t=P.TmpColors.Color3[0],r=0;r<this._rawTextureWidth;r++){var n=r/this._rawTextureWidth;i.GradientHelper.GetCurrentGradient(n,this._rampGradients,(function(n,i,o){P.Color3.LerpToRef(n.color,i.color,o,t),e[4*r]=255*t.r,e[4*r+1]=255*t.g,e[4*r+2]=255*t.b,e[4*r+3]=255}))}this._rampGradientsTexture=p.RawTexture.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,f.Texture.NEAREST_SAMPLINGMODE)}},t.prototype.getRampGradients=function(){return this._rampGradients},t.prototype.forceRefreshGradients=function(){this._syncRampGradientTexture()},t.prototype._syncRampGradientTexture=function(){this._rampGradients&&(this._rampGradients.sort((function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0})),this._rampGradientsTexture&&(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),this._createRampGradientTexture())},t.prototype.addRampGradient=function(e,t){this._rampGradients||(this._rampGradients=[]);var r=new i.Color3Gradient(e,t);return this._rampGradients.push(r),this._syncRampGradientTexture(),this},t.prototype.removeRampGradient=function(e){return this._removeGradientAndTexture(e,this._rampGradients,this._rampGradientsTexture),this._rampGradientsTexture=null,this._rampGradients&&this._rampGradients.length>0&&this._createRampGradientTexture(),this},t.prototype.addColorGradient=function(e,t,r){this._colorGradients||(this._colorGradients=[]);var n=new i.ColorGradient(e,t,r);return this._colorGradients.push(n),this._colorGradients.sort((function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0})),this},t.prototype.removeColorGradient=function(e){if(!this._colorGradients)return this;for(var t=0,r=0,n=this._colorGradients;r<n.length;r++){if(n[r].gradient===e){this._colorGradients.splice(t,1);break}t++}return this},t.prototype._fetchR=function(e,t,r,n,i){return i[4*(((e=.5*Math.abs(e)+.5)*r%r|0)+((t=.5*Math.abs(t)+.5)*n%n|0)*r)]/255},t.prototype._reset=function(){this._resetEffect()},t.prototype._resetEffect=function(){this._vertexBuffer&&(this._vertexBuffer.dispose(),this._vertexBuffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._createVertexBuffers()},t.prototype._createVertexBuffers=function(){this._vertexBufferSize=this._useInstancing?10:12,this._isAnimationSheetEnabled&&(this._vertexBufferSize+=1),this._isBillboardBased&&this.billboardMode!==t.BILLBOARDMODE_STRETCHED||(this._vertexBufferSize+=3),this._useRampGradients&&(this._vertexBufferSize+=4);var e=this._scene.getEngine();this._vertexData=new Float32Array(this._capacity*this._vertexBufferSize*(this._useInstancing?1:4)),this._vertexBuffer=new l.Buffer(e,this._vertexData,!0,this._vertexBufferSize);var r=0,n=this._vertexBuffer.createVertexBuffer(l.VertexBuffer.PositionKind,r,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[l.VertexBuffer.PositionKind]=n,r+=3;var i=this._vertexBuffer.createVertexBuffer(l.VertexBuffer.ColorKind,r,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[l.VertexBuffer.ColorKind]=i,r+=4;var o=this._vertexBuffer.createVertexBuffer("angle",r,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.angle=o,r+=1;var s,a=this._vertexBuffer.createVertexBuffer("size",r,2,this._vertexBufferSize,this._useInstancing);if(this._vertexBuffers.size=a,r+=2,this._isAnimationSheetEnabled){var c=this._vertexBuffer.createVertexBuffer("cellIndex",r,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.cellIndex=c,r+=1}if(!this._isBillboardBased||this.billboardMode===t.BILLBOARDMODE_STRETCHED){var u=this._vertexBuffer.createVertexBuffer("direction",r,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.direction=u,r+=3}if(this._useRampGradients){var d=this._vertexBuffer.createVertexBuffer("remapData",r,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.remapData=d,r+=4}if(this._useInstancing){var h=new Float32Array([0,0,1,0,1,1,0,1]);this._spriteBuffer=new l.Buffer(e,h,!1,2),s=this._spriteBuffer.createVertexBuffer("offset",0,2)}else s=this._vertexBuffer.createVertexBuffer("offset",r,2,this._vertexBufferSize,this._useInstancing),r+=2;this._vertexBuffers.offset=s},t.prototype._createIndexBuffer=function(){if(!this._useInstancing){for(var e=[],t=0,r=0;r<this._capacity;r++)e.push(t),e.push(t+1),e.push(t+2),e.push(t),e.push(t+2),e.push(t+3),t+=4;this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}},t.prototype.getCapacity=function(){return this._capacity},t.prototype.isAlive=function(){return this._alive},t.prototype.isStarted=function(){return this._started},t.prototype._prepareSubEmitterInternalArray=function(){var e=this;this._subEmitters=new Array,this.subEmitters&&this.subEmitters.forEach((function(r){r instanceof t?e._subEmitters.push([new b.SubEmitter(r)]):r instanceof b.SubEmitter?e._subEmitters.push([r]):r instanceof Array&&e._subEmitters.push(r)}))},t.prototype.start=function(e){var t=this;if(void 0===e&&(e=this.startDelay),!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";if(e)setTimeout((function(){t.start(0)}),e);else{if(this._prepareSubEmitterInternalArray(),this._started=!0,this._stopped=!1,this._actualFrame=0,this._subEmitters&&0!=this._subEmitters.length&&(this.activeSubSystems=new Array),this._emitRateGradients&&(this._emitRateGradients.length>0&&(this._currentEmitRateGradient=this._emitRateGradients[0],this._currentEmitRate1=this._currentEmitRateGradient.getFactor(),this._currentEmitRate2=this._currentEmitRate1),this._emitRateGradients.length>1&&(this._currentEmitRate2=this._emitRateGradients[1].getFactor())),this._startSizeGradients&&(this._startSizeGradients.length>0&&(this._currentStartSizeGradient=this._startSizeGradients[0],this._currentStartSize1=this._currentStartSizeGradient.getFactor(),this._currentStartSize2=this._currentStartSize1),this._startSizeGradients.length>1&&(this._currentStartSize2=this._startSizeGradients[1].getFactor())),this.preWarmCycles){this.emitter instanceof c.AbstractMesh&&this.emitter.computeWorldMatrix(!0);var r=this.noiseTexture;if(r&&r.onGeneratedObservable)r.onGeneratedObservable.addOnce((function(){setTimeout((function(){for(var e=0;e<t.preWarmCycles;e++)t.animate(!0),r.render()}))}));else for(var n=0;n<this.preWarmCycles;n++)this.animate(!0)}this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this.getScene().beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop)}},t.prototype.stop=function(e){void 0===e&&(e=!0),this._stopped=!0,e&&this._stopSubEmitters()},t.prototype.reset=function(){this._stockParticles=[],this._particles=[]},t.prototype._appendParticleVertex=function(e,r,n,i){var o=e*this._vertexBufferSize;if(this._vertexData[o++]=r.position.x+this.worldOffset.x,this._vertexData[o++]=r.position.y+this.worldOffset.y,this._vertexData[o++]=r.position.z+this.worldOffset.z,this._vertexData[o++]=r.color.r,this._vertexData[o++]=r.color.g,this._vertexData[o++]=r.color.b,this._vertexData[o++]=r.color.a,this._vertexData[o++]=r.angle,this._vertexData[o++]=r.scale.x*r.size,this._vertexData[o++]=r.scale.y*r.size,this._isAnimationSheetEnabled&&(this._vertexData[o++]=r.cellIndex),this._isBillboardBased)this.billboardMode===t.BILLBOARDMODE_STRETCHED&&(this._vertexData[o++]=r.direction.x,this._vertexData[o++]=r.direction.y,this._vertexData[o++]=r.direction.z);else if(r._initialDirection){var a=r._initialDirection;this.isLocal&&(s.Vector3.TransformNormalToRef(a,this._emitterWorldMatrix,s.TmpVectors.Vector3[0]),a=s.TmpVectors.Vector3[0]),0===a.x&&0===a.z&&(a.x=.001),this._vertexData[o++]=a.x,this._vertexData[o++]=a.y,this._vertexData[o++]=a.z}else{var l=r.direction;this.isLocal&&(s.Vector3.TransformNormalToRef(l,this._emitterWorldMatrix,s.TmpVectors.Vector3[0]),l=s.TmpVectors.Vector3[0]),0===l.x&&0===l.z&&(l.x=.001),this._vertexData[o++]=l.x,this._vertexData[o++]=l.y,this._vertexData[o++]=l.z}this._useRampGradients&&r.remapData&&(this._vertexData[o++]=r.remapData.x,this._vertexData[o++]=r.remapData.y,this._vertexData[o++]=r.remapData.z,this._vertexData[o++]=r.remapData.w),this._useInstancing||(this._isAnimationSheetEnabled&&(0===n?n=this._epsilon:1===n&&(n=1-this._epsilon),0===i?i=this._epsilon:1===i&&(i=1-this._epsilon)),this._vertexData[o++]=n,this._vertexData[o++]=i)},t.prototype._stopSubEmitters=function(){this.activeSubSystems&&(this.activeSubSystems.forEach((function(e){e.stop(!0)})),this.activeSubSystems=new Array)},t.prototype._removeFromRoot=function(){if(this._rootParticleSystem){var e=this._rootParticleSystem.activeSubSystems.indexOf(this);-1!==e&&this._rootParticleSystem.activeSubSystems.splice(e,1),this._rootParticleSystem=null}},t.prototype._update=function(e){var t,r=this;if(this._alive=this._particles.length>0,this.emitter.position){var n=this.emitter;this._emitterWorldMatrix=n.getWorldMatrix()}else{var o=this.emitter;this._emitterWorldMatrix=s.Matrix.Translation(o.x,o.y,o.z)}this.updateFunction(this._particles);for(var l,c=function(){if(u._particles.length===u._capacity)return"break";if(t=u._createParticle(),u._particles.push(t),u.targetStopDuration&&u._lifeTimeGradients&&u._lifeTimeGradients.length>0){var e=a.Scalar.Clamp(u._actualFrame/u.targetStopDuration);i.GradientHelper.GetCurrentGradient(e,u._lifeTimeGradients,(function(r,n){var i=r,o=n,s=i.getFactor(),l=o.getFactor(),c=(e-i.gradient)/(o.gradient-i.gradient);t.lifeTime=a.Scalar.Lerp(s,l,c)}))}else t.lifeTime=a.Scalar.RandomRange(u.minLifeTime,u.maxLifeTime);var n=a.Scalar.RandomRange(u.minEmitPower,u.maxEmitPower);if(u.startPositionFunction?u.startPositionFunction(u._emitterWorldMatrix,t.position,t,u.isLocal):u.particleEmitterType.startPositionFunction(u._emitterWorldMatrix,t.position,t,u.isLocal),u.isLocal&&(t._localPosition?t._localPosition.copyFrom(t.position):t._localPosition=t.position.clone(),s.Vector3.TransformCoordinatesToRef(t._localPosition,u._emitterWorldMatrix,t.position)),u.startDirectionFunction?u.startDirectionFunction(u._emitterWorldMatrix,t.direction,t,u.isLocal):u.particleEmitterType.startDirectionFunction(u._emitterWorldMatrix,t.direction,t,u.isLocal),0===n?t._initialDirection?t._initialDirection.copyFrom(t.direction):t._initialDirection=t.direction.clone():t._initialDirection=null,t.direction.scaleInPlace(n),u._sizeGradients&&0!==u._sizeGradients.length?(t._currentSizeGradient=u._sizeGradients[0],t._currentSize1=t._currentSizeGradient.getFactor(),t.size=t._currentSize1,u._sizeGradients.length>1?t._currentSize2=u._sizeGradients[1].getFactor():t._currentSize2=t._currentSize1):t.size=a.Scalar.RandomRange(u.minSize,u.maxSize),t.scale.copyFromFloats(a.Scalar.RandomRange(u.minScaleX,u.maxScaleX),a.Scalar.RandomRange(u.minScaleY,u.maxScaleY)),u._startSizeGradients&&u._startSizeGradients[0]&&u.targetStopDuration){var o=u._actualFrame/u.targetStopDuration;i.GradientHelper.GetCurrentGradient(o,u._startSizeGradients,(function(e,n,i){e!==r._currentStartSizeGradient&&(r._currentStartSize1=r._currentStartSize2,r._currentStartSize2=n.getFactor(),r._currentStartSizeGradient=e);var o=a.Scalar.Lerp(r._currentStartSize1,r._currentStartSize2,i);t.scale.scaleInPlace(o)}))}u._angularSpeedGradients&&0!==u._angularSpeedGradients.length?(t._currentAngularSpeedGradient=u._angularSpeedGradients[0],t.angularSpeed=t._currentAngularSpeedGradient.getFactor(),t._currentAngularSpeed1=t.angularSpeed,u._angularSpeedGradients.length>1?t._currentAngularSpeed2=u._angularSpeedGradients[1].getFactor():t._currentAngularSpeed2=t._currentAngularSpeed1):t.angularSpeed=a.Scalar.RandomRange(u.minAngularSpeed,u.maxAngularSpeed),t.angle=a.Scalar.RandomRange(u.minInitialRotation,u.maxInitialRotation),u._velocityGradients&&u._velocityGradients.length>0&&(t._currentVelocityGradient=u._velocityGradients[0],t._currentVelocity1=t._currentVelocityGradient.getFactor(),u._velocityGradients.length>1?t._currentVelocity2=u._velocityGradients[1].getFactor():t._currentVelocity2=t._currentVelocity1),u._limitVelocityGradients&&u._limitVelocityGradients.length>0&&(t._currentLimitVelocityGradient=u._limitVelocityGradients[0],t._currentLimitVelocity1=t._currentLimitVelocityGradient.getFactor(),u._limitVelocityGradients.length>1?t._currentLimitVelocity2=u._limitVelocityGradients[1].getFactor():t._currentLimitVelocity2=t._currentLimitVelocity1),u._dragGradients&&u._dragGradients.length>0&&(t._currentDragGradient=u._dragGradients[0],t._currentDrag1=t._currentDragGradient.getFactor(),u._dragGradients.length>1?t._currentDrag2=u._dragGradients[1].getFactor():t._currentDrag2=t._currentDrag1),u._colorGradients&&0!==u._colorGradients.length?(t._currentColorGradient=u._colorGradients[0],t._currentColorGradient.getColorToRef(t.color),t._currentColor1.copyFrom(t.color),u._colorGradients.length>1?u._colorGradients[1].getColorToRef(t._currentColor2):t._currentColor2.copyFrom(t.color)):(l=a.Scalar.RandomRange(0,1),P.Color4.LerpToRef(u.color1,u.color2,l,t.color),u.colorDead.subtractToRef(t.color,u._colorDiff),u._colorDiff.scaleToRef(1/t.lifeTime,t.colorStep)),u._isAnimationSheetEnabled&&(t._initialStartSpriteCellID=u.startSpriteCellID,t._initialEndSpriteCellID=u.endSpriteCellID),t.direction.addInPlace(u._inheritedVelocityOffset),u._useRampGradients&&(t.remapData=new s.Vector4(0,1,0,1)),u.noiseTexture&&(t._randomNoiseCoordinates1?(t._randomNoiseCoordinates1.copyFromFloats(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2.copyFromFloats(Math.random(),Math.random(),Math.random())):(t._randomNoiseCoordinates1=new s.Vector3(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2=new s.Vector3(Math.random(),Math.random(),Math.random()))),t._inheritParticleInfoToSubEmitters()},u=this,d=0;d<e&&"break"!==c();d++);},t._GetAttributeNamesOrOptions=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===r&&(r=!1);var n=[l.VertexBuffer.PositionKind,l.VertexBuffer.ColorKind,"angle","offset","size"];return e&&n.push("cellIndex"),t||n.push("direction"),r&&n.push("remapData"),n},t._GetEffectCreationOptions=function(e){void 0===e&&(e=!1);var t=["invView","view","projection","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","textureMask","translationPivot","eyePosition"];return e&&t.push("particlesInfos"),t},t.prototype.fillDefines=function(e,r){if(this._scene.clipPlane&&e.push("#define CLIPPLANE"),this._scene.clipPlane2&&e.push("#define CLIPPLANE2"),this._scene.clipPlane3&&e.push("#define CLIPPLANE3"),this._scene.clipPlane4&&e.push("#define CLIPPLANE4"),this._scene.clipPlane5&&e.push("#define CLIPPLANE5"),this._scene.clipPlane6&&e.push("#define CLIPPLANE6"),this._isAnimationSheetEnabled&&e.push("#define ANIMATESHEET"),r===t.BLENDMODE_MULTIPLY&&e.push("#define BLENDMULTIPLYMODE"),this._useRampGradients&&e.push("#define RAMPGRADIENT"),this._isBillboardBased)switch(e.push("#define BILLBOARD"),this.billboardMode){case t.BILLBOARDMODE_Y:e.push("#define BILLBOARDY");break;case t.BILLBOARDMODE_STRETCHED:e.push("#define BILLBOARDSTRETCHED");break;case t.BILLBOARDMODE_ALL:e.push("#define BILLBOARDMODE_ALL")}this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e.push(this._imageProcessingConfigurationDefines.toString()))},t.prototype.fillUniformsAttributesAndSamplerNames=function(e,r,n){r.push.apply(r,t._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled,this._isBillboardBased&&this.billboardMode!==t.BILLBOARDMODE_STRETCHED,this._useRampGradients)),e.push.apply(e,t._GetEffectCreationOptions(this._isAnimationSheetEnabled)),n.push("diffuseSampler","rampSampler"),this._imageProcessingConfiguration&&(h.ImageProcessingConfiguration.PrepareUniforms(e,this._imageProcessingConfigurationDefines),h.ImageProcessingConfiguration.PrepareSamplers(n,this._imageProcessingConfigurationDefines))},t.prototype._getEffect=function(e){var t=this.getCustomEffect(e);if(t)return t;var r=[];this.fillDefines(r,e);var n=r.join("\n");if(this._cachedDefines!==n){this._cachedDefines=n;var i=[],o=[],s=[];this.fillUniformsAttributesAndSamplerNames(o,i,s),this._effect=this._scene.getEngine().createEffect("particles",i,o,s,n)}return this._effect},t.prototype.animate=function(e){var t=this;if(void 0===e&&(e=!1),this._started){if(!e){if(!this.isReady())return;if(this._currentRenderId===this._scene.getFrameId())return;this._currentRenderId=this._scene.getFrameId()}var r;if(this._scaledUpdateSpeed=this.updateSpeed*(e?this.preWarmStepOffset:this._scene.getAnimationRatio()),this.manualEmitCount>-1)r=this.manualEmitCount,this._newPartsExcess=0,this.manualEmitCount=0;else{var n=this.emitRate;if(this._emitRateGradients&&this._emitRateGradients.length>0&&this.targetStopDuration){var o=this._actualFrame/this.targetStopDuration;i.GradientHelper.GetCurrentGradient(o,this._emitRateGradients,(function(e,r,i){e!==t._currentEmitRateGradient&&(t._currentEmitRate1=t._currentEmitRate2,t._currentEmitRate2=r.getFactor(),t._currentEmitRateGradient=e),n=a.Scalar.Lerp(t._currentEmitRate1,t._currentEmitRate2,i)}))}r=n*this._scaledUpdateSpeed>>0,this._newPartsExcess+=n*this._scaledUpdateSpeed-r}if(this._newPartsExcess>1&&(r+=this._newPartsExcess>>0,this._newPartsExcess-=this._newPartsExcess>>0),this._alive=!1,this._stopped?r=0:(this._actualFrame+=this._scaledUpdateSpeed,this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()),this._update(r),this._stopped&&(this._alive||(this._started=!1,this.onAnimationEnd&&this.onAnimationEnd(),this.disposeOnStop&&this._scene._toBeDisposed.push(this))),!e){for(var s=0,l=0;l<this._particles.length;l++){var c=this._particles[l];this._appendParticleVertices(s,c),s+=this._useInstancing?1:4}this._vertexBuffer&&this._vertexBuffer.update(this._vertexData)}0===this.manualEmitCount&&this.disposeOnStop&&this.stop()}},t.prototype._appendParticleVertices=function(e,t){this._appendParticleVertex(e++,t,0,0),this._useInstancing||(this._appendParticleVertex(e++,t,1,0),this._appendParticleVertex(e++,t,1,1),this._appendParticleVertex(e++,t,0,1))},t.prototype.rebuild=function(){for(var e in this._createIndexBuffer(),this._vertexBuffer&&this._vertexBuffer._rebuild(),this._vertexBuffers)this._vertexBuffers[e]._rebuild()},t.prototype.isReady=function(){if(!(this.emitter&&this._imageProcessingConfiguration.isReady()&&this.particleTexture&&this.particleTexture.isReady()))return!1;if(this.blendMode!==t.BLENDMODE_MULTIPLYADD){if(!this._getEffect(this.blendMode).isReady())return!1}else{if(!this._getEffect(t.BLENDMODE_MULTIPLY).isReady())return!1;if(!this._getEffect(t.BLENDMODE_ADD).isReady())return!1}return!0},t.prototype._render=function(e){var r=this._getEffect(e),n=this._scene.getEngine();n.enableEffect(r);var i=this._scene.getViewMatrix();if(r.setTexture("diffuseSampler",this.particleTexture),r.setMatrix("view",i),r.setMatrix("projection",this._scene.getProjectionMatrix()),this._isAnimationSheetEnabled&&this.particleTexture){var o=this.particleTexture.getBaseSize();r.setFloat3("particlesInfos",this.spriteCellWidth/o.width,this.spriteCellHeight/o.height,o.width/this.spriteCellWidth)}if(r.setVector2("translationPivot",this.translationPivot),r.setFloat4("textureMask",this.textureMask.r,this.textureMask.g,this.textureMask.b,this.textureMask.a),this._isBillboardBased){var s=this._scene.activeCamera;r.setVector3("eyePosition",s.globalPosition)}this._rampGradientsTexture&&(this._rampGradients&&this._rampGradients.length||(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),r.setTexture("rampSampler",this._rampGradientsTexture));var a=r.defines;if((this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4||this._scene.clipPlane5||this._scene.clipPlane6)&&d.MaterialHelper.BindClipPlane(r,this._scene),a.indexOf("#define BILLBOARDMODE_ALL")>=0){var l=i.clone();l.invert(),r.setMatrix("invView",l)}switch(n.bindBuffers(this._vertexBuffers,this._indexBuffer,r),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(r),e){case t.BLENDMODE_ADD:n.setAlphaMode(A.Constants.ALPHA_ADD);break;case t.BLENDMODE_ONEONE:n.setAlphaMode(A.Constants.ALPHA_ONEONE);break;case t.BLENDMODE_STANDARD:n.setAlphaMode(A.Constants.ALPHA_COMBINE);break;case t.BLENDMODE_MULTIPLY:n.setAlphaMode(A.Constants.ALPHA_MULTIPLY)}return this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.notifyObservers(r),this._useInstancing?n.drawArraysType(u.Material.TriangleFanDrawMode,0,4,this._particles.length):n.drawElementsType(u.Material.TriangleFillMode,0,6*this._particles.length),this._particles.length},t.prototype.render=function(){if(!this.isReady()||!this._particles.length)return 0;var e=this._scene.getEngine();e.setState(!1),this.forceDepthWrite&&e.setDepthWrite(!0);var r=0;return this.blendMode===t.BLENDMODE_MULTIPLYADD&&(r=this._render(t.BLENDMODE_MULTIPLY)+this._render(t.BLENDMODE_ADD)),r=this._render(this.blendMode),e.unbindInstanceAttributes(),e.setAlphaMode(A.Constants.ALPHA_DISABLE),r},t.prototype.dispose=function(e){if(void 0===e&&(e=!0),this._vertexBuffer&&(this._vertexBuffer.dispose(),this._vertexBuffer=null),this._spriteBuffer&&(this._spriteBuffer.dispose(),this._spriteBuffer=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),e&&this.particleTexture&&(this.particleTexture.dispose(),this.particleTexture=null),e&&this.noiseTexture&&(this.noiseTexture.dispose(),this.noiseTexture=null),this._rampGradientsTexture&&(this._rampGradientsTexture.dispose(),this._rampGradientsTexture=null),this._removeFromRoot(),this._subEmitters&&this._subEmitters.length){for(var t=0;t<this._subEmitters.length;t++)for(var r=0,n=this._subEmitters[t];r<n.length;r++)n[r].dispose();this._subEmitters=[],this.subEmitters=[]}this._disposeEmitterOnDispose&&this.emitter&&this.emitter.dispose&&this.emitter.dispose(!0),this._onBeforeDrawParticlesObservable&&this._onBeforeDrawParticlesObservable.clear(),(t=this._scene.particleSystems.indexOf(this))>-1&&this._scene.particleSystems.splice(t,1),this._scene._activeParticleSystems.dispose(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.reset()},t.prototype.clone=function(e,r){var i=Object(n.__assign)({},this._customEffect),o=null;if(null!=this.customShader){var s=(o=this.customShader).shaderOptions.defines.length>0?o.shaderOptions.defines.join("\n"):"";i[0]=this._scene.getEngine().createEffectForParticles(o.shaderPath.fragmentElement,o.shaderOptions.uniforms,o.shaderOptions.samplers,s)}var a=this.serialize(),l=t.Parse(a,this._scene,"");return l.name=e,l.customShader=o,l._customEffect=i,void 0===r&&(r=this.emitter),this.noiseTexture&&(l.noiseTexture=this.noiseTexture.clone()),l.emitter=r,this.preventAutoStart||l.start(),l},t.prototype.serialize=function(e){void 0===e&&(e=!1);var r={};if(t._Serialize(r,this,e),r.textureMask=this.textureMask.asArray(),r.customShader=this.customShader,r.preventAutoStart=this.preventAutoStart,this.subEmitters){r.subEmitters=[],this._subEmitters||this._prepareSubEmitterInternalArray();for(var n=0,i=this._subEmitters;n<i.length;n++){for(var o=[],s=0,a=i[n];s<a.length;s++){var l=a[s];o.push(l.serialize())}r.subEmitters.push(o)}}return r},t._Serialize=function(e,t,r){if(e.name=t.name,e.id=t.id,e.capacity=t.getCapacity(),t.emitter.position){var n=t.emitter;e.emitterId=n.id}else{var i=t.emitter;e.emitter=i.asArray()}t.particleEmitterType&&(e.particleEmitterType=t.particleEmitterType.serialize()),t.particleTexture&&(r?e.texture=t.particleTexture.serialize():(e.textureName=t.particleTexture.name,e.invertY=t.particleTexture._invertY)),e.isLocal=t.isLocal,T.SerializationHelper.AppendSerializedAnimations(t,e),e.beginAnimationOnStart=t.beginAnimationOnStart,e.beginAnimationFrom=t.beginAnimationFrom,e.beginAnimationTo=t.beginAnimationTo,e.beginAnimationLoop=t.beginAnimationLoop,e.startDelay=t.startDelay,e.renderingGroupId=t.renderingGroupId,e.isBillboardBased=t.isBillboardBased,e.billboardMode=t.billboardMode,e.minAngularSpeed=t.minAngularSpeed,e.maxAngularSpeed=t.maxAngularSpeed,e.minSize=t.minSize,e.maxSize=t.maxSize,e.minScaleX=t.minScaleX,e.maxScaleX=t.maxScaleX,e.minScaleY=t.minScaleY,e.maxScaleY=t.maxScaleY,e.minEmitPower=t.minEmitPower,e.maxEmitPower=t.maxEmitPower,e.minLifeTime=t.minLifeTime,e.maxLifeTime=t.maxLifeTime,e.emitRate=t.emitRate,e.gravity=t.gravity.asArray(),e.noiseStrength=t.noiseStrength.asArray(),e.color1=t.color1.asArray(),e.color2=t.color2.asArray(),e.colorDead=t.colorDead.asArray(),e.updateSpeed=t.updateSpeed,e.targetStopDuration=t.targetStopDuration,e.blendMode=t.blendMode,e.preWarmCycles=t.preWarmCycles,e.preWarmStepOffset=t.preWarmStepOffset,e.minInitialRotation=t.minInitialRotation,e.maxInitialRotation=t.maxInitialRotation,e.startSpriteCellID=t.startSpriteCellID,e.endSpriteCellID=t.endSpriteCellID,e.spriteCellChangeSpeed=t.spriteCellChangeSpeed,e.spriteCellWidth=t.spriteCellWidth,e.spriteCellHeight=t.spriteCellHeight,e.spriteRandomStartCell=t.spriteRandomStartCell,e.isAnimationSheetEnabled=t.isAnimationSheetEnabled;var o=t.getColorGradients();if(o){e.colorGradients=[];for(var s=0,a=o;s<a.length;s++){var l=a[s],c={gradient:l.gradient,color1:l.color1.asArray()};l.color2?c.color2=l.color2.asArray():c.color2=l.color1.asArray(),e.colorGradients.push(c)}}var u=t.getRampGradients();if(u){e.rampGradients=[];for(var d=0,h=u;d<h.length;d++){var f=h[d];c={gradient:f.gradient,color:f.color.asArray()},e.rampGradients.push(c)}e.useRampGradients=t.useRampGradients}var p=t.getColorRemapGradients();if(p){e.colorRemapGradients=[];for(var m=0,g=p;m<g.length;m++){var _=g[m];c={gradient:_.gradient,factor1:_.factor1},void 0!==_.factor2?c.factor2=_.factor2:c.factor2=_.factor1,e.colorRemapGradients.push(c)}}var v=t.getAlphaRemapGradients();if(v){e.alphaRemapGradients=[];for(var y=0,b=v;y<b.length;y++){var A=b[y];c={gradient:A.gradient,factor1:A.factor1},void 0!==A.factor2?c.factor2=A.factor2:c.factor2=A.factor1,e.alphaRemapGradients.push(c)}}var M=t.getSizeGradients();if(M){e.sizeGradients=[];for(var P=0,S=M;P<S.length;P++){var E=S[P];c={gradient:E.gradient,factor1:E.factor1},void 0!==E.factor2?c.factor2=E.factor2:c.factor2=E.factor1,e.sizeGradients.push(c)}}var C=t.getAngularSpeedGradients();if(C){e.angularSpeedGradients=[];for(var x=0,R=C;x<R.length;x++){var O=R[x];c={gradient:O.gradient,factor1:O.factor1},void 0!==O.factor2?c.factor2=O.factor2:c.factor2=O.factor1,e.angularSpeedGradients.push(c)}}var I=t.getVelocityGradients();if(I){e.velocityGradients=[];for(var D=0,B=I;D<B.length;D++){var N=B[D];c={gradient:N.gradient,factor1:N.factor1},void 0!==N.factor2?c.factor2=N.factor2:c.factor2=N.factor1,e.velocityGradients.push(c)}}var L=t.getDragGradients();if(L){e.dragGradients=[];for(var w=0,F=L;w<F.length;w++){var V=F[w];c={gradient:V.gradient,factor1:V.factor1},void 0!==V.factor2?c.factor2=V.factor2:c.factor2=V.factor1,e.dragGradients.push(c)}}var k=t.getEmitRateGradients();if(k){e.emitRateGradients=[];for(var U=0,z=k;U<z.length;U++){var G=z[U];c={gradient:G.gradient,factor1:G.factor1},void 0!==G.factor2?c.factor2=G.factor2:c.factor2=G.factor1,e.emitRateGradients.push(c)}}var j=t.getStartSizeGradients();if(j){e.startSizeGradients=[];for(var H=0,W=j;H<W.length;H++){var X=W[H];c={gradient:X.gradient,factor1:X.factor1},void 0!==X.factor2?c.factor2=X.factor2:c.factor2=X.factor1,e.startSizeGradients.push(c)}}var Y=t.getLifeTimeGradients();if(Y){e.lifeTimeGradients=[];for(var Q=0,K=Y;Q<K.length;Q++){var q=K[Q];c={gradient:q.gradient,factor1:q.factor1},void 0!==q.factor2?c.factor2=q.factor2:c.factor2=q.factor1,e.lifeTimeGradients.push(c)}}var Z=t.getLimitVelocityGradients();if(Z){e.limitVelocityGradients=[];for(var J=0,$=Z;J<$.length;J++){var ee=$[J];c={gradient:ee.gradient,factor1:ee.factor1},void 0!==ee.factor2?c.factor2=ee.factor2:c.factor2=ee.factor1,e.limitVelocityGradients.push(c)}e.limitVelocityDamping=t.limitVelocityDamping}t.noiseTexture&&(e.noiseTexture=t.noiseTexture.serialize())},t._Parse=function(e,t,r,n){if(e.texture?t.particleTexture=f.Texture.Parse(e.texture,r,n):e.textureName&&(t.particleTexture=new f.Texture(n+e.textureName,r,!1,void 0===e.invertY||e.invertY),t.particleTexture.name=e.textureName),e.emitterId||0===e.emitterId||void 0!==e.emitter?e.emitterId?t.emitter=r.getLastMeshByID(e.emitterId):t.emitter=s.Vector3.FromArray(e.emitter):t.emitter=s.Vector3.Zero(),t.isLocal=!!e.isLocal,void 0!==e.renderingGroupId&&(t.renderingGroupId=e.renderingGroupId),void 0!==e.isBillboardBased&&(t.isBillboardBased=e.isBillboardBased),void 0!==e.billboardMode&&(t.billboardMode=e.billboardMode),e.animations){for(var i=0;i<e.animations.length;i++){var o=e.animations[i],a=M._TypeStore.GetClass("BABYLON.Animation");a&&t.animations.push(a.Parse(o))}t.beginAnimationOnStart=e.beginAnimationOnStart,t.beginAnimationFrom=e.beginAnimationFrom,t.beginAnimationTo=e.beginAnimationTo,t.beginAnimationLoop=e.beginAnimationLoop}if(e.autoAnimate&&r.beginAnimation(t,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),t.startDelay=0|e.startDelay,t.minAngularSpeed=e.minAngularSpeed,t.maxAngularSpeed=e.maxAngularSpeed,t.minSize=e.minSize,t.maxSize=e.maxSize,e.minScaleX&&(t.minScaleX=e.minScaleX,t.maxScaleX=e.maxScaleX,t.minScaleY=e.minScaleY,t.maxScaleY=e.maxScaleY),void 0!==e.preWarmCycles&&(t.preWarmCycles=e.preWarmCycles,t.preWarmStepOffset=e.preWarmStepOffset),void 0!==e.minInitialRotation&&(t.minInitialRotation=e.minInitialRotation,t.maxInitialRotation=e.maxInitialRotation),t.minLifeTime=e.minLifeTime,t.maxLifeTime=e.maxLifeTime,t.minEmitPower=e.minEmitPower,t.maxEmitPower=e.maxEmitPower,t.emitRate=e.emitRate,t.gravity=s.Vector3.FromArray(e.gravity),e.noiseStrength&&(t.noiseStrength=s.Vector3.FromArray(e.noiseStrength)),t.color1=P.Color4.FromArray(e.color1),t.color2=P.Color4.FromArray(e.color2),t.colorDead=P.Color4.FromArray(e.colorDead),t.updateSpeed=e.updateSpeed,t.targetStopDuration=e.targetStopDuration,t.blendMode=e.blendMode,e.colorGradients)for(var l=0,c=e.colorGradients;l<c.length;l++){var u=c[l];t.addColorGradient(u.gradient,P.Color4.FromArray(u.color1),u.color2?P.Color4.FromArray(u.color2):void 0)}if(e.rampGradients){for(var d=0,h=e.rampGradients;d<h.length;d++){var p=h[d];t.addRampGradient(p.gradient,P.Color3.FromArray(p.color))}t.useRampGradients=e.useRampGradients}if(e.colorRemapGradients)for(var g=0,v=e.colorRemapGradients;g<v.length;g++){var y=v[g];t.addColorRemapGradient(y.gradient,void 0!==y.factor1?y.factor1:y.factor,y.factor2)}if(e.alphaRemapGradients)for(var b=0,A=e.alphaRemapGradients;b<A.length;b++){var T=A[b];t.addAlphaRemapGradient(T.gradient,void 0!==T.factor1?T.factor1:T.factor,T.factor2)}if(e.sizeGradients)for(var S=0,E=e.sizeGradients;S<E.length;S++){var C=E[S];t.addSizeGradient(C.gradient,void 0!==C.factor1?C.factor1:C.factor,C.factor2)}if(e.angularSpeedGradients)for(var x=0,R=e.angularSpeedGradients;x<R.length;x++){var O=R[x];t.addAngularSpeedGradient(O.gradient,void 0!==O.factor1?O.factor1:O.factor,O.factor2)}if(e.velocityGradients)for(var I=0,D=e.velocityGradients;I<D.length;I++){var B=D[I];t.addVelocityGradient(B.gradient,void 0!==B.factor1?B.factor1:B.factor,B.factor2)}if(e.dragGradients)for(var N=0,L=e.dragGradients;N<L.length;N++){var w=L[N];t.addDragGradient(w.gradient,void 0!==w.factor1?w.factor1:w.factor,w.factor2)}if(e.emitRateGradients)for(var F=0,V=e.emitRateGradients;F<V.length;F++){var k=V[F];t.addEmitRateGradient(k.gradient,void 0!==k.factor1?k.factor1:k.factor,k.factor2)}if(e.startSizeGradients)for(var U=0,z=e.startSizeGradients;U<z.length;U++){var G=z[U];t.addStartSizeGradient(G.gradient,void 0!==G.factor1?G.factor1:G.factor,G.factor2)}if(e.lifeTimeGradients)for(var j=0,H=e.lifeTimeGradients;j<H.length;j++){var W=H[j];t.addLifeTimeGradient(W.gradient,void 0!==W.factor1?W.factor1:W.factor,W.factor2)}if(e.limitVelocityGradients){for(var X=0,Y=e.limitVelocityGradients;X<Y.length;X++){var Q=Y[X];t.addLimitVelocityGradient(Q.gradient,void 0!==Q.factor1?Q.factor1:Q.factor,Q.factor2)}t.limitVelocityDamping=e.limitVelocityDamping}var K;if(e.noiseTexture&&(t.noiseTexture=m.ProceduralTexture.Parse(e.noiseTexture,r,n)),e.particleEmitterType){switch(e.particleEmitterType.type){case"SphereParticleEmitter":K=new _.SphereParticleEmitter;break;case"SphereDirectedParticleEmitter":K=new _.SphereDirectedParticleEmitter;break;case"ConeEmitter":case"ConeParticleEmitter":K=new _.ConeParticleEmitter;break;case"CylinderParticleEmitter":K=new _.CylinderParticleEmitter;break;case"CylinderDirectedParticleEmitter":K=new _.CylinderDirectedParticleEmitter;break;case"HemisphericParticleEmitter":K=new _.HemisphericParticleEmitter;break;case"PointParticleEmitter":K=new _.PointParticleEmitter;break;case"MeshParticleEmitter":K=new _.MeshParticleEmitter;break;case"BoxEmitter":case"BoxParticleEmitter":default:K=new _.BoxParticleEmitter}K.parse(e.particleEmitterType,r)}else(K=new _.BoxParticleEmitter).parse(e,r);t.particleEmitterType=K,t.startSpriteCellID=e.startSpriteCellID,t.endSpriteCellID=e.endSpriteCellID,t.spriteCellWidth=e.spriteCellWidth,t.spriteCellHeight=e.spriteCellHeight,t.spriteCellChangeSpeed=e.spriteCellChangeSpeed,t.spriteRandomStartCell=e.spriteRandomStartCell},t.Parse=function(e,r,n,i){void 0===i&&(i=!1);var o=e.name,s=null,a=null;if(e.customShader){var l=(a=e.customShader).shaderOptions.defines.length>0?a.shaderOptions.defines.join("\n"):"";s=r.getEngine().createEffectForParticles(a.shaderPath.fragmentElement,a.shaderOptions.uniforms,a.shaderOptions.samplers,l)}var c=new t(o,e.capacity,r,s,e.isAnimationSheetEnabled);if(c.customShader=a,e.id&&(c.id=e.id),e.subEmitters){c.subEmitters=[];for(var u=0,d=e.subEmitters;u<d.length;u++){for(var h=[],f=0,p=d[u];f<p.length;f++){var m=p[f];h.push(b.SubEmitter.Parse(m,r,n))}c.subEmitters.push(h)}}return t._Parse(e,c,r,n),e.textureMask&&(c.textureMask=P.Color4.FromArray(e.textureMask)),e.preventAutoStart&&(c.preventAutoStart=e.preventAutoStart),i||c.preventAutoStart||c.start(),c},t.BILLBOARDMODE_Y=A.Constants.PARTICLES_BILLBOARDMODE_Y,t.BILLBOARDMODE_ALL=A.Constants.PARTICLES_BILLBOARDMODE_ALL,t.BILLBOARDMODE_STRETCHED=A.Constants.PARTICLES_BILLBOARDMODE_STRETCHED,t}(v.BaseParticleSystem);b.SubEmitter._ParseParticleSystem=S.Parse},"./Particles/particleSystemComponent.ts":
- /*!**********************************************!*\
- !*** ./Particles/particleSystemComponent.ts ***!
- \**********************************************/
- /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),i=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts"),o=r(/*! ../abstractScene */"./abstractScene.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ./particleSystem */"./Particles/particleSystem.ts"),l=r(/*! ../sceneComponent */"./sceneComponent.ts");r(/*! ../Shaders/particles.vertex */"./Shaders/particles.vertex.ts"),o.AbstractScene.AddParser(l.SceneComponentConstants.NAME_PARTICLESYSTEM,(function(e,t,r,n){var i=o.AbstractScene.GetIndividualParser(l.SceneComponentConstants.NAME_PARTICLESYSTEM);if(i&&void 0!==e.particleSystems&&null!==e.particleSystems)for(var s=0,a=e.particleSystems.length;s<a;s++){var c=e.particleSystems[s];r.particleSystems.push(i(c,t,n))}})),o.AbstractScene.AddIndividualParser(l.SceneComponentConstants.NAME_PARTICLESYSTEM,(function(e,t,r){return e.activeParticleCount?i.GPUParticleSystem.Parse(e,t,r):a.ParticleSystem.Parse(e,t,r)})),s.Engine.prototype.createEffectForParticles=function(e,t,r,n,i,o,s,l){var c;void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");var u=[],d=[],h=[];return l?l.fillUniformsAttributesAndSamplerNames(d,u,h):(u=a.ParticleSystem._GetAttributeNamesOrOptions(),d=a.ParticleSystem._GetEffectCreationOptions()),-1===n.indexOf(" BILLBOARD")&&(n+="\n#define BILLBOARD\n"),-1===r.indexOf("diffuseSampler")&&r.push("diffuseSampler"),this.createEffect({vertex:null!==(c=null==l?void 0:l.vertexShaderName)&&void 0!==c?c:"particles",fragmentElement:e},u,d.concat(t),h.concat(r),n,i,o,s)},n.Mesh.prototype.getEmittedParticleSystems=function(){for(var e=new Array,t=0;t<this.getScene().particleSystems.length;t++){var r=this.getScene().particleSystems[t];r.emitter===this&&e.push(r)}return e},n.Mesh.prototype.getHierarchyEmittedParticleSystems=function(){var e=new Array,t=this.getDescendants();t.push(this);for(var r=0;r<this.getScene().particleSystems.length;r++){var n=this.getScene().particleSystems[r],i=n.emitter;i.position&&-1!==t.indexOf(i)&&e.push(n)}return e}},"./Particles/particleSystemSet.ts":
- /*!****************************************!*\
- !*** ./Particles/particleSystemSet.ts ***!
- \****************************************/
- /*! exports provided: ParticleSystemSet */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleSystemSet",(function(){return c}));var n=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),i=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),o=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Particles/particleSystem */"./Particles/particleSystem.ts"),l=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),c=function(){function e(){this.systems=new Array}return Object.defineProperty(e.prototype,"emitterNode",{get:function(){return this._emitterNode},enumerable:!1,configurable:!0}),e.prototype.setEmitterAsSphere=function(e,t,r){this._emitterNode&&this._emitterNode.dispose(),this._emitterCreationOptions={kind:"Sphere",options:e,renderingGroupId:t};var n=i.SphereBuilder.CreateSphere("emitterSphere",{diameter:e.diameter,segments:e.segments},r);n.renderingGroupId=t;var o=new l.StandardMaterial("emitterSphereMaterial",r);o.emissiveColor=e.color,n.material=o;for(var s=0,a=this.systems;s<a.length;s++)a[s].emitter=n;this._emitterNode=n},e.prototype.start=function(e){for(var t=0,r=this.systems;t<r.length;t++){var n=r[t];e&&(n.emitter=e),n.start()}},e.prototype.dispose=function(){for(var e=0,t=this.systems;e<t.length;e++)t[e].dispose();this.systems=[],this._emitterNode&&(this._emitterNode.dispose(),this._emitterNode=null)},e.prototype.serialize=function(e){void 0===e&&(e=!1);for(var t={systems:[]},r=0,n=this.systems;r<n.length;r++){var i=n[r];t.systems.push(i.serialize(e))}return this._emitterNode&&(t.emitter=this._emitterCreationOptions),t},e.Parse=function(t,r,i){void 0===i&&(i=!1);var l=new e,c=this.BaseAssetsUrl+"/textures/";r=r||s.EngineStore.LastCreatedScene;for(var u=0,d=t.systems;u<d.length;u++){var h=d[u];l.systems.push(i?o.GPUParticleSystem.Parse(h,r,c,!0):a.ParticleSystem.Parse(h,r,c,!0))}if(t.emitter){var f=t.emitter.options;switch(t.emitter.kind){case"Sphere":l.setEmitterAsSphere({diameter:f.diameter,segments:f.segments,color:n.Color3.FromArray(f.color)},t.emitter.renderingGroupId,r)}}return l},e.BaseAssetsUrl="https://assets.babylonjs.com/particles",e}()},"./Particles/pointsCloudSystem.ts":
- /*!****************************************!*\
- !*** ./Particles/pointsCloudSystem.ts ***!
- \****************************************/
- /*! exports provided: PointColor, PointsCloudSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"PointColor",(function(){return n})),r.d(t,"PointsCloudSystem",(function(){return _}));var n,i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),c=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),u=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),d=r(/*! ./cloudPoint */"./Particles/cloudPoint.ts"),h=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),f=r(/*! ../Culling/ray */"./Culling/ray.ts"),p=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),m=r(/*! ./../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),g=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts");!function(e){e[e.Color=2]="Color",e[e.UV=1]="UV",e[e.Random=0]="Random",e[e.Stated=3]="Stated"}(n||(n={}));var _=function(){function e(e,t,r,n){this.particles=new Array,this.nbParticles=0,this.counter=0,this.vars={},this._promises=[],this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._updatable=!0,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._groups=new Array,this._groupCounter=0,this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeBoundingBox=!1,this._isReady=!1,this.name=e,this._size=t,this._scene=r||u.EngineStore.LastCreatedScene,n&&void 0!==n.updatable?this._updatable=n.updatable:this._updatable=!0}return e.prototype.buildMeshAsync=function(){var e=this;return Promise.all(this._promises).then((function(){return e._isReady=!0,e._buildMesh()}))},e.prototype._buildMesh=function(){0===this.nbParticles&&this.addPoints(1),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors);var e=new l.VertexData;e.set(this._positions32,a.VertexBuffer.PositionKind),this._uvs32.length>0&&e.set(this._uvs32,a.VertexBuffer.UVKind);var t=0;this._colors32.length>0&&(t=1,e.set(this._colors32,a.VertexBuffer.ColorKind));var r=new c.Mesh(this.name,this._scene);e.applyToMesh(r,this._updatable),this.mesh=r,this._positions=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0);var n=new p.StandardMaterial("point cloud material",this._scene);return n.emissiveColor=new i.Color3(t,t,t),n.disableLighting=!0,n.pointsCloud=!0,n.pointSize=this._size,r.material=n,new Promise((function(e){return e(r)}))},e.prototype._addParticle=function(e,t,r,n){var i=new d.CloudPoint(e,t,r,n,this);return this.particles.push(i),i},e.prototype._randomUnitVector=function(e){e.position=new o.Vector3(Math.random(),Math.random(),Math.random()),e.color=new i.Color4(1,1,1,1)},e.prototype._getColorIndicesForCoord=function(e,t,r,n){var o=e._groupImageData,s=r*(4*n)+4*t,a=[s,s+1,s+2,s+3],l=a[1],c=a[2],u=a[3],d=o[a[0]],h=o[l],f=o[c],p=o[u];return new i.Color4(d/255,h/255,f/255,p)},e.prototype._setPointsColorOrUV=function(e,t,r,n,s,l,c){r&&e.updateFacetData();var u=2*e.getBoundingInfo().boundingSphere.radius,d=e.getVerticesData(a.VertexBuffer.PositionKind),h=e.getIndices(),p=e.getVerticesData(a.VertexBuffer.UVKind),m=e.getVerticesData(a.VertexBuffer.ColorKind),_=o.Vector3.Zero();e.computeWorldMatrix();var v=e.getWorldMatrix();if(!v.isIdentity())for(var y=0;y<d.length/3;y++)o.Vector3.TransformCoordinatesFromFloatsToRef(d[3*y],d[3*y+1],d[3*y+2],v,_),d[3*y]=_.x,d[3*y+1]=_.y,d[3*y+2]=_.z;var b,A,T=0,M=0,P=0,S=0,E=0,C=0,x=0,R=0,O=0,I=0,D=0,B=0,N=0,L=0,w=o.Vector3.Zero(),F=o.Vector3.Zero(),V=o.Vector3.Zero(),k=o.Vector3.Zero(),U=o.Vector3.Zero(),z=0,G=0,j=0,H=0,W=0,X=0,Y=o.Vector2.Zero(),Q=o.Vector2.Zero(),K=o.Vector2.Zero(),q=o.Vector2.Zero(),Z=o.Vector2.Zero(),J=0,$=0,ee=0,te=0,re=0,ne=0,ie=0,oe=0,se=0,ae=0,le=0,ce=0,ue=o.Vector4.Zero(),de=o.Vector4.Zero(),he=o.Vector4.Zero(),fe=o.Vector4.Zero(),pe=o.Vector4.Zero(),me=0,ge=0;c=c||0;var _e,ve=new o.Vector4(0,0,0,0),ye=o.Vector3.Zero(),be=o.Vector3.Zero(),Ae=o.Vector3.Zero(),Te=0,Me=o.Vector3.Zero(),Pe=0,Se=0,Ee=new f.Ray(o.Vector3.Zero(),new o.Vector3(1,0,0)),Ce=o.Vector3.Zero();for(M=0;M<h.length/3;M++){var xe,Re,Oe,Ie,De,Be,Ne,Le;P=h[3*M],S=h[3*M+1],E=h[3*M+2],C=d[3*P],x=d[3*P+1],R=d[3*P+2],O=d[3*S],I=d[3*S+1],D=d[3*S+2],B=d[3*E],N=d[3*E+1],L=d[3*E+2],w.set(C,x,R),F.set(O,I,D),V.set(B,N,L),F.subtractToRef(w,k),V.subtractToRef(F,U),p&&(z=p[2*P],G=p[2*P+1],j=p[2*S],H=p[2*S+1],W=p[2*E],X=p[2*E+1],Y.set(z,G),Q.set(j,H),K.set(W,X),Q.subtractToRef(Y,q),K.subtractToRef(Q,Z)),m&&n&&(J=m[4*P],$=m[4*P+1],ee=m[4*P+2],te=m[4*P+3],re=m[4*S],ne=m[4*S+1],ie=m[4*S+2],oe=m[4*S+3],se=m[4*E],ae=m[4*E+1],le=m[4*E+2],ce=m[4*E+3],ue.set(J,$,ee,te),de.set(re,ne,ie,oe),he.set(se,ae,le,ce),de.subtractToRef(ue,fe),he.subtractToRef(de,pe));for(var we,Fe,Ve=new i.Color3(0,0,0),ke=new i.Color3(0,0,0),Ue=0;Ue<t._groupDensity[M];Ue++)T=this.particles.length,this._addParticle(T,t,this._groupCounter,M+Ue),Fe=this.particles[T],me=g.Scalar.RandomRange(0,1),ge=g.Scalar.RandomRange(0,1),b=w.add(k.scale(me)).add(U.scale(me*ge)),r&&(ye=e.getFacetNormal(M).normalize().scale(-1),be=k.clone().normalize(),Ae=o.Vector3.Cross(ye,be),Te=g.Scalar.RandomRange(0,2*Math.PI),Me=be.scale(Math.cos(Te)).add(Ae.scale(Math.sin(Te))),Te=g.Scalar.RandomRange(.1,Math.PI/2),Ce=Me.scale(Math.cos(Te)).add(ye.scale(Math.sin(Te))),Ee.origin=b.add(Ce.scale(1e-5)),Ee.direction=Ce,Ee.length=u,(_e=Ee.intersectsMesh(e)).hit&&(Se=_e.pickedPoint.subtract(b).length(),Pe=g.Scalar.RandomRange(0,1)*Se,b.addInPlace(Ce.scale(Pe)))),Fe.position=b.clone(),this._positions.push(Fe.position.x,Fe.position.y,Fe.position.z),void 0!==n?p&&(A=Y.add(q.scale(me)).add(Z.scale(me*ge)),n?s&&null!==t._groupImageData?(xe=t._groupImgWidth,Re=t._groupImgHeight,we=this._getColorIndicesForCoord(t,Math.round(A.x*xe),Math.round(A.y*Re),xe),Fe.color=we,this._colors.push(we.r,we.g,we.b,we.a)):m?(ve=ue.add(fe.scale(me)).add(pe.scale(me*ge)),Fe.color=new i.Color4(ve.x,ve.y,ve.z,ve.w),this._colors.push(ve.x,ve.y,ve.z,ve.w)):(ve=ue.set(Math.random(),Math.random(),Math.random(),1),Fe.color=new i.Color4(ve.x,ve.y,ve.z,ve.w),this._colors.push(ve.x,ve.y,ve.z,ve.w)):(Fe.uv=A.clone(),this._uvs.push(Fe.uv.x,Fe.uv.y))):(l?(Ve.set(l.r,l.g,l.b),Oe=g.Scalar.RandomRange(-c,c),Ie=g.Scalar.RandomRange(-c,c),De=(Le=Ve.toHSV()).r,(Be=Le.g+Oe)<0&&(Be=0),Be>1&&(Be=1),(Ne=Le.b+Ie)<0&&(Ne=0),Ne>1&&(Ne=1),i.Color3.HSVtoRGBToRef(De,Be,Ne,ke),ve.set(ke.r,ke.g,ke.b,1)):ve=ue.set(Math.random(),Math.random(),Math.random(),1),Fe.color=new i.Color4(ve.x,ve.y,ve.z,ve.w),this._colors.push(ve.x,ve.y,ve.z,ve.w))}},e.prototype._colorFromTexture=function(e,t,r){var n=this;if(null===e.material)return s.Logger.Warn(e.name+"has no material."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,r,!0,!1);var i=e.material.getActiveTextures();if(0===i.length)return s.Logger.Warn(e.name+"has no useable texture."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,r,!0,!1);var o=e.clone();o.setEnabled(!1),this._promises.push(new Promise((function(e){m.BaseTexture.WhenAllReady(i,(function(){var s=t._textureNb;return s<0&&(s=0),s>i.length-1&&(s=i.length-1),t._groupImageData=i[s].readPixels(),t._groupImgWidth=i[s].getSize().width,t._groupImgHeight=i[s].getSize().height,n._setPointsColorOrUV(o,t,r,!0,!0),o.dispose(),e()}))})))},e.prototype._calculateDensity=function(e,t,r){for(var n,i,s,a,l,c,u,d,h,f,p,m,g,_,v,y,b,A=new Array,T=o.Vector3.Zero(),M=o.Vector3.Zero(),P=o.Vector3.Zero(),S=o.Vector3.Zero(),E=o.Vector3.Zero(),C=o.Vector3.Zero(),x=new Array,R=0,O=r.length/3,I=0;I<O;I++)n=r[3*I],i=r[3*I+1],s=r[3*I+2],a=t[3*n],l=t[3*n+1],c=t[3*n+2],u=t[3*i],d=t[3*i+1],h=t[3*i+2],f=t[3*s],p=t[3*s+1],m=t[3*s+2],T.set(a,l,c),M.set(u,d,h),P.set(f,p,m),M.subtractToRef(T,S),P.subtractToRef(M,E),P.subtractToRef(T,C),y=((g=S.length())+(_=E.length())+(v=C.length()))/2,R+=b=Math.sqrt(y*(y-g)*(y-_)*(y-v)),x[I]=b;var D=0;for(I=0;I<O;I++)A[I]=Math.floor(e*x[I]/R),D+=A[I];var B=e-D,N=Math.floor(B/O),L=B%O;for(N>0&&(A=A.map((function(e){return e+N}))),I=0;I<L;I++)A[I]+=1;return A},e.prototype.addPoints=function(e,t){void 0===t&&(t=this._randomUnitVector);for(var r,n=new d.PointsGroup(this._groupCounter,t),i=this.nbParticles,o=0;o<e;o++)r=this._addParticle(i,n,this._groupCounter,o),n&&n._positionFunction&&n._positionFunction(r,i,o),this._positions.push(r.position.x,r.position.y,r.position.z),r.color&&this._colors.push(r.color.r,r.color.g,r.color.b,r.color.a),r.uv&&this._uvs.push(r.uv.x,r.uv.y),i++;return this.nbParticles+=e,this._groupCounter++,this._groupCounter},e.prototype.addSurfacePoints=function(e,t,r,o,s){var l=r||n.Random;(isNaN(l)||l<0||l>3)&&(l=n.Random);var c=e.getVerticesData(a.VertexBuffer.PositionKind),u=e.getIndices();this._groups.push(this._groupCounter);var h=new d.PointsGroup(this._groupCounter,null);switch(h._groupDensity=this._calculateDensity(t,c,u),l===n.Color?h._textureNb=o||0:o=o||new i.Color4(1,1,1,1),l){case n.Color:this._colorFromTexture(e,h,!1);break;case n.UV:this._setPointsColorOrUV(e,h,!1,!1,!1);break;case n.Random:this._setPointsColorOrUV(e,h,!1);break;case n.Stated:this._setPointsColorOrUV(e,h,!1,void 0,void 0,o,s)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1},e.prototype.addVolumePoints=function(e,t,r,o,s){var l=r||n.Random;(isNaN(l)||l<0||l>3)&&(l=n.Random);var c=e.getVerticesData(a.VertexBuffer.PositionKind),u=e.getIndices();this._groups.push(this._groupCounter);var h=new d.PointsGroup(this._groupCounter,null);switch(h._groupDensity=this._calculateDensity(t,c,u),l===n.Color?h._textureNb=o||0:o=o||new i.Color4(1,1,1,1),l){case n.Color:this._colorFromTexture(e,h,!0);break;case n.UV:this._setPointsColorOrUV(e,h,!0,!1,!1);break;case n.Random:this._setPointsColorOrUV(e,h,!0);break;case n.Stated:this._setPointsColorOrUV(e,h,!0,void 0,void 0,o,s)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1},e.prototype.setParticles=function(e,t,r){if(void 0===e&&(e=0),void 0===t&&(t=this.nbParticles-1),void 0===r&&(r=!0),!this._updatable||!this._isReady)return this;this.beforeUpdateParticles(e,t,r);var n=o.TmpVectors.Matrix[0],i=this.mesh,s=this._colors32,l=this._positions32,c=this._uvs32,u=o.TmpVectors.Vector3,d=u[5].copyFromFloats(1,0,0),f=u[6].copyFromFloats(0,1,0),p=u[7].copyFromFloats(0,0,1),m=u[8].setAll(Number.MAX_VALUE),g=u[9].setAll(-Number.MAX_VALUE);o.Matrix.IdentityToRef(n);var _=0;if(this.mesh.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var v=this.mesh._boundingInfo;v&&(m.copyFrom(v.minimum),g.copyFrom(v.maximum))}_=0;for(var y=0,b=0,A=0,T=e;T<=t;T++){var M=this.particles[T];y=3*(_=M.idx),b=4*_,A=2*_,this.updateParticle(M);var P=M._rotationMatrix,S=M.position,E=M._globalPosition;if(this._computeParticleRotation&&M.getRotationMatrix(n),null!==M.parentId){var C=this.particles[M.parentId],x=C._rotationMatrix,R=C._globalPosition,O=S.x*x[1]+S.y*x[4]+S.z*x[7],I=S.x*x[0]+S.y*x[3]+S.z*x[6],D=S.x*x[2]+S.y*x[5]+S.z*x[8];if(E.x=R.x+I,E.y=R.y+O,E.z=R.z+D,this._computeParticleRotation){var B=n.m;P[0]=B[0]*x[0]+B[1]*x[3]+B[2]*x[6],P[1]=B[0]*x[1]+B[1]*x[4]+B[2]*x[7],P[2]=B[0]*x[2]+B[1]*x[5]+B[2]*x[8],P[3]=B[4]*x[0]+B[5]*x[3]+B[6]*x[6],P[4]=B[4]*x[1]+B[5]*x[4]+B[6]*x[7],P[5]=B[4]*x[2]+B[5]*x[5]+B[6]*x[8],P[6]=B[8]*x[0]+B[9]*x[3]+B[10]*x[6],P[7]=B[8]*x[1]+B[9]*x[4]+B[10]*x[7],P[8]=B[8]*x[2]+B[9]*x[5]+B[10]*x[8]}}else E.x=0,E.y=0,E.z=0,this._computeParticleRotation&&(B=n.m,P[0]=B[0],P[1]=B[1],P[2]=B[2],P[3]=B[4],P[4]=B[5],P[5]=B[6],P[6]=B[8],P[7]=B[9],P[8]=B[10]);var N=u[11];M.translateFromPivot?N.setAll(0):N.copyFrom(M.pivot);var L=u[0];L.copyFrom(M.position);var w=L.x-M.pivot.x,F=L.y-M.pivot.y,V=L.z-M.pivot.z,k=w*P[0]+F*P[3]+V*P[6],U=w*P[1]+F*P[4]+V*P[7],z=w*P[2]+F*P[5]+V*P[8];k+=N.x,U+=N.y,z+=N.z;var G=l[y]=E.x+d.x*k+f.x*U+p.x*z,j=l[y+1]=E.y+d.y*k+f.y*U+p.y*z,H=l[y+2]=E.z+d.z*k+f.z*U+p.z*z;if(this._computeBoundingBox&&(m.minimizeInPlaceFromFloats(G,j,H),g.maximizeInPlaceFromFloats(G,j,H)),this._computeParticleColor&&M.color){var W=M.color,X=this._colors32;X[b]=W.r,X[b+1]=W.g,X[b+2]=W.b,X[b+3]=W.a}if(this._computeParticleTexture&&M.uv){var Y=M.uv,Q=this._uvs32;Q[A]=Y.x,Q[A+1]=Y.y}}return r&&(this._computeParticleColor&&i.updateVerticesData(a.VertexBuffer.ColorKind,s,!1,!1),this._computeParticleTexture&&i.updateVerticesData(a.VertexBuffer.UVKind,c,!1,!1),i.updateVerticesData(a.VertexBuffer.PositionKind,l,!1,!1)),this._computeBoundingBox&&(i._boundingInfo?i._boundingInfo.reConstruct(m,g,i._worldMatrix):i._boundingInfo=new h.BoundingInfo(m,g,i._worldMatrix)),this.afterUpdateParticles(e,t,r),this},e.prototype.dispose=function(){this.mesh.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._uvs32=null,this._colors32=null},e.prototype.refreshVisibleSize=function(){return this._isVisibilityBoxLocked||this.mesh.refreshBoundingInfo(),this},e.prototype.setVisibilityBox=function(e){var t=e/2;this.mesh._boundingInfo=new h.BoundingInfo(new o.Vector3(-t,-t,-t),new o.Vector3(t,t,t))},Object.defineProperty(e.prototype,"isAlwaysVisible",{get:function(){return this._alwaysVisible},set:function(e){this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleRotation",{set:function(e){this._computeParticleRotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleColor",{get:function(){return this._computeParticleColor},set:function(e){this._computeParticleColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleTexture",{get:function(){return this._computeParticleTexture},set:function(e){this._computeParticleTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeBoundingBox",{get:function(){return this._computeBoundingBox},set:function(e){this._computeBoundingBox=e},enumerable:!1,configurable:!0}),e.prototype.initParticles=function(){},e.prototype.recycleParticle=function(e){return e},e.prototype.updateParticle=function(e){return e},e.prototype.beforeUpdateParticles=function(e,t,r){},e.prototype.afterUpdateParticles=function(e,t,r){},e}()},"./Particles/solidParticle.ts":
- /*!************************************!*\
- !*** ./Particles/solidParticle.ts ***!
- \************************************/
- /*! exports provided: SolidParticle, ModelShape, DepthSortedParticle, SolidParticleVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"SolidParticle",(function(){return l})),r.d(t,"ModelShape",(function(){return c})),r.d(t,"DepthSortedParticle",(function(){return u})),r.d(t,"SolidParticleVertex",(function(){return d}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),s=r(/*! ../Culling/boundingSphere */"./Culling/boundingSphere.ts"),a=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),l=function(){function e(e,t,r,s,l,c,u,d,h,f){void 0===h&&(h=null),void 0===f&&(f=null),this.idx=0,this.id=0,this.color=new i.Color4(1,1,1,1),this.position=n.Vector3.Zero(),this.rotation=n.Vector3.Zero(),this.scaling=n.Vector3.One(),this.uvs=new n.Vector4(0,0,1,1),this.velocity=n.Vector3.Zero(),this.pivot=n.Vector3.Zero(),this.translateFromPivot=!1,this.alive=!0,this.isVisible=!0,this._pos=0,this._ind=0,this.shapeId=0,this.idxInShape=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this.materialIndex=null,this.props=null,this.cullingStrategy=a.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this._globalPosition=n.Vector3.Zero(),this.idx=e,this.id=t,this._pos=r,this._ind=s,this._model=l,this.shapeId=c,this.idxInShape=u,this._sps=d,h&&(this._modelBoundingInfo=h,this._boundingInfo=new o.BoundingInfo(h.minimum,h.maximum)),null!==f&&(this.materialIndex=f)}return e.prototype.copyToRef=function(e){return e.position.copyFrom(this.position),e.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(e.rotationQuaternion?e.rotationQuaternion.copyFrom(this.rotationQuaternion):e.rotationQuaternion=this.rotationQuaternion.clone()),e.scaling.copyFrom(this.scaling),this.color&&(e.color?e.color.copyFrom(this.color):e.color=this.color.clone()),e.uvs.copyFrom(this.uvs),e.velocity.copyFrom(this.velocity),e.pivot.copyFrom(this.pivot),e.translateFromPivot=this.translateFromPivot,e.alive=this.alive,e.isVisible=this.isVisible,e.parentId=this.parentId,e.cullingStrategy=this.cullingStrategy,null!==this.materialIndex&&(e.materialIndex=this.materialIndex),this},Object.defineProperty(e.prototype,"scale",{get:function(){return this.scaling},set:function(e){this.scaling=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quaternion",{get:function(){return this.rotationQuaternion},set:function(e){this.rotationQuaternion=e},enumerable:!1,configurable:!0}),e.prototype.intersectsMesh=function(e){return!(!this._boundingInfo||!e._boundingInfo)&&(this._sps._bSphereOnly?s.BoundingSphere.Intersects(this._boundingInfo.boundingSphere,e._boundingInfo.boundingSphere):this._boundingInfo.intersects(e._boundingInfo,!1))},e.prototype.isInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isInFrustum(e,this.cullingStrategy)},e.prototype.getRotationMatrix=function(e){var t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=n.TmpVectors.Quaternion[0];var r=this.rotation;n.Quaternion.RotationYawPitchRollToRef(r.y,r.x,r.z,t)}t.toRotationMatrix(e)},e}(),c=function(e,t,r,n,i,o,s,a,l){this._indicesLength=0,this.shapeID=e,this._shape=t,this._indices=r,this._indicesLength=r.length,this._shapeUV=o,this._shapeColors=i,this._normals=n,this._positionFunction=s,this._vertexFunction=a,this._material=l},u=function(e,t,r,n){this.idx=0,this.ind=0,this.indicesLength=0,this.sqDistance=0,this.materialIndex=0,this.idx=e,this.ind=t,this.indicesLength=r,this.materialIndex=n},d=function(){function e(){this.position=n.Vector3.Zero(),this.color=new i.Color4(1,1,1,1),this.uv=n.Vector2.Zero()}return Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(e){this.position.x=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(e){this.position.y=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this.position.z},set:function(e){this.position.z=e},enumerable:!1,configurable:!0}),e}()},"./Particles/solidParticleSystem.ts":
- /*!******************************************!*\
- !*** ./Particles/solidParticleSystem.ts ***!
- \******************************************/
- /*! exports provided: SolidParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"SolidParticleSystem",(function(){return g}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Meshes/Builders/discBuilder */"./Meshes/Builders/discBuilder.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ./solidParticle */"./Particles/solidParticle.ts"),d=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),h=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),f=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),p=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),m=r(/*! ../Materials/multiMaterial */"./Materials/multiMaterial.ts"),g=function(){function e(e,t,r){this.particles=new Array,this.nbParticles=0,this.billboard=!1,this.recomputeNormals=!1,this.counter=0,this.vars={},this._bSphereOnly=!1,this._bSphereRadiusFactor=1,this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._index=0,this._updatable=!0,this._pickable=!1,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._depthSort=!1,this._expandable=!1,this._shapeCounter=0,this._copy=new u.SolidParticle(0,0,0,0,null,0,0,this),this._color=new i.Color4(0,0,0,0),this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeParticleVertex=!1,this._computeBoundingBox=!1,this._depthSortParticles=!0,this._mustUnrotateFixedNormals=!1,this._particlesIntersect=!1,this._needs32Bits=!1,this._isNotBuilt=!0,this._lastParticleId=0,this._idxOfId=[],this._multimaterialEnabled=!1,this._useModelMaterial=!1,this._depthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},this._materialSortFunction=function(e,t){return e.materialIndex-t.materialIndex},this._autoUpdateSubMeshes=!1,this.name=e,this._scene=t||c.EngineStore.LastCreatedScene,this._camera=t.activeCamera,this._pickable=!!r&&r.isPickable,this._depthSort=!!r&&r.enableDepthSort,this._multimaterialEnabled=!!r&&r.enableMultiMaterial,this._useModelMaterial=!!r&&r.useModelMaterial,this._multimaterialEnabled=!!this._useModelMaterial||this._multimaterialEnabled,this._expandable=!!r&&r.expandable,this._particlesIntersect=!!r&&r.particleIntersection,this._bSphereOnly=!!r&&r.boundingSphereOnly,this._bSphereRadiusFactor=r&&r.bSphereRadiusFactor?r.bSphereRadiusFactor:1,r&&void 0!==r.updatable?this._updatable=r.updatable:this._updatable=!0,this._pickable&&(this.pickedBySubMesh=[[]],this.pickedParticles=this.pickedBySubMesh[0]),(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]),this._multimaterialEnabled&&(this._multimaterial=new m.MultiMaterial(this.name+"MultiMaterial",this._scene),this._materials=[],this._materialIndexesById={}),this._tmpVertex=new u.SolidParticleVertex}return e.prototype.buildMesh=function(){if(!this._isNotBuilt&&this.mesh)return this.mesh;if(0===this.nbParticles&&!this.mesh){var e=l.DiscBuilder.CreateDisc("",{radius:1,tessellation:3},this._scene);this.addShape(e,1),e.dispose()}if(this._indices32=this._needs32Bits?new Uint32Array(this._indices):new Uint16Array(this._indices),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors),!this.mesh){var t=new a.Mesh(this.name,this._scene);this.mesh=t}!this._updatable&&this._multimaterialEnabled&&this._sortParticlesByMaterial(),this.recomputeNormals&&s.VertexData.ComputeNormals(this._positions32,this._indices32,this._normals),this._normals32=new Float32Array(this._normals),this._fixedNormal32=new Float32Array(this._normals),this._mustUnrotateFixedNormals&&this._unrotateFixedNormals();var r=new s.VertexData;if(r.indices=this._depthSort?this._indices:this._indices32,r.set(this._positions32,o.VertexBuffer.PositionKind),r.set(this._normals32,o.VertexBuffer.NormalKind),this._uvs32.length>0&&r.set(this._uvs32,o.VertexBuffer.UVKind),this._colors32.length>0&&r.set(this._colors32,o.VertexBuffer.ColorKind),r.applyToMesh(this.mesh,this._updatable),this.mesh.isPickable=this._pickable,this._pickable)for(var n=0,i=0;i<this.nbParticles;i++)for(var c=this.particles[i],u=c._model._indicesLength,d=0;d<u;d++)if(0==d%3){var h={idx:c.idx,faceId:n};this.pickedParticles[n]=h,n++}return this._multimaterialEnabled&&this.setMultiMaterial(this._materials),this._expandable||(this._depthSort||this._multimaterialEnabled||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0)),this._isNotBuilt=!1,this.recomputeNormals=!1,this.mesh},e.prototype.digest=function(e,t){var r=t&&t.facetNb||1,i=t&&t.number||0,s=t&&t.delta||0,a=e.getVerticesData(o.VertexBuffer.PositionKind),l=e.getIndices(),c=e.getVerticesData(o.VertexBuffer.UVKind),h=e.getVerticesData(o.VertexBuffer.ColorKind),f=e.getVerticesData(o.VertexBuffer.NormalKind),p=t&&t.storage?t.storage:null,m=0,g=l.length/3;i?(i=i>g?g:i,r=Math.round(g/i),s=0):r=r>g?g:r;for(var _=[],v=[],y=[],b=[],A=[],T=n.Vector3.Zero(),M=r;m<g;){m>g-(r=M+Math.floor((1+s)*Math.random()))&&(r=g-m),_.length=0,v.length=0,y.length=0,b.length=0,A.length=0;for(var P=0,S=3*m;S<3*(m+r);S++){y.push(P);var E=l[S],C=3*E;if(_.push(a[C],a[C+1],a[C+2]),v.push(f[C],f[C+1],f[C+2]),c){var x=2*E;b.push(c[x],c[x+1])}if(h){var R=4*E;A.push(h[R],h[R+1],h[R+2],h[R+3])}P++}var O,I=this.nbParticles,D=this._posToShape(_),B=this._uvsToShapeUV(b),N=Array.from(y),L=Array.from(A),w=Array.from(v);for(T.copyFromFloats(0,0,0),O=0;O<D.length;O++)T.addInPlace(D[O]);T.scaleInPlace(1/D.length);var F,V=new n.Vector3(1/0,1/0,1/0),k=new n.Vector3(-1/0,-1/0,-1/0);for(O=0;O<D.length;O++)D[O].subtractInPlace(T),V.minimizeInPlaceFromFloats(D[O].x,D[O].y,D[O].z),k.maximizeInPlaceFromFloats(D[O].x,D[O].y,D[O].z);this._particlesIntersect&&(F=new d.BoundingInfo(V,k));var U=null;this._useModelMaterial&&(U=e.material?e.material:this._setDefaultMaterial());var z=new u.ModelShape(this._shapeCounter,D,N,w,L,B,null,null,U),G=this._positions.length,j=this._indices.length;this._meshBuilder(this._index,j,D,this._positions,N,this._indices,b,this._uvs,L,this._colors,w,this._normals,I,0,null,z),this._addParticle(I,this._lastParticleId,G,j,z,this._shapeCounter,0,F,p),this.particles[this.nbParticles].position.addInPlace(T),p||(this._index+=D.length,I++,this.nbParticles++,this._lastParticleId++),this._shapeCounter++,m+=r}return this._isNotBuilt=!0,this},e.prototype._unrotateFixedNormals=function(){for(var e=0,t=0,r=n.TmpVectors.Vector3[0],i=n.TmpVectors.Quaternion[0],o=n.TmpVectors.Matrix[0],s=0;s<this.particles.length;s++){var a=this.particles[s],l=a._model._shape;if(a.rotationQuaternion)a.rotationQuaternion.conjugateToRef(i);else{var c=a.rotation;n.Quaternion.RotationYawPitchRollToRef(c.y,c.x,c.z,i),i.conjugateInPlace()}i.toRotationMatrix(o);for(var u=0;u<l.length;u++)t=e+3*u,n.Vector3.TransformNormalFromFloatsToRef(this._normals32[t],this._normals32[t+1],this._normals32[t+2],o,r),r.toArray(this._fixedNormal32,t);e=t+3}},e.prototype._resetCopy=function(){var e=this._copy;e.position.setAll(0),e.rotation.setAll(0),e.rotationQuaternion=null,e.scaling.setAll(1),e.uvs.copyFromFloats(0,0,1,1),e.color=null,e.translateFromPivot=!1,e.shapeId=0,e.materialIndex=null},e.prototype._meshBuilder=function(e,t,r,i,o,s,a,l,c,d,h,f,p,m,g,_){var v,y=0,b=0,A=0;this._resetCopy();var T=this._copy,M=!(!g||!g.storage);if(T.idx=p,T.idxInShape=m,T.shapeId=_.shapeID,this._useModelMaterial){var P=_._material.uniqueId,S=this._materialIndexesById;S.hasOwnProperty(P)||(S[P]=this._materials.length,this._materials.push(_._material));var E=S[P];T.materialIndex=E}if(g&&g.positionFunction&&(g.positionFunction(T,p,m),this._mustUnrotateFixedNormals=!0),M)return T;var C=n.TmpVectors.Matrix[0],x=this._tmpVertex,R=x.position,O=x.color,I=x.uv,D=n.TmpVectors.Vector3[1],B=n.TmpVectors.Vector3[2],N=n.TmpVectors.Vector3[3];n.Matrix.IdentityToRef(C),T.getRotationMatrix(C),T.pivot.multiplyToRef(T.scaling,N),T.translateFromPivot?B.setAll(0):B.copyFrom(N);var L=g&&g.vertexFunction;for(v=0;v<r.length;v++){if(R.copyFrom(r[v]),T.color&&O.copyFrom(T.color),a&&I.copyFromFloats(a[y],a[y+1]),L&&g.vertexFunction(T,x,v),R.multiplyInPlace(T.scaling).subtractInPlace(N),n.Vector3.TransformCoordinatesToRef(R,C,D),D.addInPlace(B).addInPlace(T.position),i.push(D.x,D.y,D.z),a){var w=T.uvs;l.push((w.z-w.x)*I.x+w.x,(w.w-w.y)*I.y+w.y),y+=2}if(T.color)this._color.copyFrom(O);else{var F=this._color;c&&void 0!==c[b]?(F.r=c[b],F.g=c[b+1],F.b=c[b+2],F.a=c[b+3]):(F.r=1,F.g=1,F.b=1,F.a=1)}d.push(this._color.r,this._color.g,this._color.b,this._color.a),b+=4,!this.recomputeNormals&&h&&(n.Vector3.TransformNormalFromFloatsToRef(h[A],h[A+1],h[A+2],C,R),f.push(R.x,R.y,R.z),A+=3)}for(v=0;v<o.length;v++){var V=e+o[v];s.push(V),V>65535&&(this._needs32Bits=!0)}if(this._depthSort||this._multimaterialEnabled){var k=null!==T.materialIndex?T.materialIndex:0;this.depthSortedParticles.push(new u.DepthSortedParticle(p,t,o.length,k))}return T},e.prototype._posToShape=function(e){for(var t=[],r=0;r<e.length;r+=3)t.push(n.Vector3.FromArray(e,r));return t},e.prototype._uvsToShapeUV=function(e){var t=[];if(e)for(var r=0;r<e.length;r++)t.push(e[r]);return t},e.prototype._addParticle=function(e,t,r,n,i,o,s,a,l){void 0===a&&(a=null),void 0===l&&(l=null);var c=new u.SolidParticle(e,t,r,n,i,o,s,this,a);return(l||this.particles).push(c),c},e.prototype.addShape=function(e,t,r){var n=e.getVerticesData(o.VertexBuffer.PositionKind),i=e.getIndices(),s=e.getVerticesData(o.VertexBuffer.UVKind),a=e.getVerticesData(o.VertexBuffer.ColorKind),l=e.getVerticesData(o.VertexBuffer.NormalKind);this.recomputeNormals=!l;var c=Array.from(i),d=Array.from(l),h=a?Array.from(a):[],f=r&&r.storage?r.storage:null,p=null;this._particlesIntersect&&(p=e.getBoundingInfo());var m=this._posToShape(n),g=this._uvsToShapeUV(s),_=r?r.positionFunction:null,v=r?r.vertexFunction:null,y=null;this._useModelMaterial&&(y=e.material?e.material:this._setDefaultMaterial());for(var b=new u.ModelShape(this._shapeCounter,m,c,d,h,g,_,v,y),A=0;A<t;A++)this._insertNewParticle(this.nbParticles,A,b,m,i,s,a,l,p,f,r);return this._shapeCounter++,this._isNotBuilt=!0,this._shapeCounter-1},e.prototype._rebuildParticle=function(e,t){void 0===t&&(t=!1),this._resetCopy();var r=this._copy;e._model._positionFunction&&e._model._positionFunction(r,e.idx,e.idxInShape);var i=n.TmpVectors.Matrix[0],o=n.TmpVectors.Vector3[0],s=n.TmpVectors.Vector3[1],a=n.TmpVectors.Vector3[2],l=n.TmpVectors.Vector3[3];r.getRotationMatrix(i),e.pivot.multiplyToRef(e.scaling,l),r.translateFromPivot?a.copyFromFloats(0,0,0):a.copyFrom(l);for(var c=e._model._shape,u=0;u<c.length;u++)o.copyFrom(c[u]),e._model._vertexFunction&&e._model._vertexFunction(r,o,u),o.multiplyInPlace(r.scaling).subtractInPlace(l),n.Vector3.TransformCoordinatesToRef(o,i,s),s.addInPlace(a).addInPlace(r.position).toArray(this._positions32,e._pos+3*u);t&&(e.position.setAll(0),e.rotation.setAll(0),e.rotationQuaternion=null,e.scaling.setAll(1),e.uvs.setAll(0),e.pivot.setAll(0),e.translateFromPivot=!1,e.parentId=null)},e.prototype.rebuildMesh=function(e){void 0===e&&(e=!1);for(var t=0;t<this.particles.length;t++)this._rebuildParticle(this.particles[t],e);return this.mesh.updateVerticesData(o.VertexBuffer.PositionKind,this._positions32,!1,!1),this},e.prototype.removeParticles=function(e,t){var r=t-e+1;if(!this._expandable||r<=0||r>=this.nbParticles||!this._updatable)return[];var n=this.particles,i=this.nbParticles;if(t<i-1)for(var o=t+1,s=n[o]._pos-n[e]._pos,a=n[o]._ind-n[e]._ind,l=o;l<i;l++){var c=n[l];c._pos-=s,c._ind-=a}var u=n.splice(e,r);this._positions.length=0,this._indices.length=0,this._colors.length=0,this._uvs.length=0,this._normals.length=0,this._index=0,this._idxOfId.length=0,(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]);for(var d=0,h=n.length,f=0;f<h;f++){var p=n[f],m=p._model,g=m._shape,_=m._indices,v=m._normals,y=m._shapeColors,b=m._shapeUV;p.idx=f,this._idxOfId[p.id]=f,this._meshBuilder(this._index,d,g,this._positions,_,this._indices,b,this._uvs,y,this._colors,v,this._normals,p.idx,p.idxInShape,null,m),this._index+=g.length,d+=_.length}return this.nbParticles-=r,this._isNotBuilt=!0,u},e.prototype.insertParticlesFromArray=function(e){if(!this._expandable)return this;for(var t=0,r=e[0].shapeId,n=e.length,i=0;i<n;i++){var o=e[i],s=o._model,a=s._shape,l=s._indices,c=s._shapeUV,u=s._shapeColors,d=s._normals,h=!d;this.recomputeNormals=h||this.recomputeNormals;var f=o._boundingInfo,p=this._insertNewParticle(this.nbParticles,t,s,a,l,c,u,d,f,null,null);o.copyToRef(p),t++,r!=o.shapeId&&(r=o.shapeId,t=0)}return this._isNotBuilt=!0,this},e.prototype._insertNewParticle=function(e,t,r,n,i,o,s,a,l,c,u){var d=this._positions.length,h=this._indices.length,f=this._meshBuilder(this._index,h,n,this._positions,i,this._indices,o,this._uvs,s,this._colors,a,this._normals,e,t,u,r),p=null;return this._updatable&&((p=this._addParticle(this.nbParticles,this._lastParticleId,d,h,r,this._shapeCounter,t,l,c)).position.copyFrom(f.position),p.rotation.copyFrom(f.rotation),f.rotationQuaternion&&(p.rotationQuaternion?p.rotationQuaternion.copyFrom(f.rotationQuaternion):p.rotationQuaternion=f.rotationQuaternion.clone()),f.color&&(p.color?p.color.copyFrom(f.color):p.color=f.color.clone()),p.scaling.copyFrom(f.scaling),p.uvs.copyFrom(f.uvs),null!==f.materialIndex&&(p.materialIndex=f.materialIndex),this.expandable&&(this._idxOfId[p.id]=p.idx)),c||(this._index+=n.length,this.nbParticles++,this._lastParticleId++),p},e.prototype.setParticles=function(e,t,r){if(void 0===e&&(e=0),void 0===t&&(t=this.nbParticles-1),void 0===r&&(r=!0),!this._updatable||this._isNotBuilt)return this;this.beforeUpdateParticles(e,t,r);var i=n.TmpVectors.Matrix[0],a=n.TmpVectors.Matrix[1],l=this.mesh,c=this._colors32,u=this._positions32,f=this._normals32,p=this._uvs32,m=this._indices32,g=this._indices,_=this._fixedNormal32,v=n.TmpVectors.Vector3,y=v[5].copyFromFloats(1,0,0),b=v[6].copyFromFloats(0,1,0),A=v[7].copyFromFloats(0,0,1),T=v[8].setAll(Number.MAX_VALUE),M=v[9].setAll(-Number.MAX_VALUE),P=v[10].setAll(0),S=this._tmpVertex,E=S.position,C=S.color,x=S.uv;if((this.billboard||this._depthSort)&&(this.mesh.computeWorldMatrix(!0),this.mesh._worldMatrix.invertToRef(a)),this.billboard){var R=v[0];this._camera.getDirectionToRef(h.Axis.Z,R),n.Vector3.TransformNormalToRef(R,a,A),A.normalize();var O=this._camera.getViewMatrix(!0);n.Vector3.TransformNormalFromFloatsToRef(O.m[1],O.m[5],O.m[9],a,b),n.Vector3.CrossToRef(b,A,y),b.normalize(),y.normalize()}this._depthSort&&n.Vector3.TransformCoordinatesToRef(this._camera.globalPosition,a,P),n.Matrix.IdentityToRef(i);var I=0,D=0,B=0,N=0,L=0,w=0,F=0;if(this.mesh.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var V=this.mesh._boundingInfo;V&&(T.copyFrom(V.minimum),M.copyFrom(V.maximum))}var k=(D=this.particles[e]._pos)/3|0;N=4*k,w=2*k;for(var U=e;U<=t;U++){var z=this.particles[U];this.updateParticle(z);var G=z._model._shape,j=z._model._shapeUV,H=z._rotationMatrix,W=z.position,X=z.rotation,Y=z.scaling,Q=z._globalPosition;if(this._depthSort&&this._depthSortParticles){var K=this.depthSortedParticles[U];K.idx=z.idx,K.ind=z._ind,K.indicesLength=z._model._indicesLength,K.sqDistance=n.Vector3.DistanceSquared(z.position,P)}if(!z.alive||z._stillInvisible&&!z.isVisible)D+=3*(F=G.length),N+=4*F,w+=2*F;else{if(z.isVisible){z._stillInvisible=!1;var q=v[12];if(z.pivot.multiplyToRef(Y,q),this.billboard&&(X.x=0,X.y=0),(this._computeParticleRotation||this.billboard)&&z.getRotationMatrix(i),null!==z.parentId){var Z=this.getParticleById(z.parentId);if(Z){var J=Z._rotationMatrix,$=Z._globalPosition,ee=W.x*J[1]+W.y*J[4]+W.z*J[7],te=W.x*J[0]+W.y*J[3]+W.z*J[6],re=W.x*J[2]+W.y*J[5]+W.z*J[8];if(Q.x=$.x+te,Q.y=$.y+ee,Q.z=$.z+re,this._computeParticleRotation||this.billboard){var ne=i.m;H[0]=ne[0]*J[0]+ne[1]*J[3]+ne[2]*J[6],H[1]=ne[0]*J[1]+ne[1]*J[4]+ne[2]*J[7],H[2]=ne[0]*J[2]+ne[1]*J[5]+ne[2]*J[8],H[3]=ne[4]*J[0]+ne[5]*J[3]+ne[6]*J[6],H[4]=ne[4]*J[1]+ne[5]*J[4]+ne[6]*J[7],H[5]=ne[4]*J[2]+ne[5]*J[5]+ne[6]*J[8],H[6]=ne[8]*J[0]+ne[9]*J[3]+ne[10]*J[6],H[7]=ne[8]*J[1]+ne[9]*J[4]+ne[10]*J[7],H[8]=ne[8]*J[2]+ne[9]*J[5]+ne[10]*J[8]}}else z.parentId=null}else Q.x=W.x,Q.y=W.y,Q.z=W.z,(this._computeParticleRotation||this.billboard)&&(ne=i.m,H[0]=ne[0],H[1]=ne[1],H[2]=ne[2],H[3]=ne[4],H[4]=ne[5],H[5]=ne[6],H[6]=ne[8],H[7]=ne[9],H[8]=ne[10]);var ie=v[11];for(z.translateFromPivot?ie.setAll(0):ie.copyFrom(q),F=0;F<G.length;F++){I=D+3*F,B=N+4*F,L=w+2*F;var oe=2*F,se=oe+1;E.copyFrom(G[F]),this._computeParticleColor&&z.color&&C.copyFrom(z.color),this._computeParticleTexture&&x.copyFromFloats(j[oe],j[se]),this._computeParticleVertex&&this.updateParticleVertex(z,S,F);var ae=E.x*Y.x-q.x,le=E.y*Y.y-q.y,ce=E.z*Y.z-q.z;te=ae*H[0]+le*H[3]+ce*H[6],ee=ae*H[1]+le*H[4]+ce*H[7],re=ae*H[2]+le*H[5]+ce*H[8],te+=ie.x,ee+=ie.y,re+=ie.z;var ue=u[I]=Q.x+y.x*te+b.x*ee+A.x*re,de=u[I+1]=Q.y+y.y*te+b.y*ee+A.y*re,he=u[I+2]=Q.z+y.z*te+b.z*ee+A.z*re;if(this._computeBoundingBox&&(T.minimizeInPlaceFromFloats(ue,de,he),M.maximizeInPlaceFromFloats(ue,de,he)),!this._computeParticleVertex){var fe=_[I],pe=_[I+1],me=_[I+2],ge=fe*H[0]+pe*H[3]+me*H[6],_e=fe*H[1]+pe*H[4]+me*H[7],ve=fe*H[2]+pe*H[5]+me*H[8];f[I]=y.x*ge+b.x*_e+A.x*ve,f[I+1]=y.y*ge+b.y*_e+A.y*ve,f[I+2]=y.z*ge+b.z*_e+A.z*ve}if(this._computeParticleColor&&z.color){var ye=this._colors32;ye[B]=C.r,ye[B+1]=C.g,ye[B+2]=C.b,ye[B+3]=C.a}if(this._computeParticleTexture){var be=z.uvs;p[L]=x.x*(be.z-be.x)+be.x,p[L+1]=x.y*(be.w-be.y)+be.y}}}else for(z._stillInvisible=!0,F=0;F<G.length;F++){if(B=N+4*F,L=w+2*F,u[I=D+3*F]=u[I+1]=u[I+2]=0,f[I]=f[I+1]=f[I+2]=0,this._computeParticleColor&&z.color){var Ae=z.color;c[B]=Ae.r,c[B+1]=Ae.g,c[B+2]=Ae.b,c[B+3]=Ae.a}this._computeParticleTexture&&(be=z.uvs,p[L]=j[2*F]*(be.z-be.x)+be.x,p[L+1]=j[2*F+1]*(be.w-be.y)+be.y)}if(this._particlesIntersect){var Te=z._boundingInfo,Me=Te.boundingBox,Pe=Te.boundingSphere,Se=z._modelBoundingInfo;if(!this._bSphereOnly){var Ee=Se.boundingBox.vectors,Ce=v[1],xe=v[2];Ce.setAll(Number.MAX_VALUE),xe.setAll(-Number.MAX_VALUE);for(var Re=0;Re<8;Re++){var Oe=Ee[Re].x*Y.x,Ie=Ee[Re].y*Y.y,De=Ee[Re].z*Y.z,Be=(te=Oe*H[0]+Ie*H[3]+De*H[6],ee=Oe*H[1]+Ie*H[4]+De*H[7],re=Oe*H[2]+Ie*H[5]+De*H[8],W.x+y.x*te+b.x*ee+A.x*re),Ne=W.y+y.y*te+b.y*ee+A.y*re,Le=W.z+y.z*te+b.z*ee+A.z*re;Ce.minimizeInPlaceFromFloats(Be,Ne,Le),xe.maximizeInPlaceFromFloats(Be,Ne,Le)}Me.reConstruct(Ce,xe,l._worldMatrix)}var we=Se.minimum.multiplyToRef(Y,v[1]),Fe=Se.maximum.multiplyToRef(Y,v[2]),Ve=Fe.addToRef(we,v[3]).scaleInPlace(.5).addInPlace(Q),ke=Fe.subtractToRef(we,v[4]).scaleInPlace(.5*this._bSphereRadiusFactor),Ue=Ve.subtractToRef(ke,v[1]),ze=Ve.addToRef(ke,v[2]);Pe.reConstruct(Ue,ze,l._worldMatrix)}D=I+3,N=B+4,w=L+2}}if(r){if(this._computeParticleColor&&l.updateVerticesData(o.VertexBuffer.ColorKind,c,!1,!1),this._computeParticleTexture&&l.updateVerticesData(o.VertexBuffer.UVKind,p,!1,!1),l.updateVerticesData(o.VertexBuffer.PositionKind,u,!1,!1),!l.areNormalsFrozen||l.isFacetDataEnabled){if(this._computeParticleVertex||l.isFacetDataEnabled){var Ge=l.isFacetDataEnabled?l.getFacetDataParameters():null;s.VertexData.ComputeNormals(u,m,f,Ge);for(var je=0;je<f.length;je++)_[je]=f[je]}l.areNormalsFrozen||l.updateVerticesData(o.VertexBuffer.NormalKind,f,!1,!1)}if(this._depthSort&&this._depthSortParticles){var He=this.depthSortedParticles;He.sort(this._depthSortFunction);for(var We=He.length,Xe=0,Ye=0,Qe=0;Qe<We;Qe++){var Ke=He[Qe],qe=Ke.indicesLength,Ze=Ke.ind;for(je=0;je<qe;je++)if(m[Xe]=g[Ze+je],Xe++,this._pickable&&0==je%3){var Je=this.pickedParticles[Ye];Je.idx=Ke.idx,Je.faceId=Ye,Ye++}}l.updateIndices(m)}}return this._computeBoundingBox&&(l._boundingInfo?l._boundingInfo.reConstruct(T,M,l._worldMatrix):l._boundingInfo=new d.BoundingInfo(T,M,l._worldMatrix)),this._autoUpdateSubMeshes&&this.computeSubMeshes(),this.afterUpdateParticles(e,t,r),this},e.prototype.dispose=function(){this.mesh.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._normals32=null,this._fixedNormal32=null,this._uvs32=null,this._colors32=null,this.pickedParticles=null,this.pickedBySubMesh=null,this._materials=null,this._materialIndexes=null,this._indicesByMaterial=null,this._idxOfId=null},e.prototype.pickedParticle=function(e){if(e.hit){var t=e.subMeshId,r=e.faceId,n=this.pickedBySubMesh;if(n[t]&&n[t][r])return n[t][r]}return null},e.prototype.getParticleById=function(e){var t=this.particles[e];if(t&&t.id==e)return t;var r=this.particles,n=this._idxOfId[e];if(void 0!==n)return r[n];for(var i=0,o=this.nbParticles;i<o;){var s=r[i];if(s.id==e)return s;i++}return null},e.prototype.getParticlesByShapeId=function(e){var t=[];return this.getParticlesByShapeIdToRef(e,t),t},e.prototype.getParticlesByShapeIdToRef=function(e,t){t.length=0;for(var r=0;r<this.nbParticles;r++){var n=this.particles[r];n.shapeId==e&&t.push(n)}return this},e.prototype.computeSubMeshes=function(){if(!this.mesh||!this._multimaterialEnabled)return this;var e=this.depthSortedParticles;if(this.particles.length>0)for(var t=0;t<this.particles.length;t++){var r=this.particles[t];r.materialIndex||(r.materialIndex=0);var n=e[t];n.materialIndex=r.materialIndex,n.ind=r._ind,n.indicesLength=r._model._indicesLength,n.idx=r.idx}this._sortParticlesByMaterial();var i=this._indicesByMaterial,o=this._materialIndexes,s=this.mesh;s.subMeshes=[];for(var a=s.getTotalVertices(),l=0;l<o.length;l++){var c=i[l],u=i[l+1]-c,d=o[l];new f.SubMesh(d,0,a,c,u,s)}return this},e.prototype._sortParticlesByMaterial=function(){var e=[0];this._indicesByMaterial=e;var t=[];this._materialIndexes=t;var r=this.depthSortedParticles;r.sort(this._materialSortFunction);var n=r.length,i=this._indices32,o=this._indices,s=0,a=0,l=0,c=r[0].materialIndex;t.push(c),this._pickable&&(this.pickedBySubMesh=[[]],this.pickedParticles=this.pickedBySubMesh[0]);for(var u=0;u<n;u++){var d=r[u],h=d.indicesLength,f=d.ind;d.materialIndex!==c&&(c=d.materialIndex,e.push(l),t.push(c),this._pickable&&(s++,this.pickedBySubMesh[s]=[],a=0));for(var p=0,m=0;m<h;m++){if(i[l]=o[f+m],this._pickable&&0==m%3){var g=this.pickedBySubMesh[s][a];g?(g.idx=d.idx,g.faceId=p):this.pickedBySubMesh[s][a]={idx:d.idx,faceId:p},a++,p++}l++}}return e.push(i.length),this._updatable&&this.mesh.updateIndices(i),this},e.prototype._setMaterialIndexesById=function(){this._materialIndexesById={};for(var e=0;e<this._materials.length;e++){var t=this._materials[e].uniqueId;this._materialIndexesById[t]=e}},e.prototype._filterUniqueMaterialId=function(e){return e.filter((function(e,t,r){return r.indexOf(e)===t}))},e.prototype._setDefaultMaterial=function(){return this._defaultMaterial||(this._defaultMaterial=new p.StandardMaterial(this.name+"DefaultMaterial",this._scene)),this._defaultMaterial},e.prototype.refreshVisibleSize=function(){return this._isVisibilityBoxLocked||this.mesh.refreshBoundingInfo(),this},e.prototype.setVisibilityBox=function(e){var t=e/2;this.mesh._boundingInfo=new d.BoundingInfo(new n.Vector3(-t,-t,-t),new n.Vector3(t,t,t))},Object.defineProperty(e.prototype,"isAlwaysVisible",{get:function(){return this._alwaysVisible},set:function(e){this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isVisibilityBoxLocked",{get:function(){return this._isVisibilityBoxLocked},set:function(e){this._isVisibilityBoxLocked=e,this.mesh.getBoundingInfo().isLocked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleRotation",{get:function(){return this._computeParticleRotation},set:function(e){this._computeParticleRotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleColor",{get:function(){return this._computeParticleColor},set:function(e){this._computeParticleColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleTexture",{get:function(){return this._computeParticleTexture},set:function(e){this._computeParticleTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleVertex",{get:function(){return this._computeParticleVertex},set:function(e){this._computeParticleVertex=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"computeBoundingBox",{get:function(){return this._computeBoundingBox},set:function(e){this._computeBoundingBox=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthSortParticles",{get:function(){return this._depthSortParticles},set:function(e){this._depthSortParticles=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"expandable",{get:function(){return this._expandable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multimaterialEnabled",{get:function(){return this._multimaterialEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useModelMaterial",{get:function(){return this._useModelMaterial},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"materials",{get:function(){return this._materials},enumerable:!1,configurable:!0}),e.prototype.setMultiMaterial=function(e){this._materials=this._filterUniqueMaterialId(e),this._setMaterialIndexesById(),this._multimaterial&&this._multimaterial.dispose(),this._multimaterial=new m.MultiMaterial(this.name+"MultiMaterial",this._scene);for(var t=0;t<this._materials.length;t++)this._multimaterial.subMaterials.push(this._materials[t]);this.computeSubMeshes(),this.mesh.material=this._multimaterial},Object.defineProperty(e.prototype,"multimaterial",{get:function(){return this._multimaterial},set:function(e){this._multimaterial=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdateSubMeshes",{get:function(){return this._autoUpdateSubMeshes},set:function(e){this._autoUpdateSubMeshes=e},enumerable:!1,configurable:!0}),e.prototype.initParticles=function(){},e.prototype.recycleParticle=function(e){return e},e.prototype.updateParticle=function(e){return e},e.prototype.updateParticleVertex=function(e,t,r){return this},e.prototype.beforeUpdateParticles=function(e,t,r){},e.prototype.afterUpdateParticles=function(e,t,r){},e}()},"./Particles/subEmitter.ts":
- /*!*********************************!*\
- !*** ./Particles/subEmitter.ts ***!
- \*********************************/
- /*! exports provided: SubEmitterType, SubEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"SubEmitterType",(function(){return n})),r.d(t,"SubEmitter",(function(){return l}));var n,i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Misc/devTools */"./Misc/devTools.ts");!function(e){e[e.ATTACHED=0]="ATTACHED",e[e.END=1]="END"}(n||(n={}));var l=function(){function e(e){this.particleSystem=e,this.type=n.END,this.inheritDirection=!1,this.inheritedVelocityAmount=0,e.emitter&&e.emitter.dispose||(e.emitter=new o.AbstractMesh("SubemitterSystemEmitter",e.getScene())),e.onDisposeObservable.add((function(){e.emitter&&e.emitter.dispose&&e.emitter.dispose()}))}return e.prototype.clone=function(){var t=this.particleSystem.emitter;t?t instanceof i.Vector3?t=t.clone():t instanceof o.AbstractMesh&&((t=new s.Mesh("",t.getScene())).isVisible=!1):t=new i.Vector3;var r=new e(this.particleSystem.clone("",t));return r.particleSystem.name+="Clone",r.type=this.type,r.inheritDirection=this.inheritDirection,r.inheritedVelocityAmount=this.inheritedVelocityAmount,r.particleSystem._disposeEmitterOnDispose=!0,r.particleSystem.disposeOnStop=!0,r},e.prototype.serialize=function(){var e={};return e.type=this.type,e.inheritDirection=this.inheritDirection,e.inheritedVelocityAmount=this.inheritedVelocityAmount,e.particleSystem=this.particleSystem.serialize(),e},e._ParseParticleSystem=function(e,t,r){throw a._DevTools.WarnImport("ParseParticle")},e.Parse=function(t,r,n){var i=t.particleSystem,o=new e(e._ParseParticleSystem(i,r,n));return o.type=t.type,o.inheritDirection=t.inheritDirection,o.inheritedVelocityAmount=t.inheritedVelocityAmount,o.particleSystem._isSubEmitter=!0,o},e.prototype.dispose=function(){this.particleSystem.dispose()},e}()},"./Physics/IPhysicsEngine.ts":
- /*!***********************************!*\
- !*** ./Physics/IPhysicsEngine.ts ***!
- \***********************************/
- /*! no static exports found */function(e,t){},"./Physics/Plugins/ammoJSPlugin.ts":
- /*!*****************************************!*\
- !*** ./Physics/Plugins/ammoJSPlugin.ts ***!
- \*****************************************/
- /*! exports provided: AmmoJSPlugin */function(e,t,r){"use strict";r.r(t),r.d(t,"AmmoJSPlugin",(function(){return f}));var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),s=r(/*! ../../Physics/physicsJoint */"./Physics/physicsJoint.ts"),a=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),c=r(/*! ../../Meshes/Builders/shapeBuilder */"./Meshes/Builders/shapeBuilder.ts"),u=r(/*! ../../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),d=r(/*! ../physicsRaycastResult */"./Physics/physicsRaycastResult.ts"),h=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),f=function(){function e(e,t,r){var o=this;void 0===e&&(e=!0),void 0===t&&(t=Ammo),void 0===r&&(r=null),this._useDeltaForWorldStep=e,this.bjsAMMO={},this.name="AmmoJSPlugin",this._timeStep=1/60,this._fixedTimeStep=1/60,this._maxSteps=5,this._tmpQuaternion=new n.Quaternion,this._tmpContactCallbackResult=!1,this._tmpMatrix=new n.Matrix,"function"==typeof t?t(this.bjsAMMO):this.bjsAMMO=t,this.isSupported()?(this._collisionConfiguration=new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration,this._dispatcher=new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration),this._overlappingPairCache=r||new this.bjsAMMO.btDbvtBroadphase,this._solver=new this.bjsAMMO.btSequentialImpulseConstraintSolver,this._softBodySolver=new this.bjsAMMO.btDefaultSoftBodySolver,this.world=new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher,this._overlappingPairCache,this._solver,this._collisionConfiguration,this._softBodySolver),this._tmpAmmoConcreteContactResultCallback=new this.bjsAMMO.ConcreteContactResultCallback,this._tmpAmmoConcreteContactResultCallback.addSingleResult=function(){o._tmpContactCallbackResult=!0},this._raycastResult=new d.PhysicsRaycastResult,this._tmpAmmoTransform=new this.bjsAMMO.btTransform,this._tmpAmmoTransform.setIdentity(),this._tmpAmmoQuaternion=new this.bjsAMMO.btQuaternion(0,0,0,1),this._tmpAmmoVectorA=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorB=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorC=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorD=new this.bjsAMMO.btVector3(0,0,0)):i.Logger.Error("AmmoJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){this._tmpAmmoVectorA.setValue(e.x,e.y,e.z),this.world.setGravity(this._tmpAmmoVectorA),this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA)},e.prototype.setTimeStep=function(e){this._timeStep=e},e.prototype.setFixedTimeStep=function(e){this._fixedTimeStep=e},e.prototype.setMaxSteps=function(e){this._maxSteps=e},e.prototype.getTimeStep=function(){return this._timeStep},e.prototype._isImpostorInContact=function(e){return this._tmpContactCallbackResult=!1,this.world.contactTest(e.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._isImpostorPairInContact=function(e,t){return this._tmpContactCallbackResult=!1,this.world.contactPairTest(e.physicsBody,t.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._stepSimulation=function(e,t,r){if(void 0===e&&(e=1/60),void 0===t&&(t=10),void 0===r&&(r=1/60),0==t)this.world.stepSimulation(e,0);else for(;t>0&&e>0;)e-r<r?(this.world.stepSimulation(e,0),e=0):(e-=r,this.world.stepSimulation(r,0)),t--},e.prototype.executeStep=function(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];i.soft||i.beforeStep()}this._stepSimulation(this._useDeltaForWorldStep?e:this._timeStep,this._maxSteps,this._fixedTimeStep);for(var o=0,s=t;o<s.length;o++){var a=s[o];if(a.soft?this._afterSoftStep(a):a.afterStep(),a._onPhysicsCollideCallbacks.length>0&&this._isImpostorInContact(a))for(var l=0,c=a._onPhysicsCollideCallbacks;l<c.length;l++)for(var u=0,d=c[l].otherImpostors;u<d.length;u++){var h=d[u];(a.physicsBody.isActive()||h.physicsBody.isActive())&&this._isImpostorPairInContact(a,h)&&(a.onCollide({body:h.physicsBody}),h.onCollide({body:a.physicsBody}))}}},e.prototype._afterSoftStep=function(e){e.type===o.PhysicsImpostor.RopeImpostor?this._ropeStep(e):this._softbodyOrClothStep(e)},e.prototype._ropeStep=function(e){for(var t,r,i,o,s=e.physicsBody.get_m_nodes(),a=s.size(),l=new Array,d=0;d<a;d++)r=(t=s.at(d).get_m_x()).x(),i=t.y(),o=t.z(),l.push(new n.Vector3(r,i,o));var h=e.object,f=e.getParam("shape");e._isFromLine?e.object=u.LinesBuilder.CreateLines("lines",{points:l,instance:h}):e.object=c.ShapeBuilder.ExtrudeShape("ext",{shape:f,path:l,instance:h})},e.prototype._softbodyOrClothStep=function(e){var t=e.type===o.PhysicsImpostor.ClothImpostor?1:-1,r=e.object,n=r.getVerticesData(a.VertexBuffer.PositionKind);n||(n=[]);var i=r.getVerticesData(a.VertexBuffer.NormalKind);i||(i=[]);for(var s,c,u,d,h,f,p,m,g=n.length/3,_=e.physicsBody.get_m_nodes(),v=0;v<g;v++){var y;u=(c=(s=_.at(v)).get_m_x()).x(),d=c.y(),h=c.z()*t,f=(y=s.get_m_n()).x(),p=y.y(),m=y.z()*t,n[3*v]=u,n[3*v+1]=d,n[3*v+2]=h,i[3*v]=f,i[3*v+1]=p,i[3*v+2]=m}var b=new l.VertexData;b.positions=n,b.normals=i,b.uvs=r.getVerticesData(a.VertexBuffer.UVKind),b.colors=r.getVerticesData(a.VertexBuffer.ColorKind),r&&r.getIndices&&(b.indices=r.getIndices()),b.applyToMesh(r)},e.prototype.applyImpulse=function(e,t,r){if(e.soft)i.Logger.Warn("Cannot be applied to a soft body");else{e.physicsBody.activate();var n=this._tmpAmmoVectorA,o=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&r.subtractInPlace(e.object.getWorldMatrix().getTranslation()),n.setValue(r.x,r.y,r.z),o.setValue(t.x,t.y,t.z),e.physicsBody.applyImpulse(o,n)}},e.prototype.applyForce=function(e,t,r){if(e.soft)i.Logger.Warn("Cannot be applied to a soft body");else{e.physicsBody.activate();var n=this._tmpAmmoVectorA,o=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&r.subtractInPlace(e.object.getWorldMatrix().getTranslation()),n.setValue(r.x,r.y,r.z),o.setValue(t.x,t.y,t.z),e.physicsBody.applyForce(o,n)}},e.prototype.generatePhysicsBody=function(t){if(t._pluginData.toDispose=[],t.parent)t.physicsBody&&(this.removePhysicsBody(t),t.forceUpdate());else if(t.isBodyInitRequired()){var r=this._createShape(t),n=t.getParam("mass");if(t._pluginData.mass=n,t.soft)r.get_m_cfg().set_collisions(17),r.get_m_cfg().set_kDP(t.getParam("damping")),this.bjsAMMO.castObject(r,this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(t.getParam("margin")),r.setActivationState(e.DISABLE_DEACTIVATION_FLAG),this.world.addSoftBody(r,1,-1),t.physicsBody=r,t._pluginData.toDispose.push(r),this.setBodyPressure(t,0),t.type===o.PhysicsImpostor.SoftbodyImpostor&&this.setBodyPressure(t,t.getParam("pressure")),this.setBodyStiffness(t,t.getParam("stiffness")),this.setBodyVelocityIterations(t,t.getParam("velocityIterations")),this.setBodyPositionIterations(t,t.getParam("positionIterations"));else{var i=new this.bjsAMMO.btVector3(0,0,0),s=new this.bjsAMMO.btTransform;s.setIdentity(),0!==n&&r.calculateLocalInertia(n,i),this._tmpAmmoVectorA.setValue(t.object.position.x,t.object.position.y,t.object.position.z),this._tmpAmmoQuaternion.setValue(t.object.rotationQuaternion.x,t.object.rotationQuaternion.y,t.object.rotationQuaternion.z,t.object.rotationQuaternion.w),s.setOrigin(this._tmpAmmoVectorA),s.setRotation(this._tmpAmmoQuaternion);var a=new this.bjsAMMO.btDefaultMotionState(s),l=new this.bjsAMMO.btRigidBodyConstructionInfo(n,a,r,i),c=new this.bjsAMMO.btRigidBody(l);0===n&&(c.setCollisionFlags(c.getCollisionFlags()|e.KINEMATIC_FLAG),c.setActivationState(e.DISABLE_DEACTIVATION_FLAG)),t.type!=o.PhysicsImpostor.NoImpostor||r.getChildShape||c.setCollisionFlags(c.getCollisionFlags()|e.DISABLE_COLLISION_FLAG);var u=t.getParam("group"),d=t.getParam("mask");u&&d?this.world.addRigidBody(c,u,d):this.world.addRigidBody(c),t.physicsBody=c,t._pluginData.toDispose=t._pluginData.toDispose.concat([c,l,a,s,i,r])}this.setBodyRestitution(t,t.getParam("restitution")),this.setBodyFriction(t,t.getParam("friction"))}},e.prototype.removePhysicsBody=function(e){var t=this;this.world&&(e.soft?this.world.removeSoftBody(e.physicsBody):this.world.removeRigidBody(e.physicsBody),e._pluginData&&(e._pluginData.toDispose.forEach((function(e){t.bjsAMMO.destroy(e)})),e._pluginData.toDispose=[]))},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,r=e.connectedImpostor.physicsBody;if(t&&r){var o,a=e.joint.jointData;switch(a.mainPivot||(a.mainPivot=new n.Vector3(0,0,0)),a.connectedPivot||(a.connectedPivot=new n.Vector3(0,0,0)),e.joint.type){case s.PhysicsJoint.DistanceJoint:var l=a.maxDistance;l&&(a.mainPivot=new n.Vector3(0,-l/2,0),a.connectedPivot=new n.Vector3(0,l/2,0)),o=new this.bjsAMMO.btPoint2PointConstraint(t,r,new this.bjsAMMO.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new this.bjsAMMO.btVector3(a.connectedPivot.x,a.connectedPivot.y,a.connectedPivot.z));break;case s.PhysicsJoint.HingeJoint:a.mainAxis||(a.mainAxis=new n.Vector3(0,0,0)),a.connectedAxis||(a.connectedAxis=new n.Vector3(0,0,0));var c=new this.bjsAMMO.btVector3(a.mainAxis.x,a.mainAxis.y,a.mainAxis.z),u=new this.bjsAMMO.btVector3(a.connectedAxis.x,a.connectedAxis.y,a.connectedAxis.z);o=new this.bjsAMMO.btHingeConstraint(t,r,new this.bjsAMMO.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new this.bjsAMMO.btVector3(a.connectedPivot.x,a.connectedPivot.y,a.connectedPivot.z),c,u);break;case s.PhysicsJoint.BallAndSocketJoint:o=new this.bjsAMMO.btPoint2PointConstraint(t,r,new this.bjsAMMO.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new this.bjsAMMO.btVector3(a.connectedPivot.x,a.connectedPivot.y,a.connectedPivot.z));break;default:i.Logger.Warn("JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint"),o=new this.bjsAMMO.btPoint2PointConstraint(t,r,new this.bjsAMMO.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new this.bjsAMMO.btVector3(a.connectedPivot.x,a.connectedPivot.y,a.connectedPivot.z))}this.world.addConstraint(o,!e.joint.jointData.collision),e.joint.physicsJoint=o}},e.prototype.removeJoint=function(e){this.world&&this.world.removeConstraint(e.joint.physicsJoint)},e.prototype._addMeshVerts=function(e,t,r){var i=this,o=0;if(r&&r.getIndices&&r.getWorldMatrix&&r.getChildMeshes){var s=r.getIndices();s||(s=[]);var l=r.getVerticesData(a.VertexBuffer.PositionKind);l||(l=[]),r.computeWorldMatrix(!1);for(var c=s.length/3,u=0;u<c;u++){for(var d=[],h=0;h<3;h++){var f,p=new n.Vector3(l[3*s[3*u+h]+0],l[3*s[3*u+h]+1],l[3*s[3*u+h]+2]);n.Matrix.ScalingToRef(r.scaling.x,r.scaling.y,r.scaling.z,this._tmpMatrix),p=n.Vector3.TransformCoordinates(p,this._tmpMatrix),(f=0==h?this._tmpAmmoVectorA:1==h?this._tmpAmmoVectorB:this._tmpAmmoVectorC).setValue(p.x,p.y,p.z),d.push(f)}e.addTriangle(d[0],d[1],d[2]),o++}r.getChildMeshes().forEach((function(r){o+=i._addMeshVerts(e,t,r)}))}return o},e.prototype._softVertexData=function(e){var t=e.object;if(t&&t.getIndices&&t.getWorldMatrix&&t.getChildMeshes){var r=t.getIndices();r||(r=[]);var i=t.getVerticesData(a.VertexBuffer.PositionKind);i||(i=[]);var o=t.getVerticesData(a.VertexBuffer.NormalKind);o||(o=[]),t.computeWorldMatrix(!1);for(var s=[],c=[],u=0;u<i.length;u+=3){var d=new n.Vector3(i[u],i[u+1],i[u+2]),h=new n.Vector3(o[u],o[u+1],o[u+2]);d=n.Vector3.TransformCoordinates(d,t.getWorldMatrix()),h=n.Vector3.TransformNormal(h,t.getWorldMatrix()),s.push(d.x,d.y,d.z),c.push(h.x,h.y,h.z)}var f=new l.VertexData;return f.positions=s,f.normals=c,f.uvs=t.getVerticesData(a.VertexBuffer.UVKind),f.colors=t.getVerticesData(a.VertexBuffer.ColorKind),t&&t.getIndices&&(f.indices=t.getIndices()),f.applyToMesh(t),t.position=n.Vector3.Zero(),t.rotationQuaternion=null,t.rotation=n.Vector3.Zero(),t.computeWorldMatrix(!0),f}return l.VertexData.ExtractFromMesh(t)},e.prototype._createSoftbody=function(e){var t=e.object;if(t&&t.getIndices){var r=t.getIndices();r||(r=[]);var i=this._softVertexData(e),o=i.positions,s=i.normals;if(null===o||null===s)return new this.bjsAMMO.btCompoundShape;for(var a=[],l=[],c=0;c<o.length;c+=3){var u=new n.Vector3(o[c],o[c+1],o[c+2]),d=new n.Vector3(s[c],s[c+1],s[c+2]);a.push(u.x,u.y,-u.z),l.push(d.x,d.y,-d.z)}var h=(new this.bjsAMMO.btSoftBodyHelpers).CreateFromTriMesh(this.world.getWorldInfo(),a,t.getIndices(),r.length/3,!0),f=o.length/3,p=h.get_m_nodes();for(c=0;c<f;c++){var m;(m=p.at(c).get_m_n()).setX(l[3*c]),m.setY(l[3*c+1]),m.setZ(l[3*c+2])}return h}},e.prototype._createCloth=function(e){var t=e.object;if(t&&t.getIndices){var r=t.getIndices();r||(r=[]);var n=this._softVertexData(e),i=n.positions,o=n.normals;if(null===i||null===o)return new this.bjsAMMO.btCompoundShape;var s=i.length,a=Math.sqrt(s/3);e.segments=a;var l=a-1;return this._tmpAmmoVectorA.setValue(i[0],i[1],i[2]),this._tmpAmmoVectorB.setValue(i[3*l],i[3*l+1],i[3*l+2]),this._tmpAmmoVectorD.setValue(i[s-3],i[s-2],i[s-1]),this._tmpAmmoVectorC.setValue(i[s-3-3*l],i[s-2-3*l],i[s-1-3*l]),(new this.bjsAMMO.btSoftBodyHelpers).CreatePatch(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,this._tmpAmmoVectorC,this._tmpAmmoVectorD,a,a,e.getParam("fixedPoints"),!0)}},e.prototype._createRope=function(e){var t,r,n=this._softVertexData(e),o=n.positions,s=n.normals;if(null===o||null===s)return new this.bjsAMMO.btCompoundShape;if(n.applyToMesh(e.object,!0),e._isFromLine=!0,0===s.map((function(e){return e*e})).reduce((function(e,t){return e+t})))r=(t=o.length)/3-1,this._tmpAmmoVectorA.setValue(o[0],o[1],o[2]),this._tmpAmmoVectorB.setValue(o[t-3],o[t-2],o[t-1]);else{e._isFromLine=!1;var a=e.getParam("path");if(null===e.getParam("shape"))return i.Logger.Warn("No shape available for extruded mesh"),new this.bjsAMMO.btCompoundShape;if(o.length%(3*a.length)!=0)return i.Logger.Warn("Path does not match extrusion"),new this.bjsAMMO.btCompoundShape;r=(t=a.length)-1,this._tmpAmmoVectorA.setValue(a[0].x,a[0].y,a[0].z),this._tmpAmmoVectorB.setValue(a[t-1].x,a[t-1].y,a[t-1].z)}e.segments=r;var l=e.getParam("fixedPoints");l=l>3?3:l;var c=(new this.bjsAMMO.btSoftBodyHelpers).CreateRope(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,r-1,l);return c.get_m_cfg().set_collisions(17),c},e.prototype._createCustom=function(e){var t=null;return this.onCreateCustomShape&&(t=this.onCreateCustomShape(e)),null==t&&(t=new this.bjsAMMO.btCompoundShape),t},e.prototype._addHullVerts=function(e,t,r){var i=this,o=0;if(r&&r.getIndices&&r.getWorldMatrix&&r.getChildMeshes){var s=r.getIndices();s||(s=[]);var l=r.getVerticesData(a.VertexBuffer.PositionKind);l||(l=[]),r.computeWorldMatrix(!1);for(var c=s.length/3,u=0;u<c;u++){for(var d=[],h=0;h<3;h++){var f,p=new n.Vector3(l[3*s[3*u+h]+0],l[3*s[3*u+h]+1],l[3*s[3*u+h]+2]);n.Matrix.ScalingToRef(r.scaling.x,r.scaling.y,r.scaling.z,this._tmpMatrix),p=n.Vector3.TransformCoordinates(p,this._tmpMatrix),(f=0==h?this._tmpAmmoVectorA:1==h?this._tmpAmmoVectorB:this._tmpAmmoVectorC).setValue(p.x,p.y,p.z),d.push(f)}e.addPoint(d[0],!0),e.addPoint(d[1],!0),e.addPoint(d[2],!0),o++}r.getChildMeshes().forEach((function(r){o+=i._addHullVerts(e,t,r)}))}return o},e.prototype._createShape=function(e,t){var r=this;void 0===t&&(t=!1);var s,a=e.object,l=e.getObjectExtendSize();if(!t){var c=e.object.getChildMeshes?e.object.getChildMeshes(!0):[];s=new this.bjsAMMO.btCompoundShape;var u=0;if(c.forEach((function(e){var t=e.getPhysicsImpostor();if(t){if(t.type==o.PhysicsImpostor.MeshImpostor)throw"A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)";var i=r._createShape(t),a=e.parent.getWorldMatrix().clone(),l=new n.Vector3;a.decompose(l),r._tmpAmmoTransform.getOrigin().setValue(e.position.x*l.x,e.position.y*l.y,e.position.z*l.z),r._tmpAmmoQuaternion.setValue(e.rotationQuaternion.x,e.rotationQuaternion.y,e.rotationQuaternion.z,e.rotationQuaternion.w),r._tmpAmmoTransform.setRotation(r._tmpAmmoQuaternion),s.addChildShape(r._tmpAmmoTransform,i),t.dispose(),u++}})),u>0){if(e.type!=o.PhysicsImpostor.NoImpostor){var d=this._createShape(e,!0);d&&(this._tmpAmmoTransform.getOrigin().setValue(0,0,0),this._tmpAmmoQuaternion.setValue(0,0,0,1),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),s.addChildShape(this._tmpAmmoTransform,d))}return s}this.bjsAMMO.destroy(s),s=null}switch(e.type){case o.PhysicsImpostor.SphereImpostor:if(h.Scalar.WithinEpsilon(l.x,l.y,1e-4)&&h.Scalar.WithinEpsilon(l.x,l.z,1e-4))s=new this.bjsAMMO.btSphereShape(l.x/2);else{var f=[new this.bjsAMMO.btVector3(0,0,0)];(s=new this.bjsAMMO.btMultiSphereShape(f,[1],1)).setLocalScaling(new this.bjsAMMO.btVector3(l.x/2,l.y/2,l.z/2))}break;case o.PhysicsImpostor.CapsuleImpostor:s=new this.bjsAMMO.btCapsuleShape(l.x/2,l.y/2);break;case o.PhysicsImpostor.CylinderImpostor:this._tmpAmmoVectorA.setValue(l.x/2,l.y/2,l.z/2),s=new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);break;case o.PhysicsImpostor.PlaneImpostor:case o.PhysicsImpostor.BoxImpostor:this._tmpAmmoVectorA.setValue(l.x/2,l.y/2,l.z/2),s=new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);break;case o.PhysicsImpostor.MeshImpostor:if(0==e.getParam("mass")){var p=new this.bjsAMMO.btTriangleMesh;e._pluginData.toDispose.push(p);var m=this._addMeshVerts(p,a,a);s=0==m?new this.bjsAMMO.btCompoundShape:new this.bjsAMMO.btBvhTriangleMeshShape(p);break}case o.PhysicsImpostor.ConvexHullImpostor:var g=new this.bjsAMMO.btConvexHullShape;0==(m=this._addHullVerts(g,a,a))?(e._pluginData.toDispose.push(g),s=new this.bjsAMMO.btCompoundShape):s=g;break;case o.PhysicsImpostor.NoImpostor:s=new this.bjsAMMO.btSphereShape(l.x/2);break;case o.PhysicsImpostor.CustomImpostor:s=this._createCustom(e);break;case o.PhysicsImpostor.SoftbodyImpostor:s=this._createSoftbody(e);break;case o.PhysicsImpostor.ClothImpostor:s=this._createCloth(e);break;case o.PhysicsImpostor.RopeImpostor:s=this._createRope(e);break;default:i.Logger.Warn("The impostor type is not currently supported by the ammo plugin.")}return s},e.prototype.setTransformationFromPhysicsBody=function(e){e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.object.position.set(this._tmpAmmoTransform.getOrigin().x(),this._tmpAmmoTransform.getOrigin().y(),this._tmpAmmoTransform.getOrigin().z()),e.object.rotationQuaternion?e.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()):e.object.rotation&&(this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()),this._tmpQuaternion.toEulerAnglesToRef(e.object.rotation))},e.prototype.setPhysicsBodyTransformation=function(e,t,r){var n=e.physicsBody.getWorldTransform();if(n.getOrigin().x()!=t.x||n.getOrigin().y()!=t.y||n.getOrigin().z()!=t.z||n.getRotation().x()!=r.x||n.getRotation().y()!=r.y||n.getRotation().z()!=r.z||n.getRotation().w()!=r.w)if(this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),n.setOrigin(this._tmpAmmoVectorA),this._tmpAmmoQuaternion.setValue(r.x,r.y,r.z,r.w),n.setRotation(this._tmpAmmoQuaternion),e.physicsBody.setWorldTransform(n),0==e.mass){var i=e.physicsBody.getMotionState();i&&i.setWorldTransform(n)}else e.physicsBody.activate()},e.prototype.isSupported=function(){return void 0!==this.bjsAMMO},e.prototype.setLinearVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.linearVelocity(this._tmpAmmoVectorA):e.physicsBody.setLinearVelocity(this._tmpAmmoVectorA)},e.prototype.setAngularVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.angularVelocity(this._tmpAmmoVectorA):e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA)},e.prototype.getLinearVelocity=function(e){if(e.soft)var t=e.physicsBody.linearVelocity();else t=e.physicsBody.getLinearVelocity();if(!t)return null;var r=new n.Vector3(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),r},e.prototype.getAngularVelocity=function(e){if(e.soft)var t=e.physicsBody.angularVelocity();else t=e.physicsBody.getAngularVelocity();if(!t)return null;var r=new n.Vector3(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),r},e.prototype.setBodyMass=function(e,t){e.soft?e.physicsBody.setTotalMass(t,!1):e.physicsBody.setMassProps(t),e._pluginData.mass=t},e.prototype.getBodyMass=function(e){return e._pluginData.mass||0},e.prototype.getBodyFriction=function(e){return e._pluginData.friction||0},e.prototype.setBodyFriction=function(e,t){e.soft?e.physicsBody.get_m_cfg().set_kDF(t):e.physicsBody.setFriction(t),e._pluginData.friction=t},e.prototype.getBodyRestitution=function(e){return e._pluginData.restitution||0},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.setRestitution(t),e._pluginData.restitution=t},e.prototype.getBodyPressure=function(e){return e.soft?e._pluginData.pressure||0:(i.Logger.Warn("Pressure is not a property of a rigid body"),0)},e.prototype.setBodyPressure=function(e,t){e.soft?e.type===o.PhysicsImpostor.SoftbodyImpostor?(e.physicsBody.get_m_cfg().set_kPR(t),e._pluginData.pressure=t):(e.physicsBody.get_m_cfg().set_kPR(0),e._pluginData.pressure=0):i.Logger.Warn("Pressure can only be applied to a softbody")},e.prototype.getBodyStiffness=function(e){return e.soft?e._pluginData.stiffness||0:(i.Logger.Warn("Stiffness is not a property of a rigid body"),0)},e.prototype.setBodyStiffness=function(e,t){e.soft?(t=(t=t<0?0:t)>1?1:t,e.physicsBody.get_m_materials().at(0).set_m_kLST(t),e._pluginData.stiffness=t):i.Logger.Warn("Stiffness cannot be applied to a rigid body")},e.prototype.getBodyVelocityIterations=function(e){return e.soft?e._pluginData.velocityIterations||0:(i.Logger.Warn("Velocity iterations is not a property of a rigid body"),0)},e.prototype.setBodyVelocityIterations=function(e,t){e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_viterations(t),e._pluginData.velocityIterations=t):i.Logger.Warn("Velocity iterations cannot be applied to a rigid body")},e.prototype.getBodyPositionIterations=function(e){return e.soft?e._pluginData.positionIterations||0:(i.Logger.Warn("Position iterations is not a property of a rigid body"),0)},e.prototype.setBodyPositionIterations=function(e,t){e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_piterations(t),e._pluginData.positionIterations=t):i.Logger.Warn("Position iterations cannot be applied to a rigid body")},e.prototype.appendAnchor=function(e,t,r,n,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var s=e.segments,a=Math.round((s-1)*r)+s*(s-1-Math.round((s-1)*n));e.physicsBody.appendAnchor(a,t.physicsBody,o,i)},e.prototype.appendHook=function(e,t,r,n,i){void 0===n&&(n=1),void 0===i&&(i=!1);var o=Math.round(e.segments*r);e.physicsBody.appendAnchor(o,t.physicsBody,i,n)},e.prototype.sleepBody=function(e){i.Logger.Warn("sleepBody is not currently supported by the Ammo physics plugin")},e.prototype.wakeUpBody=function(e){e.physicsBody.activate()},e.prototype.updateDistanceJoint=function(e,t,r){i.Logger.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin")},e.prototype.setMotor=function(e,t,r,n){e.physicsJoint.enableAngularMotor(!0,t,r)},e.prototype.setLimit=function(e,t,r){i.Logger.Warn("setLimit is not currently supported by the Ammo physics plugin")},e.prototype.syncMeshWithImpostor=function(e,t){t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.position.x=this._tmpAmmoTransform.getOrigin().x(),e.position.y=this._tmpAmmoTransform.getOrigin().y(),e.position.z=this._tmpAmmoTransform.getOrigin().z(),e.rotationQuaternion&&(e.rotationQuaternion.x=this._tmpAmmoTransform.getRotation().x(),e.rotationQuaternion.y=this._tmpAmmoTransform.getRotation().y(),e.rotationQuaternion.z=this._tmpAmmoTransform.getRotation().z(),e.rotationQuaternion.w=this._tmpAmmoTransform.getRotation().w())},e.prototype.getRadius=function(e){return e.getObjectExtendSize().x/2},e.prototype.getBoxSizeToRef=function(e,t){var r=e.getObjectExtendSize();t.x=r.x,t.y=r.y,t.z=r.z},e.prototype.dispose=function(){this.bjsAMMO.destroy(this.world),this.bjsAMMO.destroy(this._solver),this.bjsAMMO.destroy(this._overlappingPairCache),this.bjsAMMO.destroy(this._dispatcher),this.bjsAMMO.destroy(this._collisionConfiguration),this.bjsAMMO.destroy(this._tmpAmmoVectorA),this.bjsAMMO.destroy(this._tmpAmmoVectorB),this.bjsAMMO.destroy(this._tmpAmmoVectorC),this.bjsAMMO.destroy(this._tmpAmmoTransform),this.bjsAMMO.destroy(this._tmpAmmoQuaternion),this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback),this.world=null},e.prototype.raycast=function(e,t){this._tmpAmmoVectorRCA=new this.bjsAMMO.btVector3(e.x,e.y,e.z),this._tmpAmmoVectorRCB=new this.bjsAMMO.btVector3(t.x,t.y,t.z);var r=new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB);return this.world.rayTest(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB,r),this._raycastResult.reset(e,t),r.hasHit()&&(this._raycastResult.setHitData({x:r.get_m_hitNormalWorld().x(),y:r.get_m_hitNormalWorld().y(),z:r.get_m_hitNormalWorld().z()},{x:r.get_m_hitPointWorld().x(),y:r.get_m_hitPointWorld().y(),z:r.get_m_hitPointWorld().z()}),this._raycastResult.calculateHitDistance()),this.bjsAMMO.destroy(r),this.bjsAMMO.destroy(this._tmpAmmoVectorRCA),this.bjsAMMO.destroy(this._tmpAmmoVectorRCB),this._raycastResult},e.DISABLE_COLLISION_FLAG=4,e.KINEMATIC_FLAG=2,e.DISABLE_DEACTIVATION_FLAG=4,e}()},"./Physics/Plugins/cannonJSPlugin.ts":
- /*!*******************************************!*\
- !*** ./Physics/Plugins/cannonJSPlugin.ts ***!
- \*******************************************/
- /*! exports provided: CannonJSPlugin */function(e,t,r){"use strict";r.r(t),r.d(t,"CannonJSPlugin",(function(){return u}));var n=r(/*! ../../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),a=r(/*! ../../Physics/physicsJoint */"./Physics/physicsJoint.ts"),l=r(/*! ../../Physics/physicsEngine */"./Physics/physicsEngine.ts"),c=r(/*! ../physicsRaycastResult */"./Physics/physicsRaycastResult.ts"),u=function(){function e(e,t,r){void 0===e&&(e=!0),void 0===t&&(t=10),void 0===r&&(r=CANNON),this._useDeltaForWorldStep=e,this.name="CannonJSPlugin",this._physicsMaterials=new Array,this._fixedTimeStep=1/60,this._physicsBodysToRemoveAfterStep=new Array,this._firstFrame=!0,this._minus90X=new i.Quaternion(-.7071067811865475,0,0,.7071067811865475),this._plus90X=new i.Quaternion(.7071067811865475,0,0,.7071067811865475),this._tmpPosition=i.Vector3.Zero(),this._tmpDeltaPosition=i.Vector3.Zero(),this._tmpUnityRotation=new i.Quaternion,this.BJSCANNON=r,this.isSupported()?(this._extendNamespace(),this.world=new this.BJSCANNON.World,this.world.broadphase=new this.BJSCANNON.NaiveBroadphase,this.world.solver.iterations=t,this._cannonRaycastResult=new this.BJSCANNON.RaycastResult,this._raycastResult=new c.PhysicsRaycastResult):n.Logger.Error("CannonJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){var t=e;this.world.gravity.set(t.x,t.y,t.z)},e.prototype.setTimeStep=function(e){this._fixedTimeStep=e},e.prototype.getTimeStep=function(){return this._fixedTimeStep},e.prototype.executeStep=function(e,t){if(this._firstFrame){this._firstFrame=!1;for(var r=0,n=t;r<n.length;r++){var i=n[r];i.type!=s.PhysicsImpostor.HeightmapImpostor&&i.type!==s.PhysicsImpostor.PlaneImpostor&&i.beforeStep()}}this.world.step(this._useDeltaForWorldStep?e:this._fixedTimeStep),this._removeMarkedPhysicsBodiesFromWorld()},e.prototype._removeMarkedPhysicsBodiesFromWorld=function(){var e=this;this._physicsBodysToRemoveAfterStep.length>0&&(this._physicsBodysToRemoveAfterStep.forEach((function(t){e.world.remove(t)})),this._physicsBodysToRemoveAfterStep=[])},e.prototype.applyImpulse=function(e,t,r){var n=new this.BJSCANNON.Vec3(r.x,r.y,r.z),i=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyImpulse(i,n)},e.prototype.applyForce=function(e,t,r){var n=new this.BJSCANNON.Vec3(r.x,r.y,r.z),i=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyForce(i,n)},e.prototype.generatePhysicsBody=function(e){if(this._removeMarkedPhysicsBodiesFromWorld(),e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var t=this._createShape(e),r=e.physicsBody;r&&this.removePhysicsBody(e);var n=this._addMaterial("mat-"+e.uniqueId,e.getParam("friction"),e.getParam("restitution")),i={mass:e.getParam("mass"),material:n},o=e.getParam("nativeOptions");for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s]);e.physicsBody=new this.BJSCANNON.Body(i),e.physicsBody.addEventListener("collide",e.onCollide),this.world.addEventListener("preStep",e.beforeStep),this.world.addEventListener("postStep",e.afterStep),e.physicsBody.addShape(t),this.world.add(e.physicsBody),r&&["force","torque","velocity","angularVelocity"].forEach((function(t){var n=r[t];e.physicsBody[t].set(n.x,n.y,n.z)})),this._processChildMeshes(e)}this._updatePhysicsBodyTransformation(e)}},e.prototype._processChildMeshes=function(e){var t=this,r=e.object.getChildMeshes?e.object.getChildMeshes(!0):[],n=e.object.rotationQuaternion;if(r.length){var o=function(r,s){if(n&&s.rotationQuaternion){var a=s.getPhysicsImpostor();if(a&&a.parent!==e){var l=s.position.clone(),c=s.rotationQuaternion.multiply(i.Quaternion.Inverse(n));a.physicsBody&&(t.removePhysicsBody(a),a.physicsBody=null),a.parent=e,a.resetUpdateFlags(),e.physicsBody.addShape(t._createShape(a),new t.BJSCANNON.Vec3(l.x,l.y,l.z),new t.BJSCANNON.Quaternion(c.x,c.y,c.z,c.w)),e.physicsBody.mass+=a.getParam("mass")}n.multiplyInPlace(s.rotationQuaternion),s.getChildMeshes(!0).filter((function(e){return!!e.physicsImpostor})).forEach(o.bind(t,s.getAbsolutePosition()))}};r.filter((function(e){return!!e.physicsImpostor})).forEach(o.bind(this,e.object.getAbsolutePosition()))}},e.prototype.removePhysicsBody=function(e){e.physicsBody.removeEventListener("collide",e.onCollide),this.world.removeEventListener("preStep",e.beforeStep),this.world.removeEventListener("postStep",e.afterStep),-1===this._physicsBodysToRemoveAfterStep.indexOf(e.physicsBody)&&this._physicsBodysToRemoveAfterStep.push(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,r=e.connectedImpostor.physicsBody;if(t&&r){var n,i=e.joint.jointData,o={pivotA:i.mainPivot?(new this.BJSCANNON.Vec3).set(i.mainPivot.x,i.mainPivot.y,i.mainPivot.z):null,pivotB:i.connectedPivot?(new this.BJSCANNON.Vec3).set(i.connectedPivot.x,i.connectedPivot.y,i.connectedPivot.z):null,axisA:i.mainAxis?(new this.BJSCANNON.Vec3).set(i.mainAxis.x,i.mainAxis.y,i.mainAxis.z):null,axisB:i.connectedAxis?(new this.BJSCANNON.Vec3).set(i.connectedAxis.x,i.connectedAxis.y,i.connectedAxis.z):null,maxForce:i.nativeParams.maxForce,collideConnected:!!i.collision};switch(e.joint.type){case a.PhysicsJoint.HingeJoint:case a.PhysicsJoint.Hinge2Joint:n=new this.BJSCANNON.HingeConstraint(t,r,o);break;case a.PhysicsJoint.DistanceJoint:n=new this.BJSCANNON.DistanceConstraint(t,r,i.maxDistance||2);break;case a.PhysicsJoint.SpringJoint:var s=i;n=new this.BJSCANNON.Spring(t,r,{restLength:s.length,stiffness:s.stiffness,damping:s.damping,localAnchorA:o.pivotA,localAnchorB:o.pivotB});break;case a.PhysicsJoint.LockJoint:n=new this.BJSCANNON.LockConstraint(t,r,o);break;case a.PhysicsJoint.PointToPointJoint:case a.PhysicsJoint.BallAndSocketJoint:default:n=new this.BJSCANNON.PointToPointConstraint(t,o.pivotA,r,o.pivotB,o.maxForce)}n.collideConnected=!!i.collision,e.joint.physicsJoint=n,e.joint.type!==a.PhysicsJoint.SpringJoint?this.world.addConstraint(n):(e.joint.jointData.forceApplicationCallback=e.joint.jointData.forceApplicationCallback||function(){n.applyForce()},e.mainImpostor.registerAfterPhysicsStep(e.joint.jointData.forceApplicationCallback))}},e.prototype.removeJoint=function(e){e.joint.type!==a.PhysicsJoint.SpringJoint?this.world.removeConstraint(e.joint.physicsJoint):e.mainImpostor.unregisterAfterPhysicsStep(e.joint.jointData.forceApplicationCallback)},e.prototype._addMaterial=function(e,t,r){var n,i;for(n=0;n<this._physicsMaterials.length;n++)if((i=this._physicsMaterials[n]).friction===t&&i.restitution===r)return i;var o=new this.BJSCANNON.Material(e);return o.friction=t,o.restitution=r,this._physicsMaterials.push(o),o},e.prototype._checkWithEpsilon=function(e){return e<l.PhysicsEngine.Epsilon?l.PhysicsEngine.Epsilon:e},e.prototype._createShape=function(e){var t,r=e.object,a=e.getObjectExtendSize();switch(e.type){case s.PhysicsImpostor.SphereImpostor:var l=a.x,c=a.y,u=a.z;t=new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(l),this._checkWithEpsilon(c),this._checkWithEpsilon(u))/2);break;case s.PhysicsImpostor.CylinderImpostor:var d=e.getParam("nativeOptions");d||(d={});var h=void 0!==d.radiusTop?d.radiusTop:this._checkWithEpsilon(a.x)/2,f=void 0!==d.radiusBottom?d.radiusBottom:this._checkWithEpsilon(a.x)/2,p=void 0!==d.height?d.height:this._checkWithEpsilon(a.y),m=void 0!==d.numSegments?d.numSegments:16;t=new this.BJSCANNON.Cylinder(h,f,p,m);var g=new this.BJSCANNON.Quaternion;g.setFromAxisAngle(new this.BJSCANNON.Vec3(1,0,0),-Math.PI/2);var _=new this.BJSCANNON.Vec3(0,0,0);t.transformAllPoints(_,g);break;case s.PhysicsImpostor.BoxImpostor:var v=a.scale(.5);t=new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(v.x),this._checkWithEpsilon(v.y),this._checkWithEpsilon(v.z)));break;case s.PhysicsImpostor.PlaneImpostor:n.Logger.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"),t=new this.BJSCANNON.Plane;break;case s.PhysicsImpostor.MeshImpostor:var y=r.getVerticesData?r.getVerticesData(o.VertexBuffer.PositionKind):[],b=r.getIndices?r.getIndices():[];if(!y)return;var A=r.position.clone(),T=r.rotation&&r.rotation.clone(),M=r.rotationQuaternion&&r.rotationQuaternion.clone();r.position.copyFromFloats(0,0,0),r.rotation&&r.rotation.copyFromFloats(0,0,0),r.rotationQuaternion&&r.rotationQuaternion.copyFrom(e.getParentsRotation()),r.rotationQuaternion&&r.parent&&r.rotationQuaternion.conjugateInPlace();var P,S=r.computeWorldMatrix(!0),E=new Array;for(P=0;P<y.length;P+=3)i.Vector3.TransformCoordinates(i.Vector3.FromArray(y,P),S).toArray(E,P);n.Logger.Warn("MeshImpostor only collides against spheres."),t=new this.BJSCANNON.Trimesh(E,b),r.position.copyFrom(A),T&&r.rotation&&r.rotation.copyFrom(T),M&&r.rotationQuaternion&&r.rotationQuaternion.copyFrom(M);break;case s.PhysicsImpostor.HeightmapImpostor:var C=r.position.clone(),x=r.rotation&&r.rotation.clone(),R=r.rotationQuaternion&&r.rotationQuaternion.clone();r.position.copyFromFloats(0,0,0),r.rotation&&r.rotation.copyFromFloats(0,0,0),r.rotationQuaternion&&r.rotationQuaternion.copyFrom(e.getParentsRotation()),r.rotationQuaternion&&r.parent&&r.rotationQuaternion.conjugateInPlace(),r.rotationQuaternion&&r.rotationQuaternion.multiplyInPlace(this._minus90X),t=this._createHeightmap(r),r.position.copyFrom(C),x&&r.rotation&&r.rotation.copyFrom(x),R&&r.rotationQuaternion&&r.rotationQuaternion.copyFrom(R),r.computeWorldMatrix(!0);break;case s.PhysicsImpostor.ParticleImpostor:t=new this.BJSCANNON.Particle;break;case s.PhysicsImpostor.NoImpostor:t=new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0,0,0))}return t},e.prototype._createHeightmap=function(e,t){var r,n=e.getVerticesData(o.VertexBuffer.PositionKind),s=e.computeWorldMatrix(!0),a=new Array;for(r=0;r<n.length;r+=3)i.Vector3.TransformCoordinates(i.Vector3.FromArray(n,r),s).toArray(a,r);n=a;for(var l=new Array,c=t||~~(Math.sqrt(n.length/3)-1),u=e.getBoundingInfo(),d=Math.min(u.boundingBox.extendSizeWorld.x,u.boundingBox.extendSizeWorld.y),h=u.boundingBox.extendSizeWorld.z,f=2*d/c,p=0;p<n.length;p+=3){var m=Math.round(n[p+0]/f+c/2),g=Math.round(-1*(n[p+1]/f-c/2)),_=-n[p+2]+h;l[m]||(l[m]=[]),l[m][g]||(l[m][g]=_),l[m][g]=Math.max(_,l[m][g])}for(m=0;m<=c;++m){if(!l[m]){for(var v=1;!l[(m+v)%c];)v++;l[m]=l[(m+v)%c].slice()}for(g=0;g<=c;++g)if(!l[m][g]){var y;for(v=1;void 0===y;)y=l[m][(g+v++)%c];l[m][g]=y}}var b=new this.BJSCANNON.Heightfield(l,{elementSize:f});return b.minY=h,b},e.prototype._updatePhysicsBodyTransformation=function(e){var t=e.object;if(t.computeWorldMatrix&&t.computeWorldMatrix(!0),t.getBoundingInfo()){var r=e.getObjectCenter();this._tmpDeltaPosition.copyFrom(t.getAbsolutePivotPoint().subtract(r)),this._tmpDeltaPosition.divideInPlace(e.object.scaling),this._tmpPosition.copyFrom(r);var n=t.rotationQuaternion;if(n){if(e.type!==s.PhysicsImpostor.PlaneImpostor&&e.type!==s.PhysicsImpostor.HeightmapImpostor||(n=n.multiply(this._minus90X),e.setDeltaRotation(this._plus90X)),e.type===s.PhysicsImpostor.HeightmapImpostor){var o=t,a=o.getBoundingInfo(),l=o.rotationQuaternion;o.rotationQuaternion=this._tmpUnityRotation,o.computeWorldMatrix(!0);var c=r.clone(),u=o.getPivotMatrix();u=u?u.clone():i.Matrix.Identity();var d=i.Matrix.Translation(a.boundingBox.extendSizeWorld.x,0,-a.boundingBox.extendSizeWorld.z);o.setPreTransformMatrix(d),o.computeWorldMatrix(!0);var h=a.boundingBox.centerWorld.subtract(r).subtract(o.position).negate();this._tmpPosition.copyFromFloats(h.x,h.y-a.boundingBox.extendSizeWorld.y,h.z),this._tmpDeltaPosition.copyFrom(a.boundingBox.centerWorld.subtract(c)),this._tmpDeltaPosition.y+=a.boundingBox.extendSizeWorld.y,o.rotationQuaternion=l,o.setPreTransformMatrix(u),o.computeWorldMatrix(!0)}else e.type===s.PhysicsImpostor.MeshImpostor&&this._tmpDeltaPosition.copyFromFloats(0,0,0);e.setDeltaPosition(this._tmpDeltaPosition),e.physicsBody.position.set(this._tmpPosition.x,this._tmpPosition.y,this._tmpPosition.z),e.physicsBody.quaternion.set(n.x,n.y,n.z,n.w)}}},e.prototype.setTransformationFromPhysicsBody=function(e){if(e.object.position.set(e.physicsBody.position.x,e.physicsBody.position.y,e.physicsBody.position.z),e.object.rotationQuaternion){var t=e.physicsBody.quaternion;e.object.rotationQuaternion.set(t.x,t.y,t.z,t.w)}},e.prototype.setPhysicsBodyTransformation=function(e,t,r){e.physicsBody.position.set(t.x,t.y,t.z),e.physicsBody.quaternion.set(r.x,r.y,r.z,r.w)},e.prototype.isSupported=function(){return void 0!==this.BJSCANNON},e.prototype.setLinearVelocity=function(e,t){e.physicsBody.velocity.set(t.x,t.y,t.z)},e.prototype.setAngularVelocity=function(e,t){e.physicsBody.angularVelocity.set(t.x,t.y,t.z)},e.prototype.getLinearVelocity=function(e){var t=e.physicsBody.velocity;return t?new i.Vector3(t.x,t.y,t.z):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.angularVelocity;return t?new i.Vector3(t.x,t.y,t.z):null},e.prototype.setBodyMass=function(e,t){e.physicsBody.mass=t,e.physicsBody.updateMassProperties()},e.prototype.getBodyMass=function(e){return e.physicsBody.mass},e.prototype.getBodyFriction=function(e){return e.physicsBody.material.friction},e.prototype.setBodyFriction=function(e,t){e.physicsBody.material.friction=t},e.prototype.getBodyRestitution=function(e){return e.physicsBody.material.restitution},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.material.restitution=t},e.prototype.sleepBody=function(e){e.physicsBody.sleep()},e.prototype.wakeUpBody=function(e){e.physicsBody.wakeUp()},e.prototype.updateDistanceJoint=function(e,t){e.physicsJoint.distance=t},e.prototype.setMotor=function(e,t,r,n){n||(e.physicsJoint.enableMotor(),e.physicsJoint.setMotorSpeed(t),r&&this.setLimit(e,r))},e.prototype.setLimit=function(e,t,r){e.physicsJoint.motorEquation.maxForce=t,e.physicsJoint.motorEquation.minForce=void 0===r?-t:r},e.prototype.syncMeshWithImpostor=function(e,t){var r=t.physicsBody;e.position.x=r.position.x,e.position.y=r.position.y,e.position.z=r.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=r.quaternion.x,e.rotationQuaternion.y=r.quaternion.y,e.rotationQuaternion.z=r.quaternion.z,e.rotationQuaternion.w=r.quaternion.w)},e.prototype.getRadius=function(e){return e.physicsBody.shapes[0].boundingSphereRadius},e.prototype.getBoxSizeToRef=function(e,t){var r=e.physicsBody.shapes[0];t.x=2*r.halfExtents.x,t.y=2*r.halfExtents.y,t.z=2*r.halfExtents.z},e.prototype.dispose=function(){},e.prototype._extendNamespace=function(){var e=new this.BJSCANNON.Vec3,t=this.BJSCANNON;this.BJSCANNON.World.prototype.step=function(r,n,i){if(i=i||10,0===(n=n||0))this.internalStep(r),this.time+=r;else{var o=Math.floor((this.time+n)/r)-Math.floor(this.time/r);o=Math.min(o,i)||1;for(var s=performance.now(),a=0;a!==o&&(this.internalStep(r),!(performance.now()-s>1e3*r));a++);this.time+=n;for(var l=this.time%r/r,c=e,u=this.bodies,d=0;d!==u.length;d++){var h=u[d];h.type!==t.Body.STATIC&&h.sleepState!==t.Body.SLEEPING?(h.position.vsub(h.previousPosition,c),c.scale(l,c),h.position.vadd(c,h.interpolatedPosition)):(h.interpolatedPosition.set(h.position.x,h.position.y,h.position.z),h.interpolatedQuaternion.set(h.quaternion.x,h.quaternion.y,h.quaternion.z,h.quaternion.w))}}}},e.prototype.raycast=function(e,t){return this._cannonRaycastResult.reset(),this.world.raycastClosest(e,t,{},this._cannonRaycastResult),this._raycastResult.reset(e,t),this._cannonRaycastResult.hasHit&&(this._raycastResult.setHitData({x:this._cannonRaycastResult.hitNormalWorld.x,y:this._cannonRaycastResult.hitNormalWorld.y,z:this._cannonRaycastResult.hitNormalWorld.z},{x:this._cannonRaycastResult.hitPointWorld.x,y:this._cannonRaycastResult.hitPointWorld.y,z:this._cannonRaycastResult.hitPointWorld.z}),this._raycastResult.setHitDistance(this._cannonRaycastResult.distance)),this._raycastResult},e}();l.PhysicsEngine.DefaultPluginFactory=function(){return new u}},"./Physics/Plugins/index.ts":
- /*!**********************************!*\
- !*** ./Physics/Plugins/index.ts ***!
- \**********************************/
- /*! exports provided: CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./cannonJSPlugin */"./Physics/Plugins/cannonJSPlugin.ts");r.d(t,"CannonJSPlugin",(function(){return n.CannonJSPlugin}));var i=r(/*! ./ammoJSPlugin */"./Physics/Plugins/ammoJSPlugin.ts");r.d(t,"AmmoJSPlugin",(function(){return i.AmmoJSPlugin}));var o=r(/*! ./oimoJSPlugin */"./Physics/Plugins/oimoJSPlugin.ts");r.d(t,"OimoJSPlugin",(function(){return o.OimoJSPlugin}))},"./Physics/Plugins/oimoJSPlugin.ts":
- /*!*****************************************!*\
- !*** ./Physics/Plugins/oimoJSPlugin.ts ***!
- \*****************************************/
- /*! exports provided: OimoJSPlugin */function(e,t,r){"use strict";r.r(t),r.d(t,"OimoJSPlugin",(function(){return c}));var n=r(/*! ../../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),i=r(/*! ../../Physics/physicsJoint */"./Physics/physicsJoint.ts"),o=r(/*! ../../Physics/physicsEngine */"./Physics/physicsEngine.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Misc/logger */"./Misc/logger.ts"),l=r(/*! ../physicsRaycastResult */"./Physics/physicsRaycastResult.ts"),c=function(){function e(e,t,r){void 0===e&&(e=!0),void 0===r&&(r=OIMO),this._useDeltaForWorldStep=e,this.name="OimoJSPlugin",this._fixedTimeStep=1/60,this._tmpImpostorsArray=[],this._tmpPositionVector=s.Vector3.Zero(),this.BJSOIMO=r,this.world=new this.BJSOIMO.World({iterations:t}),this.world.clear(),this._raycastResult=new l.PhysicsRaycastResult}return e.prototype.setGravity=function(e){this.world.gravity.set(e.x,e.y,e.z)},e.prototype.setTimeStep=function(e){this.world.timeStep=e},e.prototype.getTimeStep=function(){return this.world.timeStep},e.prototype.executeStep=function(e,t){var r=this;t.forEach((function(e){e.beforeStep()})),this.world.timeStep=this._useDeltaForWorldStep?e:this._fixedTimeStep,this.world.step(),t.forEach((function(e){e.afterStep(),r._tmpImpostorsArray[e.uniqueId]=e}));for(var n=this.world.contacts;null!==n;)if(!n.touching||n.body1.sleeping||n.body2.sleeping){var i=this._tmpImpostorsArray[+n.body1.name],o=this._tmpImpostorsArray[+n.body2.name];i&&o?(i.onCollide({body:o.physicsBody}),o.onCollide({body:i.physicsBody}),n=n.next):n=n.next}else n=n.next},e.prototype.applyImpulse=function(e,t,r){var n=e.physicsBody.mass;e.physicsBody.applyImpulse(r.scale(this.world.invScale),t.scale(this.world.invScale*n))},e.prototype.applyForce=function(e,t,r){a.Logger.Warn("Oimo doesn't support applying force. Using impule instead."),this.applyImpulse(e,t,r)},e.prototype.generatePhysicsBody=function(e){var t=this;if(e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var r={name:e.uniqueId,config:[e.getParam("mass")||.001,e.getParam("friction"),e.getParam("restitution")],size:[],type:[],pos:[],posShape:[],rot:[],rotShape:[],move:0!==e.getParam("mass"),density:e.getParam("mass"),friction:e.getParam("friction"),restitution:e.getParam("restitution"),world:this.world},i=[e];(u=e.object).getChildMeshes&&u.getChildMeshes().forEach((function(e){e.physicsImpostor&&i.push(e.physicsImpostor)}));var l=function(e){return Math.max(e,o.PhysicsEngine.Epsilon)},c=new s.Quaternion;i.forEach((function(i){if(i.object.rotationQuaternion){var o=i.object.rotationQuaternion;c=o.clone(),i.object.rotationQuaternion.set(0,0,0,1),i.object.computeWorldMatrix(!0);var s=o.toEulerAngles(),u=i.getObjectExtendSize();if(i===e){var d=e.getObjectCenter();e.object.getAbsolutePivotPoint().subtractToRef(d,t._tmpPositionVector),t._tmpPositionVector.divideInPlace(e.object.scaling),r.pos.push(d.x),r.pos.push(d.y),r.pos.push(d.z),r.posShape.push(0,0,0),r.rotShape.push(0,0,0)}else{var h=i.object.position.clone();r.posShape.push(h.x),r.posShape.push(h.y),r.posShape.push(h.z),r.rotShape.push(57.29577951308232*s.x),r.rotShape.push(57.29577951308232*s.y),r.rotShape.push(57.29577951308232*s.z)}switch(i.object.rotationQuaternion.copyFrom(c),i.type){case n.PhysicsImpostor.ParticleImpostor:a.Logger.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case n.PhysicsImpostor.SphereImpostor:var f=u.x,p=u.y,m=u.z,g=Math.max(l(f),l(p),l(m))/2;r.type.push("sphere"),r.size.push(g),r.size.push(g),r.size.push(g);break;case n.PhysicsImpostor.CylinderImpostor:var _=l(u.x)/2,v=l(u.y);r.type.push("cylinder"),r.size.push(_),r.size.push(v),r.size.push(v);break;case n.PhysicsImpostor.PlaneImpostor:case n.PhysicsImpostor.BoxImpostor:default:_=l(u.x),v=l(u.y);var y=l(u.z);r.type.push("box"),r.size.push(_),r.size.push(v),r.size.push(y)}i.object.rotationQuaternion=o}})),e.physicsBody=this.world.add(r),e.physicsBody.resetQuaternion(c),e.physicsBody.updatePosition(0)}else this._tmpPositionVector.copyFromFloats(0,0,0);var u;e.setDeltaPosition(this._tmpPositionVector)}},e.prototype.removePhysicsBody=function(e){this.world.removeRigidBody(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,r=e.connectedImpostor.physicsBody;if(t&&r){var n,o=e.joint.jointData,s=o.nativeParams||{},l={body1:t,body2:r,axe1:s.axe1||(o.mainAxis?o.mainAxis.asArray():null),axe2:s.axe2||(o.connectedAxis?o.connectedAxis.asArray():null),pos1:s.pos1||(o.mainPivot?o.mainPivot.asArray():null),pos2:s.pos2||(o.connectedPivot?o.connectedPivot.asArray():null),min:s.min,max:s.max,collision:s.collision||o.collision,spring:s.spring,world:this.world};switch(e.joint.type){case i.PhysicsJoint.BallAndSocketJoint:n="jointBall";break;case i.PhysicsJoint.SpringJoint:a.Logger.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");var c=o;l.min=c.length||l.min,l.max=Math.max(l.min,l.max);case i.PhysicsJoint.DistanceJoint:n="jointDistance",l.max=o.maxDistance;break;case i.PhysicsJoint.PrismaticJoint:n="jointPrisme";break;case i.PhysicsJoint.SliderJoint:n="jointSlide";break;case i.PhysicsJoint.WheelJoint:n="jointWheel";break;case i.PhysicsJoint.HingeJoint:default:n="jointHinge"}l.type=n,e.joint.physicsJoint=this.world.add(l)}},e.prototype.removeJoint=function(e){try{this.world.removeJoint(e.joint.physicsJoint)}catch(e){a.Logger.Warn(e)}},e.prototype.isSupported=function(){return void 0!==this.BJSOIMO},e.prototype.setTransformationFromPhysicsBody=function(e){if(!e.physicsBody.sleeping){if(e.physicsBody.shapes.next){for(var t=e.physicsBody.shapes;t.next;)t=t.next;e.object.position.set(t.position.x,t.position.y,t.position.z)}else{var r=e.physicsBody.getPosition();e.object.position.set(r.x,r.y,r.z)}if(e.object.rotationQuaternion){var n=e.physicsBody.getQuaternion();e.object.rotationQuaternion.set(n.x,n.y,n.z,n.w)}}},e.prototype.setPhysicsBodyTransformation=function(e,t,r){var n=e.physicsBody;e.physicsBody.shapes.next||(n.position.set(t.x,t.y,t.z),n.orientation.set(r.x,r.y,r.z,r.w),n.syncShapes(),n.awake())},e.prototype.setLinearVelocity=function(e,t){e.physicsBody.linearVelocity.set(t.x,t.y,t.z)},e.prototype.setAngularVelocity=function(e,t){e.physicsBody.angularVelocity.set(t.x,t.y,t.z)},e.prototype.getLinearVelocity=function(e){var t=e.physicsBody.linearVelocity;return t?new s.Vector3(t.x,t.y,t.z):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.angularVelocity;return t?new s.Vector3(t.x,t.y,t.z):null},e.prototype.setBodyMass=function(e,t){var r=0===t;e.physicsBody.shapes.density=r?1:t,e.physicsBody.setupMass(r?2:1)},e.prototype.getBodyMass=function(e){return e.physicsBody.shapes.density},e.prototype.getBodyFriction=function(e){return e.physicsBody.shapes.friction},e.prototype.setBodyFriction=function(e,t){e.physicsBody.shapes.friction=t},e.prototype.getBodyRestitution=function(e){return e.physicsBody.shapes.restitution},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.shapes.restitution=t},e.prototype.sleepBody=function(e){e.physicsBody.sleep()},e.prototype.wakeUpBody=function(e){e.physicsBody.awake()},e.prototype.updateDistanceJoint=function(e,t,r){e.physicsJoint.limitMotor.upperLimit=t,void 0!==r&&(e.physicsJoint.limitMotor.lowerLimit=r)},e.prototype.setMotor=function(e,t,r,n){void 0!==r?a.Logger.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter"):r=1e6,t*=-1;var i=n?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;i&&i.setMotor(t,r)},e.prototype.setLimit=function(e,t,r,n){var i=n?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;i&&i.setLimit(t,void 0===r?-t:r)},e.prototype.syncMeshWithImpostor=function(e,t){var r=t.physicsBody;e.position.x=r.position.x,e.position.y=r.position.y,e.position.z=r.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=r.orientation.x,e.rotationQuaternion.y=r.orientation.y,e.rotationQuaternion.z=r.orientation.z,e.rotationQuaternion.w=r.orientation.s)},e.prototype.getRadius=function(e){return e.physicsBody.shapes.radius},e.prototype.getBoxSizeToRef=function(e,t){var r=e.physicsBody.shapes;t.x=2*r.halfWidth,t.y=2*r.halfHeight,t.z=2*r.halfDepth},e.prototype.dispose=function(){this.world.clear()},e.prototype.raycast=function(e,t){return a.Logger.Warn("raycast is not currently supported by the Oimo physics plugin"),this._raycastResult.reset(e,t),this._raycastResult},e}()},"./Physics/index.ts":
- /*!**************************!*\
- !*** ./Physics/index.ts ***!
- \**************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./IPhysicsEngine */"./Physics/IPhysicsEngine.ts");for(var i in n)"default"!==i&&function(e){r.d(t,e,(function(){return n[e]}))}(i);var o=r(/*! ./physicsEngine */"./Physics/physicsEngine.ts");r.d(t,"PhysicsEngine",(function(){return o.PhysicsEngine}));var s=r(/*! ./physicsEngineComponent */"./Physics/physicsEngineComponent.ts");r.d(t,"PhysicsEngineSceneComponent",(function(){return s.PhysicsEngineSceneComponent}));var a=r(/*! ./physicsHelper */"./Physics/physicsHelper.ts");r.d(t,"PhysicsHelper",(function(){return a.PhysicsHelper})),r.d(t,"PhysicsRadialExplosionEventOptions",(function(){return a.PhysicsRadialExplosionEventOptions})),r.d(t,"PhysicsUpdraftEventOptions",(function(){return a.PhysicsUpdraftEventOptions})),r.d(t,"PhysicsVortexEventOptions",(function(){return a.PhysicsVortexEventOptions})),r.d(t,"PhysicsRadialImpulseFalloff",(function(){return a.PhysicsRadialImpulseFalloff})),r.d(t,"PhysicsUpdraftMode",(function(){return a.PhysicsUpdraftMode}));var l=r(/*! ./physicsImpostor */"./Physics/physicsImpostor.ts");r.d(t,"PhysicsImpostor",(function(){return l.PhysicsImpostor}));var c=r(/*! ./physicsJoint */"./Physics/physicsJoint.ts");r.d(t,"PhysicsJoint",(function(){return c.PhysicsJoint})),r.d(t,"DistanceJoint",(function(){return c.DistanceJoint})),r.d(t,"MotorEnabledJoint",(function(){return c.MotorEnabledJoint})),r.d(t,"HingeJoint",(function(){return c.HingeJoint})),r.d(t,"Hinge2Joint",(function(){return c.Hinge2Joint}));var u=r(/*! ./Plugins/index */"./Physics/Plugins/index.ts");r.d(t,"CannonJSPlugin",(function(){return u.CannonJSPlugin})),r.d(t,"AmmoJSPlugin",(function(){return u.AmmoJSPlugin})),r.d(t,"OimoJSPlugin",(function(){return u.OimoJSPlugin}))},"./Physics/physicsEngine.ts":
- /*!**********************************!*\
- !*** ./Physics/physicsEngine.ts ***!
- \**********************************/
- /*! exports provided: PhysicsEngine */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsEngine",(function(){return o}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),o=function(){function e(t,r){if(void 0===r&&(r=e.DefaultPluginFactory()),this._physicsPlugin=r,this._impostors=[],this._joints=[],this._subTimeStep=0,!this._physicsPlugin.isSupported())throw new Error("Physics Engine "+this._physicsPlugin.name+" cannot be found. Please make sure it is included.");t=t||new n.Vector3(0,-9.807,0),this.setGravity(t),this.setTimeStep()}return e.DefaultPluginFactory=function(){throw i._DevTools.WarnImport("CannonJSPlugin")},e.prototype.setGravity=function(e){this.gravity=e,this._physicsPlugin.setGravity(this.gravity)},e.prototype.setTimeStep=function(e){void 0===e&&(e=1/60),this._physicsPlugin.setTimeStep(e)},e.prototype.getTimeStep=function(){return this._physicsPlugin.getTimeStep()},e.prototype.setSubTimeStep=function(e){void 0===e&&(e=0),this._subTimeStep=e},e.prototype.getSubTimeStep=function(){return this._subTimeStep},e.prototype.dispose=function(){this._impostors.forEach((function(e){e.dispose()})),this._physicsPlugin.dispose()},e.prototype.getPhysicsPluginName=function(){return this._physicsPlugin.name},e.prototype.addImpostor=function(e){e.uniqueId=this._impostors.push(e),e.parent||this._physicsPlugin.generatePhysicsBody(e)},e.prototype.removeImpostor=function(e){var t=this._impostors.indexOf(e);t>-1&&this._impostors.splice(t,1).length&&this.getPhysicsPlugin().removePhysicsBody(e)},e.prototype.addJoint=function(e,t,r){var n={mainImpostor:e,connectedImpostor:t,joint:r};r.physicsPlugin=this._physicsPlugin,this._joints.push(n),this._physicsPlugin.generateJoint(n)},e.prototype.removeJoint=function(e,t,r){var n=this._joints.filter((function(n){return n.connectedImpostor===t&&n.joint===r&&n.mainImpostor===e}));n.length&&this._physicsPlugin.removeJoint(n[0])},e.prototype._step=function(e){var t=this;this._impostors.forEach((function(e){e.isBodyInitRequired()&&t._physicsPlugin.generatePhysicsBody(e)})),e>.1?e=.1:e<=0&&(e=1/60),this._physicsPlugin.executeStep(e,this._impostors)},e.prototype.getPhysicsPlugin=function(){return this._physicsPlugin},e.prototype.getImpostors=function(){return this._impostors},e.prototype.getImpostorForPhysicsObject=function(e){for(var t=0;t<this._impostors.length;++t)if(this._impostors[t].object===e)return this._impostors[t];return null},e.prototype.getImpostorWithPhysicsBody=function(e){for(var t=0;t<this._impostors.length;++t)if(this._impostors[t].physicsBody===e)return this._impostors[t];return null},e.prototype.raycast=function(e,t){return this._physicsPlugin.raycast(e,t)},e.Epsilon=.001,e}()},"./Physics/physicsEngineComponent.ts":
- /*!*******************************************!*\
- !*** ./Physics/physicsEngineComponent.ts ***!
- \*******************************************/
- /*! exports provided: PhysicsEngineSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsEngineSceneComponent",(function(){return u}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../sceneComponent */"./sceneComponent.ts"),a=r(/*! ../scene */"./scene.ts"),l=r(/*! ./physicsEngine */"./Physics/physicsEngine.ts"),c=r(/*! ./physicsJoint */"./Physics/physicsJoint.ts");a.Scene.prototype.getPhysicsEngine=function(){return this._physicsEngine},a.Scene.prototype.enablePhysics=function(e,t){if(void 0===e&&(e=null),this._physicsEngine)return!0;var r=this._getComponent(s.SceneComponentConstants.NAME_PHYSICSENGINE);r||(r=new u(this),this._addComponent(r));try{return this._physicsEngine=new l.PhysicsEngine(e,t),this._physicsTimeAccumulator=0,!0}catch(e){return n.Logger.Error(e.message),!1}},a.Scene.prototype.disablePhysicsEngine=function(){this._physicsEngine&&(this._physicsEngine.dispose(),this._physicsEngine=null)},a.Scene.prototype.isPhysicsEnabled=function(){return void 0!==this._physicsEngine},a.Scene.prototype.deleteCompoundImpostor=function(e){var t=e.parts[0].mesh;t.physicsImpostor&&(t.physicsImpostor.dispose(),t.physicsImpostor=null)},a.Scene.prototype._advancePhysicsEngineStep=function(e){if(this._physicsEngine){var t=this._physicsEngine.getSubTimeStep();if(t>0)for(this._physicsTimeAccumulator+=e;this._physicsTimeAccumulator>t;)this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(t/1e3),this.onAfterPhysicsObservable.notifyObservers(this),this._physicsTimeAccumulator-=t;else this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(e/1e3),this.onAfterPhysicsObservable.notifyObservers(this)}},Object.defineProperty(o.AbstractMesh.prototype,"physicsImpostor",{get:function(){return this._physicsImpostor},set:function(e){var t=this;this._physicsImpostor!==e&&(this._disposePhysicsObserver&&this.onDisposeObservable.remove(this._disposePhysicsObserver),this._physicsImpostor=e,e&&(this._disposePhysicsObserver=this.onDisposeObservable.add((function(){t.physicsImpostor&&(t.physicsImpostor.dispose(),t.physicsImpostor=null)}))))},enumerable:!0,configurable:!0}),o.AbstractMesh.prototype.getPhysicsImpostor=function(){return this.physicsImpostor},o.AbstractMesh.prototype.applyImpulse=function(e,t){return this.physicsImpostor?(this.physicsImpostor.applyImpulse(e,t),this):this},o.AbstractMesh.prototype.setPhysicsLinkWith=function(e,t,r,n){return this.physicsImpostor&&e.physicsImpostor?(this.physicsImpostor.createJoint(e.physicsImpostor,c.PhysicsJoint.HingeJoint,{mainPivot:t,connectedPivot:r,nativeParams:n}),this):this};var u=function(){function e(e){var t=this;this.name=s.SceneComponentConstants.NAME_PHYSICSENGINE,this.scene=e,this.scene.onBeforePhysicsObservable=new i.Observable,this.scene.onAfterPhysicsObservable=new i.Observable,this.scene.getDeterministicFrameTime=function(){return t.scene._physicsEngine?1e3*t.scene._physicsEngine.getTimeStep():1e3/60}}return e.prototype.register=function(){},e.prototype.rebuild=function(){},e.prototype.dispose=function(){this.scene.onBeforePhysicsObservable.clear(),this.scene.onAfterPhysicsObservable.clear(),this.scene._physicsEngine&&this.scene.disablePhysicsEngine()},e}()},"./Physics/physicsHelper.ts":
- /*!**********************************!*\
- !*** ./Physics/physicsHelper.ts ***!
- \**********************************/
- /*! exports provided: PhysicsHelper, PhysicsRadialExplosionEventOptions, PhysicsUpdraftEventOptions, PhysicsVortexEventOptions, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsHelper",(function(){return d})),r.d(t,"PhysicsRadialExplosionEventOptions",(function(){return g})),r.d(t,"PhysicsUpdraftEventOptions",(function(){return _})),r.d(t,"PhysicsVortexEventOptions",(function(){return v})),r.d(t,"PhysicsRadialImpulseFalloff",(function(){return n})),r.d(t,"PhysicsUpdraftMode",(function(){return i}));var n,i,o=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),s=r(/*! ../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),c=r(/*! ../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),u=r(/*! ../Culling/ray */"./Culling/ray.ts"),d=function(){function e(e){this._scene=e,this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine||s.Logger.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.")}return e.prototype.applyRadialExplosionImpulse=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call this method."),null;var i=this._physicsEngine.getImpostors();if(0===i.length)return null;"number"==typeof t&&((t=new g).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var o=new h(this._scene,t),a=Array();return i.forEach((function(t){var r=o.getImpostorHitData(t,e);r&&(t.applyImpulse(r.force,r.contactPoint),a.push({impostor:t,hitData:r}))})),o.triggerAffectedImpostorsCallback(a),o.dispose(!1),o},e.prototype.applyRadialExplosionForce=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;var i=this._physicsEngine.getImpostors();if(0===i.length)return null;"number"==typeof t&&((t=new g).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var o=new h(this._scene,t),a=Array();return i.forEach((function(t){var r=o.getImpostorHitData(t,e);r&&(t.applyForce(r.force,r.contactPoint),a.push({impostor:t,hitData:r}))})),o.triggerAffectedImpostorsCallback(a),o.dispose(!1),o},e.prototype.gravitationalField=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new g).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var i=new f(this,this._scene,e,t);return i.dispose(!1),i},e.prototype.updraft=function(e,t,r,n,i){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new _).radius=t,t.strength=r||t.strength,t.height=n||t.height,t.updraftMode=i||t.updraftMode);var o=new p(this._scene,e,t);return o.dispose(!1),o},e.prototype.vortex=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new v).radius=t,t.strength=r||t.strength,t.height=n||t.height);var i=new m(this._scene,e,t);return i.dispose(!1),i},e}(),h=function(){function e(e,t){this._scene=e,this._options=t,this._dataFetched=!1,this._options=Object(o.__assign)(Object(o.__assign)({},new g),this._options)}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.getImpostorHitData=function(e,t){if(0===e.mass)return null;if(!this._intersectsWithSphere(e,t,this._options.radius))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var r=e.getObjectCenter().subtract(t),i=new u.Ray(t,r,this._options.radius).intersectsMesh(e.object).pickedPoint;if(!i)return null;var o=a.Vector3.Distance(t,i);if(o>this._options.radius)return null;var s=this._options.falloff===n.Constant?this._options.strength:this._options.strength*(1-o/this._options.radius);return{force:r.multiplyByFloats(s,s,s),contactPoint:i,distanceFromOrigin:o}},e.prototype.triggerAffectedImpostorsCallback=function(e){this._options.affectedImpostorsCallback&&this._options.affectedImpostorsCallback(e)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._sphere.dispose():setTimeout((function(){t._dataFetched||t._sphere.dispose()}),0)},e.prototype._prepareSphere=function(){this._sphere||(this._sphere=l.SphereBuilder.CreateSphere("radialExplosionEventSphere",this._options.sphere,this._scene),this._sphere.isVisible=!1)},e.prototype._intersectsWithSphere=function(e,t,r){var n=e.object;return this._prepareSphere(),this._sphere.position=t,this._sphere.scaling=new a.Vector3(2*r,2*r,2*r),this._sphere._updateBoundingInfo(),this._sphere.computeWorldMatrix(!0),this._sphere.intersectsMesh(n,!0)},e}(),f=function(){function e(e,t,r,n){this._physicsHelper=e,this._scene=t,this._origin=r,this._options=n,this._dataFetched=!1,this._options=Object(o.__assign)(Object(o.__assign)({},new g),this._options),this._tickCallback=this._tick.bind(this),this._options.strength=-1*this._options.strength}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._sphere.dispose():setTimeout((function(){t._dataFetched||t._sphere.dispose()}),0)},e.prototype._tick=function(){if(this._sphere)this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);else{var e=this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);e&&(this._sphere=e.getData().sphere.clone("radialExplosionEventSphereClone"))}},e}(),p=function(){function e(e,t,r){this._scene=e,this._origin=t,this._options=r,this._originTop=a.Vector3.Zero(),this._originDirection=a.Vector3.Zero(),this._cylinderPosition=a.Vector3.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options=Object(o.__assign)(Object(o.__assign)({},new _),this._options),this._origin.addToRef(new a.Vector3(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new a.Vector3(0,this._options.height,0),this._originTop),this._options.updraftMode===i.Perpendicular&&(this._originDirection=this._origin.subtract(this._originTop).normalize()),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),this._cylinder&&(e?this._cylinder.dispose():setTimeout((function(){t._dataFetched||t._cylinder.dispose()}),0))},e.prototype.getImpostorHitData=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;var t=e.getObjectCenter();if(this._options.updraftMode===i.Perpendicular)var r=this._originDirection;else r=t.subtract(this._originTop);var n=a.Vector3.Distance(this._origin,t),o=-1*this._options.strength;return{force:r.multiplyByFloats(o,o,o),contactPoint:t,distanceFromOrigin:n}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach((function(t){var r=e.getImpostorHitData(t);r&&t.applyForce(r.force,r.contactPoint)}))},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=c.CylinderBuilder.CreateCylinder("updraftEventCylinder",{height:this._options.height,diameter:2*this._options.radius},this._scene),this._cylinder.isVisible=!1)},e.prototype._intersectsWithCylinder=function(e){var t=e.object;return this._cylinder.position=this._cylinderPosition,this._cylinder.intersectsMesh(t,!0)},e}(),m=function(){function e(e,t,r){this._scene=e,this._origin=t,this._options=r,this._originTop=a.Vector3.Zero(),this._cylinderPosition=a.Vector3.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options=Object(o.__assign)(Object(o.__assign)({},new v),this._options),this._origin.addToRef(new a.Vector3(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new a.Vector3(0,this._options.height,0),this._originTop),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._cylinder.dispose():setTimeout((function(){t._dataFetched||t._cylinder.dispose()}),0)},e.prototype.getImpostorHitData=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var t=e.getObjectCenter(),r=new a.Vector3(this._origin.x,t.y,this._origin.z),n=t.subtract(r),i=new u.Ray(r,n,this._options.radius).intersectsMesh(e.object),o=i.pickedPoint;if(!o)return null;var s=i.distance/this._options.radius,l=o.normalize();if(s>this._options.centripetalForceThreshold&&(l=l.negate()),s>this._options.centripetalForceThreshold)var c=l.x*this._options.centripetalForceMultiplier,d=l.y*this._options.updraftForceMultiplier,h=l.z*this._options.centripetalForceMultiplier;else{var f=a.Vector3.Cross(r,t).normalize();c=(f.x+l.x)*this._options.centrifugalForceMultiplier,d=this._originTop.y*this._options.updraftForceMultiplier,h=(f.z+l.z)*this._options.centrifugalForceMultiplier}var p=new a.Vector3(c,d,h);return{force:p=p.multiplyByFloats(this._options.strength,this._options.strength,this._options.strength),contactPoint:t,distanceFromOrigin:s}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach((function(t){var r=e.getImpostorHitData(t);r&&t.applyForce(r.force,r.contactPoint)}))},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=c.CylinderBuilder.CreateCylinder("vortexEventCylinder",{height:this._options.height,diameter:2*this._options.radius},this._scene),this._cylinder.isVisible=!1)},e.prototype._intersectsWithCylinder=function(e){var t=e.object;return this._cylinder.position=this._cylinderPosition,this._cylinder.intersectsMesh(t,!0)},e}(),g=function(){this.radius=5,this.strength=10,this.falloff=n.Constant,this.sphere={segments:32,diameter:1}},_=function(){this.radius=5,this.strength=10,this.height=10,this.updraftMode=i.Center},v=function(){this.radius=5,this.strength=10,this.height=10,this.centripetalForceThreshold=.7,this.centripetalForceMultiplier=5,this.centrifugalForceMultiplier=.5,this.updraftForceMultiplier=.02};!function(e){e[e.Constant=0]="Constant",e[e.Linear=1]="Linear"}(n||(n={})),function(e){e[e.Center=0]="Center",e[e.Perpendicular=1]="Perpendicular"}(i||(i={}))},"./Physics/physicsImpostor.ts":
- /*!************************************!*\
- !*** ./Physics/physicsImpostor.ts ***!
- \************************************/
- /*! exports provided: PhysicsImpostor */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsImpostor",(function(){return u}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ./physicsJoint */"./Physics/physicsJoint.ts"),c=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts");a.Mesh._PhysicsImpostorParser=function(e,t,r){return new u(t,r.physicsImpostor,{mass:r.physicsMass,friction:r.physicsFriction,restitution:r.physicsRestitution},e)};var u=function(){function e(e,t,r,i){var s=this;void 0===r&&(r={mass:0}),this.object=e,this.type=t,this._options=r,this._scene=i,this._pluginData={},this._bodyUpdateRequired=!1,this._onBeforePhysicsStepCallbacks=new Array,this._onAfterPhysicsStepCallbacks=new Array,this._onPhysicsCollideCallbacks=[],this._deltaPosition=o.Vector3.Zero(),this._isDisposed=!1,this.soft=!1,this.segments=0,this._tmpQuat=new o.Quaternion,this._tmpQuat2=new o.Quaternion,this.beforeStep=function(){s._physicsEngine&&(s.object.translate(s._deltaPosition,-1),s._deltaRotationConjugated&&s.object.rotationQuaternion&&s.object.rotationQuaternion.multiplyToRef(s._deltaRotationConjugated,s.object.rotationQuaternion),s.object.computeWorldMatrix(!1),s.object.parent&&s.object.rotationQuaternion?(s.getParentsRotation(),s._tmpQuat.multiplyToRef(s.object.rotationQuaternion,s._tmpQuat)):s._tmpQuat.copyFrom(s.object.rotationQuaternion||new o.Quaternion),s._options.disableBidirectionalTransformation||s.object.rotationQuaternion&&s._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(s,s.object.getAbsolutePosition(),s._tmpQuat),s._onBeforePhysicsStepCallbacks.forEach((function(e){e(s)})))},this.afterStep=function(){s._physicsEngine&&(s._onAfterPhysicsStepCallbacks.forEach((function(e){e(s)})),s._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(s),s.object.parent&&s.object.rotationQuaternion&&(s.getParentsRotation(),s._tmpQuat.conjugateInPlace(),s._tmpQuat.multiplyToRef(s.object.rotationQuaternion,s.object.rotationQuaternion)),s.object.setAbsolutePosition(s.object.position),s._deltaRotation&&s.object.rotationQuaternion&&s.object.rotationQuaternion.multiplyToRef(s._deltaRotation,s.object.rotationQuaternion),s.object.translate(s._deltaPosition,1))},this.onCollideEvent=null,this.onCollide=function(e){if((s._onPhysicsCollideCallbacks.length||s.onCollideEvent)&&s._physicsEngine){var t=s._physicsEngine.getImpostorWithPhysicsBody(e.body);t&&(s.onCollideEvent&&s.onCollideEvent(s,t),s._onPhysicsCollideCallbacks.filter((function(e){return-1!==e.otherImpostors.indexOf(t)})).forEach((function(e){e.callback(s,t)})))}},this.object?(this.object.parent&&0!==r.mass&&n.Logger.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."),!this._scene&&e.getScene&&(this._scene=e.getScene()),this._scene&&(this.type>100&&(this.soft=!0),this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine?(this.object.rotationQuaternion||(this.object.rotation?this.object.rotationQuaternion=o.Quaternion.RotationYawPitchRoll(this.object.rotation.y,this.object.rotation.x,this.object.rotation.z):this.object.rotationQuaternion=new o.Quaternion),this._options.mass=void 0===r.mass?0:r.mass,this._options.friction=void 0===r.friction?.2:r.friction,this._options.restitution=void 0===r.restitution?.2:r.restitution,this.soft&&(this._options.mass=this._options.mass>0?this._options.mass:1,this._options.pressure=void 0===r.pressure?200:r.pressure,this._options.stiffness=void 0===r.stiffness?1:r.stiffness,this._options.velocityIterations=void 0===r.velocityIterations?20:r.velocityIterations,this._options.positionIterations=void 0===r.positionIterations?20:r.positionIterations,this._options.fixedPoints=void 0===r.fixedPoints?0:r.fixedPoints,this._options.margin=void 0===r.margin?0:r.margin,this._options.damping=void 0===r.damping?0:r.damping,this._options.path=void 0===r.path?null:r.path,this._options.shape=void 0===r.shape?null:r.shape),this._joints=[],!this.object.parent||this._options.ignoreParent?this._init():this.object.parent.physicsImpostor&&n.Logger.Warn("You must affect impostors to children before affecting impostor to parent.")):n.Logger.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."))):n.Logger.Error("No object was provided. A physics object is obligatory")}return Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mass",{get:function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyMass(this):0},set:function(e){this.setMass(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"friction",{get:function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyFriction(this):0},set:function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyFriction(this,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"restitution",{get:function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this):0},set:function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pressure",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.setBodyPressure?e.getBodyPressure(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyPressure&&t.setBodyPressure(this,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stiffness",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.getBodyStiffness?e.getBodyStiffness(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyStiffness&&t.setBodyStiffness(this,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"velocityIterations",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.getBodyVelocityIterations?e.getBodyVelocityIterations(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyVelocityIterations&&t.setBodyVelocityIterations(this,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"positionIterations",{get:function(){if(!this._physicsEngine)return 0;var e=this._physicsEngine.getPhysicsPlugin();return e.getBodyPositionIterations?e.getBodyPositionIterations(this):0},set:function(e){if(this._physicsEngine){var t=this._physicsEngine.getPhysicsPlugin();t.setBodyPositionIterations&&t.setBodyPositionIterations(this,e)}},enumerable:!1,configurable:!0}),e.prototype._init=function(){this._physicsEngine&&(this._physicsEngine.removeImpostor(this),this.physicsBody=null,this._parent=this._parent||this._getPhysicsParent(),this._isDisposed||this.parent&&!this._options.ignoreParent||this._physicsEngine.addImpostor(this))},e.prototype._getPhysicsParent=function(){return this.object.parent instanceof s.AbstractMesh?this.object.parent.physicsImpostor:null},e.prototype.isBodyInitRequired=function(){return this._bodyUpdateRequired||!this._physicsBody&&!this._parent},e.prototype.setScalingUpdated=function(){this.forceUpdate()},e.prototype.forceUpdate=function(){this._init(),this.parent&&!this._options.ignoreParent&&this.parent.forceUpdate()},Object.defineProperty(e.prototype,"physicsBody",{get:function(){return this._parent&&!this._options.ignoreParent?this._parent.physicsBody:this._physicsBody},set:function(e){this._physicsBody&&this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this),this._physicsBody=e,this.resetUpdateFlags()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return!this._options.ignoreParent&&this._parent?this._parent:null},set:function(e){this._parent=e},enumerable:!1,configurable:!0}),e.prototype.resetUpdateFlags=function(){this._bodyUpdateRequired=!1},e.prototype.getObjectExtendSize=function(){if(this.object.getBoundingInfo){var t=this.object.rotationQuaternion;this.object.rotationQuaternion=e.IDENTITY_QUATERNION,this.object.computeWorldMatrix&&this.object.computeWorldMatrix(!0);var r=this.object.getBoundingInfo().boundingBox.extendSizeWorld.scale(2);return this.object.rotationQuaternion=t,this.object.computeWorldMatrix&&this.object.computeWorldMatrix(!0),r}return e.DEFAULT_OBJECT_SIZE},e.prototype.getObjectCenter=function(){return this.object.getBoundingInfo?this.object.getBoundingInfo().boundingBox.centerWorld:this.object.position},e.prototype.getParam=function(e){return this._options[e]},e.prototype.setParam=function(e,t){this._options[e]=t,this._bodyUpdateRequired=!0},e.prototype.setMass=function(e){this.getParam("mass")!==e&&this.setParam("mass",e),this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setBodyMass(this,e)},e.prototype.getLinearVelocity=function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this):o.Vector3.Zero()},e.prototype.setLinearVelocity=function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this,e)},e.prototype.getAngularVelocity=function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this):o.Vector3.Zero()},e.prototype.setAngularVelocity=function(e){this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this,e)},e.prototype.executeNativeFunction=function(e){this._physicsEngine&&e(this._physicsEngine.getPhysicsPlugin().world,this.physicsBody)},e.prototype.registerBeforePhysicsStep=function(e){this._onBeforePhysicsStepCallbacks.push(e)},e.prototype.unregisterBeforePhysicsStep=function(e){var t=this._onBeforePhysicsStepCallbacks.indexOf(e);t>-1?this._onBeforePhysicsStepCallbacks.splice(t,1):n.Logger.Warn("Function to remove was not found")},e.prototype.registerAfterPhysicsStep=function(e){this._onAfterPhysicsStepCallbacks.push(e)},e.prototype.unregisterAfterPhysicsStep=function(e){var t=this._onAfterPhysicsStepCallbacks.indexOf(e);t>-1?this._onAfterPhysicsStepCallbacks.splice(t,1):n.Logger.Warn("Function to remove was not found")},e.prototype.registerOnPhysicsCollide=function(e,t){var r=e instanceof Array?e:[e];this._onPhysicsCollideCallbacks.push({callback:t,otherImpostors:r})},e.prototype.unregisterOnPhysicsCollide=function(e,t){var r=e instanceof Array?e:[e],i=-1;this._onPhysicsCollideCallbacks.some((function(e,n){if(e.callback===t&&e.otherImpostors.length===r.length){var o=e.otherImpostors.every((function(e){return r.indexOf(e)>-1}));return o&&(i=n),o}return!1}))?this._onPhysicsCollideCallbacks.splice(i,1):n.Logger.Warn("Function to remove was not found")},e.prototype.getParentsRotation=function(){var e=this.object.parent;for(this._tmpQuat.copyFromFloats(0,0,0,1);e;)e.rotationQuaternion?this._tmpQuat2.copyFrom(e.rotationQuaternion):o.Quaternion.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,e.rotation.z,this._tmpQuat2),this._tmpQuat.multiplyToRef(this._tmpQuat2,this._tmpQuat),e=e.parent;return this._tmpQuat},e.prototype.applyForce=function(e,t){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().applyForce(this,e,t),this},e.prototype.applyImpulse=function(e,t){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().applyImpulse(this,e,t),this},e.prototype.createJoint=function(e,t,r){var n=new l.PhysicsJoint(t,r);return this.addJoint(e,n),this},e.prototype.addJoint=function(e,t){return this._joints.push({otherImpostor:e,joint:t}),this._physicsEngine&&this._physicsEngine.addJoint(this,e,t),this},e.prototype.addAnchor=function(e,t,r,n,i){if(!this._physicsEngine)return this;var o=this._physicsEngine.getPhysicsPlugin();return o.appendAnchor?(this._physicsEngine&&o.appendAnchor(this,e,t,r,n,i),this):this},e.prototype.addHook=function(e,t,r,n){if(!this._physicsEngine)return this;var i=this._physicsEngine.getPhysicsPlugin();return i.appendAnchor?(this._physicsEngine&&i.appendHook(this,e,t,r,n),this):this},e.prototype.sleep=function(){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().sleepBody(this),this},e.prototype.wakeUp=function(){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().wakeUpBody(this),this},e.prototype.clone=function(t){return t?new e(t,this.type,this._options,this._scene):null},e.prototype.dispose=function(){var e=this;this._physicsEngine&&(this._joints.forEach((function(t){e._physicsEngine&&e._physicsEngine.removeJoint(e,t.otherImpostor,t.joint)})),this._physicsEngine.removeImpostor(this),this.parent&&this.parent.forceUpdate(),this._isDisposed=!0)},e.prototype.setDeltaPosition=function(e){this._deltaPosition.copyFrom(e)},e.prototype.setDeltaRotation=function(e){this._deltaRotation||(this._deltaRotation=new o.Quaternion),this._deltaRotation.copyFrom(e),this._deltaRotationConjugated=this._deltaRotation.conjugate()},e.prototype.getBoxSizeToRef=function(e){return this._physicsEngine&&this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this,e),this},e.prototype.getRadius=function(){return this._physicsEngine?this._physicsEngine.getPhysicsPlugin().getRadius(this):0},e.prototype.syncBoneWithImpostor=function(t,r,n,i,o){var s=e._tmpVecs[0],a=this.object;if(a.rotationQuaternion)if(o){var l=e._tmpQuat;a.rotationQuaternion.multiplyToRef(o,l),t.setRotationQuaternion(l,c.Space.WORLD,r)}else t.setRotationQuaternion(a.rotationQuaternion,c.Space.WORLD,r);s.x=0,s.y=0,s.z=0,n&&(s.x=n.x,s.y=n.y,s.z=n.z,t.getDirectionToRef(s,r,s),null==i&&(i=n.length()),s.x*=i,s.y*=i,s.z*=i),t.getParent()?(s.addInPlace(a.getAbsolutePosition()),t.setAbsolutePosition(s,r)):(r.setAbsolutePosition(a.getAbsolutePosition()),r.position.x-=s.x,r.position.y-=s.y,r.position.z-=s.z)},e.prototype.syncImpostorWithBone=function(t,r,n,i,o,s){var a=this.object;if(a.rotationQuaternion)if(o){var l=e._tmpQuat;t.getRotationQuaternionToRef(c.Space.WORLD,r,l),l.multiplyToRef(o,a.rotationQuaternion)}else t.getRotationQuaternionToRef(c.Space.WORLD,r,a.rotationQuaternion);var u=e._tmpVecs[0],d=e._tmpVecs[1];s||((s=e._tmpVecs[2]).x=0,s.y=1,s.z=0),t.getDirectionToRef(s,r,d),t.getAbsolutePositionToRef(r,u),null==i&&n&&(i=n.length()),null!=i&&(u.x+=d.x*i,u.y+=d.y*i,u.z+=d.z*i),a.setAbsolutePosition(u)},e.DEFAULT_OBJECT_SIZE=new o.Vector3(1,1,1),e.IDENTITY_QUATERNION=o.Quaternion.Identity(),e._tmpVecs=i.ArrayTools.BuildArray(3,o.Vector3.Zero),e._tmpQuat=o.Quaternion.Identity(),e.NoImpostor=0,e.SphereImpostor=1,e.BoxImpostor=2,e.PlaneImpostor=3,e.MeshImpostor=4,e.CapsuleImpostor=6,e.CylinderImpostor=7,e.ParticleImpostor=8,e.HeightmapImpostor=9,e.ConvexHullImpostor=10,e.CustomImpostor=100,e.RopeImpostor=101,e.ClothImpostor=102,e.SoftbodyImpostor=103,e}()},"./Physics/physicsJoint.ts":
- /*!*********************************!*\
- !*** ./Physics/physicsJoint.ts ***!
- \*********************************/
- /*! exports provided: PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsJoint",(function(){return i})),r.d(t,"DistanceJoint",(function(){return o})),r.d(t,"MotorEnabledJoint",(function(){return s})),r.d(t,"HingeJoint",(function(){return a})),r.d(t,"Hinge2Joint",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(){function e(e,t){this.type=e,this.jointData=t,t.nativeParams=t.nativeParams||{}}return Object.defineProperty(e.prototype,"physicsJoint",{get:function(){return this._physicsJoint},set:function(e){this._physicsJoint,this._physicsJoint=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"physicsPlugin",{set:function(e){this._physicsPlugin=e},enumerable:!1,configurable:!0}),e.prototype.executeNativeFunction=function(e){e(this._physicsPlugin.world,this._physicsJoint)},e.DistanceJoint=0,e.HingeJoint=1,e.BallAndSocketJoint=2,e.WheelJoint=3,e.SliderJoint=4,e.PrismaticJoint=5,e.UniversalJoint=6,e.Hinge2Joint=e.WheelJoint,e.PointToPointJoint=8,e.SpringJoint=9,e.LockJoint=10,e}(),o=function(e){function t(t){return e.call(this,i.DistanceJoint,t)||this}return Object(n.__extends)(t,e),t.prototype.updateDistance=function(e,t){this._physicsPlugin.updateDistanceJoint(this,e,t)},t}(i),s=function(e){function t(t,r){return e.call(this,t,r)||this}return Object(n.__extends)(t,e),t.prototype.setMotor=function(e,t){this._physicsPlugin.setMotor(this,e||0,t)},t.prototype.setLimit=function(e,t){this._physicsPlugin.setLimit(this,e,t)},t}(i),a=function(e){function t(t){return e.call(this,i.HingeJoint,t)||this}return Object(n.__extends)(t,e),t.prototype.setMotor=function(e,t){this._physicsPlugin.setMotor(this,e||0,t)},t.prototype.setLimit=function(e,t){this._physicsPlugin.setLimit(this,e,t)},t}(s),l=function(e){function t(t){return e.call(this,i.Hinge2Joint,t)||this}return Object(n.__extends)(t,e),t.prototype.setMotor=function(e,t,r){void 0===r&&(r=0),this._physicsPlugin.setMotor(this,e||0,t,r)},t.prototype.setLimit=function(e,t,r){void 0===r&&(r=0),this._physicsPlugin.setLimit(this,e,t,r)},t}(s)},"./Physics/physicsRaycastResult.ts":
- /*!*****************************************!*\
- !*** ./Physics/physicsRaycastResult.ts ***!
- \*****************************************/
- /*! exports provided: PhysicsRaycastResult */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsRaycastResult",(function(){return i}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=function(){function e(){this._hasHit=!1,this._hitDistance=0,this._hitNormalWorld=n.Vector3.Zero(),this._hitPointWorld=n.Vector3.Zero(),this._rayFromWorld=n.Vector3.Zero(),this._rayToWorld=n.Vector3.Zero()}return Object.defineProperty(e.prototype,"hasHit",{get:function(){return this._hasHit},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hitDistance",{get:function(){return this._hitDistance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hitNormalWorld",{get:function(){return this._hitNormalWorld},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hitPointWorld",{get:function(){return this._hitPointWorld},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rayFromWorld",{get:function(){return this._rayFromWorld},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rayToWorld",{get:function(){return this._rayToWorld},enumerable:!1,configurable:!0}),e.prototype.setHitData=function(e,t){this._hasHit=!0,this._hitNormalWorld=new n.Vector3(e.x,e.y,e.z),this._hitPointWorld=new n.Vector3(t.x,t.y,t.z)},e.prototype.setHitDistance=function(e){this._hitDistance=e},e.prototype.calculateHitDistance=function(){this._hitDistance=n.Vector3.Distance(this._rayFromWorld,this._hitPointWorld)},e.prototype.reset=function(e,t){void 0===e&&(e=n.Vector3.Zero()),void 0===t&&(t=n.Vector3.Zero()),this._rayFromWorld=e,this._rayToWorld=t,this._hasHit=!1,this._hitDistance=0,this._hitNormalWorld=n.Vector3.Zero(),this._hitPointWorld=n.Vector3.Zero()},e}()},"./PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.ts":
- /*!****************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.ts ***!
- \****************************************************************************/
- /*! exports provided: DefaultRenderingPipeline */function(e,t,r){"use strict";r.r(t),r.d(t,"DefaultRenderingPipeline",(function(){return b}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../../../Layers/glowLayer */"./Layers/glowLayer.ts"),c=r(/*! ../../../PostProcesses/sharpenPostProcess */"./PostProcesses/sharpenPostProcess.ts"),u=r(/*! ../../../PostProcesses/imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts"),d=r(/*! ../../../PostProcesses/chromaticAberrationPostProcess */"./PostProcesses/chromaticAberrationPostProcess.ts"),h=r(/*! ../../../PostProcesses/grainPostProcess */"./PostProcesses/grainPostProcess.ts"),f=r(/*! ../../../PostProcesses/fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts"),p=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),m=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),g=r(/*! ../../../PostProcesses/depthOfFieldEffect */"./PostProcesses/depthOfFieldEffect.ts"),_=r(/*! ../../../PostProcesses/bloomEffect */"./PostProcesses/bloomEffect.ts"),v=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),y=r(/*! ../../../Engines/engineStore */"./Engines/engineStore.ts"),b=(r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts"),function(e){function t(t,r,n,i,o){void 0===t&&(t=""),void 0===r&&(r=!0),void 0===n&&(n=y.EngineStore.LastCreatedScene),void 0===o&&(o=!0);var l=e.call(this,n.getEngine(),t)||this;l._camerasToBeAttached=[],l.SharpenPostProcessId="SharpenPostProcessEffect",l.ImageProcessingPostProcessId="ImageProcessingPostProcessEffect",l.FxaaPostProcessId="FxaaPostProcessEffect",l.ChromaticAberrationPostProcessId="ChromaticAberrationPostProcessEffect",l.GrainPostProcessId="GrainPostProcessEffect",l._glowLayer=null,l.animations=[],l._imageProcessingConfigurationObserver=null,l._sharpenEnabled=!1,l._bloomEnabled=!1,l._depthOfFieldEnabled=!1,l._depthOfFieldBlurLevel=g.DepthOfFieldEffectBlurLevel.Low,l._fxaaEnabled=!1,l._imageProcessingEnabled=!0,l._bloomScale=.5,l._chromaticAberrationEnabled=!1,l._grainEnabled=!1,l._buildAllowed=!0,l._resizeObserver=null,l._hardwareScaleLevel=1,l._bloomKernel=64,l._bloomWeight=.15,l._bloomThreshold=.9,l._samples=1,l._hasCleared=!1,l._prevPostProcess=null,l._prevPrevPostProcess=null,l._depthOfFieldSceneObserver=null,l._cameras=i||n.cameras,l._cameras=l._cameras.slice(),l._camerasToBeAttached=l._cameras.slice(),l._buildAllowed=o,l._scene=n;var u=l._scene.getEngine().getCaps();l._hdr=r&&(u.textureHalfFloatRender||u.textureFloatRender),l._hdr?u.textureHalfFloatRender?l._defaultPipelineTextureType=a.Constants.TEXTURETYPE_HALF_FLOAT:u.textureFloatRender&&(l._defaultPipelineTextureType=a.Constants.TEXTURETYPE_FLOAT):l._defaultPipelineTextureType=a.Constants.TEXTURETYPE_UNSIGNED_INT,n.postProcessRenderPipelineManager.addPipeline(l);var f=l._scene.getEngine();return l.sharpen=new c.SharpenPostProcess("sharpen",1,null,s.Texture.BILINEAR_SAMPLINGMODE,f,!1,l._defaultPipelineTextureType,!0),l._sharpenEffect=new m.PostProcessRenderEffect(f,l.SharpenPostProcessId,(function(){return l.sharpen}),!0),l.depthOfField=new g.DepthOfFieldEffect(l._scene,null,l._depthOfFieldBlurLevel,l._defaultPipelineTextureType,!0),l.bloom=new _.BloomEffect(l._scene,l._bloomScale,l._bloomWeight,l.bloomKernel,l._defaultPipelineTextureType,!0),l.chromaticAberration=new d.ChromaticAberrationPostProcess("ChromaticAberration",f.getRenderWidth(),f.getRenderHeight(),1,null,s.Texture.BILINEAR_SAMPLINGMODE,f,!1,l._defaultPipelineTextureType,!0),l._chromaticAberrationEffect=new m.PostProcessRenderEffect(f,l.ChromaticAberrationPostProcessId,(function(){return l.chromaticAberration}),!0),l.grain=new h.GrainPostProcess("Grain",1,null,s.Texture.BILINEAR_SAMPLINGMODE,f,!1,l._defaultPipelineTextureType,!0),l._grainEffect=new m.PostProcessRenderEffect(f,l.GrainPostProcessId,(function(){return l.grain}),!0),l._resizeObserver=f.onResizeObservable.add((function(){l._hardwareScaleLevel=f.getHardwareScalingLevel(),l.bloomKernel=l.bloomKernel})),l._imageProcessingConfigurationObserver=l._scene.imageProcessingConfiguration.onUpdateParameters.add((function(){l.bloom._downscale._exposure=l._scene.imageProcessingConfiguration.exposure,l.imageProcessingEnabled!==l._scene.imageProcessingConfiguration.isEnabled&&(l._imageProcessingEnabled=l._scene.imageProcessingConfiguration.isEnabled,l._buildPipeline())})),l._buildPipeline(),l}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sharpenEnabled",{get:function(){return this._sharpenEnabled},set:function(e){this._sharpenEnabled!==e&&(this._sharpenEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomKernel",{get:function(){return this._bloomKernel},set:function(e){this._bloomKernel=e,this.bloom.kernel=e/this._hardwareScaleLevel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomWeight",{get:function(){return this._bloomWeight},set:function(e){this._bloomWeight!==e&&(this.bloom.weight=e,this._bloomWeight=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomThreshold",{get:function(){return this._bloomThreshold},set:function(e){this._bloomThreshold!==e&&(this.bloom.threshold=e,this._bloomThreshold=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomScale",{get:function(){return this._bloomScale},set:function(e){this._bloomScale!==e&&(this._bloomScale=e,this._rebuildBloom(),this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),t.prototype._rebuildBloom=function(){var e=this.bloom;this.bloom=new _.BloomEffect(this._scene,this.bloomScale,this._bloomWeight,this.bloomKernel,this._defaultPipelineTextureType,!1),this.bloom.threshold=e.threshold;for(var t=0;t<this._cameras.length;t++)e.disposeEffects(this._cameras[t])},Object.defineProperty(t.prototype,"depthOfFieldEnabled",{get:function(){return this._depthOfFieldEnabled},set:function(e){this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthOfFieldBlurLevel",{get:function(){return this._depthOfFieldBlurLevel},set:function(e){if(this._depthOfFieldBlurLevel!==e){this._depthOfFieldBlurLevel=e;var t=this.depthOfField;this.depthOfField=new g.DepthOfFieldEffect(this._scene,null,this._depthOfFieldBlurLevel,this._defaultPipelineTextureType,!1),this.depthOfField.focalLength=t.focalLength,this.depthOfField.focusDistance=t.focusDistance,this.depthOfField.fStop=t.fStop,this.depthOfField.lensSize=t.lensSize;for(var r=0;r<this._cameras.length;r++)t.disposeEffects(this._cameras[r]);this._buildPipeline()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingEnabled",{get:function(){return this._imageProcessingEnabled},set:function(e){this._imageProcessingEnabled!==e&&(this._scene.imageProcessingConfiguration.isEnabled=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glowLayerEnabled",{get:function(){return null!=this._glowLayer},set:function(e){e&&!this._glowLayer?this._glowLayer=new l.GlowLayer("",this._scene):!e&&this._glowLayer&&(this._glowLayer.dispose(),this._glowLayer=null)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glowLayer",{get:function(){return this._glowLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chromaticAberrationEnabled",{get:function(){return this._chromaticAberrationEnabled},set:function(e){this._chromaticAberrationEnabled!==e&&(this._chromaticAberrationEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grainEnabled",{get:function(){return this._grainEnabled},set:function(e){this._grainEnabled!==e&&(this._grainEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"DefaultRenderingPipeline"},t.prototype.prepare=function(){var e=this._buildAllowed;this._buildAllowed=!0,this._buildPipeline(),this._buildAllowed=e},t.prototype._setAutoClearAndTextureSharing=function(e,t){void 0===t&&(t=!1),this._hasCleared?e.autoClear=!1:(e.autoClear=!0,this._scene.autoClear=!1,this._hasCleared=!0),t||(this._prevPrevPostProcess?e.shareOutputWith(this._prevPrevPostProcess):e.useOwnOutput(),this._prevPostProcess&&(this._prevPrevPostProcess=this._prevPostProcess),this._prevPostProcess=e)},t.prototype._buildPipeline=function(){var e=this;if(this._buildAllowed){this._scene.autoClear=!0;var t=this._scene.getEngine();if(this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._prevPostProcess=null,this._prevPrevPostProcess=null,this._hasCleared=!1,this.depthOfFieldEnabled){if(this._cameras.length>1){for(var r=0,n=this._cameras;r<n.length;r++){var i=n[r];(a=this._scene.enableDepthRenderer(i)).useOnlyInActiveCamera=!0}this._depthOfFieldSceneObserver=this._scene.onAfterRenderTargetsRenderObservable.add((function(t){e._cameras.indexOf(t.activeCamera)>-1&&(e.depthOfField.depthTexture=t.enableDepthRenderer(t.activeCamera).getDepthMap())}))}else{this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);var a=this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture=a.getDepthMap()}this.depthOfField._isReady()||this.depthOfField._updateEffects(),this.addEffect(this.depthOfField),this._setAutoClearAndTextureSharing(this.depthOfField._effects[0],!0)}else this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);this.bloomEnabled&&(this.bloom._isReady()||this.bloom._updateEffects(),this.addEffect(this.bloom),this._setAutoClearAndTextureSharing(this.bloom._effects[0],!0)),this._imageProcessingEnabled&&(this.imageProcessing=new u.ImageProcessingPostProcess("imageProcessing",1,null,s.Texture.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this._hdr?(this.addEffect(new m.PostProcessRenderEffect(t,this.ImageProcessingPostProcessId,(function(){return e.imageProcessing}),!0)),this._setAutoClearAndTextureSharing(this.imageProcessing)):this._scene.imageProcessingConfiguration.applyByPostProcess=!1,this.cameras&&0!==this.cameras.length||(this._scene.imageProcessingConfiguration.applyByPostProcess=!1),this.imageProcessing.getEffect()||this.imageProcessing._updateParameters()),this.sharpenEnabled&&(this.sharpen.isReady()||this.sharpen.updateEffect(),this.addEffect(this._sharpenEffect),this._setAutoClearAndTextureSharing(this.sharpen)),this.grainEnabled&&(this.grain.isReady()||this.grain.updateEffect(),this.addEffect(this._grainEffect),this._setAutoClearAndTextureSharing(this.grain)),this.chromaticAberrationEnabled&&(this.chromaticAberration.isReady()||this.chromaticAberration.updateEffect(),this.addEffect(this._chromaticAberrationEffect),this._setAutoClearAndTextureSharing(this.chromaticAberration)),this.fxaaEnabled&&(this.fxaa=new f.FxaaPostProcess("fxaa",1,null,s.Texture.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this.addEffect(new m.PostProcessRenderEffect(t,this.FxaaPostProcessId,(function(){return e.fxaa}),!0)),this._setAutoClearAndTextureSharing(this.fxaa,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),this._scene.activeCameras&&this._scene.activeCameras.length>1&&(this._scene.autoClear=!0),!this._enableMSAAOnFirstPostProcess(this.samples)&&this.samples>1&&o.Logger.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")}},t.prototype._disposePostProcesses=function(e){void 0===e&&(e=!1);for(var t=0;t<this._cameras.length;t++){var r=this._cameras[t];this.imageProcessing&&this.imageProcessing.dispose(r),this.fxaa&&this.fxaa.dispose(r),e&&(this.sharpen&&this.sharpen.dispose(r),this.depthOfField&&(this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver),this.depthOfField.disposeEffects(r)),this.bloom&&this.bloom.disposeEffects(r),this.chromaticAberration&&this.chromaticAberration.dispose(r),this.grain&&this.grain.dispose(r),this._glowLayer&&this._glowLayer.dispose())}this.imageProcessing=null,this.fxaa=null,e&&(this.sharpen=null,this._sharpenEffect=null,this.depthOfField=null,this.bloom=null,this.chromaticAberration=null,this._chromaticAberrationEffect=null,this.grain=null,this._grainEffect=null,this._glowLayer=null)},t.prototype.addCamera=function(e){this._camerasToBeAttached.push(e),this._buildPipeline()},t.prototype.removeCamera=function(e){var t=this._camerasToBeAttached.indexOf(e);this._camerasToBeAttached.splice(t,1),this._buildPipeline()},t.prototype.dispose=function(){this._disposePostProcesses(!0),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._scene.autoClear=!0,this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver),e.prototype.dispose.call(this)},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="DefaultRenderingPipeline",e},t.Parse=function(e,r,n){return i.SerializationHelper.Parse((function(){return new t(e._name,e._name._hdr,r)}),e,r,n)},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"sharpenEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"bloomKernel",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_bloomWeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_bloomThreshold",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_hdr",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"bloomWeight",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"bloomThreshold",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"bloomScale",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"bloomEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"depthOfFieldEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"depthOfFieldBlurLevel",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"fxaaEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"samples",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"imageProcessingEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"glowLayerEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"chromaticAberrationEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"grainEnabled",null),t}(p.PostProcessRenderPipeline));v._TypeStore.RegisteredTypes["BABYLON.DefaultRenderingPipeline"]=b},"./PostProcesses/RenderPipeline/Pipelines/index.ts":
- /*!*********************************************************!*\
- !*** ./PostProcesses/RenderPipeline/Pipelines/index.ts ***!
- \*********************************************************/
- /*! exports provided: DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./defaultRenderingPipeline */"./PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.ts");r.d(t,"DefaultRenderingPipeline",(function(){return n.DefaultRenderingPipeline}));var i=r(/*! ./lensRenderingPipeline */"./PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.ts");r.d(t,"LensRenderingPipeline",(function(){return i.LensRenderingPipeline}));var o=r(/*! ./ssao2RenderingPipeline */"./PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.ts");r.d(t,"SSAO2RenderingPipeline",(function(){return o.SSAO2RenderingPipeline}));var s=r(/*! ./ssaoRenderingPipeline */"./PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.ts");r.d(t,"SSAORenderingPipeline",(function(){return s.SSAORenderingPipeline}));var a=r(/*! ./standardRenderingPipeline */"./PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.ts");r.d(t,"StandardRenderingPipeline",(function(){return a.StandardRenderingPipeline}))},"./PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.ts":
- /*!*************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.ts ***!
- \*************************************************************************/
- /*! exports provided: LensRenderingPipeline */function(e,t,r){"use strict";r.r(t),r.d(t,"LensRenderingPipeline",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),s=r(/*! ../../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),a=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),l=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),c=(r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts"),r(/*! ../../../Shaders/chromaticAberration.fragment */"./Shaders/chromaticAberration.fragment.ts"),r(/*! ../../../Shaders/lensHighlights.fragment */"./Shaders/lensHighlights.fragment.ts"),r(/*! ../../../Shaders/depthOfField.fragment */"./Shaders/depthOfField.fragment.ts"),function(e){function t(t,r,n,i,o){void 0===i&&(i=1);var s=e.call(this,n.getEngine(),t)||this;return s.LensChromaticAberrationEffect="LensChromaticAberrationEffect",s.HighlightsEnhancingEffect="HighlightsEnhancingEffect",s.LensDepthOfFieldEffect="LensDepthOfFieldEffect",s._pentagonBokehIsEnabled=!1,s._scene=n,s._depthTexture=n.enableDepthRenderer().getDepthMap(),r.grain_texture?s._grainTexture=r.grain_texture:s._createGrainTexture(),s._edgeBlur=r.edge_blur?r.edge_blur:0,s._grainAmount=r.grain_amount?r.grain_amount:0,s._chromaticAberration=r.chromatic_aberration?r.chromatic_aberration:0,s._distortion=r.distortion?r.distortion:0,s._highlightsGain=void 0!==r.dof_gain?r.dof_gain:-1,s._highlightsThreshold=r.dof_threshold?r.dof_threshold:1,s._dofDistance=void 0!==r.dof_focus_distance?r.dof_focus_distance:-1,s._dofAperture=r.dof_aperture?r.dof_aperture:1,s._dofDarken=r.dof_darken?r.dof_darken:0,s._dofPentagon=void 0===r.dof_pentagon||r.dof_pentagon,s._blurNoise=void 0===r.blur_noise||r.blur_noise,s._createChromaticAberrationPostProcess(i),s._createHighlightsPostProcess(i),s._createDepthOfFieldPostProcess(i/4),s.addEffect(new l.PostProcessRenderEffect(n.getEngine(),s.LensChromaticAberrationEffect,(function(){return s._chromaticAberrationPostProcess}),!0)),s.addEffect(new l.PostProcessRenderEffect(n.getEngine(),s.HighlightsEnhancingEffect,(function(){return s._highlightsPostProcess}),!0)),s.addEffect(new l.PostProcessRenderEffect(n.getEngine(),s.LensDepthOfFieldEffect,(function(){return s._depthOfFieldPostProcess}),!0)),-1===s._highlightsGain&&s._disableEffect(s.HighlightsEnhancingEffect,null),n.postProcessRenderPipelineManager.addPipeline(s),o&&n.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,o),s}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"LensRenderingPipeline"},Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeBlur",{get:function(){return this._edgeBlur},set:function(e){this.setEdgeBlur(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grainAmount",{get:function(){return this._grainAmount},set:function(e){this.setGrainAmount(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"chromaticAberration",{get:function(){return this._chromaticAberration},set:function(e){this.setChromaticAberration(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dofAperture",{get:function(){return this._dofAperture},set:function(e){this.setAperture(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeDistortion",{get:function(){return this._distortion},set:function(e){this.setEdgeDistortion(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dofDistortion",{get:function(){return this._dofDistance},set:function(e){this.setFocusDistance(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"darkenOutOfFocus",{get:function(){return this._dofDarken},set:function(e){this.setDarkenOutOfFocus(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurNoise",{get:function(){return this._blurNoise},set:function(e){this._blurNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pentagonBokeh",{get:function(){return this._pentagonBokehIsEnabled},set:function(e){e?this.enablePentagonBokeh():this.disablePentagonBokeh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightsGain",{get:function(){return this._highlightsGain},set:function(e){this.setHighlightsGain(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightsThreshold",{get:function(){return this._highlightsThreshold},set:function(e){this.setHighlightsThreshold(e)},enumerable:!1,configurable:!0}),t.prototype.setEdgeBlur=function(e){this._edgeBlur=e},t.prototype.disableEdgeBlur=function(){this._edgeBlur=0},t.prototype.setGrainAmount=function(e){this._grainAmount=e},t.prototype.disableGrain=function(){this._grainAmount=0},t.prototype.setChromaticAberration=function(e){this._chromaticAberration=e},t.prototype.disableChromaticAberration=function(){this._chromaticAberration=0},t.prototype.setEdgeDistortion=function(e){this._distortion=e},t.prototype.disableEdgeDistortion=function(){this._distortion=0},t.prototype.setFocusDistance=function(e){this._dofDistance=e},t.prototype.disableDepthOfField=function(){this._dofDistance=-1},t.prototype.setAperture=function(e){this._dofAperture=e},t.prototype.setDarkenOutOfFocus=function(e){this._dofDarken=e},t.prototype.enablePentagonBokeh=function(){this._highlightsPostProcess.updateEffect("#define PENTAGON\n"),this._pentagonBokehIsEnabled=!0},t.prototype.disablePentagonBokeh=function(){this._pentagonBokehIsEnabled=!1,this._highlightsPostProcess.updateEffect()},t.prototype.enableNoiseBlur=function(){this._blurNoise=!0},t.prototype.disableNoiseBlur=function(){this._blurNoise=!1},t.prototype.setHighlightsGain=function(e){this._highlightsGain=e},t.prototype.setHighlightsThreshold=function(e){-1===this._highlightsGain&&(this._highlightsGain=1),this._highlightsThreshold=e},t.prototype.disableHighlights=function(){this._highlightsGain=-1},t.prototype.dispose=function(e){void 0===e&&(e=!1),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),this._chromaticAberrationPostProcess=null,this._highlightsPostProcess=null,this._depthOfFieldPostProcess=null,this._grainTexture.dispose(),e&&this._scene.disableDepthRenderer()},t.prototype._createChromaticAberrationPostProcess=function(e){var t=this;this._chromaticAberrationPostProcess=new s.PostProcess("LensChromaticAberration","chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],e,null,i.Texture.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._chromaticAberrationPostProcess.onApply=function(e){e.setFloat("chromatic_aberration",t._chromaticAberration),e.setFloat("screen_width",t._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",t._scene.getEngine().getRenderHeight()),e.setFloat("radialIntensity",1),e.setFloat2("direction",17,17),e.setFloat2("centerPosition",.5,.5)}},t.prototype._createHighlightsPostProcess=function(e){var t=this;this._highlightsPostProcess=new s.PostProcess("LensHighlights","lensHighlights",["gain","threshold","screen_width","screen_height"],[],e,null,i.Texture.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,this._dofPentagon?"#define PENTAGON\n":""),this._highlightsPostProcess.onApply=function(e){e.setFloat("gain",t._highlightsGain),e.setFloat("threshold",t._highlightsThreshold),e.setTextureFromPostProcess("textureSampler",t._chromaticAberrationPostProcess),e.setFloat("screen_width",t._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",t._scene.getEngine().getRenderHeight())}},t.prototype._createDepthOfFieldPostProcess=function(e){var t=this;this._depthOfFieldPostProcess=new s.PostProcess("LensDepthOfField","depthOfField",["grain_amount","blur_noise","screen_width","screen_height","distortion","dof_enabled","screen_distance","aperture","darken","edge_blur","highlights","near","far"],["depthSampler","grainSampler","highlightsSampler"],e,null,i.Texture.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._depthOfFieldPostProcess.onApply=function(e){e.setTexture("depthSampler",t._depthTexture),e.setTexture("grainSampler",t._grainTexture),e.setTextureFromPostProcess("textureSampler",t._highlightsPostProcess),e.setTextureFromPostProcess("highlightsSampler",t._depthOfFieldPostProcess),e.setFloat("grain_amount",t._grainAmount),e.setBool("blur_noise",t._blurNoise),e.setFloat("screen_width",t._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",t._scene.getEngine().getRenderHeight()),e.setFloat("distortion",t._distortion),e.setBool("dof_enabled",-1!==t._dofDistance),e.setFloat("screen_distance",1/(.1-1/t._dofDistance)),e.setFloat("aperture",t._dofAperture),e.setFloat("darken",t._dofDarken),e.setFloat("edge_blur",t._edgeBlur),e.setBool("highlights",-1!==t._highlightsGain),t._scene.activeCamera&&(e.setFloat("near",t._scene.activeCamera.minZ),e.setFloat("far",t._scene.activeCamera.maxZ))}},t.prototype._createGrainTexture=function(){this._grainTexture=new o.DynamicTexture("LensNoiseTexture",512,this._scene,!1,i.Texture.BILINEAR_SAMPLINGMODE),this._grainTexture.wrapU=i.Texture.WRAP_ADDRESSMODE,this._grainTexture.wrapV=i.Texture.WRAP_ADDRESSMODE;for(var e,t,r,n=this._grainTexture.getContext(),s=0;s<512;s++)for(var a=0;a<512;a++)e=Math.floor(255*(t=.42,r=.58,Math.random()*(r-t)+t)),n.fillStyle="rgb("+e+", "+e+", "+e+")",n.fillRect(s,a,1,1);this._grainTexture.update(!1)},t}(a.PostProcessRenderPipeline))},"./PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.ts":
- /*!**************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.ts ***!
- \**************************************************************************/
- /*! exports provided: SSAO2RenderingPipeline */function(e,t,r){"use strict";r.r(t),r.d(t,"SSAO2RenderingPipeline",(function(){return g}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../../Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),c=r(/*! ../../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),u=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),d=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),h=r(/*! ../../../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),f=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),p=r(/*! ../../../Engines/engineStore */"./Engines/engineStore.ts"),m=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),g=(r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts"),r(/*! ../../../Shaders/ssao2.fragment */"./Shaders/ssao2.fragment.ts"),r(/*! ../../../Shaders/ssaoCombine.fragment */"./Shaders/ssaoCombine.fragment.ts"),function(e){function t(t,r,n,o,s){void 0===s&&(s=!1);var l=e.call(this,r.getEngine(),t)||this;if(l.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",l.SSAORenderEffect="SSAORenderEffect",l.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",l.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",l.SSAOCombineRenderEffect="SSAOCombineRenderEffect",l.totalStrength=1,l.maxZ=100,l.minZAspect=.2,l._samples=8,l._textureSamples=1,l._forceGeometryBuffer=!1,l._expensiveBlur=!0,l.radius=2,l.base=0,l._bits=new Uint32Array(1),l._scene=r,l._ratio=n,l._forceGeometryBuffer=s,!l.isSupported)return i.Logger.Error("SSAO 2 needs WebGL 2 support."),l;var c=l._ratio.ssaoRatio||n,u=l._ratio.blurRatio||n;return l._forceGeometryBuffer?r.enableGeometryBufferRenderer():(l._prePassRenderer=r.enablePrePassRenderer(),l._prePassRenderer.markAsDirty()),l._createRandomTexture(),l._originalColorPostProcess=new h.PassPostProcess("SSAOOriginalSceneColor",1,null,a.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1),l._originalColorPostProcess.samples=l.textureSamples,l._createSSAOPostProcess(1),l._createBlurPostProcess(c,u),l._createSSAOCombinePostProcess(u),l.addEffect(new d.PostProcessRenderEffect(r.getEngine(),l.SSAOOriginalSceneColorEffect,(function(){return l._originalColorPostProcess}),!0)),l.addEffect(new d.PostProcessRenderEffect(r.getEngine(),l.SSAORenderEffect,(function(){return l._ssaoPostProcess}),!0)),l.addEffect(new d.PostProcessRenderEffect(r.getEngine(),l.SSAOBlurHRenderEffect,(function(){return l._blurHPostProcess}),!0)),l.addEffect(new d.PostProcessRenderEffect(r.getEngine(),l.SSAOBlurVRenderEffect,(function(){return l._blurVPostProcess}),!0)),l.addEffect(new d.PostProcessRenderEffect(r.getEngine(),l.SSAOCombineRenderEffect,(function(){return l._ssaoCombinePostProcess}),!0)),r.postProcessRenderPipelineManager.addPipeline(l),o&&r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,o),l}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples=e,this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()),this._sampleSphere=this._generateHemisphere()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textureSamples",{get:function(){return this._textureSamples},set:function(e){this._textureSamples=e,this._originalColorPostProcess.samples=e,this._blurHPostProcess.samples=e,this._blurVPostProcess.samples=e,this._ssaoPostProcess.samples=e,this._ssaoCombinePostProcess.samples=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"expensiveBlur",{get:function(){return this._expensiveBlur},set:function(e){this._blurHPostProcess.updateEffect("#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE "+(e?"1":"0")+"\n",null,["textureSampler","depthNormalSampler"]),this._blurVPostProcess.updateEffect("#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE "+(e?"1":"0")+"\n",null,["textureSampler","depthNormalSampler"]),this._expensiveBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"IsSupported",{get:function(){var e=p.EngineStore.LastCreatedEngine;return!!e&&e.webGLVersion>=2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"SSAO2RenderingPipeline"},t.prototype.dispose=function(t){void 0===t&&(t=!1);for(var r=0;r<this._scene.cameras.length;r++){var n=this._scene.cameras[r];this._originalColorPostProcess.dispose(n),this._ssaoPostProcess.dispose(n),this._blurHPostProcess.dispose(n),this._blurVPostProcess.dispose(n),this._ssaoCombinePostProcess.dispose(n)}this._randomTexture.dispose(),t&&this._scene.disableGeometryBufferRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),e.prototype.dispose.call(this)},t.prototype._createBlurPostProcess=function(e,t){var r=this;this._samplerOffsets=[];for(var n=this.expensiveBlur,i=-8;i<8;i++)this._samplerOffsets.push(2*i+.5);this._blurHPostProcess=new c.PostProcess("BlurH","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthNormalSampler"],e,null,a.Texture.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE "+(n?"1":"0")+"\n"),this._blurHPostProcess.onApply=function(e){r._scene.activeCamera&&(e.setFloat("outSize",r._ssaoCombinePostProcess.width>0?r._ssaoCombinePostProcess.width:r._originalColorPostProcess.width),e.setFloat("near",r._scene.activeCamera.minZ),e.setFloat("far",r._scene.activeCamera.maxZ),e.setFloat("radius",r.radius),r._forceGeometryBuffer?e.setTexture("depthNormalSampler",r._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]):e.setTexture("depthNormalSampler",r._prePassRenderer.prePassRT.textures[m.Constants.PREPASS_DEPTHNORMAL_INDEX]),e.setArray("samplerOffsets",r._samplerOffsets))},this._blurVPostProcess=new c.PostProcess("BlurV","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthNormalSampler"],t,null,a.Texture.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE "+(n?"1":"0")+"\n"),this._blurVPostProcess.onApply=function(e){r._scene.activeCamera&&(e.setFloat("outSize",r._ssaoCombinePostProcess.height>0?r._ssaoCombinePostProcess.height:r._originalColorPostProcess.height),e.setFloat("near",r._scene.activeCamera.minZ),e.setFloat("far",r._scene.activeCamera.maxZ),e.setFloat("radius",r.radius),r._forceGeometryBuffer?e.setTexture("depthNormalSampler",r._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]):e.setTexture("depthNormalSampler",r._prePassRenderer.prePassRT.textures[m.Constants.PREPASS_DEPTHNORMAL_INDEX]),e.setArray("samplerOffsets",r._samplerOffsets))},this._blurHPostProcess.samples=this.textureSamples,this._blurVPostProcess.samples=this.textureSamples},t.prototype._rebuild=function(){e.prototype._rebuild.call(this)},t.prototype._radicalInverse_VdC=function(e){return this._bits[0]=e,this._bits[0]=(this._bits[0]<<16|this._bits[0]>>16)>>>0,this._bits[0]=(1431655765&this._bits[0])<<1|(2863311530&this._bits[0])>>>1>>>0,this._bits[0]=(858993459&this._bits[0])<<2|(3435973836&this._bits[0])>>>2>>>0,this._bits[0]=(252645135&this._bits[0])<<4|(4042322160&this._bits[0])>>>4>>>0,this._bits[0]=(16711935&this._bits[0])<<8|(4278255360&this._bits[0])>>>8>>>0,2.3283064365386963e-10*this._bits[0]},t.prototype._hammersley=function(e,t){return[e/t,this._radicalInverse_VdC(e)]},t.prototype._hemisphereSample_uniform=function(e,t){var r=2*t*Math.PI,n=1-(.85*e+.15),i=Math.sqrt(1-n*n);return new s.Vector3(Math.cos(r)*i,Math.sin(r)*i,n)},t.prototype._generateHemisphere=function(){for(var e,t=this.samples,r=[],n=0;n<t;){if(t<16)e=this._hemisphereSample_uniform(Math.random(),Math.random());else{var i=this._hammersley(n,t);e=this._hemisphereSample_uniform(i[0],i[1])}r.push(e.x,e.y,e.z),n++}return r},t.prototype._getDefinesForSSAO=function(){var e="#define SAMPLES "+this.samples+"\n#define SSAO";return this._forceGeometryBuffer&&(e+="\n#define GEOMETRYBUFFER"),e},t.prototype._createSSAOPostProcess=function(e){var t=this;this._sampleSphere=this._generateHemisphere();var r,n=this._getDefinesForSSAO();r=this._forceGeometryBuffer?["randomSampler","depthSampler","normalSampler"]:["randomSampler","depthNormalSampler"],this._ssaoPostProcess=new c.PostProcess("ssao2","ssao2",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","base","range","projection","near","far","texelSize","xViewport","yViewport","maxZ","minZAspect"],r,e,null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._ssaoPostProcess.onApply=function(e){t._scene.activeCamera&&(e.setArray3("sampleSphere",t._sampleSphere),e.setFloat("randTextureTiles",32),e.setFloat("samplesFactor",1/t.samples),e.setFloat("totalStrength",t.totalStrength),e.setFloat2("texelSize",1/t._ssaoPostProcess.width,1/t._ssaoPostProcess.height),e.setFloat("radius",t.radius),e.setFloat("maxZ",t.maxZ),e.setFloat("minZAspect",t.minZAspect),e.setFloat("base",t.base),e.setFloat("near",t._scene.activeCamera.minZ),e.setFloat("far",t._scene.activeCamera.maxZ),e.setFloat("xViewport",Math.tan(t._scene.activeCamera.fov/2)*t._scene.getEngine().getAspectRatio(t._scene.activeCamera,!0)),e.setFloat("yViewport",Math.tan(t._scene.activeCamera.fov/2)),e.setMatrix("projection",t._scene.getProjectionMatrix()),t._forceGeometryBuffer?(e.setTexture("depthSampler",t._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]),e.setTexture("normalSampler",t._scene.enableGeometryBufferRenderer().getGBuffer().textures[1])):e.setTexture("depthNormalSampler",t._prePassRenderer.prePassRT.textures[m.Constants.PREPASS_DEPTHNORMAL_INDEX]),e.setTexture("randomSampler",t._randomTexture))},this._ssaoPostProcess.samples=this.textureSamples},t.prototype._createSSAOCombinePostProcess=function(e){var t=this;this._ssaoCombinePostProcess=new c.PostProcess("ssaoCombine","ssaoCombine",[],["originalColor","viewport"],e,null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._ssaoCombinePostProcess.onApply=function(e){var r=t._scene.activeCamera.viewport;e.setVector4("viewport",s.TmpVectors.Vector4[0].copyFromFloats(r.x,r.y,r.width,r.height)),e.setTextureFromPostProcess("originalColor",t._originalColorPostProcess)},this._ssaoCombinePostProcess.samples=this.textureSamples},t.prototype._createRandomTexture=function(){this._randomTexture=new l.DynamicTexture("SSAORandomTexture",128,this._scene,!1,a.Texture.TRILINEAR_SAMPLINGMODE),this._randomTexture.wrapU=a.Texture.WRAP_ADDRESSMODE,this._randomTexture.wrapV=a.Texture.WRAP_ADDRESSMODE;for(var e=this._randomTexture.getContext(),t=function(e,t){return Math.random()*(t-e)+e},r=s.Vector3.Zero(),n=0;n<128;n++)for(var i=0;i<128;i++)r.x=t(0,1),r.y=t(0,1),r.z=0,r.normalize(),r.scaleInPlace(255),r.x=Math.floor(r.x),r.y=Math.floor(r.y),e.fillStyle="rgb("+r.x+", "+r.y+", "+r.z+")",e.fillRect(n,i,1,1);this._randomTexture.update(!1)},t.prototype.serialize=function(){var e=o.SerializationHelper.Serialize(this);return e.customType="SSAO2RenderingPipeline",e},t.Parse=function(e,r,n){return o.SerializationHelper.Parse((function(){return new t(e._name,r,e._ratio)}),e,r,n)},t.prototype.setPrePassRenderer=function(e){return e.materialsShouldRenderGeometry=e.materialsShouldRenderGeometry||!0,!0},Object(n.__decorate)([Object(o.serialize)()],t.prototype,"totalStrength",void 0),Object(n.__decorate)([Object(o.serialize)()],t.prototype,"maxZ",void 0),Object(n.__decorate)([Object(o.serialize)()],t.prototype,"minZAspect",void 0),Object(n.__decorate)([Object(o.serialize)("samples")],t.prototype,"_samples",void 0),Object(n.__decorate)([Object(o.serialize)("textureSamples")],t.prototype,"_textureSamples",void 0),Object(n.__decorate)([Object(o.serialize)()],t.prototype,"_ratio",void 0),Object(n.__decorate)([Object(o.serialize)("expensiveBlur")],t.prototype,"_expensiveBlur",void 0),Object(n.__decorate)([Object(o.serialize)()],t.prototype,"radius",void 0),Object(n.__decorate)([Object(o.serialize)()],t.prototype,"base",void 0),t}(u.PostProcessRenderPipeline));f._TypeStore.RegisteredTypes["BABYLON.SSAO2RenderingPipeline"]=g},"./PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.ts":
- /*!*************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.ts ***!
- \*************************************************************************/
- /*! exports provided: SSAORenderingPipeline */function(e,t,r){"use strict";r.r(t),r.d(t,"SSAORenderingPipeline",(function(){return p}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),a=r(/*! ../../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),l=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),c=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),u=r(/*! ../../../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),d=r(/*! ../../../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),h=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),f=r(/*! ../../../Misc/decorators */"./Misc/decorators.ts"),p=(r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts"),r(/*! ../../../Shaders/ssao.fragment */"./Shaders/ssao.fragment.ts"),r(/*! ../../../Shaders/ssaoCombine.fragment */"./Shaders/ssaoCombine.fragment.ts"),function(e){function t(t,r,n,i){var s=e.call(this,r.getEngine(),t)||this;s.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",s.SSAORenderEffect="SSAORenderEffect",s.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",s.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",s.SSAOCombineRenderEffect="SSAOCombineRenderEffect",s.totalStrength=1,s.radius=1e-4,s.area=.0075,s.fallOff=1e-6,s.base=.5,s._firstUpdate=!0,s._scene=r,s._createRandomTexture(),s._depthTexture=r.enableDepthRenderer().getDepthMap();var a=n.ssaoRatio||n,l=n.combineRatio||n;return s._originalColorPostProcess=new u.PassPostProcess("SSAOOriginalSceneColor",l,null,o.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1),s._createSSAOPostProcess(a),s._createBlurPostProcess(a),s._createSSAOCombinePostProcess(l),s.addEffect(new c.PostProcessRenderEffect(r.getEngine(),s.SSAOOriginalSceneColorEffect,(function(){return s._originalColorPostProcess}),!0)),s.addEffect(new c.PostProcessRenderEffect(r.getEngine(),s.SSAORenderEffect,(function(){return s._ssaoPostProcess}),!0)),s.addEffect(new c.PostProcessRenderEffect(r.getEngine(),s.SSAOBlurHRenderEffect,(function(){return s._blurHPostProcess}),!0)),s.addEffect(new c.PostProcessRenderEffect(r.getEngine(),s.SSAOBlurVRenderEffect,(function(){return s._blurVPostProcess}),!0)),s.addEffect(new c.PostProcessRenderEffect(r.getEngine(),s.SSAOCombineRenderEffect,(function(){return s._ssaoCombinePostProcess}),!0)),r.postProcessRenderPipelineManager.addPipeline(s),i&&r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,i),s}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"SSAORenderingPipeline"},t.prototype.dispose=function(t){void 0===t&&(t=!1);for(var r=0;r<this._scene.cameras.length;r++){var n=this._scene.cameras[r];this._originalColorPostProcess.dispose(n),this._ssaoPostProcess.dispose(n),this._blurHPostProcess.dispose(n),this._blurVPostProcess.dispose(n),this._ssaoCombinePostProcess.dispose(n)}this._randomTexture.dispose(),t&&this._scene.disableDepthRenderer(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),e.prototype.dispose.call(this)},t.prototype._createBlurPostProcess=function(e){var t=this;this._blurHPostProcess=new d.BlurPostProcess("BlurH",new i.Vector2(1,0),16,e,null,o.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,h.Constants.TEXTURETYPE_UNSIGNED_INT),this._blurVPostProcess=new d.BlurPostProcess("BlurV",new i.Vector2(0,1),16,e,null,o.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,h.Constants.TEXTURETYPE_UNSIGNED_INT),this._blurHPostProcess.onActivateObservable.add((function(){var e=t._blurHPostProcess.width/t._scene.getEngine().getRenderWidth();t._blurHPostProcess.kernel=16*e})),this._blurVPostProcess.onActivateObservable.add((function(){var e=t._blurVPostProcess.height/t._scene.getEngine().getRenderHeight();t._blurVPostProcess.kernel=16*e}))},t.prototype._rebuild=function(){this._firstUpdate=!0,e.prototype._rebuild.call(this)},t.prototype._createSSAOPostProcess=function(e){var t=this,r=[.5381,.1856,-.4319,.1379,.2486,.443,.3371,.5679,-.0057,-.6999,-.0451,-.0019,.0689,-.1598,-.8547,.056,.0069,-.1843,-.0146,.1402,.0762,.01,-.1924,-.0344,-.3577,-.5301,-.4358,-.3169,.1063,.0158,.0103,-.5869,.0046,-.0897,-.494,.3287,.7119,-.0154,-.0918,-.0533,.0596,-.5411,.0352,-.0631,.546,-.4776,.2847,-.0271];this._ssaoPostProcess=new a.PostProcess("ssao","ssao",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","area","fallOff","base","range","viewport"],["randomSampler"],e,null,o.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define SAMPLES 16\n#define SSAO"),this._ssaoPostProcess.onApply=function(e){t._firstUpdate&&(e.setArray3("sampleSphere",r),e.setFloat("samplesFactor",1/16),e.setFloat("randTextureTiles",4)),e.setFloat("totalStrength",t.totalStrength),e.setFloat("radius",t.radius),e.setFloat("area",t.area),e.setFloat("fallOff",t.fallOff),e.setFloat("base",t.base),e.setTexture("textureSampler",t._depthTexture),e.setTexture("randomSampler",t._randomTexture)}},t.prototype._createSSAOCombinePostProcess=function(e){var t=this;this._ssaoCombinePostProcess=new a.PostProcess("ssaoCombine","ssaoCombine",[],["originalColor","viewport"],e,null,o.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._ssaoCombinePostProcess.onApply=function(e){e.setVector4("viewport",i.TmpVectors.Vector4[0].copyFromFloats(0,0,1,1)),e.setTextureFromPostProcess("originalColor",t._originalColorPostProcess)}},t.prototype._createRandomTexture=function(){this._randomTexture=new s.DynamicTexture("SSAORandomTexture",512,this._scene,!1,o.Texture.TRILINEAR_SAMPLINGMODE),this._randomTexture.wrapU=o.Texture.WRAP_ADDRESSMODE,this._randomTexture.wrapV=o.Texture.WRAP_ADDRESSMODE;for(var e=this._randomTexture.getContext(),t=function(e,t){return Math.random()*(t-e)+e},r=i.Vector3.Zero(),n=0;n<512;n++)for(var a=0;a<512;a++)r.x=Math.floor(255*t(-1,1)),r.y=Math.floor(255*t(-1,1)),r.z=Math.floor(255*t(-1,1)),e.fillStyle="rgb("+r.x+", "+r.y+", "+r.z+")",e.fillRect(n,a,1,1);this._randomTexture.update(!1)},Object(n.__decorate)([Object(f.serialize)()],t.prototype,"totalStrength",void 0),Object(n.__decorate)([Object(f.serialize)()],t.prototype,"radius",void 0),Object(n.__decorate)([Object(f.serialize)()],t.prototype,"area",void 0),Object(n.__decorate)([Object(f.serialize)()],t.prototype,"fallOff",void 0),Object(n.__decorate)([Object(f.serialize)()],t.prototype,"base",void 0),t}(l.PostProcessRenderPipeline))},"./PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.ts":
- /*!*****************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.ts ***!
- \*****************************************************************************/
- /*! exports provided: StandardRenderingPipeline */function(e,t,r){"use strict";r.r(t),r.d(t,"StandardRenderingPipeline",(function(){return v}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../../Maths/math.scalar */"./Maths/math.scalar.ts"),l=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),u=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),d=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),h=r(/*! ../../../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),f=r(/*! ../../../PostProcesses/fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts"),p=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),m=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),g=r(/*! ../../motionBlurPostProcess */"./PostProcesses/motionBlurPostProcess.ts"),_=r(/*! ../../screenSpaceReflectionPostProcess */"./PostProcesses/screenSpaceReflectionPostProcess.ts"),v=(r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts"),r(/*! ../../../Shaders/standard.fragment */"./Shaders/standard.fragment.ts"),function(e){function t(t,r,n,i,o){void 0===i&&(i=null);var s=e.call(this,r.getEngine(),t)||this;return s.downSampleX4PostProcess=null,s.brightPassPostProcess=null,s.blurHPostProcesses=[],s.blurVPostProcesses=[],s.textureAdderPostProcess=null,s.volumetricLightPostProcess=null,s.volumetricLightSmoothXPostProcess=null,s.volumetricLightSmoothYPostProcess=null,s.volumetricLightMergePostProces=null,s.volumetricLightFinalPostProcess=null,s.luminancePostProcess=null,s.luminanceDownSamplePostProcesses=[],s.hdrPostProcess=null,s.textureAdderFinalPostProcess=null,s.lensFlareFinalPostProcess=null,s.hdrFinalPostProcess=null,s.lensFlarePostProcess=null,s.lensFlareComposePostProcess=null,s.motionBlurPostProcess=null,s.depthOfFieldPostProcess=null,s.fxaaPostProcess=null,s.screenSpaceReflectionPostProcess=null,s.brightThreshold=1,s.blurWidth=512,s.horizontalBlur=!1,s.lensTexture=null,s.volumetricLightCoefficient=.2,s.volumetricLightPower=4,s.volumetricLightBlurScale=64,s.sourceLight=null,s.hdrMinimumLuminance=1,s.hdrDecreaseRate=.5,s.hdrIncreaseRate=.5,s.lensColorTexture=null,s.lensFlareStrength=20,s.lensFlareGhostDispersal=1.4,s.lensFlareHaloWidth=.7,s.lensFlareDistortionStrength=16,s.lensFlareBlurWidth=512,s.lensStarTexture=null,s.lensFlareDirtTexture=null,s.depthOfFieldDistance=10,s.depthOfFieldBlurWidth=64,s.animations=[],s._currentDepthOfFieldSource=null,s._fixedExposure=1,s._currentExposure=1,s._hdrAutoExposure=!1,s._hdrCurrentLuminance=1,s._motionStrength=1,s._isObjectBasedMotionBlur=!1,s._camerasToBeAttached=[],s._bloomEnabled=!1,s._depthOfFieldEnabled=!1,s._vlsEnabled=!1,s._lensFlareEnabled=!1,s._hdrEnabled=!1,s._motionBlurEnabled=!1,s._fxaaEnabled=!1,s._screenSpaceReflectionsEnabled=!1,s._motionBlurSamples=64,s._volumetricLightStepsCount=50,s._samples=1,s._cameras=o||r.cameras,s._cameras=s._cameras.slice(),s._camerasToBeAttached=s._cameras.slice(),s._scene=r,s._basePostProcess=i,s._ratio=n,s._floatTextureType=r.getEngine().getCaps().textureFloatRender?p.Constants.TEXTURETYPE_FLOAT:p.Constants.TEXTURETYPE_HALF_FLOAT,r.postProcessRenderPipelineManager.addPipeline(s),s._buildPipeline(),s}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"exposure",{get:function(){return this._fixedExposure},set:function(e){this._fixedExposure=e,this._currentExposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hdrAutoExposure",{get:function(){return this._hdrAutoExposure},set:function(e){if(this._hdrAutoExposure=e,this.hdrPostProcess){var t=["#define HDR"];e&&t.push("#define AUTO_EXPOSURE"),this.hdrPostProcess.updateEffect(t.join("\n"))}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"motionStrength",{get:function(){return this._motionStrength},set:function(e){this._motionStrength=e,this._isObjectBasedMotionBlur&&this.motionBlurPostProcess&&(this.motionBlurPostProcess.motionStrength=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objectBasedMotionBlur",{get:function(){return this._isObjectBasedMotionBlur},set:function(e){var t=this._isObjectBasedMotionBlur!==e;this._isObjectBasedMotionBlur=e,t&&this._buildPipeline()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DepthOfFieldEnabled",{get:function(){return this._depthOfFieldEnabled},set:function(e){this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LensFlareEnabled",{get:function(){return this._lensFlareEnabled},set:function(e){this._lensFlareEnabled!==e&&(this._lensFlareEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HDREnabled",{get:function(){return this._hdrEnabled},set:function(e){this._hdrEnabled!==e&&(this._hdrEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VLSEnabled",{get:function(){return this._vlsEnabled},set:function(e){if(this._vlsEnabled!==e){if(e&&!this._scene.enableGeometryBufferRenderer())return void o.Logger.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline");this._vlsEnabled=e,this._buildPipeline()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MotionBlurEnabled",{get:function(){return this._motionBlurEnabled},set:function(e){this._motionBlurEnabled!==e&&(this._motionBlurEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenSpaceReflectionsEnabled",{get:function(){return this._screenSpaceReflectionsEnabled},set:function(e){this._screenSpaceReflectionsEnabled!==e&&(this._screenSpaceReflectionsEnabled=e,this._buildPipeline())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volumetricLightStepsCount",{get:function(){return this._volumetricLightStepsCount},set:function(e){this.volumetricLightPostProcess&&this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS "+e.toFixed(1)),this._volumetricLightStepsCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"motionBlurSamples",{get:function(){return this._motionBlurSamples},set:function(e){this.motionBlurPostProcess&&(this._isObjectBasedMotionBlur?this.motionBlurPostProcess.motionBlurSamples=e:this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+e.toFixed(1))),this._motionBlurSamples=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=e,this._buildPipeline())},enumerable:!1,configurable:!0}),t.prototype._buildPipeline=function(){var e=this,t=this._ratio,r=this._scene;this._disposePostProcesses(),null!==this._cameras&&(this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),this._cameras=this._camerasToBeAttached.slice()),this._reset(),this._screenSpaceReflectionsEnabled&&(this.screenSpaceReflectionPostProcess=new _.ScreenSpaceReflectionPostProcess("HDRPass",r,t,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,this._floatTextureType),this.screenSpaceReflectionPostProcess.onApplyObservable.add((function(){e._currentDepthOfFieldSource=e.screenSpaceReflectionPostProcess})),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRScreenSpaceReflections",(function(){return e.screenSpaceReflectionPostProcess}),!0))),this._basePostProcess?this.originalPostProcess=this._basePostProcess:this.originalPostProcess=new c.PostProcess("HDRPass","standard",[],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",this._floatTextureType),this.originalPostProcess.autoClear=!this.screenSpaceReflectionPostProcess,this.originalPostProcess.onApplyObservable.add((function(){e._currentDepthOfFieldSource=e.originalPostProcess})),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRPassPostProcess",(function(){return e.originalPostProcess}),!0)),this._bloomEnabled&&(this._createDownSampleX4PostProcess(r,t/4),this._createBrightPassPostProcess(r,t/4),this._createBlurPostProcesses(r,t/4,1),this._createTextureAdderPostProcess(r,t),this.textureAdderFinalPostProcess=new c.PostProcess("HDRDepthOfFieldSource","standard",[],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRBaseDepthOfFieldSource",(function(){return e.textureAdderFinalPostProcess}),!0))),this._vlsEnabled&&(this._createVolumetricLightPostProcess(r,t),this.volumetricLightFinalPostProcess=new c.PostProcess("HDRVLSFinal","standard",[],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRVLSFinal",(function(){return e.volumetricLightFinalPostProcess}),!0))),this._lensFlareEnabled&&(this._createLensFlarePostProcess(r,t),this.lensFlareFinalPostProcess=new c.PostProcess("HDRPostLensFlareDepthOfFieldSource","standard",[],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRPostLensFlareDepthOfFieldSource",(function(){return e.lensFlareFinalPostProcess}),!0))),this._hdrEnabled&&(this._createLuminancePostProcesses(r,this._floatTextureType),this._createHdrPostProcess(r,t),this.hdrFinalPostProcess=new c.PostProcess("HDRPostHDReDepthOfFieldSource","standard",[],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRPostHDReDepthOfFieldSource",(function(){return e.hdrFinalPostProcess}),!0))),this._depthOfFieldEnabled&&(this._createBlurPostProcesses(r,t/2,3,"depthOfFieldBlurWidth"),this._createDepthOfFieldPostProcess(r,t)),this._motionBlurEnabled&&this._createMotionBlurPostProcess(r,t),this._fxaaEnabled&&(this.fxaaPostProcess=new f.FxaaPostProcess("fxaa",1,null,l.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(r.getEngine(),"HDRFxaa",(function(){return e.fxaaPostProcess}),!0))),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),!this._enableMSAAOnFirstPostProcess(this._samples)&&this._samples>1&&o.Logger.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")},t.prototype._createDownSampleX4PostProcess=function(e,t){var r=this,n=new Array(32);this.downSampleX4PostProcess=new c.PostProcess("HDRDownSampleX4","standard",["dsOffsets"],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DOWN_SAMPLE_X4",this._floatTextureType),this.downSampleX4PostProcess.onApply=function(e){for(var t=0,i=r.downSampleX4PostProcess.width,o=r.downSampleX4PostProcess.height,s=-2;s<2;s++)for(var a=-2;a<2;a++)n[t]=(s+.5)*(1/i),n[t+1]=(a+.5)*(1/o),t+=2;e.setArray2("dsOffsets",n)},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRDownSampleX4",(function(){return r.downSampleX4PostProcess}),!0))},t.prototype._createBrightPassPostProcess=function(e,t){var r=this,n=new Array(8);this.brightPassPostProcess=new c.PostProcess("HDRBrightPass","standard",["dsOffsets","brightThreshold"],[],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define BRIGHT_PASS",this._floatTextureType),this.brightPassPostProcess.onApply=function(e){var t=1/r.brightPassPostProcess.width,i=1/r.brightPassPostProcess.height;n[0]=-.5*t,n[1]=.5*i,n[2]=.5*t,n[3]=.5*i,n[4]=-.5*t,n[5]=-.5*i,n[6]=.5*t,n[7]=-.5*i,e.setArray2("dsOffsets",n),e.setFloat("brightThreshold",r.brightThreshold)},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRBrightPass",(function(){return r.brightPassPostProcess}),!0))},t.prototype._createBlurPostProcesses=function(e,t,r,n){var i=this;void 0===n&&(n="blurWidth");var o=e.getEngine(),a=new h.BlurPostProcess("HDRBlurH_"+r,new s.Vector2(1,0),this[n],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType),c=new h.BlurPostProcess("HDRBlurV_"+r,new s.Vector2(0,1),this[n],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType);a.onActivateObservable.add((function(){var e=a.width/o.getRenderWidth();a.kernel=i[n]*e})),c.onActivateObservable.add((function(){var e=c.height/o.getRenderHeight();c.kernel=i.horizontalBlur?64*e:i[n]*e})),this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRBlurH"+r,(function(){return a}),!0)),this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRBlurV"+r,(function(){return c}),!0)),this.blurHPostProcesses.push(a),this.blurVPostProcesses.push(c)},t.prototype._createTextureAdderPostProcess=function(e,t){var r=this;this.textureAdderPostProcess=new c.PostProcess("HDRTextureAdder","standard",["exposure"],["otherSampler","lensSampler"],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define TEXTURE_ADDER",this._floatTextureType),this.textureAdderPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",r._vlsEnabled?r._currentDepthOfFieldSource:r.originalPostProcess),e.setTexture("lensSampler",r.lensTexture),e.setFloat("exposure",r._currentExposure),r._currentDepthOfFieldSource=r.textureAdderFinalPostProcess},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRTextureAdder",(function(){return r.textureAdderPostProcess}),!0))},t.prototype._createVolumetricLightPostProcess=function(e,t){var r=this,n=e.enableGeometryBufferRenderer();n.enablePosition=!0;var i=n.getGBuffer();this.volumetricLightPostProcess=new c.PostProcess("HDRVLS","standard",["shadowViewProjection","cameraPosition","sunDirection","sunColor","scatteringCoefficient","scatteringPower","depthValues"],["shadowMapSampler","positionSampler"],t/8,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLS\n#define NB_STEPS "+this._volumetricLightStepsCount.toFixed(1));var o=s.Vector2.Zero();this.volumetricLightPostProcess.onApply=function(e){if(r.sourceLight&&r.sourceLight.getShadowGenerator()&&r._scene.activeCamera){var t=r.sourceLight.getShadowGenerator();e.setTexture("shadowMapSampler",t.getShadowMap()),e.setTexture("positionSampler",i.textures[2]),e.setColor3("sunColor",r.sourceLight.diffuse),e.setVector3("sunDirection",r.sourceLight.getShadowDirection()),e.setVector3("cameraPosition",r._scene.activeCamera.globalPosition),e.setMatrix("shadowViewProjection",t.getTransformMatrix()),e.setFloat("scatteringCoefficient",r.volumetricLightCoefficient),e.setFloat("scatteringPower",r.volumetricLightPower),o.x=r.sourceLight.getDepthMinZ(r._scene.activeCamera),o.y=r.sourceLight.getDepthMaxZ(r._scene.activeCamera),e.setVector2("depthValues",o)}},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRVLS",(function(){return r.volumetricLightPostProcess}),!0)),this._createBlurPostProcesses(e,t/4,0,"volumetricLightBlurScale"),this.volumetricLightMergePostProces=new c.PostProcess("HDRVLSMerge","standard",[],["originalSampler"],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLSMERGE"),this.volumetricLightMergePostProces.onApply=function(e){e.setTextureFromPostProcess("originalSampler",r._bloomEnabled?r.textureAdderFinalPostProcess:r.originalPostProcess),r._currentDepthOfFieldSource=r.volumetricLightFinalPostProcess},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRVLSMerge",(function(){return r.volumetricLightMergePostProces}),!0))},t.prototype._createLuminancePostProcesses=function(e,r){var n=this,i=Math.pow(3,t.LuminanceSteps);this.luminancePostProcess=new c.PostProcess("HDRLuminance","standard",["lumOffsets"],[],{width:i,height:i},null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LUMINANCE",r);var o=[];this.luminancePostProcess.onApply=function(e){var t=1/n.luminancePostProcess.width,r=1/n.luminancePostProcess.height;o[0]=-.5*t,o[1]=.5*r,o[2]=.5*t,o[3]=.5*r,o[4]=-.5*t,o[5]=-.5*r,o[6]=.5*t,o[7]=-.5*r,e.setArray2("lumOffsets",o)},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRLuminance",(function(){return n.luminancePostProcess}),!0));for(var a=t.LuminanceSteps-1;a>=0;a--){i=Math.pow(3,a);var u="#define LUMINANCE_DOWN_SAMPLE\n";0===a&&(u+="#define FINAL_DOWN_SAMPLER");var h=new c.PostProcess("HDRLuminanceDownSample"+a,"standard",["dsOffsets","halfDestPixelSize"],[],{width:i,height:i},null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,u,r);this.luminanceDownSamplePostProcesses.push(h)}var f=this.luminancePostProcess;this.luminanceDownSamplePostProcesses.forEach((function(t,r){var i=new Array(18);t.onApply=function(e){if(f){for(var o=0,s=-1;s<2;s++)for(var a=-1;a<2;a++)i[o]=s/f.width,i[o+1]=a/f.height,o+=2;e.setArray2("dsOffsets",i),e.setFloat("halfDestPixelSize",.5/f.width),f=r===n.luminanceDownSamplePostProcesses.length-1?n.luminancePostProcess:t}},r===n.luminanceDownSamplePostProcesses.length-1&&(t.onAfterRender=function(){var t=e.getEngine().readPixels(0,0,1,1),r=new s.Vector4(1/16581375,1/65025,1/255,1);n._hdrCurrentLuminance=(t[0]*r.x+t[1]*r.y+t[2]*r.z+t[3]*r.w)/100}),n.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRLuminanceDownSample"+r,(function(){return t}),!0))}))},t.prototype._createHdrPostProcess=function(e,t){var r=this,n=["#define HDR"];this._hdrAutoExposure&&n.push("#define AUTO_EXPOSURE"),this.hdrPostProcess=new c.PostProcess("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,n.join("\n"),p.Constants.TEXTURETYPE_UNSIGNED_INT);var i=1,o=0,s=0;this.hdrPostProcess.onApply=function(t){if(t.setTextureFromPostProcess("textureAdderSampler",r._currentDepthOfFieldSource),o+=e.getEngine().getDeltaTime(),i<0)i=r._hdrCurrentLuminance;else{var n=(s-o)/1e3;r._hdrCurrentLuminance<i+r.hdrDecreaseRate*n?i+=r.hdrDecreaseRate*n:r._hdrCurrentLuminance>i-r.hdrIncreaseRate*n?i-=r.hdrIncreaseRate*n:i=r._hdrCurrentLuminance}r.hdrAutoExposure?r._currentExposure=r._fixedExposure/i:(i=a.Scalar.Clamp(i,r.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",i)),s=o,r._currentDepthOfFieldSource=r.hdrFinalPostProcess},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDR",(function(){return r.hdrPostProcess}),!0))},t.prototype._createLensFlarePostProcess=function(e,t){var r=this;this.lensFlarePostProcess=new c.PostProcess("HDRLensFlare","standard",["strength","ghostDispersal","haloWidth","resolution","distortionStrength"],["lensColorSampler"],t/2,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRLensFlare",(function(){return r.lensFlarePostProcess}),!0)),this._createBlurPostProcesses(e,t/4,2,"lensFlareBlurWidth"),this.lensFlareComposePostProcess=new c.PostProcess("HDRLensFlareCompose","standard",["lensStarMatrix"],["otherSampler","lensDirtSampler","lensStarSampler"],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE_COMPOSE",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRLensFlareCompose",(function(){return r.lensFlareComposePostProcess}),!0));var n=new s.Vector2(0,0);this.lensFlarePostProcess.onApply=function(e){e.setTextureFromPostProcess("textureSampler",r._bloomEnabled?r.blurHPostProcesses[0]:r.originalPostProcess),e.setTexture("lensColorSampler",r.lensColorTexture),e.setFloat("strength",r.lensFlareStrength),e.setFloat("ghostDispersal",r.lensFlareGhostDispersal),e.setFloat("haloWidth",r.lensFlareHaloWidth),n.x=r.lensFlarePostProcess.width,n.y=r.lensFlarePostProcess.height,e.setVector2("resolution",n),e.setFloat("distortionStrength",r.lensFlareDistortionStrength)};var i=s.Matrix.FromValues(2,0,-1,0,0,2,-1,0,0,0,1,0,0,0,0,1),o=s.Matrix.FromValues(.5,0,.5,0,0,.5,.5,0,0,0,1,0,0,0,0,1);this.lensFlareComposePostProcess.onApply=function(e){if(r._scene.activeCamera){e.setTextureFromPostProcess("otherSampler",r.lensFlarePostProcess),e.setTexture("lensDirtSampler",r.lensFlareDirtTexture),e.setTexture("lensStarSampler",r.lensStarTexture);var t=r._scene.activeCamera.getViewMatrix().getRow(0),n=r._scene.activeCamera.getViewMatrix().getRow(2),a=s.Vector3.Dot(t.toVector3(),new s.Vector3(1,0,0))+s.Vector3.Dot(n.toVector3(),new s.Vector3(0,0,1));a*=4;var l=s.Matrix.FromValues(.5*Math.cos(a),-Math.sin(a),0,0,Math.sin(a),.5*Math.cos(a),0,0,0,0,1,0,0,0,0,1),c=o.multiply(l).multiply(i);e.setMatrix("lensStarMatrix",c),r._currentDepthOfFieldSource=r.lensFlareFinalPostProcess}}},t.prototype._createDepthOfFieldPostProcess=function(e,t){var r=this;this.depthOfFieldPostProcess=new c.PostProcess("HDRDepthOfField","standard",["distance"],["otherSampler","depthSampler"],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DEPTH_OF_FIELD",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.depthOfFieldPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",r._currentDepthOfFieldSource),e.setTexture("depthSampler",r._getDepthTexture()),e.setFloat("distance",r.depthOfFieldDistance)},this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRDepthOfField",(function(){return r.depthOfFieldPostProcess}),!0))},t.prototype._createMotionBlurPostProcess=function(e,t){var r=this;if(this._isObjectBasedMotionBlur){var n=new g.MotionBlurPostProcess("HDRMotionBlur",e,t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,p.Constants.TEXTURETYPE_UNSIGNED_INT);n.motionStrength=this.motionStrength,n.motionBlurSamples=this.motionBlurSamples,this.motionBlurPostProcess=n}else{this.motionBlurPostProcess=new c.PostProcess("HDRMotionBlur","standard",["inverseViewProjection","prevViewProjection","screenSize","motionScale","motionStrength"],["depthSampler"],t,null,l.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+this.motionBlurSamples.toFixed(1),p.Constants.TEXTURETYPE_UNSIGNED_INT);var i=0,o=s.Matrix.Identity(),a=s.Matrix.Identity(),u=s.Matrix.Identity(),h=s.Vector2.Zero();this.motionBlurPostProcess.onApply=function(t){(u=e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(a),t.setMatrix("inverseViewProjection",a),t.setMatrix("prevViewProjection",o),o=u,h.x=r.motionBlurPostProcess.width,h.y=r.motionBlurPostProcess.height,t.setVector2("screenSize",h),i=e.getEngine().getFps()/60,t.setFloat("motionScale",i),t.setFloat("motionStrength",r.motionStrength),t.setTexture("depthSampler",r._getDepthTexture())}}this.addEffect(new d.PostProcessRenderEffect(e.getEngine(),"HDRMotionBlur",(function(){return r.motionBlurPostProcess}),!0))},t.prototype._getDepthTexture=function(){return this._scene.getEngine().getCaps().drawBuffersExtension?this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]:this._scene.enableDepthRenderer().getDepthMap()},t.prototype._disposePostProcesses=function(){for(var e=0;e<this._cameras.length;e++){var t=this._cameras[e];this.originalPostProcess&&this.originalPostProcess.dispose(t),this.screenSpaceReflectionPostProcess&&this.screenSpaceReflectionPostProcess.dispose(t),this.downSampleX4PostProcess&&this.downSampleX4PostProcess.dispose(t),this.brightPassPostProcess&&this.brightPassPostProcess.dispose(t),this.textureAdderPostProcess&&this.textureAdderPostProcess.dispose(t),this.volumetricLightPostProcess&&this.volumetricLightPostProcess.dispose(t),this.volumetricLightSmoothXPostProcess&&this.volumetricLightSmoothXPostProcess.dispose(t),this.volumetricLightSmoothYPostProcess&&this.volumetricLightSmoothYPostProcess.dispose(t),this.volumetricLightMergePostProces&&this.volumetricLightMergePostProces.dispose(t),this.volumetricLightFinalPostProcess&&this.volumetricLightFinalPostProcess.dispose(t),this.lensFlarePostProcess&&this.lensFlarePostProcess.dispose(t),this.lensFlareComposePostProcess&&this.lensFlareComposePostProcess.dispose(t);for(var r=0;r<this.luminanceDownSamplePostProcesses.length;r++)this.luminanceDownSamplePostProcesses[r].dispose(t);for(this.luminancePostProcess&&this.luminancePostProcess.dispose(t),this.hdrPostProcess&&this.hdrPostProcess.dispose(t),this.hdrFinalPostProcess&&this.hdrFinalPostProcess.dispose(t),this.depthOfFieldPostProcess&&this.depthOfFieldPostProcess.dispose(t),this.motionBlurPostProcess&&this.motionBlurPostProcess.dispose(t),this.fxaaPostProcess&&this.fxaaPostProcess.dispose(t),r=0;r<this.blurHPostProcesses.length;r++)this.blurHPostProcesses[r].dispose(t);for(r=0;r<this.blurVPostProcesses.length;r++)this.blurVPostProcesses[r].dispose(t)}this.originalPostProcess=null,this.downSampleX4PostProcess=null,this.brightPassPostProcess=null,this.textureAdderPostProcess=null,this.textureAdderFinalPostProcess=null,this.volumetricLightPostProcess=null,this.volumetricLightSmoothXPostProcess=null,this.volumetricLightSmoothYPostProcess=null,this.volumetricLightMergePostProces=null,this.volumetricLightFinalPostProcess=null,this.lensFlarePostProcess=null,this.lensFlareComposePostProcess=null,this.luminancePostProcess=null,this.hdrPostProcess=null,this.hdrFinalPostProcess=null,this.depthOfFieldPostProcess=null,this.motionBlurPostProcess=null,this.fxaaPostProcess=null,this.screenSpaceReflectionPostProcess=null,this.luminanceDownSamplePostProcesses=[],this.blurHPostProcesses=[],this.blurVPostProcesses=[]},t.prototype.dispose=function(){this._disposePostProcesses(),this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._cameras),e.prototype.dispose.call(this)},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return this.sourceLight&&(e.sourceLightId=this.sourceLight.id),this.screenSpaceReflectionPostProcess&&(e.screenSpaceReflectionPostProcess=i.SerializationHelper.Serialize(this.screenSpaceReflectionPostProcess)),e.customType="StandardRenderingPipeline",e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse((function(){return new t(e._name,r,e._ratio)}),e,r,n);return e.sourceLightId&&(o.sourceLight=r.getLightByID(e.sourceLightId)),e.screenSpaceReflectionPostProcess&&i.SerializationHelper.Parse((function(){return o.screenSpaceReflectionPostProcess}),e.screenSpaceReflectionPostProcess,r,n),o},t.LuminanceSteps=6,Object(n.__decorate)([Object(i.serialize)()],t.prototype,"brightThreshold",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"blurWidth",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"horizontalBlur",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"exposure",null),Object(n.__decorate)([Object(i.serializeAsTexture)("lensTexture")],t.prototype,"lensTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"volumetricLightCoefficient",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"volumetricLightPower",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"volumetricLightBlurScale",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"hdrMinimumLuminance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"hdrDecreaseRate",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"hdrIncreaseRate",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"hdrAutoExposure",null),Object(n.__decorate)([Object(i.serializeAsTexture)("lensColorTexture")],t.prototype,"lensColorTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lensFlareStrength",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lensFlareGhostDispersal",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lensFlareHaloWidth",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lensFlareDistortionStrength",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lensFlareBlurWidth",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("lensStarTexture")],t.prototype,"lensStarTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("lensFlareDirtTexture")],t.prototype,"lensFlareDirtTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"depthOfFieldDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"depthOfFieldBlurWidth",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"motionStrength",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"objectBasedMotionBlur",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_ratio",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"BloomEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"DepthOfFieldEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"LensFlareEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"HDREnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"VLSEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"MotionBlurEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"fxaaEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"screenSpaceReflectionsEnabled",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"volumetricLightStepsCount",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"motionBlurSamples",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"samples",null),t}(u.PostProcessRenderPipeline));m._TypeStore.RegisteredTypes["BABYLON.StandardRenderingPipeline"]=v},"./PostProcesses/RenderPipeline/index.ts":
- /*!***********************************************!*\
- !*** ./PostProcesses/RenderPipeline/index.ts ***!
- \***********************************************/
- /*! exports provided: DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Pipelines/index */"./PostProcesses/RenderPipeline/Pipelines/index.ts");r.d(t,"DefaultRenderingPipeline",(function(){return n.DefaultRenderingPipeline})),r.d(t,"LensRenderingPipeline",(function(){return n.LensRenderingPipeline})),r.d(t,"SSAO2RenderingPipeline",(function(){return n.SSAO2RenderingPipeline})),r.d(t,"SSAORenderingPipeline",(function(){return n.SSAORenderingPipeline})),r.d(t,"StandardRenderingPipeline",(function(){return n.StandardRenderingPipeline}));var i=r(/*! ./postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts");r.d(t,"PostProcessRenderEffect",(function(){return i.PostProcessRenderEffect}));var o=r(/*! ./postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts");r.d(t,"PostProcessRenderPipeline",(function(){return o.PostProcessRenderPipeline}));var s=r(/*! ./postProcessRenderPipelineManager */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManager.ts");r.d(t,"PostProcessRenderPipelineManager",(function(){return s.PostProcessRenderPipelineManager}));var a=r(/*! ./postProcessRenderPipelineManagerSceneComponent */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts");r.d(t,"PostProcessRenderPipelineManagerSceneComponent",(function(){return a.PostProcessRenderPipelineManagerSceneComponent}))},"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts":
- /*!*****************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/postProcessRenderEffect.ts ***!
- \*****************************************************************/
- /*! exports provided: PostProcessRenderEffect */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcessRenderEffect",(function(){return i}));var n=r(/*! ../../Misc/tools */"./Misc/tools.ts"),i=function(){function e(e,t,r,n){this._name=t,this._singleInstance=n||!0,this._getPostProcesses=r,this._cameras={},this._indicesForCamera={},this._postProcesses={}}return Object.defineProperty(e.prototype,"isSupported",{get:function(){for(var e in this._postProcesses)if(this._postProcesses.hasOwnProperty(e))for(var t=this._postProcesses[e],r=0;r<t.length;r++)if(!t[r].isSupported)return!1;return!0},enumerable:!1,configurable:!0}),e.prototype._update=function(){},e.prototype._attachCameras=function(e){var t,r=this,i=n.Tools.MakeArray(e||this._cameras);if(i)for(var o=0;o<i.length;o++){var s=i[o];if(s){var a=s.name;if(t=this._singleInstance?0:a,!this._postProcesses[t]){var l=this._getPostProcesses();l&&(this._postProcesses[t]=Array.isArray(l)?l:[l])}this._indicesForCamera[a]||(this._indicesForCamera[a]=[]),this._postProcesses[t].forEach((function(e){var t=s.attachPostProcess(e);r._indicesForCamera[a].push(t)})),this._cameras[a]||(this._cameras[a]=s)}}},e.prototype._detachCameras=function(e){var t=n.Tools.MakeArray(e||this._cameras);if(t)for(var r=0;r<t.length;r++){var i=t[r],o=i.name,s=this._postProcesses[this._singleInstance?0:o];s&&s.forEach((function(e){i.detachPostProcess(e)})),this._cameras[o]&&(this._cameras[o]=null)}},e.prototype._enable=function(e){var t=this,r=n.Tools.MakeArray(e||this._cameras);if(r)for(var i=0;i<r.length;i++)for(var o=r[i],s=o.name,a=0;a<this._indicesForCamera[s].length;a++)void 0!==o._postProcesses[this._indicesForCamera[s][a]]&&null!==o._postProcesses[this._indicesForCamera[s][a]]||this._postProcesses[this._singleInstance?0:s].forEach((function(e){r[i].attachPostProcess(e,t._indicesForCamera[s][a])}))},e.prototype._disable=function(e){var t=n.Tools.MakeArray(e||this._cameras);if(t)for(var r=0;r<t.length;r++){var i=t[r],o=i.name;this._postProcesses[this._singleInstance?0:o].forEach((function(e){i.detachPostProcess(e)}))}},e.prototype.getPostProcesses=function(e){return this._singleInstance?this._postProcesses[0]:e?this._postProcesses[e.name]:null},e}()},"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts":
- /*!*******************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts ***!
- \*******************************************************************/
- /*! exports provided: PostProcessRenderPipeline */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcessRenderPipeline",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/tools */"./Misc/tools.ts"),o=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),s=function(){function e(e,t){this.engine=e,this._name=t,this._renderEffects={},this._renderEffectsForIsolatedPass=new Array,this._cameras=[]}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cameras",{get:function(){return this._cameras},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"PostProcessRenderPipeline"},Object.defineProperty(e.prototype,"isSupported",{get:function(){for(var e in this._renderEffects)if(this._renderEffects.hasOwnProperty(e)&&!this._renderEffects[e].isSupported)return!1;return!0},enumerable:!1,configurable:!0}),e.prototype.addEffect=function(e){this._renderEffects[e._name]=e},e.prototype._rebuild=function(){},e.prototype._enableEffect=function(e,t){var r=this._renderEffects[e];r&&r._enable(i.Tools.MakeArray(t||this._cameras))},e.prototype._disableEffect=function(e,t){var r=this._renderEffects[e];r&&r._disable(i.Tools.MakeArray(t||this._cameras))},e.prototype._attachCameras=function(e,t){var r=i.Tools.MakeArray(e||this._cameras);if(r){var n,o=[];for(n=0;n<r.length;n++){var s=r[n];if(s){var a=s.name;-1===this._cameras.indexOf(s)?this._cameras[a]=s:t&&o.push(n)}}for(n=0;n<o.length;n++)e.splice(o[n],1);for(var l in this._renderEffects)this._renderEffects.hasOwnProperty(l)&&this._renderEffects[l]._attachCameras(r)}},e.prototype._detachCameras=function(e){var t=i.Tools.MakeArray(e||this._cameras);if(t){for(var r in this._renderEffects)this._renderEffects.hasOwnProperty(r)&&this._renderEffects[r]._detachCameras(t);for(var n=0;n<t.length;n++)this._cameras.splice(this._cameras.indexOf(t[n]),1)}},e.prototype._update=function(){for(var e in this._renderEffects)this._renderEffects.hasOwnProperty(e)&&this._renderEffects[e]._update();for(var t=0;t<this._cameras.length;t++)if(this._cameras[t]){var r=this._cameras[t].name;this._renderEffectsForIsolatedPass[r]&&this._renderEffectsForIsolatedPass[r]._update()}},e.prototype._reset=function(){this._renderEffects={},this._renderEffectsForIsolatedPass=new Array},e.prototype._enableMSAAOnFirstPostProcess=function(e){if(1===this.engine.webGLVersion)return!1;var t=Object.keys(this._renderEffects);if(t.length>0){var r=this._renderEffects[t[0]].getPostProcesses();r&&(r[0].samples=e)}return!0},e.prototype.setPrePassRenderer=function(e){return!1},e.prototype.dispose=function(){},Object(n.__decorate)([Object(o.serialize)()],e.prototype,"_name",void 0),e}()},"./PostProcesses/RenderPipeline/postProcessRenderPipelineManager.ts":
- /*!**************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/postProcessRenderPipelineManager.ts ***!
- \**************************************************************************/
- /*! exports provided: PostProcessRenderPipelineManager */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcessRenderPipelineManager",(function(){return n}));var n=function(){function e(){this._renderPipelines={}}return Object.defineProperty(e.prototype,"supportedPipelines",{get:function(){var e=[];for(var t in this._renderPipelines)if(this._renderPipelines.hasOwnProperty(t)){var r=this._renderPipelines[t];r.isSupported&&e.push(r)}return e},enumerable:!1,configurable:!0}),e.prototype.addPipeline=function(e){this._renderPipelines[e._name]=e},e.prototype.attachCamerasToRenderPipeline=function(e,t,r){void 0===r&&(r=!1);var n=this._renderPipelines[e];n&&n._attachCameras(t,r)},e.prototype.detachCamerasFromRenderPipeline=function(e,t){var r=this._renderPipelines[e];r&&r._detachCameras(t)},e.prototype.enableEffectInPipeline=function(e,t,r){var n=this._renderPipelines[e];n&&n._enableEffect(t,r)},e.prototype.disableEffectInPipeline=function(e,t,r){var n=this._renderPipelines[e];n&&n._disableEffect(t,r)},e.prototype.update=function(){for(var e in this._renderPipelines)if(this._renderPipelines.hasOwnProperty(e)){var t=this._renderPipelines[e];t.isSupported?t._update():(t.dispose(),delete this._renderPipelines[e])}},e.prototype._rebuild=function(){for(var e in this._renderPipelines)this._renderPipelines.hasOwnProperty(e)&&this._renderPipelines[e]._rebuild()},e.prototype.dispose=function(){for(var e in this._renderPipelines)this._renderPipelines.hasOwnProperty(e)&&this._renderPipelines[e].dispose()},e}()},"./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts":
- /*!****************************************************************************************!*\
- !*** ./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts ***!
- \****************************************************************************************/
- /*! exports provided: PostProcessRenderPipelineManagerSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",(function(){return s}));var n=r(/*! ../../sceneComponent */"./sceneComponent.ts"),i=r(/*! ./postProcessRenderPipelineManager */"./PostProcesses/RenderPipeline/postProcessRenderPipelineManager.ts"),o=r(/*! ../../scene */"./scene.ts");Object.defineProperty(o.Scene.prototype,"postProcessRenderPipelineManager",{get:function(){if(!this._postProcessRenderPipelineManager){var e=this._getComponent(n.SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER);e||(e=new s(this),this._addComponent(e)),this._postProcessRenderPipelineManager=new i.PostProcessRenderPipelineManager}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0});var s=function(){function e(e){this.name=n.SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(n.SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER,this,this._gatherRenderTargets)},e.prototype.rebuild=function(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager._rebuild()},e.prototype.dispose=function(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.dispose()},e.prototype._gatherRenderTargets=function(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.update()},e}()},"./PostProcesses/anaglyphPostProcess.ts":
- /*!**********************************************!*\
- !*** ./PostProcesses/anaglyphPostProcess.ts ***!
- \**********************************************/
- /*! exports provided: AnaglyphPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphPostProcess",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/anaglyph.fragment */"./Shaders/anaglyph.fragment.ts"),function(e){function t(t,r,n,i,o,s){var a=e.call(this,t,"anaglyph",null,["leftSampler"],r,n[1],i,o,s)||this;return a._passedProcess=n[0]._rigPostProcess,a.onApplyObservable.add((function(e){e.setTextureFromPostProcess("leftSampler",a._passedProcess)})),a}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/blackAndWhitePostProcess.ts":
- /*!***************************************************!*\
- !*** ./PostProcesses/blackAndWhitePostProcess.ts ***!
- \***************************************************/
- /*! exports provided: BlackAndWhitePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"BlackAndWhitePostProcess",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/blackAndWhite.fragment */"./Shaders/blackAndWhite.fragment.ts"),function(e){function t(t,r,n,i,o,s){var a=e.call(this,t,"blackAndWhite",["degree"],null,r,n,i,o,s)||this;return a.degree=1,a.onApplyObservable.add((function(e){e.setFloat("degree",a.degree)})),a}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/bloomEffect.ts":
- /*!**************************************!*\
- !*** ./PostProcesses/bloomEffect.ts ***!
- \**************************************/
- /*! exports provided: BloomEffect */function(e,t,r){"use strict";r.r(t),r.d(t,"BloomEffect",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),o=r(/*! ./extractHighlightsPostProcess */"./PostProcesses/extractHighlightsPostProcess.ts"),s=r(/*! ./blurPostProcess */"./PostProcesses/blurPostProcess.ts"),a=r(/*! ./bloomMergePostProcess */"./PostProcesses/bloomMergePostProcess.ts"),l=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=function(e){function t(t,r,n,i,u,d){void 0===u&&(u=0),void 0===d&&(d=!1);var h=e.call(this,t.getEngine(),"bloom",(function(){return h._effects}),!0)||this;return h.bloomScale=r,h._effects=[],h._downscale=new o.ExtractHighlightsPostProcess("highlights",1,null,c.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,d),h._blurX=new s.BlurPostProcess("horizontal blur",new l.Vector2(1,0),10,r,null,c.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,void 0,d),h._blurX.alwaysForcePOT=!0,h._blurX.autoClear=!1,h._blurY=new s.BlurPostProcess("vertical blur",new l.Vector2(0,1),10,r,null,c.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,void 0,d),h._blurY.alwaysForcePOT=!0,h._blurY.autoClear=!1,h.kernel=i,h._effects=[h._downscale,h._blurX,h._blurY],h._merge=new a.BloomMergePostProcess("bloomMerge",h._downscale,h._blurY,n,r,null,c.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,d),h._merge.autoClear=!1,h._effects.push(h._merge),h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"threshold",{get:function(){return this._downscale.threshold},set:function(e){this._downscale.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this._merge.weight},set:function(e){this._merge.weight=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernel",{get:function(){return this._blurX.kernel/this.bloomScale},set:function(e){this._blurX.kernel=e*this.bloomScale,this._blurY.kernel=e*this.bloomScale},enumerable:!1,configurable:!0}),t.prototype.disposeEffects=function(e){for(var t=0;t<this._effects.length;t++)this._effects[t].dispose(e)},t.prototype._updateEffects=function(){for(var e=0;e<this._effects.length;e++)this._effects[e].updateEffect()},t.prototype._isReady=function(){for(var e=0;e<this._effects.length;e++)if(!this._effects[e].isReady())return!1;return!0},t}(i.PostProcessRenderEffect)},"./PostProcesses/bloomMergePostProcess.ts":
- /*!************************************************!*\
- !*** ./PostProcesses/bloomMergePostProcess.ts ***!
- \************************************************/
- /*! exports provided: BloomMergePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"BloomMergePostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/bloomMerge.fragment */"./Shaders/bloomMerge.fragment.ts"),function(e){function t(t,r,n,i,s,a,l,c,u,d,h){void 0===d&&(d=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var f=e.call(this,t,"bloomMerge",["bloomWeight"],["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2","bloomBlur"],s,a,l,c,u,null,d,void 0,null,!0)||this;return f.weight=i,f.onApplyObservable.add((function(e){e.setTextureFromPostProcess("textureSampler",r),e.setTextureFromPostProcessOutput("bloomBlur",n),e.setFloat("bloomWeight",f.weight)})),h||f.updateEffect(),f}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/blurPostProcess.ts":
- /*!******************************************!*\
- !*** ./PostProcesses/blurPostProcess.ts ***!
- \******************************************/
- /*! exports provided: BlurPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"BlurPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/kernelBlur.fragment */"./Shaders/kernelBlur.fragment.ts"),r(/*! ../Shaders/kernelBlur.vertex */"./Shaders/kernelBlur.vertex.ts"),function(e){function t(t,r,n,i,a,l,c,u,d,h,f){void 0===l&&(l=o.Texture.BILINEAR_SAMPLINGMODE),void 0===d&&(d=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=""),void 0===f&&(f=!1);var p=e.call(this,t,"kernelBlur",["delta","direction","cameraMinMaxZ"],["circleOfConfusionSampler"],i,a,l,c,u,null,d,"kernelBlur",{varyingCount:0,depCount:0},!0)||this;return p.direction=r,p.blockCompilation=f,p._packedFloat=!1,p._staticDefines="",p._staticDefines=h,p.onApplyObservable.add((function(e){p._outputTexture?e.setFloat2("delta",1/p._outputTexture.width*p.direction.x,1/p._outputTexture.height*p.direction.y):e.setFloat2("delta",1/p.width*p.direction.x,1/p.height*p.direction.y)})),p.kernel=n,p}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"kernel",{get:function(){return this._idealKernel},set:function(e){this._idealKernel!==e&&(e=Math.max(e,1),this._idealKernel=e,this._kernel=this._nearestBestKernel(e),this.blockCompilation||this._updateParameters())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"packedFloat",{get:function(){return this._packedFloat},set:function(e){this._packedFloat!==e&&(this._packedFloat=e,this.blockCompilation||this._updateParameters())},enumerable:!1,configurable:!0}),t.prototype.updateEffect=function(e,t,r,n,i,o){void 0===e&&(e=null),void 0===t&&(t=null),void 0===r&&(r=null),this._updateParameters(i,o)},t.prototype._updateParameters=function(t,r){for(var n=this._kernel,i=(n-1)/2,o=[],s=[],a=0,l=0;l<n;l++){var c=l/(n-1),u=this._gaussianWeight(2*c-1);o[l]=l-i,s[l]=u,a+=u}for(l=0;l<s.length;l++)s[l]/=a;var d=[],h=[],f=[];for(l=0;l<=i;l+=2){var p=Math.min(l+1,Math.floor(i));if(l===p)f.push({o:o[l],w:s[l]});else{var m=p===i,g=s[l]+s[p]*(m?.5:1),_=o[l]+1/(1+s[l]/s[p]);0===_?(f.push({o:o[l],w:s[l]}),f.push({o:o[l+1],w:s[l+1]})):(f.push({o:_,w:g}),f.push({o:-_,w:g}))}}for(l=0;l<f.length;l++)h[l]=f[l].o,d[l]=f[l].w;o=h,s=d;var v=this.getEngine().getCaps().maxVaryingVectors,y=Math.max(v,0)-1,b=Math.min(o.length,y),A="";for(A+=this._staticDefines,-1!=this._staticDefines.indexOf("DOF")&&(A+="#define CENTER_WEIGHT "+this._glslFloat(s[b-1])+"\r\n",b--),l=0;l<b;l++)A+="#define KERNEL_OFFSET"+l+" "+this._glslFloat(o[l])+"\r\n",A+="#define KERNEL_WEIGHT"+l+" "+this._glslFloat(s[l])+"\r\n";var T=0;for(l=y;l<o.length;l++)A+="#define KERNEL_DEP_OFFSET"+T+" "+this._glslFloat(o[l])+"\r\n",A+="#define KERNEL_DEP_WEIGHT"+T+" "+this._glslFloat(s[l])+"\r\n",T++;this.packedFloat&&(A+="#define PACKEDFLOAT 1"),this.blockCompilation=!1,e.prototype.updateEffect.call(this,A,null,null,{varyingCount:b,depCount:T},t,r)},t.prototype._nearestBestKernel=function(e){for(var t=Math.round(e),r=0,n=[t,t-1,t+1,t-2,t+2];r<n.length;r++){var i=n[r];if(i%2!=0&&Math.floor(i/2)%2==0&&i>0)return Math.max(i,3)}return Math.max(t,3)},t.prototype._gaussianWeight=function(e){var t=-e*e/(1/3*2*(1/3));return 1/(Math.sqrt(2*Math.PI)*(1/3))*Math.exp(t)},t.prototype._glslFloat=function(e,t){return void 0===t&&(t=8),e.toFixed(t).replace(/0+$/,"")},t}(i.PostProcess))},"./PostProcesses/chromaticAberrationPostProcess.ts":
- /*!*********************************************************!*\
- !*** ./PostProcesses/chromaticAberrationPostProcess.ts ***!
- \*********************************************************/
- /*! exports provided: ChromaticAberrationPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ChromaticAberrationPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/chromaticAberration.fragment */"./Shaders/chromaticAberration.fragment.ts"),function(e){function t(t,r,n,o,a,l,c,u,d,h){void 0===d&&(d=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var f=e.call(this,t,"chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],o,a,l,c,u,null,d,void 0,null,h)||this;return f.aberrationAmount=30,f.radialIntensity=0,f.direction=new i.Vector2(.707,.707),f.centerPosition=new i.Vector2(.5,.5),f.onApplyObservable.add((function(e){e.setFloat("chromatic_aberration",f.aberrationAmount),e.setFloat("screen_width",r),e.setFloat("screen_height",n),e.setFloat("radialIntensity",f.radialIntensity),e.setFloat2("direction",f.direction.x,f.direction.y),e.setFloat2("centerPosition",f.centerPosition.x,f.centerPosition.y)})),f}return Object(n.__extends)(t,e),t}(o.PostProcess))},"./PostProcesses/circleOfConfusionPostProcess.ts":
- /*!*******************************************************!*\
- !*** ./PostProcesses/circleOfConfusionPostProcess.ts ***!
- \*******************************************************/
- /*! exports provided: CircleOfConfusionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"CircleOfConfusionPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/circleOfConfusion.fragment */"./Shaders/circleOfConfusion.fragment.ts"),function(e){function t(t,r,n,i,a,l,c,u,d){void 0===u&&(u=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1);var h=e.call(this,t,"circleOfConfusion",["cameraMinMaxZ","focusDistance","cocPrecalculation"],["depthSampler"],n,i,a,l,c,null,u,void 0,null,d)||this;return h.lensSize=50,h.fStop=1.4,h.focusDistance=2e3,h.focalLength=50,h._depthTexture=null,h._depthTexture=r,h.onApplyObservable.add((function(e){if(h._depthTexture){e.setTexture("depthSampler",h._depthTexture);var t=h.lensSize/h.fStop*h.focalLength/(h.focusDistance-h.focalLength);e.setFloat("focusDistance",h.focusDistance),e.setFloat("cocPrecalculation",t),e.setFloat2("cameraMinMaxZ",h._depthTexture.activeCamera.minZ,h._depthTexture.activeCamera.maxZ)}else o.Logger.Warn("No depth texture set on CircleOfConfusionPostProcess")})),h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"depthTexture",{set:function(e){this._depthTexture=e},enumerable:!1,configurable:!0}),t}(i.PostProcess))},"./PostProcesses/colorCorrectionPostProcess.ts":
- /*!*****************************************************!*\
- !*** ./PostProcesses/colorCorrectionPostProcess.ts ***!
- \*****************************************************/
- /*! exports provided: ColorCorrectionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorCorrectionPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=(r(/*! ../Shaders/colorCorrection.fragment */"./Shaders/colorCorrection.fragment.ts"),function(e){function t(t,r,n,i,s,a,l){var c=e.call(this,t,"colorCorrection",null,["colorTable"],n,i,s,a,l)||this;return c._colorTableTexture=new o.Texture(r,i.getScene(),!0,!1,o.Texture.TRILINEAR_SAMPLINGMODE),c._colorTableTexture.anisotropicFilteringLevel=1,c._colorTableTexture.wrapU=o.Texture.CLAMP_ADDRESSMODE,c._colorTableTexture.wrapV=o.Texture.CLAMP_ADDRESSMODE,c.onApply=function(e){e.setTexture("colorTable",c._colorTableTexture)},c}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/convolutionPostProcess.ts":
- /*!*************************************************!*\
- !*** ./PostProcesses/convolutionPostProcess.ts ***!
- \*************************************************/
- /*! exports provided: ConvolutionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ConvolutionPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/convolution.fragment */"./Shaders/convolution.fragment.ts"),function(e){function t(t,r,n,i,s,a,l,c){void 0===c&&(c=o.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"convolution",["kernel","screenSize"],null,n,i,s,a,l,null,c)||this;return u.kernel=r,u.onApply=function(e){e.setFloat2("screenSize",u.width,u.height),e.setArray("kernel",u.kernel)},u}return Object(n.__extends)(t,e),t.EdgeDetect0Kernel=[1,0,-1,0,0,0,-1,0,1],t.EdgeDetect1Kernel=[0,1,0,1,-4,1,0,1,0],t.EdgeDetect2Kernel=[-1,-1,-1,-1,8,-1,-1,-1,-1],t.SharpenKernel=[0,-1,0,-1,5,-1,0,-1,0],t.EmbossKernel=[-2,-1,0,-1,1,1,0,1,2],t.GaussianKernel=[0,1,0,1,1,1,0,1,0],t}(i.PostProcess))},"./PostProcesses/depthOfFieldBlurPostProcess.ts":
- /*!******************************************************!*\
- !*** ./PostProcesses/depthOfFieldBlurPostProcess.ts ***!
- \******************************************************/
- /*! exports provided: DepthOfFieldBlurPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthOfFieldBlurPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ./blurPostProcess */"./PostProcesses/blurPostProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=function(e){function t(t,r,n,o,a,l,c,u,d,h,f,p,m){void 0===u&&(u=null),void 0===d&&(d=i.Texture.BILINEAR_SAMPLINGMODE),void 0===p&&(p=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===m&&(m=!1);var g=e.call(this,t,n,o,a,l,d=s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,h,f,p=s.Constants.TEXTURETYPE_UNSIGNED_INT,"#define DOF 1\r\n",m)||this;return g.direction=n,g.onApplyObservable.add((function(e){null!=u&&e.setTextureFromPostProcess("textureSampler",u),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",c),r.activeCamera&&e.setFloat2("cameraMinMaxZ",r.activeCamera.minZ,r.activeCamera.maxZ)})),g}return Object(n.__extends)(t,e),t}(o.BlurPostProcess)},"./PostProcesses/depthOfFieldEffect.ts":
- /*!*********************************************!*\
- !*** ./PostProcesses/depthOfFieldEffect.ts ***!
- \*********************************************/
- /*! exports provided: DepthOfFieldEffectBlurLevel, DepthOfFieldEffect */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthOfFieldEffectBlurLevel",(function(){return n})),r.d(t,"DepthOfFieldEffect",(function(){return d}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),l=r(/*! ./circleOfConfusionPostProcess */"./PostProcesses/circleOfConfusionPostProcess.ts"),c=r(/*! ./depthOfFieldBlurPostProcess */"./PostProcesses/depthOfFieldBlurPostProcess.ts"),u=r(/*! ./depthOfFieldMergePostProcess */"./PostProcesses/depthOfFieldMergePostProcess.ts");!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(n||(n={}));var d=function(e){function t(t,r,i,a,d){void 0===i&&(i=n.Low),void 0===a&&(a=0),void 0===d&&(d=!1);var h=e.call(this,t.getEngine(),"depth of field",(function(){return h._effects}),!0)||this;h._effects=[],h._circleOfConfusion=new l.CircleOfConfusionPostProcess("circleOfConfusion",r,1,null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,d),h._depthOfFieldBlurY=[],h._depthOfFieldBlurX=[];var f=1,p=15;switch(i){case n.High:f=3,p=51;break;case n.Medium:f=2,p=31;break;default:p=15,f=1}for(var m=p/Math.pow(2,f-1),g=1,_=0;_<f;_++){var v=new c.DepthOfFieldBlurPostProcess("verticle blur",t,new o.Vector2(0,1),m,g,null,h._circleOfConfusion,0==_?h._circleOfConfusion:null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,d);v.autoClear=!1,g=.75/Math.pow(2,_);var y=new c.DepthOfFieldBlurPostProcess("horizontal blur",t,new o.Vector2(1,0),m,g,null,h._circleOfConfusion,null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,d);y.autoClear=!1,h._depthOfFieldBlurY.push(v),h._depthOfFieldBlurX.push(y)}for(h._effects=[h._circleOfConfusion],_=0;_<h._depthOfFieldBlurX.length;_++)h._effects.push(h._depthOfFieldBlurY[_]),h._effects.push(h._depthOfFieldBlurX[_]);return h._dofMerge=new u.DepthOfFieldMergePostProcess("dofMerge",h._circleOfConfusion,h._circleOfConfusion,h._depthOfFieldBlurX,g,null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,d),h._dofMerge.autoClear=!1,h._effects.push(h._dofMerge),h}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"focalLength",{get:function(){return this._circleOfConfusion.focalLength},set:function(e){this._circleOfConfusion.focalLength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fStop",{get:function(){return this._circleOfConfusion.fStop},set:function(e){this._circleOfConfusion.fStop=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"focusDistance",{get:function(){return this._circleOfConfusion.focusDistance},set:function(e){this._circleOfConfusion.focusDistance=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lensSize",{get:function(){return this._circleOfConfusion.lensSize},set:function(e){this._circleOfConfusion.lensSize=e},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"DepthOfFieldEffect"},Object.defineProperty(t.prototype,"depthTexture",{set:function(e){this._circleOfConfusion.depthTexture=e},enumerable:!1,configurable:!0}),t.prototype.disposeEffects=function(e){for(var t=0;t<this._effects.length;t++)this._effects[t].dispose(e)},t.prototype._updateEffects=function(){for(var e=0;e<this._effects.length;e++)this._effects[e].updateEffect()},t.prototype._isReady=function(){for(var e=0;e<this._effects.length;e++)if(!this._effects[e].isReady())return!1;return!0},t}(a.PostProcessRenderEffect)},"./PostProcesses/depthOfFieldMergePostProcess.ts":
- /*!*******************************************************!*\
- !*** ./PostProcesses/depthOfFieldMergePostProcess.ts ***!
- \*******************************************************/
- /*! exports provided: DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthOfFieldMergePostProcessOptions",(function(){return s})),r.d(t,"DepthOfFieldMergePostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/depthOfFieldMerge.fragment */"./Shaders/depthOfFieldMerge.fragment.ts"),function(){}),a=function(e){function t(t,r,n,i,s,a,l,c,u,d,h){void 0===d&&(d=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var f=e.call(this,t,"depthOfFieldMerge",[],["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2"],s,a,l,c,u,null,d,void 0,null,!0)||this;return f.blurSteps=i,f.onApplyObservable.add((function(e){e.setTextureFromPostProcess("textureSampler",r),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",n),i.forEach((function(t,r){e.setTextureFromPostProcessOutput("blurStep"+(i.length-r-1),t)}))})),h||f.updateEffect(),f}return Object(n.__extends)(t,e),t.prototype.updateEffect=function(t,r,n,i,o,s){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),t||(t="",t+="#define BLUR_LEVEL "+(this.blurSteps.length-1)+"\n"),e.prototype.updateEffect.call(this,t,r,n,i,o,s)},t}(i.PostProcess)},"./PostProcesses/displayPassPostProcess.ts":
- /*!*************************************************!*\
- !*** ./PostProcesses/displayPassPostProcess.ts ***!
- \*************************************************/
- /*! exports provided: DisplayPassPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"DisplayPassPostProcess",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/displayPass.fragment */"./Shaders/displayPass.fragment.ts"),function(e){function t(t,r,n,i,o,s){return e.call(this,t,"displayPass",["passSampler"],["passSampler"],r,n,i,o,s)||this}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/extractHighlightsPostProcess.ts":
- /*!*******************************************************!*\
- !*** ./PostProcesses/extractHighlightsPostProcess.ts ***!
- \*******************************************************/
- /*! exports provided: ExtractHighlightsPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ExtractHighlightsPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/extractHighlights.fragment */"./Shaders/extractHighlights.fragment.ts"),function(e){function t(t,r,n,i,a,l,c,u){void 0===c&&(c=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===u&&(u=!1);var d=e.call(this,t,"extractHighlights",["threshold","exposure"],null,r,n,i,a,l,null,c,void 0,null,u)||this;return d.threshold=.9,d._exposure=1,d._inputPostProcess=null,d.onApplyObservable.add((function(e){d._inputPostProcess&&e.setTextureFromPostProcess("textureSampler",d._inputPostProcess),e.setFloat("threshold",Math.pow(d.threshold,o.ToGammaSpace)),e.setFloat("exposure",d._exposure)})),d}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/filterPostProcess.ts":
- /*!********************************************!*\
- !*** ./PostProcesses/filterPostProcess.ts ***!
- \********************************************/
- /*! exports provided: FilterPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"FilterPostProcess",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/filter.fragment */"./Shaders/filter.fragment.ts"),function(e){function t(t,r,n,i,o,s,a){var l=e.call(this,t,"filter",["kernelMatrix"],null,n,i,o,s,a)||this;return l.kernelMatrix=r,l.onApply=function(e){e.setMatrix("kernelMatrix",l.kernelMatrix)},l}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/fxaaPostProcess.ts":
- /*!******************************************!*\
- !*** ./PostProcesses/fxaaPostProcess.ts ***!
- \******************************************/
- /*! exports provided: FxaaPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"FxaaPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/fxaa.fragment */"./Shaders/fxaa.fragment.ts"),r(/*! ../Shaders/fxaa.vertex */"./Shaders/fxaa.vertex.ts"),function(e){function t(t,r,n,o,a,l,c){void 0===n&&(n=null),void 0===c&&(c=s.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"fxaa",["texelSize"],null,r,n,o||i.Texture.BILINEAR_SAMPLINGMODE,a,l,null,c,"fxaa",void 0,!0)||this,d=u._getDefines();return u.updateEffect(d),u.onApplyObservable.add((function(e){var t=u.texelSize;e.setFloat2("texelSize",t.x,t.y)})),u}return Object(n.__extends)(t,e),t.prototype._getDefines=function(){var e=this.getEngine();if(!e)return null;var t=e.getGlInfo();return t&&t.renderer&&t.renderer.toLowerCase().indexOf("mali")>-1?"#define MALI 1\n":null},t}(o.PostProcess))},"./PostProcesses/grainPostProcess.ts":
- /*!*******************************************!*\
- !*** ./PostProcesses/grainPostProcess.ts ***!
- \*******************************************/
- /*! exports provided: GrainPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"GrainPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/grain.fragment */"./Shaders/grain.fragment.ts"),function(e){function t(t,r,n,i,s,a,l,c){void 0===l&&(l=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var u=e.call(this,t,"grain",["intensity","animatedSeed"],[],r,n,i,s,a,null,l,void 0,null,c)||this;return u.intensity=30,u.animated=!1,u.onApplyObservable.add((function(e){e.setFloat("intensity",u.intensity),e.setFloat("animatedSeed",u.animated?Math.random()+1:1)})),u}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/highlightsPostProcess.ts":
- /*!************************************************!*\
- !*** ./PostProcesses/highlightsPostProcess.ts ***!
- \************************************************/
- /*! exports provided: HighlightsPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"HighlightsPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/highlights.fragment */"./Shaders/highlights.fragment.ts"),function(e){function t(t,r,n,i,s,a,l){return void 0===l&&(l=o.Constants.TEXTURETYPE_UNSIGNED_INT),e.call(this,t,"highlights",null,null,r,n,i,s,a,null,l)||this}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/imageProcessingPostProcess.ts":
- /*!*****************************************************!*\
- !*** ./PostProcesses/imageProcessingPostProcess.ts ***!
- \*****************************************************/
- /*! exports provided: ImageProcessingPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ImageProcessingPostProcess",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),s=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),a=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=(r(/*! ../Shaders/imageProcessing.fragment */"./Shaders/imageProcessing.fragment.ts"),r(/*! ../Shaders/postprocess.vertex */"./Shaders/postprocess.vertex.ts"),function(e){function t(t,r,n,i,o,s,a,c){void 0===n&&(n=null),void 0===a&&(a=l.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"imageProcessing",[],[],r,n,i,o,s,null,a,"postprocess",null,!0)||this;return u._fromLinearSpace=!0,u._defines={IMAGEPROCESSING:!1,VIGNETTE:!1,VIGNETTEBLENDMODEMULTIPLY:!1,VIGNETTEBLENDMODEOPAQUE:!1,TONEMAPPING:!1,TONEMAPPING_ACES:!1,CONTRAST:!1,COLORCURVES:!1,COLORGRADING:!1,COLORGRADING3D:!1,FROMLINEARSPACE:!1,SAMPLER3DGREENDEPTH:!1,SAMPLER3DBGRMAP:!1,IMAGEPROCESSINGPOSTPROCESS:!1,EXPOSURE:!1},c?(c.applyByPostProcess=!0,u._attachImageProcessingConfiguration(c,!0),u.fromLinearSpace=!1):(u._attachImageProcessingConfiguration(null,!0),u.imageProcessingConfiguration.applyByPostProcess=!0),u.onApply=function(e){u.imageProcessingConfiguration.bind(e,u.aspectRatio)},u}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){e.applyByPostProcess=!0,this._attachImageProcessingConfiguration(e)},enumerable:!1,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e,t){var r=this;if(void 0===t&&(t=!1),e!==this._imageProcessingConfiguration){if(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e)this._imageProcessingConfiguration=e;else{var n=null,i=this.getEngine(),s=this.getCamera();if(s)n=s.getScene();else if(i&&i.scenes){var l=i.scenes;n=l[l.length-1]}else n=a.EngineStore.LastCreatedScene;this._imageProcessingConfiguration=n?n.imageProcessingConfiguration:new o.ImageProcessingConfiguration}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add((function(){r._updateParameters()}))),t||this._updateParameters()}},Object.defineProperty(t.prototype,"isSupported",{get:function(){var e=this.getEffect();return!e||e.isSupported},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorCurves",{get:function(){return this.imageProcessingConfiguration.colorCurves},set:function(e){this.imageProcessingConfiguration.colorCurves=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorGradingTexture",{get:function(){return this.imageProcessingConfiguration.colorGradingTexture},set:function(e){this.imageProcessingConfiguration.colorGradingTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exposure",{get:function(){return this.imageProcessingConfiguration.exposure},set:function(e){this.imageProcessingConfiguration.exposure=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toneMappingType",{get:function(){return this._imageProcessingConfiguration.toneMappingType},set:function(e){this._imageProcessingConfiguration.toneMappingType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contrast",{get:function(){return this.imageProcessingConfiguration.contrast},set:function(e){this.imageProcessingConfiguration.contrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteStretch",{get:function(){return this.imageProcessingConfiguration.vignetteStretch},set:function(e){this.imageProcessingConfiguration.vignetteStretch=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCentreX",{get:function(){return this.imageProcessingConfiguration.vignetteCentreX},set:function(e){this.imageProcessingConfiguration.vignetteCentreX=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCentreY",{get:function(){return this.imageProcessingConfiguration.vignetteCentreY},set:function(e){this.imageProcessingConfiguration.vignetteCentreY=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteWeight",{get:function(){return this.imageProcessingConfiguration.vignetteWeight},set:function(e){this.imageProcessingConfiguration.vignetteWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteColor",{get:function(){return this.imageProcessingConfiguration.vignetteColor},set:function(e){this.imageProcessingConfiguration.vignetteColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCameraFov",{get:function(){return this.imageProcessingConfiguration.vignetteCameraFov},set:function(e){this.imageProcessingConfiguration.vignetteCameraFov=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteBlendMode",{get:function(){return this.imageProcessingConfiguration.vignetteBlendMode},set:function(e){this.imageProcessingConfiguration.vignetteBlendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetteEnabled",{get:function(){return this.imageProcessingConfiguration.vignetteEnabled},set:function(e){this.imageProcessingConfiguration.vignetteEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fromLinearSpace",{get:function(){return this._fromLinearSpace},set:function(e){this._fromLinearSpace!==e&&(this._fromLinearSpace=e,this._updateParameters())},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"ImageProcessingPostProcess"},t.prototype._updateParameters=function(){this._defines.FROMLINEARSPACE=this._fromLinearSpace,this.imageProcessingConfiguration.prepareDefines(this._defines,!0);var e="";for(var t in this._defines)this._defines[t]&&(e+="#define "+t+";\r\n");var r=["textureSampler"],n=["scale"];o.ImageProcessingConfiguration&&(o.ImageProcessingConfiguration.PrepareSamplers(r,this._defines),o.ImageProcessingConfiguration.PrepareUniforms(n,this._defines)),this.updateEffect(e,n,r)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),this._imageProcessingConfiguration&&(this.imageProcessingConfiguration.applyByPostProcess=!1)},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_fromLinearSpace",void 0),t}(s.PostProcess))},"./PostProcesses/index.ts":
- /*!********************************!*\
- !*** ./PostProcesses/index.ts ***!
- \********************************/
- /*! exports provided: AnaglyphPostProcess, BlackAndWhitePostProcess, BloomEffect, BloomMergePostProcess, BlurPostProcess, ChromaticAberrationPostProcess, CircleOfConfusionPostProcess, ColorCorrectionPostProcess, ConvolutionPostProcess, DepthOfFieldBlurPostProcess, DepthOfFieldEffectBlurLevel, DepthOfFieldEffect, DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess, DisplayPassPostProcess, ExtractHighlightsPostProcess, FilterPostProcess, FxaaPostProcess, GrainPostProcess, HighlightsPostProcess, ImageProcessingPostProcess, MotionBlurPostProcess, PassPostProcess, PassCubePostProcess, PostProcess, PostProcessManager, RefractionPostProcess, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, SharpenPostProcess, StereoscopicInterlacePostProcessI, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, VRMultiviewToSingleviewPostProcess, ScreenSpaceReflectionPostProcess, ScreenSpaceCurvaturePostProcess */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./anaglyphPostProcess */"./PostProcesses/anaglyphPostProcess.ts");r.d(t,"AnaglyphPostProcess",(function(){return n.AnaglyphPostProcess}));var i=r(/*! ./blackAndWhitePostProcess */"./PostProcesses/blackAndWhitePostProcess.ts");r.d(t,"BlackAndWhitePostProcess",(function(){return i.BlackAndWhitePostProcess}));var o=r(/*! ./bloomEffect */"./PostProcesses/bloomEffect.ts");r.d(t,"BloomEffect",(function(){return o.BloomEffect}));var s=r(/*! ./bloomMergePostProcess */"./PostProcesses/bloomMergePostProcess.ts");r.d(t,"BloomMergePostProcess",(function(){return s.BloomMergePostProcess}));var a=r(/*! ./blurPostProcess */"./PostProcesses/blurPostProcess.ts");r.d(t,"BlurPostProcess",(function(){return a.BlurPostProcess}));var l=r(/*! ./chromaticAberrationPostProcess */"./PostProcesses/chromaticAberrationPostProcess.ts");r.d(t,"ChromaticAberrationPostProcess",(function(){return l.ChromaticAberrationPostProcess}));var c=r(/*! ./circleOfConfusionPostProcess */"./PostProcesses/circleOfConfusionPostProcess.ts");r.d(t,"CircleOfConfusionPostProcess",(function(){return c.CircleOfConfusionPostProcess}));var u=r(/*! ./colorCorrectionPostProcess */"./PostProcesses/colorCorrectionPostProcess.ts");r.d(t,"ColorCorrectionPostProcess",(function(){return u.ColorCorrectionPostProcess}));var d=r(/*! ./convolutionPostProcess */"./PostProcesses/convolutionPostProcess.ts");r.d(t,"ConvolutionPostProcess",(function(){return d.ConvolutionPostProcess}));var h=r(/*! ./depthOfFieldBlurPostProcess */"./PostProcesses/depthOfFieldBlurPostProcess.ts");r.d(t,"DepthOfFieldBlurPostProcess",(function(){return h.DepthOfFieldBlurPostProcess}));var f=r(/*! ./depthOfFieldEffect */"./PostProcesses/depthOfFieldEffect.ts");r.d(t,"DepthOfFieldEffectBlurLevel",(function(){return f.DepthOfFieldEffectBlurLevel})),r.d(t,"DepthOfFieldEffect",(function(){return f.DepthOfFieldEffect}));var p=r(/*! ./depthOfFieldMergePostProcess */"./PostProcesses/depthOfFieldMergePostProcess.ts");r.d(t,"DepthOfFieldMergePostProcessOptions",(function(){return p.DepthOfFieldMergePostProcessOptions})),r.d(t,"DepthOfFieldMergePostProcess",(function(){return p.DepthOfFieldMergePostProcess}));var m=r(/*! ./displayPassPostProcess */"./PostProcesses/displayPassPostProcess.ts");r.d(t,"DisplayPassPostProcess",(function(){return m.DisplayPassPostProcess}));var g=r(/*! ./extractHighlightsPostProcess */"./PostProcesses/extractHighlightsPostProcess.ts");r.d(t,"ExtractHighlightsPostProcess",(function(){return g.ExtractHighlightsPostProcess}));var _=r(/*! ./filterPostProcess */"./PostProcesses/filterPostProcess.ts");r.d(t,"FilterPostProcess",(function(){return _.FilterPostProcess}));var v=r(/*! ./fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts");r.d(t,"FxaaPostProcess",(function(){return v.FxaaPostProcess}));var y=r(/*! ./grainPostProcess */"./PostProcesses/grainPostProcess.ts");r.d(t,"GrainPostProcess",(function(){return y.GrainPostProcess}));var b=r(/*! ./highlightsPostProcess */"./PostProcesses/highlightsPostProcess.ts");r.d(t,"HighlightsPostProcess",(function(){return b.HighlightsPostProcess}));var A=r(/*! ./imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts");r.d(t,"ImageProcessingPostProcess",(function(){return A.ImageProcessingPostProcess}));var T=r(/*! ./motionBlurPostProcess */"./PostProcesses/motionBlurPostProcess.ts");r.d(t,"MotionBlurPostProcess",(function(){return T.MotionBlurPostProcess}));var M=r(/*! ./passPostProcess */"./PostProcesses/passPostProcess.ts");r.d(t,"PassPostProcess",(function(){return M.PassPostProcess})),r.d(t,"PassCubePostProcess",(function(){return M.PassCubePostProcess}));var P=r(/*! ./postProcess */"./PostProcesses/postProcess.ts");r.d(t,"PostProcess",(function(){return P.PostProcess}));var S=r(/*! ./postProcessManager */"./PostProcesses/postProcessManager.ts");r.d(t,"PostProcessManager",(function(){return S.PostProcessManager}));var E=r(/*! ./refractionPostProcess */"./PostProcesses/refractionPostProcess.ts");r.d(t,"RefractionPostProcess",(function(){return E.RefractionPostProcess}));var C=r(/*! ./RenderPipeline/index */"./PostProcesses/RenderPipeline/index.ts");r.d(t,"DefaultRenderingPipeline",(function(){return C.DefaultRenderingPipeline})),r.d(t,"LensRenderingPipeline",(function(){return C.LensRenderingPipeline})),r.d(t,"SSAO2RenderingPipeline",(function(){return C.SSAO2RenderingPipeline})),r.d(t,"SSAORenderingPipeline",(function(){return C.SSAORenderingPipeline})),r.d(t,"StandardRenderingPipeline",(function(){return C.StandardRenderingPipeline})),r.d(t,"PostProcessRenderEffect",(function(){return C.PostProcessRenderEffect})),r.d(t,"PostProcessRenderPipeline",(function(){return C.PostProcessRenderPipeline})),r.d(t,"PostProcessRenderPipelineManager",(function(){return C.PostProcessRenderPipelineManager})),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",(function(){return C.PostProcessRenderPipelineManagerSceneComponent}));var x=r(/*! ./sharpenPostProcess */"./PostProcesses/sharpenPostProcess.ts");r.d(t,"SharpenPostProcess",(function(){return x.SharpenPostProcess}));var R=r(/*! ./stereoscopicInterlacePostProcess */"./PostProcesses/stereoscopicInterlacePostProcess.ts");r.d(t,"StereoscopicInterlacePostProcessI",(function(){return R.StereoscopicInterlacePostProcessI})),r.d(t,"StereoscopicInterlacePostProcess",(function(){return R.StereoscopicInterlacePostProcess}));var O=r(/*! ./tonemapPostProcess */"./PostProcesses/tonemapPostProcess.ts");r.d(t,"TonemappingOperator",(function(){return O.TonemappingOperator})),r.d(t,"TonemapPostProcess",(function(){return O.TonemapPostProcess}));var I=r(/*! ./volumetricLightScatteringPostProcess */"./PostProcesses/volumetricLightScatteringPostProcess.ts");r.d(t,"VolumetricLightScatteringPostProcess",(function(){return I.VolumetricLightScatteringPostProcess}));var D=r(/*! ./vrDistortionCorrectionPostProcess */"./PostProcesses/vrDistortionCorrectionPostProcess.ts");r.d(t,"VRDistortionCorrectionPostProcess",(function(){return D.VRDistortionCorrectionPostProcess}));var B=r(/*! ./vrMultiviewToSingleviewPostProcess */"./PostProcesses/vrMultiviewToSingleviewPostProcess.ts");r.d(t,"VRMultiviewToSingleviewPostProcess",(function(){return B.VRMultiviewToSingleviewPostProcess}));var N=r(/*! ./screenSpaceReflectionPostProcess */"./PostProcesses/screenSpaceReflectionPostProcess.ts");r.d(t,"ScreenSpaceReflectionPostProcess",(function(){return N.ScreenSpaceReflectionPostProcess}));var L=r(/*! ./screenSpaceCurvaturePostProcess */"./PostProcesses/screenSpaceCurvaturePostProcess.ts");r.d(t,"ScreenSpaceCurvaturePostProcess",(function(){return L.ScreenSpaceCurvaturePostProcess}))},"./PostProcesses/motionBlurPostProcess.ts":
- /*!************************************************!*\
- !*** ./PostProcesses/motionBlurPostProcess.ts ***!
- \************************************************/
- /*! exports provided: MotionBlurPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"MotionBlurPostProcess",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../Rendering/geometryBufferRenderer */"./Rendering/geometryBufferRenderer.ts"),c=(r(/*! ../Animations/animatable */"./Animations/animatable.ts"),r(/*! ../Rendering/geometryBufferRendererSceneComponent */"./Rendering/geometryBufferRendererSceneComponent.ts"),r(/*! ../Shaders/motionBlur.fragment */"./Shaders/motionBlur.fragment.ts"),function(e){function t(t,r,n,s,c,u,d,h,f){void 0===h&&(h=a.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===f&&(f=!1);var p=e.call(this,t,"motionBlur",["motionStrength","motionScale","screenSize"],["velocitySampler"],n,s,c,u,d,"#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0",h,void 0,null,f)||this;return p.motionStrength=1,p._motionBlurSamples=32,p._geometryBufferRenderer=r.enableGeometryBufferRenderer(),p._geometryBufferRenderer?(p._geometryBufferRenderer.enableVelocity=!0,p.onApply=function(e){if(e.setVector2("screenSize",new o.Vector2(p.width,p.height)),e.setFloat("motionScale",r.getAnimationRatio()),e.setFloat("motionStrength",p.motionStrength),p._geometryBufferRenderer){var t=p._geometryBufferRenderer.getTextureIndex(l.GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE);e.setTexture("velocitySampler",p._geometryBufferRenderer.getGBuffer().textures[t])}}):(i.Logger.Warn("Multiple Render Target support needed to compute object based motion blur"),p.updateEffect()),p}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"motionBlurSamples",{get:function(){return this._motionBlurSamples},set:function(e){this._motionBlurSamples=e,this._geometryBufferRenderer&&this.updateEffect("#define GEOMETRY_SUPPORTED\n#define SAMPLES "+e.toFixed(1))},enumerable:!1,configurable:!0}),t.prototype.excludeSkinnedMesh=function(e){this._geometryBufferRenderer&&e.skeleton&&this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity.push(e)},t.prototype.removeExcludedSkinnedMesh=function(e){if(this._geometryBufferRenderer&&e.skeleton){var t=this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity.indexOf(e);-1!==t&&this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity.splice(t,1)}},t.prototype.dispose=function(t){this._geometryBufferRenderer&&(this._geometryBufferRenderer._previousTransformationMatrices={},this._geometryBufferRenderer._previousBonesTransformationMatrices={},this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity=[]),e.prototype.dispose.call(this,t)},t}(s.PostProcess))},"./PostProcesses/passPostProcess.ts":
- /*!******************************************!*\
- !*** ./PostProcesses/passPostProcess.ts ***!
- \******************************************/
- /*! exports provided: PassPostProcess, PassCubePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"PassPostProcess",(function(){return a})),r.d(t,"PassCubePostProcess",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=(r(/*! ../Shaders/pass.fragment */"./Shaders/pass.fragment.ts"),r(/*! ../Shaders/passCube.fragment */"./Shaders/passCube.fragment.ts"),function(e){function t(t,r,n,o,s,a,l,c){return void 0===n&&(n=null),void 0===l&&(l=i.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1),e.call(this,t,"pass",null,null,r,n,o,s,a,void 0,l,void 0,null,c)||this}return Object(n.__extends)(t,e),t}(o.PostProcess)),l=function(e){function t(t,r,n,o,s,a,l,c){void 0===n&&(n=null),void 0===l&&(l=i.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var u=e.call(this,t,"passCube",null,null,r,n,o,s,a,"#define POSITIVEX",l,void 0,null,c)||this;return u._face=0,u}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"face",{get:function(){return this._face},set:function(e){if(!(e<0||e>5))switch(this._face=e,this._face){case 0:this.updateEffect("#define POSITIVEX");break;case 1:this.updateEffect("#define NEGATIVEX");break;case 2:this.updateEffect("#define POSITIVEY");break;case 3:this.updateEffect("#define NEGATIVEY");break;case 4:this.updateEffect("#define POSITIVEZ");break;case 5:this.updateEffect("#define NEGATIVEZ")}},enumerable:!1,configurable:!0}),t}(o.PostProcess);s.Engine._RescalePostProcessFactory=function(e){return new a("rescale",1,null,i.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,e,!1,i.Constants.TEXTURETYPE_UNSIGNED_INT)}},"./PostProcesses/postProcess.ts":
- /*!**************************************!*\
- !*** ./PostProcesses/postProcess.ts ***!
- \**************************************/
- /*! exports provided: PostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcess",(function(){return l}));var n=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/postprocess.vertex */"./Shaders/postprocess.vertex.ts"),r(/*! ../Engines/engine */"./Engines/engine.ts")),l=(r(/*! ../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),function(){function e(e,t,r,a,l,c,u,d,h,f,p,m,g,_,v){void 0===u&&(u=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE),void 0===f&&(f=null),void 0===p&&(p=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===m&&(m="postprocess"),void 0===_&&(_=!1),void 0===v&&(v=s.Constants.TEXTUREFORMAT_RGBA),this.name=e,this.width=-1,this.height=-1,this.nodeMaterialSource=null,this._outputTexture=null,this.autoClear=!0,this.alphaMode=s.Constants.ALPHA_DISABLE,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=s.Constants.SCALEMODE_FLOOR,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._textures=new n.SmartArray(2),this._currentRenderTextureInd=0,this._scaleRatio=new o.Vector2(1,1),this._texelSize=o.Vector2.Zero(),this.onActivateObservable=new i.Observable,this.onSizeChangedObservable=new i.Observable,this.onApplyObservable=new i.Observable,this.onBeforeRenderObservable=new i.Observable,this.onAfterRenderObservable=new i.Observable,null!=c?(this._camera=c,this._scene=c.getScene(),c.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this),this.uniqueId=this._scene.getUniqueId()):d&&(this._engine=d,this._engine.postProcesses.push(this)),this._options=l,this.renderTargetSamplingMode=u||s.Constants.TEXTURE_NEAREST_SAMPLINGMODE,this._reusable=h||!1,this._textureType=p,this._textureFormat=v,this._samplers=a||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=m,this._parameters=r||[],this._parameters.push("scale"),this._indexParameters=g,_||this.updateEffect(f)}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._samples},set:function(e){var t=this;this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach((function(e){e.samples!==t._samples&&t._engine.updateRenderTargetTextureSampleCount(e,t._samples)}))},enumerable:!1,configurable:!0}),e.prototype.getEffectName=function(){return this._fragmentUrl},Object.defineProperty(e.prototype,"onActivate",{set:function(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSizeChanged",{set:function(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onApply",{set:function(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputTexture",{get:function(){return this._textures.data[this._currentRenderTextureInd]},set:function(e){this._forcedOutputTexture=e},enumerable:!1,configurable:!0}),e.prototype.restoreDefaultInputTexture=function(){this._forcedOutputTexture=null},e.prototype.getCamera=function(){return this._camera},Object.defineProperty(e.prototype,"texelSize",{get:function(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"PostProcess"},e.prototype.getEngine=function(){return this._engine},e.prototype.getEffect=function(){return this._effect},e.prototype.shareOutputWith=function(e){return this._disposeTextures(),this._shareOutputWithPostProcess=e,this},e.prototype.useOwnOutput=function(){0==this._textures.length&&(this._textures=new n.SmartArray(2)),this._shareOutputWithPostProcess=null},e.prototype.updateEffect=function(e,t,r,n,i,o,s,a){void 0===e&&(e=null),void 0===t&&(t=null),void 0===r&&(r=null),this._effect=this._engine.createEffect({vertex:null!=s?s:this._vertexUrl,fragment:null!=a?a:this._fragmentUrl},["position"],t||this._parameters,r||this._samplers,null!==e?e:"",void 0,i,o,n||this._indexParameters)},e.prototype.isReusable=function(){return this._reusable},e.prototype.markTextureDirty=function(){this.width=-1},e.prototype.activate=function(e,t,r){var n=this;void 0===t&&(t=null);var i=(e=e||this._camera).getScene(),o=i.getEngine(),l=o.getCaps().maxTextureSize,c=(t?t.width:this._engine.getRenderWidth(!0))*this._options|0,u=(t?t.height:this._engine.getRenderHeight(!0))*this._options|0,d=e.parent;!d||d.leftCamera!=e&&d.rightCamera!=e||(c/=2);var h,f=this._options.width||c,p=this._options.height||u,m=this.renderTargetSamplingMode!==s.Constants.TEXTURE_NEAREST_LINEAR&&this.renderTargetSamplingMode!==s.Constants.TEXTURE_NEAREST_NEAREST&&this.renderTargetSamplingMode!==s.Constants.TEXTURE_LINEAR_LINEAR;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){var g=o.currentViewport;g&&(f*=g.width,p*=g.height)}if((m||this.alwaysForcePOT)&&(this._options.width||(f=o.needPOTTextures?a.Engine.GetExponentOfTwo(f,l,this.scaleMode):f),this._options.height||(p=o.needPOTTextures?a.Engine.GetExponentOfTwo(p,l,this.scaleMode):p)),this.width!==f||this.height!==p){if(this._textures.length>0){for(var _=0;_<this._textures.length;_++)this._engine._releaseTexture(this._textures.data[_]);this._textures.reset()}this.width=f,this.height=p;var v={width:this.width,height:this.height},y={generateMipMaps:m,generateDepthBuffer:r||0===e._postProcesses.indexOf(this),generateStencilBuffer:(r||0===e._postProcesses.indexOf(this))&&this._engine.isStencilEnable,samplingMode:this.renderTargetSamplingMode,type:this._textureType,format:this._textureFormat};this._textures.push(this._engine.createRenderTargetTexture(v,y)),this._reusable&&this._textures.push(this._engine.createRenderTargetTexture(v,y)),this._texelSize.copyFromFloats(1/this.width,1/this.height),this.onSizeChangedObservable.notifyObservers(this)}this._textures.forEach((function(e){e.samples!==n.samples&&n._engine.updateRenderTargetTextureSampleCount(e,n.samples)}))}return this._shareOutputWithPostProcess?h=this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?(h=this._forcedOutputTexture,this.width=this._forcedOutputTexture.width,this.height=this._forcedOutputTexture.height):h=this.inputTexture,this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(c/f,u/p),this._engine.bindFramebuffer(h,0,c,u,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(h,0,void 0,void 0,this.forceFullscreenViewport)),this.onActivateObservable.notifyObservers(e),this.autoClear&&this.alphaMode===s.Constants.ALPHA_DISABLE&&this._engine.clear(this.clearColor?this.clearColor:i.clearColor,i._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),h},Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._effect.isSupported},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.aspectRatio:this._forcedOutputTexture?this._forcedOutputTexture.width/this._forcedOutputTexture.height:this.width/this.height},enumerable:!1,configurable:!0}),e.prototype.isReady=function(){return this._effect&&this._effect.isReady()},e.prototype.apply=function(){return this._effect&&this._effect.isReady()?(this._engine.enableEffect(this._effect),this._engine.setState(!1),this._engine.setDepthBuffer(!1),this._engine.setDepthWrite(!1),this._engine.setAlphaMode(this.alphaMode),this.alphaConstants&&this.getEngine().setAlphaConstants(this.alphaConstants.r,this.alphaConstants.g,this.alphaConstants.b,this.alphaConstants.a),e=this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?this._forcedOutputTexture:this.inputTexture,this._effect._bindTexture("textureSampler",e),this._effect.setVector2("scale",this._scaleRatio),this.onApplyObservable.notifyObservers(this._effect),this._effect):null;var e},e.prototype._disposeTextures=function(){if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this._textures.length>0)for(var e=0;e<this._textures.length;e++)this._engine._releaseTexture(this._textures.data[e]);this._textures.dispose()}},e.prototype.dispose=function(e){var t;if(e=e||this._camera,this._disposeTextures(),this._scene&&-1!==(t=this._scene.postProcesses.indexOf(this))&&this._scene.postProcesses.splice(t,1),-1!==(t=this._engine.postProcesses.indexOf(this))&&this._engine.postProcesses.splice(t,1),e){if(e.detachPostProcess(this),0===(t=e._postProcesses.indexOf(this))&&e._postProcesses.length>0){var r=this._camera._getFirstPostProcess();r&&r.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear()}},e}())},"./PostProcesses/postProcessManager.ts":
- /*!*********************************************!*\
- !*** ./PostProcesses/postProcessManager.ts ***!
- \*********************************************/
- /*! exports provided: PostProcessManager */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcessManager",(function(){return s}));var n=r(/*! ../Materials/material */"./Materials/material.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=function(){function e(e){this._vertexBuffers={},this._scene=e}return e.prototype._prepareBuffers=function(){if(!this._vertexBuffers[i.VertexBuffer.PositionKind]){var e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(this._scene.getEngine(),e,i.VertexBuffer.PositionKind,!1,!1,2),this._buildIndexBuffer()}},e.prototype._buildIndexBuffer=function(){var e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)},e.prototype._rebuild=function(){var e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())},e.prototype._prepareFrame=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null);var r=this._scene.activeCamera;return!(!r||!(t=t||r._postProcesses.filter((function(e){return null!=e})))||0===t.length||!this._scene.postProcessesEnabled||(t[0].activate(r,e,null!=t),0))},e.prototype.directRender=function(e,t,r,i,o,s){void 0===t&&(t=null),void 0===r&&(r=!1),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=!1);for(var a=this._scene.getEngine(),l=0;l<e.length;l++){l<e.length-1?e[l+1].activate(this._scene.activeCamera,t):t?a.bindFramebuffer(t,i,void 0,void 0,r,o):s||a.restoreDefaultFramebuffer();var c=e[l],u=c.apply();u&&(c.onBeforeRenderObservable.notifyObservers(u),this._prepareBuffers(),a.bindBuffers(this._vertexBuffers,this._indexBuffer,u),a.drawElementsType(n.Material.TriangleFillMode,0,6),c.onAfterRenderObservable.notifyObservers(u))}a.setDepthBuffer(!0),a.setDepthWrite(!0)},e.prototype._finalizeFrame=function(e,t,r,i,s){void 0===s&&(s=!1);var a=this._scene.activeCamera;if(a&&0!==(i=i||a._postProcesses.filter((function(e){return null!=e}))).length&&this._scene.postProcessesEnabled){for(var l=this._scene.getEngine(),c=0,u=i.length;c<u;c++){var d=i[c];if(c<u-1?d._outputTexture=i[c+1].activate(a,t):t?(l.bindFramebuffer(t,r,void 0,void 0,s),d._outputTexture=t):(l.restoreDefaultFramebuffer(),d._outputTexture=null),e)break;var h=d.apply();h&&(d.onBeforeRenderObservable.notifyObservers(h),this._prepareBuffers(),l.bindBuffers(this._vertexBuffers,this._indexBuffer,h),l.drawElementsType(n.Material.TriangleFillMode,0,6),d.onAfterRenderObservable.notifyObservers(h))}l.setDepthBuffer(!0),l.setDepthWrite(!0),l.setAlphaMode(o.Constants.ALPHA_DISABLE)}},e.prototype.dispose=function(){var e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[i.VertexBuffer.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)},e}()},"./PostProcesses/refractionPostProcess.ts":
- /*!************************************************!*\
- !*** ./PostProcesses/refractionPostProcess.ts ***!
- \************************************************/
- /*! exports provided: RefractionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"RefractionPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=(r(/*! ../Shaders/refraction.fragment */"./Shaders/refraction.fragment.ts"),function(e){function t(t,r,n,o,s,a,l,c,u,d){var h=e.call(this,t,"refraction",["baseColor","depth","colorLevel"],["refractionSampler"],a,l,c,u,d)||this;return h.color=n,h.depth=o,h.colorLevel=s,h._ownRefractionTexture=!0,h.onActivateObservable.add((function(e){h._refTexture=h._refTexture||new i.Texture(r,e.getScene())})),h.onApplyObservable.add((function(e){e.setColor3("baseColor",h.color),e.setFloat("depth",h.depth),e.setFloat("colorLevel",h.colorLevel),e.setTexture("refractionSampler",h._refTexture)})),h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this._refTexture},set:function(e){this._refTexture&&this._ownRefractionTexture&&this._refTexture.dispose(),this._refTexture=e,this._ownRefractionTexture=!1},enumerable:!1,configurable:!0}),t.prototype.dispose=function(t){this._refTexture&&this._ownRefractionTexture&&(this._refTexture.dispose(),this._refTexture=null),e.prototype.dispose.call(this,t)},t}(o.PostProcess))},"./PostProcesses/screenSpaceCurvaturePostProcess.ts":
- /*!**********************************************************!*\
- !*** ./PostProcesses/screenSpaceCurvaturePostProcess.ts ***!
- \**********************************************************/
- /*! exports provided: ScreenSpaceCurvaturePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ScreenSpaceCurvaturePostProcess",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Rendering/geometryBufferRendererSceneComponent */"./Rendering/geometryBufferRendererSceneComponent.ts"),r(/*! ../Shaders/screenSpaceCurvature.fragment */"./Shaders/screenSpaceCurvature.fragment.ts"),r(/*! ../Engines/engineStore */"./Engines/engineStore.ts")),l=function(e){function t(t,r,n,o,a,l,c,u,d){void 0===u&&(u=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1);var h=e.call(this,t,"screenSpaceCurvature",["curvature_ridge","curvature_valley"],["textureSampler","normalSampler"],n,o,a,l,c,void 0,u,void 0,null,d)||this;return h.ridge=1,h.valley=1,h._geometryBufferRenderer=r.enableGeometryBufferRenderer(),h._geometryBufferRenderer?h.onApply=function(e){e.setFloat("curvature_ridge",.5/Math.max(h.ridge*h.ridge,1e-4)),e.setFloat("curvature_valley",.7/Math.max(h.valley*h.valley,1e-4));var t=h._geometryBufferRenderer.getGBuffer().textures[1];e.setTexture("normalSampler",t)}:i.Logger.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first."),h}return Object(n.__extends)(t,e),Object.defineProperty(t,"IsSupported",{get:function(){var e=a.EngineStore.LastCreatedEngine;return!!e&&(e.webGLVersion>1||e.getCaps().drawBuffersExtension)},enumerable:!1,configurable:!0}),t}(o.PostProcess)},"./PostProcesses/screenSpaceReflectionPostProcess.ts":
- /*!***********************************************************!*\
- !*** ./PostProcesses/screenSpaceReflectionPostProcess.ts ***!
- \***********************************************************/
- /*! exports provided: ScreenSpaceReflectionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ScreenSpaceReflectionPostProcess",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../Rendering/geometryBufferRenderer */"./Rendering/geometryBufferRenderer.ts"),a=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),l=(r(/*! ../Shaders/screenSpaceReflection.fragment */"./Shaders/screenSpaceReflection.fragment.ts"),function(e){function t(t,r,n,i,a,l,c,u,d){void 0===u&&(u=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1);var h=e.call(this,t,"screenSpaceReflection",["projection","view","threshold","reflectionSpecularFalloffExponent","strength","step","roughnessFactor"],["textureSampler","normalSampler","positionSampler","reflectivitySampler"],n,i,a,l,c,"#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n",u,void 0,null,d)||this;h.threshold=1.2,h.strength=1,h.reflectionSpecularFalloffExponent=3,h.step=1,h.roughnessFactor=.2,h._enableSmoothReflections=!1,h._reflectionSamples=64,h._smoothSteps=5;var f=r.enableGeometryBufferRenderer();return f&&f.isSupported&&(f.enablePosition=!0,f.enableReflectivity=!0,h._geometryBufferRenderer=f),h._updateEffectDefines(),h.onApply=function(e){if(f){var t=f.getTextureIndex(s.GeometryBufferRenderer.POSITION_TEXTURE_TYPE),n=f.getTextureIndex(s.GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);e.setTexture("normalSampler",f.getGBuffer().textures[1]),e.setTexture("positionSampler",f.getGBuffer().textures[t]),e.setTexture("reflectivitySampler",f.getGBuffer().textures[n]);var i=r.activeCamera;if(i){var o=i.getViewMatrix(),a=i.getProjectionMatrix();e.setMatrix("projection",a),e.setMatrix("view",o),e.setFloat("threshold",h.threshold),e.setFloat("reflectionSpecularFalloffExponent",h.reflectionSpecularFalloffExponent),e.setFloat("strength",h.strength),e.setFloat("step",h.step),e.setFloat("roughnessFactor",h.roughnessFactor)}}},h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"enableSmoothReflections",{get:function(){return this._enableSmoothReflections},set:function(e){e!==this._enableSmoothReflections&&(this._enableSmoothReflections=e,this._updateEffectDefines())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reflectionSamples",{get:function(){return this._reflectionSamples},set:function(e){e!==this._reflectionSamples&&(this._reflectionSamples=e,this._updateEffectDefines())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"smoothSteps",{get:function(){return this._smoothSteps},set:function(e){e!==this._smoothSteps&&(this._smoothSteps=e,this._updateEffectDefines())},enumerable:!1,configurable:!0}),t.prototype._updateEffectDefines=function(){var e=[];this._geometryBufferRenderer&&e.push("#define SSR_SUPPORTED"),this._enableSmoothReflections&&e.push("#define ENABLE_SMOOTH_REFLECTIONS"),e.push("#define REFLECTION_SAMPLES "+(this._reflectionSamples>>0)),e.push("#define SMOOTH_STEPS "+(this._smoothSteps>>0)),this.updateEffect(e.join("\n"))},Object(n.__decorate)([Object(a.serialize)()],t.prototype,"threshold",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"strength",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"reflectionSpecularFalloffExponent",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"step",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"roughnessFactor",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"enableSmoothReflections",null),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"reflectionSamples",null),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"smoothSteps",null),t}(i.PostProcess))},"./PostProcesses/sharpenPostProcess.ts":
- /*!*********************************************!*\
- !*** ./PostProcesses/sharpenPostProcess.ts ***!
- \*********************************************/
- /*! exports provided: SharpenPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"SharpenPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/sharpen.fragment */"./Shaders/sharpen.fragment.ts"),function(e){function t(t,r,n,i,s,a,l,c){void 0===l&&(l=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var u=e.call(this,t,"sharpen",["sharpnessAmounts","screenSize"],null,r,n,i,s,a,null,l,void 0,null,c)||this;return u.colorAmount=1,u.edgeAmount=.3,u.onApply=function(e){e.setFloat2("screenSize",u.width,u.height),e.setFloat2("sharpnessAmounts",u.edgeAmount,u.colorAmount)},u}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/stereoscopicInterlacePostProcess.ts":
- /*!***********************************************************!*\
- !*** ./PostProcesses/stereoscopicInterlacePostProcess.ts ***!
- \***********************************************************/
- /*! exports provided: StereoscopicInterlacePostProcessI, StereoscopicInterlacePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicInterlacePostProcessI",(function(){return s})),r.d(t,"StereoscopicInterlacePostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=(r(/*! ../Shaders/stereoscopicInterlace.fragment */"./Shaders/stereoscopicInterlace.fragment.ts"),function(e){function t(t,r,n,o,s,a,l){var c=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,r[1],s,a,l,o?"#define IS_STEREOSCOPIC_INTERLACED 1":n?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return c._passedProcess=r[0]._rigPostProcess,c._stepSize=new i.Vector2(1/c.width,1/c.height),c.onSizeChangedObservable.add((function(){c._stepSize=new i.Vector2(1/c.width,1/c.height)})),c.onApplyObservable.add((function(e){e.setTextureFromPostProcess("camASampler",c._passedProcess),e.setFloat2("stepSize",c._stepSize.x,c._stepSize.y)})),c}return Object(n.__extends)(t,e),t}(o.PostProcess)),a=function(e){function t(t,r,n,o,s,a){var l=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,r[1],o,s,a,n?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return l._passedProcess=r[0]._rigPostProcess,l._stepSize=new i.Vector2(1/l.width,1/l.height),l.onSizeChangedObservable.add((function(){l._stepSize=new i.Vector2(1/l.width,1/l.height)})),l.onApplyObservable.add((function(e){e.setTextureFromPostProcess("camASampler",l._passedProcess),e.setFloat2("stepSize",l._stepSize.x,l._stepSize.y)})),l}return Object(n.__extends)(t,e),t}(o.PostProcess)},"./PostProcesses/subSurfaceScatteringPostProcess.ts":
- /*!**********************************************************!*\
- !*** ./PostProcesses/subSurfaceScatteringPostProcess.ts ***!
- \**********************************************************/
- /*! exports provided: SubSurfaceScatteringPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"SubSurfaceScatteringPostProcess",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=(r(/*! ../Shaders/imageProcessing.fragment */"./Shaders/imageProcessing.fragment.ts"),r(/*! ../Shaders/subSurfaceScattering.fragment */"./Shaders/subSurfaceScattering.fragment.ts"),r(/*! ../Shaders/postprocess.vertex */"./Shaders/postprocess.vertex.ts"),function(e){function t(t,r,n,o,l,c,u,d){void 0===o&&(o=null),void 0===d&&(d=s.Constants.TEXTURETYPE_UNSIGNED_INT);var h=e.call(this,t,"subSurfaceScattering",["texelSize","viewportSize","metersPerUnit"],["diffusionS","diffusionD","filterRadii","irradianceSampler","depthSampler","albedoSampler"],n,o,l||i.Texture.BILINEAR_SAMPLINGMODE,c,u,null,d,"postprocess",void 0,!0)||this;return h._scene=r,h.updateEffect(),h.onApplyObservable.add((function(e){if(r.prePassRenderer){var t=h.texelSize;e.setFloat("metersPerUnit",r.prePassRenderer.subSurfaceConfiguration.metersPerUnit),e.setFloat2("texelSize",t.x,t.y),e.setTexture("irradianceSampler",r.prePassRenderer.prePassRT.textures[1]),e.setTexture("depthSampler",r.prePassRenderer.prePassRT.textures[2]),e.setTexture("albedoSampler",r.prePassRenderer.prePassRT.textures[3]),e.setFloat2("viewportSize",Math.tan(r.activeCamera.fov/2)*r.getEngine().getAspectRatio(r.activeCamera,!0),Math.tan(r.activeCamera.fov/2)),e.setArray3("diffusionS",r.prePassRenderer.subSurfaceConfiguration.ssDiffusionS),e.setArray("diffusionD",r.prePassRenderer.subSurfaceConfiguration.ssDiffusionD),e.setArray("filterRadii",r.prePassRenderer.subSurfaceConfiguration.ssFilterRadii)}else a.Logger.Error("PrePass needs to be enabled for subsurface scattering.")})),h}return Object(n.__extends)(t,e),t}(o.PostProcess))},"./PostProcesses/tonemapPostProcess.ts":
- /*!*********************************************!*\
- !*** ./PostProcesses/tonemapPostProcess.ts ***!
- \*********************************************/
- /*! exports provided: TonemappingOperator, TonemapPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"TonemappingOperator",(function(){return n})),r.d(t,"TonemapPostProcess",(function(){return a}));var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts");r(/*! ../Shaders/tonemap.fragment */"./Shaders/tonemap.fragment.ts"),function(e){e[e.Hable=0]="Hable",e[e.Reinhard=1]="Reinhard",e[e.HejiDawson=2]="HejiDawson",e[e.Photographic=3]="Photographic"}(n||(n={}));var a=function(e){function t(t,r,i,o,a,l,c){void 0===a&&(a=s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE),void 0===c&&(c=s.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"tonemap",["_ExposureAdjustment"],null,1,o,a,l,!0,null,c)||this;u._operator=r,u.exposureAdjustment=i;var d="#define ";return u._operator===n.Hable?d+="HABLE_TONEMAPPING":u._operator===n.Reinhard?d+="REINHARD_TONEMAPPING":u._operator===n.HejiDawson?d+="OPTIMIZED_HEJIDAWSON_TONEMAPPING":u._operator===n.Photographic&&(d+="PHOTOGRAPHIC_TONEMAPPING"),u.updateEffect(d),u.onApply=function(e){e.setFloat("_ExposureAdjustment",u.exposureAdjustment)},u}return Object(i.__extends)(t,e),t}(o.PostProcess)},"./PostProcesses/volumetricLightScatteringPostProcess.ts":
- /*!***************************************************************!*\
- !*** ./PostProcesses/volumetricLightScatteringPostProcess.ts ***!
- \***************************************************************/
- /*! exports provided: VolumetricLightScatteringPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"VolumetricLightScatteringPostProcess",(function(){return y}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),c=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),d=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),h=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),f=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),p=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),m=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),g=r(/*! ../Engines/constants */"./Engines/constants.ts"),_=(r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),r(/*! ../Shaders/depth.vertex */"./Shaders/depth.vertex.ts"),r(/*! ../Shaders/volumetricLightScattering.fragment */"./Shaders/volumetricLightScattering.fragment.ts"),r(/*! ../Shaders/volumetricLightScatteringPass.vertex */"./Shaders/volumetricLightScatteringPass.vertex.ts"),r(/*! ../Shaders/volumetricLightScatteringPass.fragment */"./Shaders/volumetricLightScatteringPass.fragment.ts"),r(/*! ../Maths/math.color */"./Maths/math.color.ts")),v=r(/*! ../Maths/math.viewport */"./Maths/math.viewport.ts"),y=function(e){function t(r,n,i,o,a,l,c,u,d){void 0===a&&(a=100),void 0===l&&(l=f.Texture.BILINEAR_SAMPLINGMODE);var h=e.call(this,r,"volumetricLightScattering",["decay","exposure","weight","meshPositionOnScreen","density"],["lightScatteringSampler"],n.postProcessRatio||n,i,l,c,u,"#define NUM_SAMPLES "+a)||this;return h._screenCoordinates=s.Vector2.Zero(),h.customMeshPosition=s.Vector3.Zero(),h.useCustomMeshPosition=!1,h.invert=!0,h.excludedMeshes=new Array,h.exposure=.3,h.decay=.96815,h.weight=.58767,h.density=.926,c=(d=null===i?d:i.getScene()).getEngine(),h._viewPort=new v.Viewport(0,0,1,1).toGlobal(c.getRenderWidth(),c.getRenderHeight()),h.mesh=null!==o?o:t.CreateDefaultMesh("VolumetricLightScatteringMesh",d),h._createPass(d,n.passRatio||n),h.onActivate=function(e){h.isSupported||h.dispose(e),h.onActivate=null},h.onApplyObservable.add((function(e){h._updateMeshScreenCoordinates(d),e.setTexture("lightScatteringSampler",h._volumetricLightScatteringRTT),e.setFloat("exposure",h.exposure),e.setFloat("decay",h.decay),e.setFloat("weight",h.weight),e.setFloat("density",h.density),e.setVector2("meshPositionOnScreen",h._screenCoordinates)})),h}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"useDiffuseColor",{get:function(){return o.Logger.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"),!1},set:function(e){o.Logger.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead")},enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"VolumetricLightScatteringPostProcess"},t.prototype._isReady=function(e,t){var r=e.getMesh();if(r===this.mesh&&r.material)return r.material.isReady(r);var n=[],i=[a.VertexBuffer.PositionKind],o=e.getMaterial();o&&(o.needAlphaTesting()&&n.push("#define ALPHATEST"),r.isVerticesDataPresent(a.VertexBuffer.UVKind)&&(i.push(a.VertexBuffer.UVKind),n.push("#define UV1")),r.isVerticesDataPresent(a.VertexBuffer.UV2Kind)&&(i.push(a.VertexBuffer.UV2Kind),n.push("#define UV2"))),r.useBones&&r.computeBonesUsingShaders?(i.push(a.VertexBuffer.MatricesIndicesKind),i.push(a.VertexBuffer.MatricesWeightsKind),n.push("#define NUM_BONE_INFLUENCERS "+r.numBoneInfluencers),n.push("#define BonesPerMesh "+(r.skeleton?r.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0"),t&&(n.push("#define INSTANCES"),d.MaterialHelper.PushAttributesForInstances(i),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES"));var s=n.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._volumetricLightScatteringPass=r.getScene().getEngine().createEffect("volumetricLightScatteringPass",i,["world","mBones","viewProjection","diffuseMatrix"],["diffuseSampler"],s,void 0,void 0,void 0,{maxSimultaneousMorphTargets:r.numBoneInfluencers})),this._volumetricLightScatteringPass.isReady()},t.prototype.setCustomMeshPosition=function(e){this.customMeshPosition=e},t.prototype.getCustomMeshPosition=function(){return this.customMeshPosition},t.prototype.dispose=function(t){var r=t.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);-1!==r&&t.getScene().customRenderTargets.splice(r,1),this._volumetricLightScatteringRTT.dispose(),e.prototype.dispose.call(this,t)},t.prototype.getPass=function(){return this._volumetricLightScatteringRTT},t.prototype._meshExcluded=function(e){return this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e)},t.prototype._createPass=function(e,t){var r=this,n=e.getEngine();this._volumetricLightScatteringRTT=new p.RenderTargetTexture("volumetricLightScatteringMap",{width:n.getRenderWidth()*t,height:n.getRenderHeight()*t},e,!1,!0,g.Constants.TEXTURETYPE_UNSIGNED_INT),this._volumetricLightScatteringRTT.wrapU=f.Texture.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=f.Texture.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.renderList=null,this._volumetricLightScatteringRTT.renderParticles=!1,this._volumetricLightScatteringRTT.ignoreCameraViewport=!0;var i=this.getCamera();i?i.customRenderTargets.push(this._volumetricLightScatteringRTT):e.customRenderTargets.push(this._volumetricLightScatteringRTT);var o,s=function(e){var t=e.getRenderingMesh(),n=e.getEffectiveMesh();if(!r._meshExcluded(t)){n._internalAbstractMeshDataInfo._isActiveIntermediate=!1;var i=e.getMaterial();if(i){var o=t.getScene(),s=o.getEngine();s.setState(i.backFaceCulling);var a=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(!a.mustReturn){var l=s.getCaps().instancedArrays&&(null!==a.visibleInstances[e._id]||t.hasThinInstances);if(r._isReady(e,l)){var c=r._volumetricLightScatteringPass;if(t===r.mesh&&(c=e.effect?e.effect:i.getEffect()),s.enableEffect(c),t._bind(e,c,i.fillMode),t===r.mesh)i.bind(n.getWorldMatrix(),t);else{if(r._volumetricLightScatteringPass.setMatrix("viewProjection",o.getTransformMatrix()),i&&i.needAlphaTesting()){var d=i.getAlphaTestTexture();r._volumetricLightScatteringPass.setTexture("diffuseSampler",d),d&&r._volumetricLightScatteringPass.setMatrix("diffuseMatrix",d.getTextureMatrix())}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&r._volumetricLightScatteringPass.setMatrices("mBones",t.skeleton.getTransformMatrices(t))}t._processRendering(n,e,r._volumetricLightScatteringPass,u.Material.TriangleFillMode,a,l,(function(e,t){return c.setMatrix("world",t)}))}}}}},a=new _.Color4(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add((function(){o=e.clearColor,e.clearColor=a})),this._volumetricLightScatteringRTT.onAfterRenderObservable.add((function(){e.clearColor=o})),this._volumetricLightScatteringRTT.customRenderFunction=function(t,r,n,i){var o,a=e.getEngine();if(i.length){for(a.setColorWrite(!1),o=0;o<i.length;o++)s(i.data[o]);a.setColorWrite(!0)}for(o=0;o<t.length;o++)s(t.data[o]);for(o=0;o<r.length;o++)s(r.data[o]);if(n.length){for(o=0;o<n.length;o++){var l=n.data[o],c=l.getBoundingInfo();c&&e.activeCamera&&(l._alphaIndex=l.getMesh().alphaIndex,l._distanceToCamera=c.boundingSphere.centerWorld.subtract(e.activeCamera.position).length())}var u=n.data.slice(0,n.length);for(u.sort((function(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0})),a.setAlphaMode(g.Constants.ALPHA_COMBINE),o=0;o<u.length;o++)s(u[o]);a.setAlphaMode(g.Constants.ALPHA_DISABLE)}}},t.prototype._updateMeshScreenCoordinates=function(e){var t,r=e.getTransformMatrix();t=this.useCustomMeshPosition?this.customMeshPosition:this.attachedNode?this.attachedNode.position:this.mesh.parent?this.mesh.getAbsolutePosition():this.mesh.position;var n=s.Vector3.Project(t,s.Matrix.Identity(),r,this._viewPort);this._screenCoordinates.x=n.x/this._viewPort.width,this._screenCoordinates.y=n.y/this._viewPort.height,this.invert&&(this._screenCoordinates.y=1-this._screenCoordinates.y)},t.CreateDefaultMesh=function(e,t){var r=c.Mesh.CreatePlane(e,1,t);r.billboardMode=l.AbstractMesh.BILLBOARDMODE_ALL;var n=new h.StandardMaterial(e+"Material",t);return n.emissiveColor=new _.Color3(1,1,1),r.material=n,r},Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"customMeshPosition",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useCustomMeshPosition",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"invert",void 0),Object(n.__decorate)([Object(i.serializeAsMeshReference)()],t.prototype,"mesh",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"excludedMeshes",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"exposure",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"decay",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"weight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"density",void 0),t}(m.PostProcess)},"./PostProcesses/vrDistortionCorrectionPostProcess.ts":
- /*!************************************************************!*\
- !*** ./PostProcesses/vrDistortionCorrectionPostProcess.ts ***!
- \************************************************************/
- /*! exports provided: VRDistortionCorrectionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDistortionCorrectionPostProcess",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),a=(r(/*! ../Shaders/vrDistortionCorrection.fragment */"./Shaders/vrDistortionCorrection.fragment.ts"),function(e){function t(t,r,n,s){var a=e.call(this,t,"vrDistortionCorrection",["LensCenter","Scale","ScaleIn","HmdWarpParam"],null,s.postProcessScaleFactor,r,o.Texture.BILINEAR_SAMPLINGMODE)||this;return a._isRightEye=n,a._distortionFactors=s.distortionK,a._postProcessScaleFactor=s.postProcessScaleFactor,a._lensCenterOffset=s.lensCenterOffset,a.adaptScaleToCurrentViewport=!0,a.onSizeChangedObservable.add((function(){a._scaleIn=new i.Vector2(2,2/a.aspectRatio),a._scaleFactor=new i.Vector2(1/a._postProcessScaleFactor*.5,1/a._postProcessScaleFactor*.5*a.aspectRatio),a._lensCenter=new i.Vector2(a._isRightEye?.5-.5*a._lensCenterOffset:.5+.5*a._lensCenterOffset,.5)})),a.onApplyObservable.add((function(e){e.setFloat2("LensCenter",a._lensCenter.x,a._lensCenter.y),e.setFloat2("Scale",a._scaleFactor.x,a._scaleFactor.y),e.setFloat2("ScaleIn",a._scaleIn.x,a._scaleIn.y),e.setFloat4("HmdWarpParam",a._distortionFactors[0],a._distortionFactors[1],a._distortionFactors[2],a._distortionFactors[3])})),a}return Object(n.__extends)(t,e),t}(s.PostProcess))},"./PostProcesses/vrMultiviewToSingleviewPostProcess.ts":
- /*!*************************************************************!*\
- !*** ./PostProcesses/vrMultiviewToSingleviewPostProcess.ts ***!
- \*************************************************************/
- /*! exports provided: VRMultiviewToSingleviewPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"VRMultiviewToSingleviewPostProcess",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=(r(/*! ../Shaders/vrMultiviewToSingleview.fragment */"./Shaders/vrMultiviewToSingleview.fragment.ts"),r(/*! ../Engines/Extensions/engine.multiview */"./Engines/Extensions/engine.multiview.ts"),function(e){function t(t,r,n){var o=e.call(this,t,"vrMultiviewToSingleview",["imageIndex"],["multiviewSampler"],n,r,i.Texture.BILINEAR_SAMPLINGMODE)||this;return o.onSizeChangedObservable.add((function(){})),o.onApplyObservable.add((function(e){r._scene.activeCamera&&r._scene.activeCamera.isLeftCamera?e.setInt("imageIndex",0):e.setInt("imageIndex",1),e.setTexture("multiviewSampler",r._multiviewTexture)})),o}return Object(n.__extends)(t,e),t}(o.PostProcess))},"./Probes/index.ts":
- /*!*************************!*\
- !*** ./Probes/index.ts ***!
- \*************************/
- /*! exports provided: ReflectionProbe */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./reflectionProbe */"./Probes/reflectionProbe.ts");r.d(t,"ReflectionProbe",(function(){return n.ReflectionProbe}))},"./Probes/reflectionProbe.ts":
- /*!***********************************!*\
- !*** ./Probes/reflectionProbe.ts ***!
- \***********************************/
- /*! exports provided: ReflectionProbe */function(e,t,r){"use strict";r.r(t),r.d(t,"ReflectionProbe",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../abstractScene */"./abstractScene.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts");a.AbstractScene.prototype.removeReflectionProbe=function(e){if(!this.reflectionProbes)return-1;var t=this.reflectionProbes.indexOf(e);return-1!==t&&this.reflectionProbes.splice(t,1),t},a.AbstractScene.prototype.addReflectionProbe=function(e){this.reflectionProbes||(this.reflectionProbes=[]),this.reflectionProbes.push(e)};var c=function(){function e(e,t,r,n,i){var a=this;void 0===n&&(n=!0),void 0===i&&(i=!1),this.name=e,this._viewMatrix=s.Matrix.Identity(),this._target=s.Vector3.Zero(),this._add=s.Vector3.Zero(),this._invertYAxis=!1,this.position=s.Vector3.Zero(),this._scene=r,this._scene.reflectionProbes||(this._scene.reflectionProbes=new Array),this._scene.reflectionProbes.push(this);var c=l.Constants.TEXTURETYPE_UNSIGNED_BYTE;if(i){var u=this._scene.getEngine().getCaps();u.textureHalfFloatRender?c=l.Constants.TEXTURETYPE_HALF_FLOAT:u.textureFloatRender&&(c=l.Constants.TEXTURETYPE_FLOAT)}this._renderTargetTexture=new o.RenderTargetTexture(e,t,r,n,!0,c,!0),this._renderTargetTexture.onBeforeRenderObservable.add((function(e){switch(e){case 0:a._add.copyFromFloats(1,0,0);break;case 1:a._add.copyFromFloats(-1,0,0);break;case 2:a._add.copyFromFloats(0,a._invertYAxis?1:-1,0);break;case 3:a._add.copyFromFloats(0,a._invertYAxis?-1:1,0);break;case 4:a._add.copyFromFloats(0,0,1);break;case 5:a._add.copyFromFloats(0,0,-1)}a._attachedMesh&&a.position.copyFrom(a._attachedMesh.getAbsolutePosition()),a.position.addToRef(a._add,a._target),s.Matrix.LookAtLHToRef(a.position,a._target,s.Vector3.Up(),a._viewMatrix),r.activeCamera&&(a._projectionMatrix=s.Matrix.PerspectiveFovLH(Math.PI/2,1,r.activeCamera.minZ,r.activeCamera.maxZ),r.setTransformMatrix(a._viewMatrix,a._projectionMatrix)),r._forcedViewPosition=a.position})),this._renderTargetTexture.onAfterUnbindObservable.add((function(){r._forcedViewPosition=null,r.updateTransformMatrix(!0)}))}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._renderTargetTexture.samples},set:function(e){this._renderTargetTexture.samples=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._renderTargetTexture.refreshRate},set:function(e){this._renderTargetTexture.refreshRate=e},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"cubeTexture",{get:function(){return this._renderTargetTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderList",{get:function(){return this._renderTargetTexture.renderList},enumerable:!1,configurable:!0}),e.prototype.attachToMesh=function(e){this._attachedMesh=e},e.prototype.setRenderingAutoClearDepthStencil=function(e,t){this._renderTargetTexture.setRenderingAutoClearDepthStencil(e,t)},e.prototype.dispose=function(){var e=this._scene.reflectionProbes.indexOf(this);-1!==e&&this._scene.reflectionProbes.splice(e,1),this._renderTargetTexture&&(this._renderTargetTexture.dispose(),this._renderTargetTexture=null)},e.prototype.toString=function(e){var t="Name: "+this.name;return e&&(t+=", position: "+this.position.toString(),this._attachedMesh&&(t+=", attached mesh: "+this._attachedMesh.name)),t},e.prototype.getClassName=function(){return"ReflectionProbe"},e.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this,this._renderTargetTexture.serialize());return e.isReflectionProbe=!0,e},e.Parse=function(t,r,n){var o=null;if(r.reflectionProbes)for(var s=0;s<r.reflectionProbes.length;s++){var a=r.reflectionProbes[s];if(a.name===t.name){o=a;break}}return(o=i.SerializationHelper.Parse((function(){return o||new e(t.name,t.renderTargetSize,r,t._generateMipMaps)}),t,r,n)).cubeTexture._waitingRenderList=t.renderList,t._attachedMesh&&o.attachToMesh(r.getMeshByID(t._attachedMesh)),o},Object(n.__decorate)([Object(i.serializeAsMeshReference)()],e.prototype,"_attachedMesh",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],e.prototype,"position",void 0),e}()},"./Rendering/boundingBoxRenderer.ts":
- /*!******************************************!*\
- !*** ./Rendering/boundingBoxRenderer.ts ***!
- \******************************************/
- /*! exports provided: BoundingBoxRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"BoundingBoxRenderer",(function(){return p}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),c=r(/*! ../sceneComponent */"./sceneComponent.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),d=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts"),h=(r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),r(/*! ../Shaders/color.fragment */"./Shaders/color.fragment.ts"),r(/*! ../Shaders/color.vertex */"./Shaders/color.vertex.ts"),r(/*! ../Maths/math.color */"./Maths/math.color.ts")),f=r(/*! ../Misc/observable */"./Misc/observable.ts");Object.defineProperty(n.Scene.prototype,"forceShowBoundingBoxes",{get:function(){return this._forceShowBoundingBoxes||!1},set:function(e){this._forceShowBoundingBoxes=e,e&&this.getBoundingBoxRenderer()},enumerable:!0,configurable:!0}),n.Scene.prototype.getBoundingBoxRenderer=function(){return this._boundingBoxRenderer||(this._boundingBoxRenderer=new p(this)),this._boundingBoxRenderer},Object.defineProperty(o.AbstractMesh.prototype,"showBoundingBox",{get:function(){return this._showBoundingBox||!1},set:function(e){this._showBoundingBox=e,e&&this.getScene().getBoundingBoxRenderer()},enumerable:!0,configurable:!0});var p=function(){function e(e){this.name=c.SceneComponentConstants.NAME_BOUNDINGBOXRENDERER,this.frontColor=new h.Color3(1,1,1),this.backColor=new h.Color3(.1,.1,.1),this.showBackLines=!0,this.onBeforeBoxRenderingObservable=new f.Observable,this.onAfterBoxRenderingObservable=new f.Observable,this.renderList=new l.SmartArray(32),this._vertexBuffers={},this._fillIndexBuffer=null,this._fillIndexData=null,this.scene=e,e._addComponent(this)}return e.prototype.register=function(){this.scene._beforeEvaluateActiveMeshStage.registerStep(c.SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER,this,this.reset),this.scene._activeMeshStage.registerStep(c.SceneComponentConstants.STEP_ACTIVEMESH_BOUNDINGBOXRENDERER,this,this._activeMesh),this.scene._evaluateSubMeshStage.registerStep(c.SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER,this,this._evaluateSubMesh),this.scene._afterRenderingGroupDrawStage.registerStep(c.SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER,this,this.render)},e.prototype._evaluateSubMesh=function(e,t){if(e.showSubMeshesBoundingBox){var r=t.getBoundingInfo();null!=r&&(r.boundingBox._tag=e.renderingGroupId,this.renderList.push(r.boundingBox))}},e.prototype._activeMesh=function(e,t){if(e.showBoundingBox||this.scene.forceShowBoundingBoxes){var r=e.getBoundingInfo();r.boundingBox._tag=t.renderingGroupId,this.renderList.push(r.boundingBox)}},e.prototype._prepareRessources=function(){if(!this._colorShader){this._colorShader=new d.ShaderMaterial("colorShader",this.scene,"color",{attributes:[i.VertexBuffer.PositionKind],uniforms:["world","viewProjection","color"]}),this._colorShader.reservedDataStore={hidden:!0};var e=this.scene.getEngine(),t=s.VertexData.CreateBox({size:1});this._vertexBuffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(e,t.positions,i.VertexBuffer.PositionKind,!1),this._createIndexBuffer(),this._fillIndexData=t.indices}},e.prototype._createIndexBuffer=function(){var e=this.scene.getEngine();this._indexBuffer=e.createIndexBuffer([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,7,1,6,2,5,3,4])},e.prototype.rebuild=function(){var e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.reset=function(){this.renderList.reset()},e.prototype.render=function(e){if(0!==this.renderList.length&&(this._prepareRessources(),this._colorShader.isReady())){var t=this.scene.getEngine();t.setDepthWrite(!1),this._colorShader._preBind();for(var r=0;r<this.renderList.length;r++){var n=this.renderList.data[r];if(n._tag===e){this.onBeforeBoxRenderingObservable.notifyObservers(n);var i=n.minimum,o=n.maximum.subtract(i),s=i.add(o.scale(.5)),l=a.Matrix.Scaling(o.x,o.y,o.z).multiply(a.Matrix.Translation(s.x,s.y,s.z)).multiply(n.getWorldMatrix());t.bindBuffers(this._vertexBuffers,this._indexBuffer,this._colorShader.getEffect()),this.showBackLines&&(t.setDepthFunctionToGreaterOrEqual(),this.scene.resetCachedMaterial(),this._colorShader.setColor4("color",this.backColor.toColor4()),this._colorShader.bind(l),t.drawElementsType(u.Material.LineListDrawMode,0,24)),t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._colorShader.setColor4("color",this.frontColor.toColor4()),this._colorShader.bind(l),t.drawElementsType(u.Material.LineListDrawMode,0,24),this.onAfterBoxRenderingObservable.notifyObservers(n)}}this._colorShader.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0)}},e.prototype.renderOcclusionBoundingBox=function(e){if(this._prepareRessources(),this._colorShader.isReady()&&e._boundingInfo){var t=this.scene.getEngine();this._fillIndexBuffer||(this._fillIndexBuffer=t.createIndexBuffer(this._fillIndexData)),t.setDepthWrite(!1),t.setColorWrite(!1),this._colorShader._preBind();var r=e._boundingInfo.boundingBox,n=r.minimum,i=r.maximum.subtract(n),o=n.add(i.scale(.5)),s=a.Matrix.Scaling(i.x,i.y,i.z).multiply(a.Matrix.Translation(o.x,o.y,o.z)).multiply(r.getWorldMatrix());t.bindBuffers(this._vertexBuffers,this._fillIndexBuffer,this._colorShader.getEffect()),t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._colorShader.bind(s),t.drawElementsType(u.Material.TriangleFillMode,0,36),this._colorShader.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0),t.setColorWrite(!0)}},e.prototype.dispose=function(){if(this._colorShader){this.onBeforeBoxRenderingObservable.clear(),this.onAfterBoxRenderingObservable.clear(),this.renderList.dispose(),this._colorShader.dispose();var e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[i.VertexBuffer.PositionKind]=null),this.scene.getEngine()._releaseBuffer(this._indexBuffer),this._fillIndexBuffer&&(this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer),this._fillIndexBuffer=null)}},e}()},"./Rendering/depthRenderer.ts":
- /*!************************************!*\
- !*** ./Rendering/depthRenderer.ts ***!
- \************************************/
- /*! exports provided: DepthRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthRenderer",(function(){return u}));var n=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),a=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=(r(/*! ../Shaders/depth.fragment */"./Shaders/depth.fragment.ts"),r(/*! ../Shaders/depth.vertex */"./Shaders/depth.vertex.ts"),r(/*! ../Misc/devTools */"./Misc/devTools.ts")),u=function(){function e(t,r,i,c){var u=this;void 0===r&&(r=l.Constants.TEXTURETYPE_FLOAT),void 0===i&&(i=null),void 0===c&&(c=!1),this.enabled=!0,this.useOnlyInActiveCamera=!1,this._scene=t,this._storeNonLinearDepth=c,this.isPacked=r===l.Constants.TEXTURETYPE_UNSIGNED_BYTE,this.isPacked?this._clearColor=new n.Color4(1,1,1,1):this._clearColor=new n.Color4(1,0,0,1),e._SceneComponentInitialization(this._scene),this._camera=i;var d=t.getEngine(),h=this.isPacked||1===d.webGLVersion?l.Constants.TEXTUREFORMAT_RGBA:l.Constants.TEXTUREFORMAT_R;this._depthMap=new s.RenderTargetTexture("depthMap",{width:d.getRenderWidth(),height:d.getRenderHeight()},this._scene,!1,!0,r,!1,void 0,void 0,void 0,void 0,h),this._depthMap.wrapU=o.Texture.CLAMP_ADDRESSMODE,this._depthMap.wrapV=o.Texture.CLAMP_ADDRESSMODE,this._depthMap.refreshRate=1,this._depthMap.renderParticles=!1,this._depthMap.renderList=null,this._depthMap.activeCamera=this._camera,this._depthMap.ignoreCameraViewport=!0,this._depthMap.useCameraPostProcesses=!1,this._depthMap.onClearObservable.add((function(e){e.clear(u._clearColor,!0,!0,!0)}));var f=function(e){var t=e.getRenderingMesh(),r=e.getEffectiveMesh(),n=u._scene,i=n.getEngine(),o=e.getMaterial();if(r._internalAbstractMeshDataInfo._isActiveIntermediate=!1,o){i.setState(o.backFaceCulling,0,!1,n.useRightHandedSystem);var s=t._getInstancesRenderList(e._id,!!e.getReplacementMesh());if(!s.mustReturn){var l=i.getCaps().instancedArrays&&(null!==s.visibleInstances[e._id]||t.hasThinInstances),c=u._camera||n.activeCamera;if(u.isReady(e,l)&&c){if(i.enableEffect(u._effect),t._bind(e,u._effect,o.fillMode),u._effect.setMatrix("viewProjection",n.getTransformMatrix()),u._effect.setFloat2("depthValues",c.minZ,c.minZ+c.maxZ),o&&o.needAlphaTesting()){var d=o.getAlphaTestTexture();d&&(u._effect.setTexture("diffuseSampler",d),u._effect.setMatrix("diffuseMatrix",d.getTextureMatrix()))}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&u._effect.setMatrices("mBones",t.skeleton.getTransformMatrices(t)),a.MaterialHelper.BindMorphTargetParameters(t,u._effect),t._processRendering(r,e,u._effect,o.fillMode,s,l,(function(e,t){return u._effect.setMatrix("world",t)}))}}}};this._depthMap.customRenderFunction=function(e,t,r,n){var i;if(n.length){for(d.setColorWrite(!1),i=0;i<n.length;i++)f(n.data[i]);d.setColorWrite(!0)}for(i=0;i<e.length;i++)f(e.data[i]);for(i=0;i<t.length;i++)f(t.data[i])}}return e.prototype.isReady=function(e,t){var r=e.getMaterial();if(r.disableDepthWrite)return!1;var n=[],o=[i.VertexBuffer.PositionKind],s=e.getMesh();r&&r.needAlphaTesting()&&r.getAlphaTestTexture()&&(n.push("#define ALPHATEST"),s.isVerticesDataPresent(i.VertexBuffer.UVKind)&&(o.push(i.VertexBuffer.UVKind),n.push("#define UV1")),s.isVerticesDataPresent(i.VertexBuffer.UV2Kind)&&(o.push(i.VertexBuffer.UV2Kind),n.push("#define UV2"))),s.useBones&&s.computeBonesUsingShaders?(o.push(i.VertexBuffer.MatricesIndicesKind),o.push(i.VertexBuffer.MatricesWeightsKind),s.numBoneInfluencers>4&&(o.push(i.VertexBuffer.MatricesIndicesExtraKind),o.push(i.VertexBuffer.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),n.push("#define BonesPerMesh "+(s.skeleton?s.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0");var l=s.morphTargetManager,c=0;l&&l.numInfluencers>0&&(c=l.numInfluencers,n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+c),a.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(o,s,c)),t&&(n.push("#define INSTANCES"),a.MaterialHelper.PushAttributesForInstances(o),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES")),this._storeNonLinearDepth&&n.push("#define NONLINEARDEPTH"),this.isPacked&&n.push("#define PACKED");var u=n.join("\n");return this._cachedDefines!==u&&(this._cachedDefines=u,this._effect=this._scene.getEngine().createEffect("depth",o,["world","mBones","viewProjection","diffuseMatrix","depthValues","morphTargetInfluences"],["diffuseSampler"],u,void 0,void 0,void 0,{maxSimultaneousMorphTargets:c})),this._effect.isReady()},e.prototype.getDepthMap=function(){return this._depthMap},e.prototype.dispose=function(){this._depthMap.dispose()},e._SceneComponentInitialization=function(e){throw c._DevTools.WarnImport("DepthRendererSceneComponent")},e}()},"./Rendering/depthRendererSceneComponent.ts":
- /*!**************************************************!*\
- !*** ./Rendering/depthRendererSceneComponent.ts ***!
- \**************************************************/
- /*! exports provided: DepthRendererSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthRendererSceneComponent",(function(){return a}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ./depthRenderer */"./Rendering/depthRenderer.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../sceneComponent */"./sceneComponent.ts");n.Scene.prototype.enableDepthRenderer=function(e,t){if(void 0===t&&(t=!1),!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){var r=0;r=this.getEngine().getCaps().textureHalfFloatRender?o.Constants.TEXTURETYPE_HALF_FLOAT:this.getEngine().getCaps().textureFloatRender?o.Constants.TEXTURETYPE_FLOAT:o.Constants.TEXTURETYPE_UNSIGNED_BYTE,this._depthRenderer[e.id]=new i.DepthRenderer(this,r,e,t)}return this._depthRenderer[e.id]},n.Scene.prototype.disableDepthRenderer=function(e){(e=e||this.activeCamera)&&this._depthRenderer&&this._depthRenderer[e.id]&&(this._depthRenderer[e.id].dispose(),delete this._depthRenderer[e.id])};var a=function(){function e(e){this.name=s.SceneComponentConstants.NAME_DEPTHRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(s.SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(s.SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER,this,this._gatherActiveCameraRenderTargets)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){for(var e in this.scene._depthRenderer)this.scene._depthRenderer[e].dispose()},e.prototype._gatherRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var r=this.scene._depthRenderer[t];r.enabled&&!r.useOnlyInActiveCamera&&e.push(r.getDepthMap())}},e.prototype._gatherActiveCameraRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var r=this.scene._depthRenderer[t];r.enabled&&r.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(r.getDepthMap())}},e}();i.DepthRenderer._SceneComponentInitialization=function(e){var t=e._getComponent(s.SceneComponentConstants.NAME_DEPTHRENDERER);t||(t=new a(e),e._addComponent(t))}},"./Rendering/edgesRenderer.ts":
- /*!************************************!*\
- !*** ./Rendering/edgesRenderer.ts ***!
- \************************************/
- /*! exports provided: EdgesRenderer, LineEdgesRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"EdgesRenderer",(function(){return p})),r.d(t,"LineEdgesRenderer",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Meshes/linesMesh */"./Meshes/linesMesh.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../Materials/material */"./Materials/material.ts"),c=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts"),u=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),d=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=(r(/*! ../Shaders/line.fragment */"./Shaders/line.fragment.ts"),r(/*! ../Shaders/line.vertex */"./Shaders/line.vertex.ts"),r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"));o.AbstractMesh.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this},o.AbstractMesh.prototype.enableEdgesRendering=function(e,t,r){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new p(this,e,t,!0,r),this},Object.defineProperty(o.AbstractMesh.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0}),s.LinesMesh.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new m(this,e,t),this},s.InstancedLinesMesh.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),s.LinesMesh.prototype.enableEdgesRendering.apply(this,arguments),this};var f=function(){this.edges=new Array,this.edgesConnectedCount=0},p=function(){function e(e,t,r,n,i){var o,s=this;void 0===t&&(t=.95),void 0===r&&(r=!1),void 0===n&&(n=!0),this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._buffersForInstances={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this.customInstances=new h.SmartArray(32),this._source=e,this._checkVerticesInsteadOfIndices=r,this._options=null!=i?i:null,this._epsilon=t,this._prepareRessources(),n&&(null===(o=null==i?void 0:i.useAlternateEdgeFinder)||void 0===o||o?this._generateEdgesLinesAlternate():this._generateEdgesLines()),this._meshRebuildObserver=this._source.onRebuildObservable.add((function(){s._rebuild()})),this._meshDisposeObserver=this._source.onDisposeObservable.add((function(){s.dispose()}))}return e.GetShader=function(e){if(!e._edgeRenderLineShader){var t=new c.ShaderMaterial("lineShader",e,"line",{attributes:["position","normal"],uniforms:["world","viewProjection","color","width","aspectRatio"]});t.disableDepthWrite=!0,t.backFaceCulling=!1,e._edgeRenderLineShader=t}return e._edgeRenderLineShader},e.prototype._prepareRessources=function(){this._lineShader||(this._lineShader=e.GetShader(this._source.getScene()))},e.prototype._rebuild=function(){var e=this._buffers[i.VertexBuffer.PositionKind];e&&e._rebuild(),(e=this._buffers[i.VertexBuffer.NormalKind])&&e._rebuild();var t=this._source.getScene().getEngine();this._ib=t.createIndexBuffer(this._linesIndices)},e.prototype.dispose=function(){this._source.onRebuildObservable.remove(this._meshRebuildObserver),this._source.onDisposeObservable.remove(this._meshDisposeObserver);var e=this._buffers[i.VertexBuffer.PositionKind];e&&(e.dispose(),this._buffers[i.VertexBuffer.PositionKind]=null),(e=this._buffers[i.VertexBuffer.NormalKind])&&(e.dispose(),this._buffers[i.VertexBuffer.NormalKind]=null),this._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose()},e.prototype._processEdgeForAdjacencies=function(e,t,r,n,i){return e===r&&t===n||e===n&&t===r?0:e===n&&t===i||e===i&&t===n?1:e===i&&t===r||e===r&&t===i?2:-1},e.prototype._processEdgeForAdjacenciesWithVertices=function(e,t,r,n,i){var o=1e-10;return e.equalsWithEpsilon(r,o)&&t.equalsWithEpsilon(n,o)||e.equalsWithEpsilon(n,o)&&t.equalsWithEpsilon(r,o)?0:e.equalsWithEpsilon(n,o)&&t.equalsWithEpsilon(i,o)||e.equalsWithEpsilon(i,o)&&t.equalsWithEpsilon(n,o)?1:e.equalsWithEpsilon(i,o)&&t.equalsWithEpsilon(r,o)||e.equalsWithEpsilon(r,o)&&t.equalsWithEpsilon(i,o)?2:-1},e.prototype._checkEdge=function(e,t,r,n,i){(void 0===t||a.Vector3.Dot(r[e],r[t])<this._epsilon)&&this.createLine(n,i,this._linesPositions.length/3)},e.prototype.createLine=function(e,t,r){this._linesPositions.push(e.x,e.y,e.z,e.x,e.y,e.z,t.x,t.y,t.z,t.x,t.y,t.z),this._linesNormals.push(t.x,t.y,t.z,-1,t.x,t.y,t.z,1,e.x,e.y,e.z,-1,e.x,e.y,e.z,1),this._linesIndices.push(r,r+1,r+2,r,r+2,r+3)},e.prototype._tessellateTriangle=function(e,t,r,n){var i=function(e,t,r){r>=0&&t.push(r);for(var n=0;n<e.length;++n)t.push(e[n][0])},o=0;e[1].length>=e[0].length&&e[1].length>=e[2].length?o=1:e[2].length>=e[0].length&&e[2].length>=e[1].length&&(o=2);for(var s=0;s<3;++s)s===o?e[s].sort((function(e,t){return e[1]<t[1]?-1:e[1]>t[1]?1:0})):e[s].sort((function(e,t){return e[1]>t[1]?-1:e[1]<t[1]?1:0}));var a=[],l=[];i(e[o],a,-1);for(var c=a.length,u=o+2;u>=o+1;--u)i(e[u%3],l,u!==o+2?n[r[t+(u+1)%3]]:-1);var d=l.length;r.push(n[r[t+o]],a[0],l[0]),r.push(n[r[t+(o+1)%3]],l[d-1],a[c-1]);for(var h=c<=d,f=h?c:d,p=h?d:c,m=h?c-1:d-1,g=h?0:1,_=c+d-2,v=0,y=0,b=h?a:l,A=h?l:a,T=0;_-- >0;){g?r.push(b[v],A[y]):r.push(A[y],b[v]);var M=void 0;(T+=f)>=p&&v<m?(M=b[++v],T-=p):M=A[++y],r.push(M)}r[t+0]=r[r.length-3],r[t+1]=r[r.length-2],r[t+2]=r[r.length-1],r.length=r.length-3},e.prototype._generateEdgesLinesAlternate=function(){var e,t,r,n,o,s,l,c,u,d=this._source.getVerticesData(i.VertexBuffer.PositionKind),h=this._source.getIndices();if(h&&d){Array.isArray(h)||(h=Array.from(h));var f=null===(t=null===(e=this._options)||void 0===e?void 0:e.useFastVertexMerger)||void 0===t||t,p=f?Math.round(-Math.log(null!==(n=null===(r=this._options)||void 0===r?void 0:r.epsilonVertexMerge)&&void 0!==n?n:1e-6)/Math.log(10)):null!==(s=null===(o=this._options)||void 0===o?void 0:o.epsilonVertexMerge)&&void 0!==s?s:1e-6,m=[],g=[];if(f)for(var _={},v=0;v<d.length;v+=3){var y=d[v+0],b=d[v+1],A=d[v+2];if(void 0!==_[te=y.toFixed(p)+"|"+b.toFixed(p)+"|"+A.toFixed(p)])m.push(_[te]);else{var T=v/3;_[te]=T,m.push(T),g.push(T)}}else for(v=0;v<d.length;v+=3){y=d[v+0],b=d[v+1],A=d[v+2];for(var M=!1,P=0;P<v&&!M;P+=3){var S=d[P+0],E=d[P+1],C=d[P+2];if(Math.abs(y-S)<p&&Math.abs(b-E)<p&&Math.abs(A-C)<p){m.push(P/3),M=!0;break}}M||(m.push(v/3),g.push(v/3))}if(null===(l=this._options)||void 0===l?void 0:l.applyTessellation){for(var x=null!==(u=null===(c=this._options)||void 0===c?void 0:c.epsilonVertexAligned)&&void 0!==u?u:1e-6,R=[],O=0;O<h.length;O+=3)for(var I=void 0,D=0;D<3;++D){var B=m[h[O+D]],N=m[h[O+(D+1)%3]],L=m[h[O+(D+2)%3]];if(B!==N)for(var w=d[3*B+0],F=d[3*B+1],V=d[3*B+2],k=d[3*N+0],U=d[3*N+1],z=d[3*N+2],G=Math.sqrt((k-w)*(k-w)+(U-F)*(U-F)+(z-V)*(z-V)),j=0;j<g.length-1;j++){var H=g[j];if(H!==B&&H!==N&&H!==L){var W=d[3*H+0],X=d[3*H+1],Y=d[3*H+2],Q=Math.sqrt((W-w)*(W-w)+(X-F)*(X-F)+(Y-V)*(Y-V)),K=Math.sqrt((W-k)*(W-k)+(X-U)*(X-U)+(Y-z)*(Y-z));Math.abs(Q+K-G)<x&&(I||(I={index:O,edgesPoints:[[],[],[]]},R.push(I)),I.edgesPoints[D].push([H,Q]))}}}for(var q=0;q<R.length;++q){var Z=R[q];this._tessellateTriangle(Z.edgesPoints,Z.index,h,m)}R=null}var J={};for(O=0;O<h.length;O+=3){var $=void 0;for(D=0;D<3;++D)if(B=m[h[O+D]],N=m[h[O+(D+1)%3]],L=m[h[O+(D+2)%3]],B!==N){if(a.TmpVectors.Vector3[0].copyFromFloats(d[3*B+0],d[3*B+1],d[3*B+2]),a.TmpVectors.Vector3[1].copyFromFloats(d[3*N+0],d[3*N+1],d[3*N+2]),a.TmpVectors.Vector3[2].copyFromFloats(d[3*L+0],d[3*L+1],d[3*L+2]),$||(a.TmpVectors.Vector3[1].subtractToRef(a.TmpVectors.Vector3[0],a.TmpVectors.Vector3[3]),a.TmpVectors.Vector3[2].subtractToRef(a.TmpVectors.Vector3[1],a.TmpVectors.Vector3[4]),($=a.Vector3.Cross(a.TmpVectors.Vector3[3],a.TmpVectors.Vector3[4])).normalize()),B>N){var ee=B;B=N,N=ee}(re=J[te=B+"_"+N])?re.done||(a.Vector3.Dot($,re.normal)<this._epsilon&&this.createLine(a.TmpVectors.Vector3[0],a.TmpVectors.Vector3[1],this._linesPositions.length/3),re.done=!0):J[te]={normal:$,done:!1,index:O,i:D}}}for(var te in J){var re;(re=J[te]).done||(B=m[h[re.index+re.i]],N=m[h[re.index+(re.i+1)%3]],a.TmpVectors.Vector3[0].copyFromFloats(d[3*B+0],d[3*B+1],d[3*B+2]),a.TmpVectors.Vector3[1].copyFromFloats(d[3*N+0],d[3*N+1],d[3*N+2]),this.createLine(a.TmpVectors.Vector3[0],a.TmpVectors.Vector3[1],this._linesPositions.length/3))}var ne=this._source.getScene().getEngine();this._buffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(ne,this._linesPositions,i.VertexBuffer.PositionKind,!1),this._buffers[i.VertexBuffer.NormalKind]=new i.VertexBuffer(ne,this._linesNormals,i.VertexBuffer.NormalKind,!1,!1,4),this._buffersForInstances[i.VertexBuffer.PositionKind]=this._buffers[i.VertexBuffer.PositionKind],this._buffersForInstances[i.VertexBuffer.NormalKind]=this._buffers[i.VertexBuffer.NormalKind],this._ib=ne.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},e.prototype._generateEdgesLines=function(){var e=this._source.getVerticesData(i.VertexBuffer.PositionKind),t=this._source.getIndices();if(t&&e){var r,n,o=new Array,s=new Array;for(r=0;r<t.length;r+=3){n=new f;var l=t[r],c=t[r+1],u=t[r+2];n.p0=new a.Vector3(e[3*l],e[3*l+1],e[3*l+2]),n.p1=new a.Vector3(e[3*c],e[3*c+1],e[3*c+2]),n.p2=new a.Vector3(e[3*u],e[3*u+1],e[3*u+2]);var d=a.Vector3.Cross(n.p1.subtract(n.p0),n.p2.subtract(n.p1));d.normalize(),s.push(d),o.push(n)}for(r=0;r<o.length;r++){n=o[r];for(var h=r+1;h<o.length;h++){var p=o[h];if(3===n.edgesConnectedCount)break;if(3!==p.edgesConnectedCount)for(var m=t[3*h],g=t[3*h+1],_=t[3*h+2],v=0;v<3;v++){var y=0;if(void 0===n.edges[v]){switch(v){case 0:y=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p0,n.p1,p.p0,p.p1,p.p2):this._processEdgeForAdjacencies(t[3*r],t[3*r+1],m,g,_);break;case 1:y=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p1,n.p2,p.p0,p.p1,p.p2):this._processEdgeForAdjacencies(t[3*r+1],t[3*r+2],m,g,_);break;case 2:y=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p2,n.p0,p.p0,p.p1,p.p2):this._processEdgeForAdjacencies(t[3*r+2],t[3*r],m,g,_)}if(-1!==y&&(n.edges[v]=h,p.edges[y]=r,n.edgesConnectedCount++,p.edgesConnectedCount++,3===n.edgesConnectedCount))break}}}}for(r=0;r<o.length;r++){var b=o[r];this._checkEdge(r,b.edges[0],s,b.p0,b.p1),this._checkEdge(r,b.edges[1],s,b.p1,b.p2),this._checkEdge(r,b.edges[2],s,b.p2,b.p0)}var A=this._source.getScene().getEngine();this._buffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(A,this._linesPositions,i.VertexBuffer.PositionKind,!1),this._buffers[i.VertexBuffer.NormalKind]=new i.VertexBuffer(A,this._linesNormals,i.VertexBuffer.NormalKind,!1,!1,4),this._buffersForInstances[i.VertexBuffer.PositionKind]=this._buffers[i.VertexBuffer.PositionKind],this._buffersForInstances[i.VertexBuffer.NormalKind]=this._buffers[i.VertexBuffer.NormalKind],this._ib=A.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},e.prototype.isReady=function(){return this._lineShader.isReady(this._source,this._source.hasInstances&&this.customInstances.length>0||this._source.hasThinInstances)},e.prototype.render=function(){var e=this._source.getScene();if(this.isReady()&&e.activeCamera){var t=e.getEngine();this._lineShader._preBind(),1!==this._source.edgesColor.a?t.setAlphaMode(d.Constants.ALPHA_COMBINE):t.setAlphaMode(d.Constants.ALPHA_DISABLE);var r=this._source.hasInstances&&this.customInstances.length>0,n=r||this._source.hasThinInstances,i=0;if(n)if(this._buffersForInstances.world0=this._source.getVertexBuffer("world0"),this._buffersForInstances.world1=this._source.getVertexBuffer("world1"),this._buffersForInstances.world2=this._source.getVertexBuffer("world2"),this._buffersForInstances.world3=this._source.getVertexBuffer("world3"),r){var o=this._source._instanceDataStorage;if(i=this.customInstances.length,!o.isFrozen){for(var s=0,a=0;a<i;++a)this.customInstances.data[a].copyToArray(o.instancesData,s),s+=16;o.instancesBuffer.updateDirectly(o.instancesData,0,i)}}else i=this._source.thinInstanceCount;t.bindBuffers(n?this._buffersForInstances:this._buffers,this._ib,this._lineShader.getEffect()),e.resetCachedMaterial(),this._lineShader.setColor4("color",this._source.edgesColor),e.activeCamera.mode===u.Camera.ORTHOGRAPHIC_CAMERA?this._lineShader.setFloat("width",this._source.edgesWidth/this.edgesWidthScalerForOrthographic):this._lineShader.setFloat("width",this._source.edgesWidth/this.edgesWidthScalerForPerspective),this._lineShader.setFloat("aspectRatio",t.getAspectRatio(e.activeCamera)),this._lineShader.bind(this._source.getWorldMatrix()),t.drawElementsType(l.Material.TriangleFillMode,0,this._indicesCount,i),this._lineShader.unbind(),this.customInstances.reset()}},e}(),m=function(e){function t(t,r,n){void 0===r&&(r=.95),void 0===n&&(n=!1);var i=e.call(this,t,r,n,!1)||this;return i._generateEdgesLines(),i}return Object(n.__extends)(t,e),t.prototype._generateEdgesLines=function(){var e=this._source.getVerticesData(i.VertexBuffer.PositionKind),t=this._source.getIndices();if(t&&e){for(var r=a.TmpVectors.Vector3[0],n=a.TmpVectors.Vector3[1],o=t.length-1,s=0,l=0;s<o;s+=2,l+=4)a.Vector3.FromArrayToRef(e,3*t[s],r),a.Vector3.FromArrayToRef(e,3*t[s+1],n),this.createLine(r,n,l);var c=this._source.getScene().getEngine();this._buffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(c,this._linesPositions,i.VertexBuffer.PositionKind,!1),this._buffers[i.VertexBuffer.NormalKind]=new i.VertexBuffer(c,this._linesNormals,i.VertexBuffer.NormalKind,!1,!1,4),this._ib=c.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},t}(p)},"./Rendering/geometryBufferRenderer.ts":
- /*!*********************************************!*\
- !*** ./Rendering/geometryBufferRenderer.ts ***!
- \*********************************************/
- /*! exports provided: GeometryBufferRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"GeometryBufferRenderer",(function(){return f}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../Materials/Textures/multiRenderTarget */"./Materials/Textures/multiRenderTarget.ts"),l=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),c=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),u=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),d=r(/*! ../Materials/PBR/pbrMaterial */"./Materials/PBR/pbrMaterial.ts"),h=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),f=(r(/*! ../Shaders/geometry.fragment */"./Shaders/geometry.fragment.ts"),r(/*! ../Shaders/geometry.vertex */"./Shaders/geometry.vertex.ts"),function(){function e(t,r){void 0===r&&(r=1),this._previousTransformationMatrices={},this._previousBonesTransformationMatrices={},this.excludedSkinnedMeshesFromVelocity=[],this.renderTransparentMeshes=!0,this._resizeObserver=null,this._enablePosition=!1,this._enableVelocity=!1,this._enableReflectivity=!1,this._positionIndex=-1,this._velocityIndex=-1,this._reflectivityIndex=-1,this._scene=t,this._ratio=r,e._SceneComponentInitialization(this._scene),this._createRenderTargets()}return Object.defineProperty(e.prototype,"renderList",{set:function(e){this._multiRenderTarget.renderList=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._multiRenderTarget.isSupported},enumerable:!1,configurable:!0}),e.prototype.getTextureIndex=function(t){switch(t){case e.POSITION_TEXTURE_TYPE:return this._positionIndex;case e.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;case e.REFLECTIVITY_TEXTURE_TYPE:return this._reflectivityIndex;default:return-1}},Object.defineProperty(e.prototype,"enablePosition",{get:function(){return this._enablePosition},set:function(e){this._enablePosition=e,this.dispose(),this._createRenderTargets()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableVelocity",{get:function(){return this._enableVelocity},set:function(e){this._enableVelocity=e,e||(this._previousTransformationMatrices={}),this.dispose(),this._createRenderTargets()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableReflectivity",{get:function(){return this._enableReflectivity},set:function(e){this._enableReflectivity=e,this.dispose(),this._createRenderTargets()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ratio",{get:function(){return this._ratio},enumerable:!1,configurable:!0}),e.prototype.isReady=function(e,t){var r=e.getMaterial();if(r&&r.disableDepthWrite)return!1;var n=[],o=[i.VertexBuffer.PositionKind,i.VertexBuffer.NormalKind],s=e.getMesh();if(r){var a=!1;r.needAlphaTesting()&&(n.push("#define ALPHATEST"),a=!0),r.bumpTexture&&u.StandardMaterial.BumpTextureEnabled&&(n.push("#define BUMP"),n.push("#define BUMPDIRECTUV 0"),a=!0),this._enableReflectivity&&(r instanceof u.StandardMaterial&&r.specularTexture?(n.push("#define HAS_SPECULAR"),a=!0):r instanceof d.PBRMaterial&&r.reflectivityTexture&&(n.push("#define HAS_REFLECTIVITY"),a=!0)),a&&(n.push("#define NEED_UV"),s.isVerticesDataPresent(i.VertexBuffer.UVKind)&&(o.push(i.VertexBuffer.UVKind),n.push("#define UV1")),s.isVerticesDataPresent(i.VertexBuffer.UV2Kind)&&(o.push(i.VertexBuffer.UV2Kind),n.push("#define UV2")))}this._enablePosition&&(n.push("#define POSITION"),n.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(n.push("#define VELOCITY"),n.push("#define VELOCITY_INDEX "+this._velocityIndex),-1===this.excludedSkinnedMeshesFromVelocity.indexOf(s)&&n.push("#define BONES_VELOCITY_ENABLED")),this._enableReflectivity&&(n.push("#define REFLECTIVITY"),n.push("#define REFLECTIVITY_INDEX "+this._reflectivityIndex)),s.useBones&&s.computeBonesUsingShaders?(o.push(i.VertexBuffer.MatricesIndicesKind),o.push(i.VertexBuffer.MatricesWeightsKind),s.numBoneInfluencers>4&&(o.push(i.VertexBuffer.MatricesIndicesExtraKind),o.push(i.VertexBuffer.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),n.push("#define BonesPerMesh "+(s.skeleton?s.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0");var c=s.morphTargetManager,h=0;c&&c.numInfluencers>0&&(h=c.numInfluencers,n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+h),l.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(o,s,h)),t&&(n.push("#define INSTANCES"),l.MaterialHelper.PushAttributesForInstances(o),e.getRenderingMesh().hasThinInstances&&n.push("#define THIN_INSTANCES")),n.push("#define RENDER_TARGET_COUNT "+this._multiRenderTarget.textures.length);var f=n.join("\n");return this._cachedDefines!==f&&(this._cachedDefines=f,this._effect=this._scene.getEngine().createEffect("geometry",o,["world","mBones","viewProjection","diffuseMatrix","view","previousWorld","previousViewProjection","mPreviousBones","morphTargetInfluences","bumpMatrix","reflectivityMatrix","vTangentSpaceParams","vBumpInfos"],["diffuseSampler","bumpSampler","reflectivitySampler"],f,void 0,void 0,void 0,{buffersCount:this._multiRenderTarget.textures.length-1,maxSimultaneousMorphTargets:h})),this._effect.isReady()},e.prototype.getGBuffer=function(){return this._multiRenderTarget},Object.defineProperty(e.prototype,"samples",{get:function(){return this._multiRenderTarget.samples},set:function(e){this._multiRenderTarget.samples=e},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._resizeObserver&&(this._scene.getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null),this.getGBuffer().dispose()},e.prototype._createRenderTargets=function(){var e=this,t=this._scene.getEngine(),r=2;if(this._enablePosition&&(this._positionIndex=r,r++),this._enableVelocity&&(this._velocityIndex=r,r++),this._enableReflectivity&&(this._reflectivityIndex=r,r++),this._multiRenderTarget=new a.MultiRenderTarget("gBuffer",{width:t.getRenderWidth()*this._ratio,height:t.getRenderHeight()*this._ratio},r,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:o.Constants.TEXTURETYPE_FLOAT}),this.isSupported){this._multiRenderTarget.wrapU=s.Texture.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=s.Texture.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null,this._multiRenderTarget.onClearObservable.add((function(e){e.clear(new c.Color4(0,0,0,1),!0,!0,!0)})),this._resizeObserver=t.onResizeObservable.add((function(){e._multiRenderTarget&&e._multiRenderTarget.resize({width:t.getRenderWidth()*e._ratio,height:t.getRenderHeight()*e._ratio})}));var i=function(t){var r=t.getRenderingMesh(),i=t.getEffectiveMesh(),o=e._scene,s=o.getEngine(),a=t.getMaterial();if(a){if(i._internalAbstractMeshDataInfo._isActiveIntermediate=!1,e._enableVelocity&&!e._previousTransformationMatrices[i.uniqueId]&&(e._previousTransformationMatrices[i.uniqueId]={world:n.Matrix.Identity(),viewProjection:o.getTransformMatrix()},r.skeleton)){var c=r.skeleton.getTransformMatrices(r);e._previousBonesTransformationMatrices[r.uniqueId]=e._copyBonesTransformationMatrices(c,new Float32Array(c.length))}s.setState(a.backFaceCulling,0,!1,o.useRightHandedSystem);var h=r._getInstancesRenderList(t._id,!!t.getReplacementMesh());if(!h.mustReturn){var f=s.getCaps().instancedArrays&&(null!==h.visibleInstances[t._id]||r.hasThinInstances),p=i.getWorldMatrix();if(e.isReady(t,f)){if(s.enableEffect(e._effect),r._bind(t,e._effect,a.fillMode),e._effect.setMatrix("viewProjection",o.getTransformMatrix()),e._effect.setMatrix("view",o.getViewMatrix()),a){if(a.needAlphaTesting()){var m=a.getAlphaTestTexture();m&&(e._effect.setTexture("diffuseSampler",m),e._effect.setMatrix("diffuseMatrix",m.getTextureMatrix()))}a.bumpTexture&&o.getEngine().getCaps().standardDerivatives&&u.StandardMaterial.BumpTextureEnabled&&(e._effect.setFloat3("vBumpInfos",a.bumpTexture.coordinatesIndex,1/a.bumpTexture.level,a.parallaxScaleBias),e._effect.setMatrix("bumpMatrix",a.bumpTexture.getTextureMatrix()),e._effect.setTexture("bumpSampler",a.bumpTexture),e._effect.setFloat2("vTangentSpaceParams",a.invertNormalMapX?-1:1,a.invertNormalMapY?-1:1)),e._enableReflectivity&&(a instanceof u.StandardMaterial&&a.specularTexture?(e._effect.setMatrix("reflectivityMatrix",a.specularTexture.getTextureMatrix()),e._effect.setTexture("reflectivitySampler",a.specularTexture)):a instanceof d.PBRMaterial&&a.reflectivityTexture&&(e._effect.setMatrix("reflectivityMatrix",a.reflectivityTexture.getTextureMatrix()),e._effect.setTexture("reflectivitySampler",a.reflectivityTexture)))}r.useBones&&r.computeBonesUsingShaders&&r.skeleton&&(e._effect.setMatrices("mBones",r.skeleton.getTransformMatrices(r)),e._enableVelocity&&e._effect.setMatrices("mPreviousBones",e._previousBonesTransformationMatrices[r.uniqueId])),l.MaterialHelper.BindMorphTargetParameters(r,e._effect),e._enableVelocity&&(e._effect.setMatrix("previousWorld",e._previousTransformationMatrices[i.uniqueId].world),e._effect.setMatrix("previousViewProjection",e._previousTransformationMatrices[i.uniqueId].viewProjection)),r._processRendering(i,t,e._effect,a.fillMode,h,f,(function(t,r){return e._effect.setMatrix("world",r)}))}e._enableVelocity&&(e._previousTransformationMatrices[i.uniqueId].world=p.clone(),e._previousTransformationMatrices[i.uniqueId].viewProjection=e._scene.getTransformMatrix().clone(),r.skeleton&&e._copyBonesTransformationMatrices(r.skeleton.getTransformMatrices(r),e._previousBonesTransformationMatrices[i.uniqueId]))}}};this._multiRenderTarget.customRenderFunction=function(r,n,o,s){var a;if(s.length){for(t.setColorWrite(!1),a=0;a<s.length;a++)i(s.data[a]);t.setColorWrite(!0)}for(a=0;a<r.length;a++)i(r.data[a]);for(a=0;a<n.length;a++)i(n.data[a]);if(e.renderTransparentMeshes)for(a=0;a<o.length;a++)i(o.data[a])}}},e.prototype._copyBonesTransformationMatrices=function(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t},e.POSITION_TEXTURE_TYPE=1,e.VELOCITY_TEXTURE_TYPE=2,e.REFLECTIVITY_TEXTURE_TYPE=3,e._SceneComponentInitialization=function(e){throw h._DevTools.WarnImport("GeometryBufferRendererSceneComponent")},e}())},"./Rendering/geometryBufferRendererSceneComponent.ts":
- /*!***********************************************************!*\
- !*** ./Rendering/geometryBufferRendererSceneComponent.ts ***!
- \***********************************************************/
- /*! exports provided: GeometryBufferRendererSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"GeometryBufferRendererSceneComponent",(function(){return s}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../sceneComponent */"./sceneComponent.ts"),o=r(/*! ./geometryBufferRenderer */"./Rendering/geometryBufferRenderer.ts");Object.defineProperty(n.Scene.prototype,"geometryBufferRenderer",{get:function(){this._geometryBufferRenderer},set:function(e){e&&e.isSupported&&(this._geometryBufferRenderer=e)},enumerable:!0,configurable:!0}),n.Scene.prototype.enableGeometryBufferRenderer=function(e){return void 0===e&&(e=1),this._geometryBufferRenderer||(this._geometryBufferRenderer=new o.GeometryBufferRenderer(this,e),this._geometryBufferRenderer.isSupported||(this._geometryBufferRenderer=null)),this._geometryBufferRenderer},n.Scene.prototype.disableGeometryBufferRenderer=function(){this._geometryBufferRenderer&&(this._geometryBufferRenderer.dispose(),this._geometryBufferRenderer=null)};var s=function(){function e(e){this.name=i.SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(i.SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER,this,this._gatherRenderTargets)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._gatherRenderTargets=function(e){this.scene._geometryBufferRenderer&&e.push(this.scene._geometryBufferRenderer.getGBuffer())},e}();o.GeometryBufferRenderer._SceneComponentInitialization=function(e){var t=e._getComponent(i.SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER);t||(t=new s(e),e._addComponent(t))}},"./Rendering/index.ts":
- /*!****************************!*\
- !*** ./Rendering/index.ts ***!
- \****************************/
- /*! exports provided: BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, PrePassRenderer, PrePassRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./boundingBoxRenderer */"./Rendering/boundingBoxRenderer.ts");r.d(t,"BoundingBoxRenderer",(function(){return n.BoundingBoxRenderer}));var i=r(/*! ./depthRenderer */"./Rendering/depthRenderer.ts");r.d(t,"DepthRenderer",(function(){return i.DepthRenderer}));var o=r(/*! ./depthRendererSceneComponent */"./Rendering/depthRendererSceneComponent.ts");r.d(t,"DepthRendererSceneComponent",(function(){return o.DepthRendererSceneComponent}));var s=r(/*! ./edgesRenderer */"./Rendering/edgesRenderer.ts");r.d(t,"EdgesRenderer",(function(){return s.EdgesRenderer})),r.d(t,"LineEdgesRenderer",(function(){return s.LineEdgesRenderer}));var a=r(/*! ./geometryBufferRenderer */"./Rendering/geometryBufferRenderer.ts");r.d(t,"GeometryBufferRenderer",(function(){return a.GeometryBufferRenderer}));var l=r(/*! ./geometryBufferRendererSceneComponent */"./Rendering/geometryBufferRendererSceneComponent.ts");r.d(t,"GeometryBufferRendererSceneComponent",(function(){return l.GeometryBufferRendererSceneComponent}));var c=r(/*! ./prePassRenderer */"./Rendering/prePassRenderer.ts");r.d(t,"PrePassRenderer",(function(){return c.PrePassRenderer}));var u=r(/*! ./prePassRendererSceneComponent */"./Rendering/prePassRendererSceneComponent.ts");r.d(t,"PrePassRendererSceneComponent",(function(){return u.PrePassRendererSceneComponent}));var d=r(/*! ./outlineRenderer */"./Rendering/outlineRenderer.ts");r.d(t,"OutlineRenderer",(function(){return d.OutlineRenderer}));var h=r(/*! ./renderingGroup */"./Rendering/renderingGroup.ts");r.d(t,"RenderingGroup",(function(){return h.RenderingGroup}));var f=r(/*! ./renderingManager */"./Rendering/renderingManager.ts");r.d(t,"RenderingGroupInfo",(function(){return f.RenderingGroupInfo})),r.d(t,"RenderingManager",(function(){return f.RenderingManager}));var p=r(/*! ./utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts");r.d(t,"UtilityLayerRenderer",(function(){return p.UtilityLayerRenderer}))},"./Rendering/outlineRenderer.ts":
- /*!**************************************!*\
- !*** ./Rendering/outlineRenderer.ts ***!
- \**************************************/
- /*! exports provided: OutlineRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"OutlineRenderer",(function(){return c}));var n=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),i=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),o=r(/*! ../scene */"./scene.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../sceneComponent */"./sceneComponent.ts"),l=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts");r(/*! ../Shaders/outline.fragment */"./Shaders/outline.fragment.ts"),r(/*! ../Shaders/outline.vertex */"./Shaders/outline.vertex.ts"),o.Scene.prototype.getOutlineRenderer=function(){return this._outlineRenderer||(this._outlineRenderer=new c(this)),this._outlineRenderer},Object.defineProperty(i.Mesh.prototype,"renderOutline",{get:function(){return this._renderOutline},set:function(e){e&&this.getScene().getOutlineRenderer(),this._renderOutline=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.Mesh.prototype,"renderOverlay",{get:function(){return this._renderOverlay},set:function(e){e&&this.getScene().getOutlineRenderer(),this._renderOverlay=e},enumerable:!0,configurable:!0});var c=function(){function e(e){this.name=a.SceneComponentConstants.NAME_OUTLINERENDERER,this.zOffset=1,this.scene=e,this._engine=e.getEngine(),this.scene._addComponent(this)}return e.prototype.register=function(){this.scene._beforeRenderingMeshStage.registerStep(a.SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE,this,this._beforeRenderingMesh),this.scene._afterRenderingMeshStage.registerStep(a.SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE,this,this._afterRenderingMesh)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype.render=function(e,t,r){var n=this;void 0===r&&(r=!1);var i=this.scene,o=i.getEngine(),s=o.getCaps().instancedArrays&&(null!==t.visibleInstances[e._id]&&void 0!==t.visibleInstances[e._id]||e.getRenderingMesh().hasThinInstances);if(this.isReady(e,s)){var a=e.getMesh(),c=a._internalAbstractMeshDataInfo._actAsRegularMesh?a:null,u=e.getRenderingMesh(),d=c||u,h=e.getMaterial();if(h&&i.activeCamera){if(o.enableEffect(this._effect),h.useLogarithmicDepth&&this._effect.setFloat("logarithmicDepthConstant",2/(Math.log(i.activeCamera.maxZ+1)/Math.LN2)),this._effect.setFloat("offset",r?0:u.outlineWidth),this._effect.setColor4("color",r?u.overlayColor:u.outlineColor,r?u.overlayAlpha:h.alpha),this._effect.setMatrix("viewProjection",i.getTransformMatrix()),u.useBones&&u.computeBonesUsingShaders&&u.skeleton&&this._effect.setMatrices("mBones",u.skeleton.getTransformMatrices(u)),l.MaterialHelper.BindMorphTargetParameters(u,this._effect),u._bind(e,this._effect,h.fillMode),h&&h.needAlphaTesting()){var f=h.getAlphaTestTexture();f&&(this._effect.setTexture("diffuseSampler",f),this._effect.setMatrix("diffuseMatrix",f.getTextureMatrix()))}o.setZOffset(-this.zOffset),u._processRendering(d,e,this._effect,h.fillMode,t,s,(function(e,t){n._effect.setMatrix("world",t)})),o.setZOffset(0)}}},e.prototype.isReady=function(e,t){var r=[],i=[n.VertexBuffer.PositionKind,n.VertexBuffer.NormalKind],o=e.getMesh(),s=e.getMaterial();s&&(s.needAlphaTesting()&&(r.push("#define ALPHATEST"),o.isVerticesDataPresent(n.VertexBuffer.UVKind)&&(i.push(n.VertexBuffer.UVKind),r.push("#define UV1")),o.isVerticesDataPresent(n.VertexBuffer.UV2Kind)&&(i.push(n.VertexBuffer.UV2Kind),r.push("#define UV2"))),s.useLogarithmicDepth&&r.push("#define LOGARITHMICDEPTH")),o.useBones&&o.computeBonesUsingShaders?(i.push(n.VertexBuffer.MatricesIndicesKind),i.push(n.VertexBuffer.MatricesWeightsKind),o.numBoneInfluencers>4&&(i.push(n.VertexBuffer.MatricesIndicesExtraKind),i.push(n.VertexBuffer.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),r.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):r.push("#define NUM_BONE_INFLUENCERS 0");var a=o.morphTargetManager,c=0;a&&a.numInfluencers>0&&(c=a.numInfluencers,r.push("#define MORPHTARGETS"),r.push("#define NUM_MORPH_INFLUENCERS "+c),l.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(i,o,c)),t&&(r.push("#define INSTANCES"),l.MaterialHelper.PushAttributesForInstances(i),e.getRenderingMesh().hasThinInstances&&r.push("#define THIN_INSTANCES"));var u=r.join("\n");return this._cachedDefines!==u&&(this._cachedDefines=u,this._effect=this.scene.getEngine().createEffect("outline",i,["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant","morphTargetInfluences"],["diffuseSampler"],u,void 0,void 0,void 0,{maxSimultaneousMorphTargets:c})),this._effect.isReady()},e.prototype._beforeRenderingMesh=function(t,r,n){if(this._savedDepthWrite=this._engine.getDepthWrite(),t.renderOutline){var i=r.getMaterial();i&&i.needAlphaBlendingForMesh(t)&&(this._engine.cacheStencilState(),this._engine.setDepthWrite(!1),this._engine.setColorWrite(!1),this._engine.setStencilBuffer(!0),this._engine.setStencilOperationPass(s.Constants.REPLACE),this._engine.setStencilFunction(s.Constants.ALWAYS),this._engine.setStencilMask(e._StencilReference),this._engine.setStencilFunctionReference(e._StencilReference),this.render(r,n,!0),this._engine.setColorWrite(!0),this._engine.setStencilFunction(s.Constants.NOTEQUAL)),this._engine.setDepthWrite(!1),this.render(r,n),this._engine.setDepthWrite(this._savedDepthWrite),i&&i.needAlphaBlendingForMesh(t)&&this._engine.restoreStencilState()}},e.prototype._afterRenderingMesh=function(e,t,r){if(e.renderOverlay){var n=this._engine.getAlphaMode(),i=this._engine.alphaState.alphaBlend;this._engine.setAlphaMode(s.Constants.ALPHA_COMBINE),this.render(t,r,!0),this._engine.setAlphaMode(n),this._engine.setDepthWrite(this._savedDepthWrite),this._engine.alphaState.alphaBlend=i}e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,r),this._engine.setColorWrite(!0))},e._StencilReference=4,e}()},"./Rendering/prePassRenderer.ts":
- /*!**************************************!*\
- !*** ./Rendering/prePassRenderer.ts ***!
- \**************************************/
- /*! exports provided: PrePassRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"PrePassRenderer",(function(){return c}));var n=r(/*! ../Materials/Textures/multiRenderTarget */"./Materials/Textures/multiRenderTarget.ts"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ../PostProcesses/imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts"),s=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ./subSurfaceConfiguration */"./Rendering/subSurfaceConfiguration.ts"),c=function(){function e(t){this._isDirty=!1,this.mrtCount=4,this._mrtTypes=[i.Constants.TEXTURETYPE_HALF_FLOAT,i.Constants.TEXTURETYPE_HALF_FLOAT,i.Constants.TEXTURETYPE_HALF_FLOAT,i.Constants.TEXTURETYPE_UNSIGNED_INT],this._postProcesses=[],this._clearColor=new a.Color4(0,0,0,0),this.materialsShouldRenderGeometry=!1,this.materialsShouldRenderIrradiance=!1,this._enabled=!1,this._scene=t,this._engine=t.getEngine(),e._SceneComponentInitialization(this._scene),this.subSurfaceConfiguration=new l.SubSurfaceConfiguration(this._scene)}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"samples",{get:function(){return this.prePassRT.samples},set:function(e){this.imageProcessingPostProcess||this._createCompositionEffect(),this.prePassRT.samples=e},enumerable:!1,configurable:!0}),e.prototype._initializeAttachments=function(){var e=this._engine._gl;this._multiRenderAttachments=[],this._clearAttachments=[e.NONE],this._defaultAttachments=[e.COLOR_ATTACHMENT0];for(var t=0;t<this.mrtCount;t++)this._multiRenderAttachments.push(e["COLOR_ATTACHMENT"+t]),t>0&&(this._clearAttachments.push(e["COLOR_ATTACHMENT"+t]),this._defaultAttachments.push(e.NONE))},e.prototype._createCompositionEffect=function(){this.prePassRT=new n.MultiRenderTarget("sceneprePassRT",{width:this._engine.getRenderWidth(),height:this._engine.getRenderHeight()},this.mrtCount,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:i.Constants.TEXTURETYPE_UNSIGNED_INT,types:this._mrtTypes}),this.prePassRT.samples=1,this._initializeAttachments(),this.imageProcessingPostProcess=new o.ImageProcessingPostProcess("sceneCompositionPass",1,null,void 0,this._engine),this.imageProcessingPostProcess.autoClear=!1},Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._engine.webGLVersion>1},enumerable:!1,configurable:!0}),e.prototype.bindAttachmentsForEffect=function(e){this.enabled&&(e._multiTarget?this._engine.bindAttachments(this._multiRenderAttachments):this._engine.bindAttachments(this._defaultAttachments))},e.prototype._beforeCameraDraw=function(){this._isDirty&&this._update(),this._bindFrameBuffer()},e.prototype._afterCameraDraw=function(){if(this._enabled){var e=this._scene.activeCamera&&this._scene.activeCamera._getFirstPostProcess();e&&this._scene.postProcessManager._prepareFrame(),this._scene.postProcessManager.directRender(this._postProcesses,e?e.inputTexture:null)}},e.prototype._checkRTSize=function(){var e=this._engine.getRenderWidth(!0),t=this._engine.getRenderHeight(!0),r=this.prePassRT.getRenderWidth(),n=this.prePassRT.getRenderHeight();r===e&&n===t||(this.prePassRT.resize({width:e,height:t}),this._bindPostProcessChain())},e.prototype._bindFrameBuffer=function(){if(this._enabled){this._checkRTSize();var e=this.prePassRT.getInternalTexture();e&&this._engine.bindFramebuffer(e)}},e.prototype.clear=function(){this._enabled&&(this._bindFrameBuffer(),this._engine.clear(this._scene.clearColor,this._scene.autoClear||this._scene.forceWireframe||this._scene.forcePointsCloud,this._scene.autoClearDepthAndStencil,this._scene.autoClearDepthAndStencil),this._engine.bindAttachments(this._clearAttachments),this._engine.clear(this._clearColor,!0,!1,!1),this._engine.bindAttachments(this._multiRenderAttachments))},e.prototype._setState=function(e){this._enabled=e,this._scene.prePass=e,this.imageProcessingPostProcess&&(this.imageProcessingPostProcess.imageProcessingConfiguration.applyByPostProcess=e)},e.prototype._enable=function(){this._resetPostProcessChain(),this.subSurfaceConfiguration.enabled&&(this.subSurfaceConfiguration.postProcess||this.subSurfaceConfiguration.createPostProcess(),this._postProcesses.push(this.subSurfaceConfiguration.postProcess)),this.imageProcessingPostProcess||this._createCompositionEffect(),this._postProcesses.push(this.imageProcessingPostProcess),this._bindPostProcessChain(),this._setState(!0)},e.prototype._disable=function(){this._setState(!1),this.subSurfaceConfiguration.enabled=!1,this.materialsShouldRenderGeometry=!1,this.materialsShouldRenderIrradiance=!1},e.prototype._resetPostProcessChain=function(){this._postProcesses=[],this.imageProcessingPostProcess&&this.imageProcessingPostProcess.restoreDefaultInputTexture(),this.subSurfaceConfiguration.postProcess&&this.subSurfaceConfiguration.postProcess.restoreDefaultInputTexture()},e.prototype._bindPostProcessChain=function(){this._postProcesses[0].inputTexture=this.prePassRT.getInternalTexture()},e.prototype.markAsDirty=function(){this._isDirty=!0},e.prototype._update=function(){this._disable();for(var e=!1,t=0;t<this._scene.materials.length;t++)this._scene.materials[t].setPrePassRenderer(this)&&(e=!0);var r=this._scene.postProcessRenderPipelineManager.supportedPipelines;for(t=0;t<r.length;t++)r[t].setPrePassRenderer(this)&&(e=!0);this._isDirty=!1,e&&this._enable(),this.enabled||this._engine.bindAttachments(this._defaultAttachments)},e.prototype.dispose=function(){this.imageProcessingPostProcess.dispose(),this.subSurfaceConfiguration.dispose(),this.prePassRT.dispose()},e._SceneComponentInitialization=function(e){throw s._DevTools.WarnImport("PrePassRendererSceneComponent")},e}()},"./Rendering/prePassRendererSceneComponent.ts":
- /*!****************************************************!*\
- !*** ./Rendering/prePassRendererSceneComponent.ts ***!
- \****************************************************/
- /*! exports provided: PrePassRendererSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"PrePassRendererSceneComponent",(function(){return c}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../sceneComponent */"./sceneComponent.ts"),o=r(/*! ./prePassRenderer */"./Rendering/prePassRenderer.ts"),s=r(/*! ../abstractScene */"./abstractScene.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ../Misc/logger */"./Misc/logger.ts");s.AbstractScene.AddParser(i.SceneComponentConstants.NAME_PREPASSRENDERER,(function(e,t){if(void 0!==e.ssDiffusionProfileColors&&null!==e.ssDiffusionProfileColors&&(t.enablePrePassRenderer(),t.prePassRenderer))for(var r=0,n=e.ssDiffusionProfileColors.length;r<n;r++){var i=e.ssDiffusionProfileColors[r];t.prePassRenderer.subSurfaceConfiguration.addDiffusionProfile(new a.Color3(i.r,i.g,i.b))}})),Object.defineProperty(n.Scene.prototype,"prePassRenderer",{get:function(){return this._prePassRenderer},set:function(e){e&&e.isSupported&&(this._prePassRenderer=e)},enumerable:!0,configurable:!0}),n.Scene.prototype.enablePrePassRenderer=function(){return this._prePassRenderer||(this._prePassRenderer=new o.PrePassRenderer(this),this._prePassRenderer.isSupported||(this._prePassRenderer=null,l.Logger.Error("PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering"))),this._prePassRenderer},n.Scene.prototype.disablePrePassRenderer=function(){this._prePassRenderer&&(this._prePassRenderer.dispose(),this._prePassRenderer=null)};var c=function(){function e(e){this.name=i.SceneComponentConstants.NAME_PREPASSRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._beforeCameraDrawStage.registerStep(i.SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS,this,this._beforeCameraDraw),this.scene._afterCameraDrawStage.registerStep(i.SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS,this,this._afterCameraDraw),this.scene._beforeClearStage.registerStep(i.SceneComponentConstants.STEP_BEFORECLEARSTAGE_PREPASS,this,this._beforeClearStage)},e.prototype._beforeCameraDraw=function(){this.scene.prePassRenderer&&this.scene.prePassRenderer._beforeCameraDraw()},e.prototype._afterCameraDraw=function(){this.scene.prePassRenderer&&this.scene.prePassRenderer._afterCameraDraw()},e.prototype._beforeClearStage=function(){this.scene.prePassRenderer&&this.scene.prePassRenderer.clear()},e.prototype.serialize=function(e){if(this.scene.prePassRenderer){var t=this.scene.prePassRenderer.subSurfaceConfiguration.ssDiffusionProfileColors;e.ssDiffusionProfileColors=[];for(var r=0;r<t.length;r++)e.ssDiffusionProfileColors.push({r:t[r].r,g:t[r].g,b:t[r].b})}},e.prototype.addFromContainer=function(e){},e.prototype.removeFromContainer=function(e,t){this.scene.prePassRenderer&&this.scene.prePassRenderer.subSurfaceConfiguration.clearAllDiffusionProfiles()},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e}();o.PrePassRenderer._SceneComponentInitialization=function(e){var t=e._getComponent(i.SceneComponentConstants.NAME_PREPASSRENDERER);t||(t=new c(e),e._addComponent(t))}},"./Rendering/renderingGroup.ts":
- /*!*************************************!*\
- !*** ./Rendering/renderingGroup.ts ***!
- \*************************************/
- /*! exports provided: RenderingGroup */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingGroup",(function(){return s}));var n=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=function(){function e(e,t,r,i,o){void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),this.index=e,this._opaqueSubMeshes=new n.SmartArray(256),this._transparentSubMeshes=new n.SmartArray(256),this._alphaTestSubMeshes=new n.SmartArray(256),this._depthOnlySubMeshes=new n.SmartArray(256),this._particleSystems=new n.SmartArray(256),this._spriteManagers=new n.SmartArray(256),this._edgesRenderers=new n.SmartArrayNoDuplicate(16),this._scene=t,this.opaqueSortCompareFn=r,this.alphaTestSortCompareFn=i,this.transparentSortCompareFn=o}return Object.defineProperty(e.prototype,"opaqueSortCompareFn",{set:function(t){this._opaqueSortCompareFn=t,this._renderOpaque=t?this.renderOpaqueSorted:e.renderUnsorted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaTestSortCompareFn",{set:function(t){this._alphaTestSortCompareFn=t,this._renderAlphaTest=t?this.renderAlphaTestSorted:e.renderUnsorted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transparentSortCompareFn",{set:function(t){this._transparentSortCompareFn=t||e.defaultTransparentSortCompare,this._renderTransparent=this.renderTransparentSorted},enumerable:!1,configurable:!0}),e.prototype.render=function(e,t,r,n){if(e)e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);else{var i=this._scene.getEngine();0!==this._depthOnlySubMeshes.length&&(i.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),i.setColorWrite(!0)),0!==this._opaqueSubMeshes.length&&this._renderOpaque(this._opaqueSubMeshes),0!==this._alphaTestSubMeshes.length&&this._renderAlphaTest(this._alphaTestSubMeshes);var s=i.getStencilBuffer();if(i.setStencilBuffer(!1),t&&this._renderSprites(),r&&this._renderParticles(n),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),0!==this._transparentSubMeshes.length&&(i.setStencilBuffer(s),this._renderTransparent(this._transparentSubMeshes),i.setAlphaMode(o.Constants.ALPHA_DISABLE)),i.setStencilBuffer(!1),this._edgesRenderers.length){for(var a=0;a<this._edgesRenderers.length;a++)this._edgesRenderers.data[a].render();i.setAlphaMode(o.Constants.ALPHA_DISABLE)}i.setStencilBuffer(s)}},e.prototype.renderOpaqueSorted=function(t){return e.renderSorted(t,this._opaqueSortCompareFn,this._scene.activeCamera,!1)},e.prototype.renderAlphaTestSorted=function(t){return e.renderSorted(t,this._alphaTestSortCompareFn,this._scene.activeCamera,!1)},e.prototype.renderTransparentSorted=function(t){return e.renderSorted(t,this._transparentSortCompareFn,this._scene.activeCamera,!0)},e.renderSorted=function(t,r,n,s){for(var a,l=0,c=n?n.globalPosition:e._zeroVector;l<t.length;l++)(a=t.data[l])._alphaIndex=a.getMesh().alphaIndex,a._distanceToCamera=i.Vector3.Distance(a.getBoundingInfo().boundingSphere.centerWorld,c);var u=t.data.slice(0,t.length);for(r&&u.sort(r),l=0;l<u.length;l++){if(a=u[l],s){var d=a.getMaterial();if(d&&d.needDepthPrePass){var h=d.getScene().getEngine();h.setColorWrite(!1),h.setAlphaMode(o.Constants.ALPHA_DISABLE),a.render(!1),h.setColorWrite(!0)}}a.render(s)}},e.renderUnsorted=function(e){for(var t=0;t<e.length;t++)e.data[t].render(!1)},e.defaultTransparentSortCompare=function(t,r){return t._alphaIndex>r._alphaIndex?1:t._alphaIndex<r._alphaIndex?-1:e.backToFrontSortCompare(t,r)},e.backToFrontSortCompare=function(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0},e.frontToBackSortCompare=function(e,t){return e._distanceToCamera<t._distanceToCamera?-1:e._distanceToCamera>t._distanceToCamera?1:0},e.prototype.prepare=function(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this._spriteManagers.reset(),this._edgesRenderers.reset()},e.prototype.dispose=function(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()},e.prototype.dispatch=function(e,t,r){void 0===t&&(t=e.getMesh()),void 0===r&&(r=e.getMaterial()),null!=r&&(r.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):r.needAlphaTesting()?(r.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(r.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer))},e.prototype.dispatchSprites=function(e){this._spriteManagers.push(e)},e.prototype.dispatchParticles=function(e){this._particleSystems.push(e)},e.prototype._renderParticles=function(e){if(0!==this._particleSystems.length){var t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(var r=0;r<this._particleSystems.length;r++){var n=this._particleSystems.data[r];if(0!==(t&&t.layerMask&n.layerMask)){var i=n.emitter;i.position&&e&&-1===e.indexOf(i)||this._scene._activeParticles.addCount(n.render(),!1)}}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}},e.prototype._renderSprites=function(){if(this._scene.spritesEnabled&&0!==this._spriteManagers.length){var e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(var t=0;t<this._spriteManagers.length;t++){var r=this._spriteManagers.data[t];0!==(e&&e.layerMask&r.layerMask)&&r.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}},e._zeroVector=i.Vector3.Zero(),e}()},"./Rendering/renderingManager.ts":
- /*!***************************************!*\
- !*** ./Rendering/renderingManager.ts ***!
- \***************************************/
- /*! exports provided: RenderingGroupInfo, RenderingManager */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingGroupInfo",(function(){return i})),r.d(t,"RenderingManager",(function(){return o}));var n=r(/*! ./renderingGroup */"./Rendering/renderingGroup.ts"),i=function(){},o=function(){function e(t){this._useSceneAutoClearSetup=!1,this._renderingGroups=new Array,this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new i,this._scene=t;for(var r=e.MIN_RENDERINGGROUPS;r<e.MAX_RENDERINGGROUPS;r++)this._autoClearDepthStencil[r]={autoClear:!0,depth:!0,stencil:!0}}return e.prototype._clearDepthStencilBuffer=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0),this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)},e.prototype.render=function(t,r,n,i){var o=this._renderingGroupInfo;if(o.scene=this._scene,o.camera=this._scene.activeCamera,this._scene.spriteManagers&&i)for(var s=0;s<this._scene.spriteManagers.length;s++){var a=this._scene.spriteManagers[s];this.dispatchSprites(a)}for(s=e.MIN_RENDERINGGROUPS;s<e.MAX_RENDERINGGROUPS;s++){this._depthStencilBufferAlreadyCleaned=s===e.MIN_RENDERINGGROUPS;var l=this._renderingGroups[s];if(l){var c=Math.pow(2,s);if(o.renderingGroupId=s,this._scene.onBeforeRenderingGroupObservable.notifyObservers(o,c),e.AUTOCLEAR){var u=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(s):this._autoClearDepthStencil[s];u&&u.autoClear&&this._clearDepthStencilBuffer(u.depth,u.stencil)}for(var d=0,h=this._scene._beforeRenderingGroupDrawStage;d<h.length;d++)h[d].action(s);l.render(t,i,n,r);for(var f=0,p=this._scene._afterRenderingGroupDrawStage;f<p.length;f++)p[f].action(s);this._scene.onAfterRenderingGroupObservable.notifyObservers(o,c)}}},e.prototype.reset=function(){for(var t=e.MIN_RENDERINGGROUPS;t<e.MAX_RENDERINGGROUPS;t++){var r=this._renderingGroups[t];r&&r.prepare()}},e.prototype.dispose=function(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null},e.prototype.freeRenderingGroups=function(){for(var t=e.MIN_RENDERINGGROUPS;t<e.MAX_RENDERINGGROUPS;t++){var r=this._renderingGroups[t];r&&r.dispose()}},e.prototype._prepareRenderingGroup=function(e){void 0===this._renderingGroups[e]&&(this._renderingGroups[e]=new n.RenderingGroup(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]))},e.prototype.dispatchSprites=function(e){var t=e.renderingGroupId||0;this._prepareRenderingGroup(t),this._renderingGroups[t].dispatchSprites(e)},e.prototype.dispatchParticles=function(e){var t=e.renderingGroupId||0;this._prepareRenderingGroup(t),this._renderingGroups[t].dispatchParticles(e)},e.prototype.dispatch=function(e,t,r){void 0===t&&(t=e.getMesh());var n=t.renderingGroupId||0;this._prepareRenderingGroup(n),this._renderingGroups[n].dispatch(e,t,r)},e.prototype.setRenderingOrder=function(e,t,r,n){if(void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=r,this._customTransparentSortCompareFn[e]=n,this._renderingGroups[e]){var i=this._renderingGroups[e];i.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],i.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],i.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}},e.prototype.setRenderingAutoClearDepthStencil=function(e,t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0),this._autoClearDepthStencil[e]={autoClear:t,depth:r,stencil:n}},e.prototype.getAutoClearDepthStencilSetup=function(e){return this._autoClearDepthStencil[e]},e.MAX_RENDERINGGROUPS=4,e.MIN_RENDERINGGROUPS=0,e.AUTOCLEAR=!0,e}()},"./Rendering/subSurfaceConfiguration.ts":
- /*!**********************************************!*\
- !*** ./Rendering/subSurfaceConfiguration.ts ***!
- \**********************************************/
- /*! exports provided: SubSurfaceConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"SubSurfaceConfiguration",(function(){return s}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../PostProcesses/subSurfaceScatteringPostProcess */"./PostProcesses/subSurfaceScatteringPostProcess.ts"),s=function(){function e(e){this._ssDiffusionS=[],this._ssFilterRadii=[],this._ssDiffusionD=[],this.enabled=!1,this.ssDiffusionProfileColors=[],this.metersPerUnit=1,this.addDiffusionProfile(new i.Color3(1,1,1)),this._scene=e}return Object.defineProperty(e.prototype,"ssDiffusionS",{get:function(){return this._ssDiffusionS},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ssDiffusionD",{get:function(){return this._ssDiffusionD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ssFilterRadii",{get:function(){return this._ssFilterRadii},enumerable:!1,configurable:!0}),e.prototype.addDiffusionProfile=function(e){if(this.ssDiffusionD.length>=5)return n.Logger.Error("You already reached the maximum number of diffusion profiles."),0;for(var t=0;t<this._ssDiffusionS.length/3;t++)if(this._ssDiffusionS[3*t]===e.r&&this._ssDiffusionS[3*t+1]===e.g&&this._ssDiffusionS[3*t+2]===e.b)return t;return this._ssDiffusionS.push(e.r,e.b,e.g),this._ssDiffusionD.push(Math.max(Math.max(e.r,e.b),e.g)),this._ssFilterRadii.push(this.getDiffusionProfileParameters(e)),this.ssDiffusionProfileColors.push(e),this._ssDiffusionD.length-1},e.prototype.createPostProcess=function(){return this.postProcess=new o.SubSurfaceScatteringPostProcess("subSurfaceScattering",this._scene,1,null,void 0,this._scene.getEngine()),this.postProcess.autoClear=!1,this.postProcess},e.prototype.clearAllDiffusionProfiles=function(){this._ssDiffusionD=[],this._ssDiffusionS=[],this._ssFilterRadii=[],this.ssDiffusionProfileColors=[]},e.prototype.dispose=function(){this.clearAllDiffusionProfiles(),this.postProcess.dispose()},e.prototype.getDiffusionProfileParameters=function(e){var t=Math.max(e.r,e.g,e.b);return this._sampleBurleyDiffusionProfile(.997,t)},e.prototype._sampleBurleyDiffusionProfile=function(e,t){var r=1+4*(e=1-e)*(2*e+Math.sqrt(1+4*e*e)),n=Math.pow(r,-1/3),i=1+r*n*n+n;return 3*Math.log(i/(4*e))*t},e}()},"./Rendering/utilityLayerRenderer.ts":
- /*!*******************************************!*\
- !*** ./Rendering/utilityLayerRenderer.ts ***!
- \*******************************************/
- /*! exports provided: UtilityLayerRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"UtilityLayerRenderer",(function(){return u}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Events/pointerEvents */"./Events/pointerEvents.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),l=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),u=function(){function e(e,t){var r=this;void 0===t&&(t=!0),this.originalScene=e,this._pointerCaptures={},this._lastPointerEvents={},this._sharedGizmoLight=null,this._renderCamera=null,this.pickUtilitySceneFirst=!0,this.shouldRender=!0,this.onlyCheckPointerDownEvents=!0,this.processAllEvents=!1,this.onPointerOutObservable=new i.Observable,this.utilityLayerScene=new n.Scene(e.getEngine(),{virtual:!0}),this.utilityLayerScene.useRightHandedSystem=e.useRightHandedSystem,this.utilityLayerScene._allowPostProcessClearColor=!1,this.utilityLayerScene.detachControl(),t&&(this._originalPointerObserver=e.onPrePointerObservable.add((function(t,n){if(r.utilityLayerScene.activeCamera&&(r.processAllEvents||t.type===o.PointerEventTypes.POINTERMOVE||t.type===o.PointerEventTypes.POINTERUP||t.type===o.PointerEventTypes.POINTERDOWN||t.type===o.PointerEventTypes.POINTERDOUBLETAP)){r.utilityLayerScene.pointerX=e.pointerX,r.utilityLayerScene.pointerY=e.pointerY;var i=t.event;if(e.isPointerCaptured(i.pointerId))r._pointerCaptures[i.pointerId]=!1;else{var s=t.ray?r.utilityLayerScene.pickWithRay(t.ray):r.utilityLayerScene.pick(e.pointerX,e.pointerY);if(!t.ray&&s&&(t.ray=s.ray),r.utilityLayerScene.onPrePointerObservable.notifyObservers(t),r.onlyCheckPointerDownEvents&&t.type!=o.PointerEventTypes.POINTERDOWN)return t.skipOnPointerObservable||r.utilityLayerScene.onPointerObservable.notifyObservers(new o.PointerInfo(t.type,t.event,s)),void(t.type===o.PointerEventTypes.POINTERUP&&r._pointerCaptures[i.pointerId]&&(r._pointerCaptures[i.pointerId]=!1));if(r.utilityLayerScene.autoClearDepthAndStencil||r.pickUtilitySceneFirst)s&&s.hit&&(t.skipOnPointerObservable||r.utilityLayerScene.onPointerObservable.notifyObservers(new o.PointerInfo(t.type,t.event,s)),t.skipOnPointerObservable=!0);else{var a=t.ray?e.pickWithRay(t.ray):e.pick(e.pointerX,e.pointerY),l=t.event;a&&s&&(0===s.distance&&a.pickedMesh?r.mainSceneTrackerPredicate&&r.mainSceneTrackerPredicate(a.pickedMesh)?(r._notifyObservers(t,a,l),t.skipOnPointerObservable=!0):t.type===o.PointerEventTypes.POINTERDOWN?r._pointerCaptures[l.pointerId]=!0:r._lastPointerEvents[l.pointerId]&&(r.onPointerOutObservable.notifyObservers(l.pointerId),delete r._lastPointerEvents[l.pointerId]):!r._pointerCaptures[l.pointerId]&&(s.distance<a.distance||0===a.distance)?(r._notifyObservers(t,s,l),t.skipOnPointerObservable||(t.skipOnPointerObservable=s.distance>0)):!r._pointerCaptures[l.pointerId]&&s.distance>a.distance&&(r.mainSceneTrackerPredicate&&r.mainSceneTrackerPredicate(a.pickedMesh)?(r._notifyObservers(t,a,l),t.skipOnPointerObservable=!0):r._lastPointerEvents[l.pointerId]&&(r.onPointerOutObservable.notifyObservers(l.pointerId),delete r._lastPointerEvents[l.pointerId])),t.type===o.PointerEventTypes.POINTERUP&&r._pointerCaptures[l.pointerId]&&(r._pointerCaptures[l.pointerId]=!1))}}}})),this._originalPointerObserver&&e.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)),this.utilityLayerScene.autoClear=!1,this._afterRenderObserver=this.originalScene.onAfterCameraRenderObservable.add((function(e){r.shouldRender&&e==r.getRenderCamera()&&r.render()})),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add((function(){r.dispose()})),this._updateCamera()}return e.prototype.getRenderCamera=function(e){if(this._renderCamera)return this._renderCamera;var t=void 0;return t=this.originalScene.activeCameras.length>1?this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.originalScene.activeCamera,e&&t&&t.isRigCamera?t.rigParent:t},e.prototype.setRenderCamera=function(e){this._renderCamera=e},e.prototype._getSharedGizmoLight=function(){return this._sharedGizmoLight||(this._sharedGizmoLight=new a.HemisphericLight("shared gizmo light",new l.Vector3(0,1,0),this.utilityLayerScene),this._sharedGizmoLight.intensity=2,this._sharedGizmoLight.groundColor=c.Color3.Gray()),this._sharedGizmoLight},Object.defineProperty(e,"DefaultUtilityLayer",{get:function(){return null==e._DefaultUtilityLayer&&(e._DefaultUtilityLayer=new e(s.EngineStore.LastCreatedScene),e._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce((function(){e._DefaultUtilityLayer=null}))),e._DefaultUtilityLayer},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DefaultKeepDepthUtilityLayer",{get:function(){return null==e._DefaultKeepDepthUtilityLayer&&(e._DefaultKeepDepthUtilityLayer=new e(s.EngineStore.LastCreatedScene),e._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,e._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce((function(){e._DefaultKeepDepthUtilityLayer=null}))),e._DefaultKeepDepthUtilityLayer},enumerable:!1,configurable:!0}),e.prototype._notifyObservers=function(e,t,r){e.skipOnPointerObservable||(this.utilityLayerScene.onPointerObservable.notifyObservers(new o.PointerInfo(e.type,e.event,t)),this._lastPointerEvents[r.pointerId]=!0)},e.prototype.render=function(){if(this._updateCamera(),this.utilityLayerScene.activeCamera){var e=this.utilityLayerScene.activeCamera.getScene(),t=this.utilityLayerScene.activeCamera;t._scene=this.utilityLayerScene,t.leftCamera&&(t.leftCamera._scene=this.utilityLayerScene),t.rightCamera&&(t.rightCamera._scene=this.utilityLayerScene),this.utilityLayerScene.render(!1),t._scene=e,t.leftCamera&&(t.leftCamera._scene=e),t.rightCamera&&(t.rightCamera._scene=e)}},e.prototype.dispose=function(){this.onPointerOutObservable.clear(),this._afterRenderObserver&&this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()},e.prototype._updateCamera=function(){this.utilityLayerScene.cameraToUseForPointers=this.getRenderCamera(),this.utilityLayerScene.activeCamera=this.getRenderCamera()},e._DefaultUtilityLayer=null,e._DefaultKeepDepthUtilityLayer=null,e}()},"./Shaders/ShadersInclude/backgroundFragmentDeclaration.ts":
- /*!*****************************************************************!*\
- !*** ./Shaders/ShadersInclude/backgroundFragmentDeclaration.ts ***!
- \*****************************************************************/
- /*! exports provided: backgroundFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundFragmentDeclaration",(function(){return o}));var n="backgroundFragmentDeclaration",i=" uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;\nuniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/backgroundUboDeclaration.ts":
- /*!************************************************************!*\
- !*** ./Shaders/ShadersInclude/backgroundUboDeclaration.ts ***!
- \************************************************************/
- /*! exports provided: backgroundUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundUboDeclaration",(function(){return o}));var n="backgroundUboDeclaration",i="layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec4 vPrimaryColor;\nuniform vec4 vPrimaryColorShadow;\nuniform vec2 vDiffuseInfos;\nuniform vec2 vReflectionInfos;\nuniform mat4 diffuseMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\nuniform float pointSize;\nuniform float shadowLevel;\nuniform float alpha;\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/backgroundVertexDeclaration.ts":
- /*!***************************************************************!*\
- !*** ./Shaders/ShadersInclude/backgroundVertexDeclaration.ts ***!
- \***************************************************************/
- /*! exports provided: backgroundVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundVertexDeclaration",(function(){return o}));var n="backgroundVertexDeclaration",i="uniform mat4 view;\nuniform mat4 viewProjection;\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/bayerDitherFunctions.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/bayerDitherFunctions.ts ***!
- \********************************************************/
- /*! exports provided: bayerDitherFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"bayerDitherFunctions",(function(){return o}));var n="bayerDitherFunctions",i="\n\n\n\n\nfloat bayerDither2(vec2 _P) {\nreturn mod(2.0*_P.y+_P.x+1.0,4.0);\n}\n\n\nfloat bayerDither4(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nreturn 4.0*bayerDither2(P1)+bayerDither2(P2);\n}\n\nfloat bayerDither8(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nvec2 P4=floor(0.25*mod(_P,8.0));\nreturn 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);\n}\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/bonesDeclaration.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/bonesDeclaration.ts ***!
- \****************************************************/
- /*! exports provided: bonesDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"bonesDeclaration",(function(){return o}));var n="bonesDeclaration",i="#if NUM_BONE_INFLUENCERS>0\n#ifdef BONETEXTURE\nuniform sampler2D boneSampler;\nuniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#endif\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{\nfloat offset=index*4.0;\nfloat dx=1.0/boneTextureWidth;\nvec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));\nvec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));\nvec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));\nvec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));\nreturn mat4(m0,m1,m2,m3);\n}\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/bonesVertex.ts":
- /*!***********************************************!*\
- !*** ./Shaders/ShadersInclude/bonesVertex.ts ***!
- \***********************************************/
- /*! exports provided: bonesVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"bonesVertex",(function(){return i}));var n="#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.bonesVertex=n;var i={name:"bonesVertex",shader:n}},"./Shaders/ShadersInclude/bumpFragment.ts":
- /*!************************************************!*\
- !*** ./Shaders/ShadersInclude/bumpFragment.ts ***!
- \************************************************/
- /*! exports provided: bumpFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"bumpFragment",(function(){return i}));var n="vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#elif defined(BUMP)\nfloat normalScale=vBumpInfos.y;\n#else\nfloat normalScale=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#elif defined(BUMP)\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vDetailUV,vec2(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW,vPositionW,vMainUV1,vec2(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);\nvec2 detailNormalRG=detailColor.wy*2.0-1.0;\nfloat detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));\nvec3 detailNormal=vec3(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz*2.0-1.0);\nnormalW=normalize(mat3(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#else\nvec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n\n#if DETAIL_NORMALBLENDMETHOD == 0\ndetailNormal.xy*=vDetailInfos.z;\nvec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD == 1\ndetailNormal.xy*=vDetailInfos.z;\nbumpNormal+=vec3(0.0,0.0,1.0);\ndetailNormal*=vec3(-1.0,-1.0,1.0);\nvec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;\nnormalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.bumpFragment=n;var i={name:"bumpFragment",shader:n}},"./Shaders/ShadersInclude/bumpFragmentFunctions.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/ShadersInclude/bumpFragmentFunctions.ts ***!
- \*********************************************************/
- /*! exports provided: bumpFragmentFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"bumpFragmentFunctions",(function(){return o}));var n="bumpFragmentFunctions",i="#if defined(BUMP)\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nreturn perturbNormal(cotangentFrame,texture2D(bumpSampler,uv).xyz,vBumpInfos.y);\n}\n#endif\n#if defined(DETAIL)\n#if DETAILDIRECTUV == 1\n#define vDetailUV vMainUV1\n#elif DETAILDIRECTUV == 2\n#define vDetailUV vMainUV2\n#else\nvarying vec2 vDetailUV;\n#endif\nuniform sampler2D detailSampler;\n#endif\n#if defined(BUMP)\nvec3 perturbNormal(mat3 cotangentFrame,vec3 color)\n{\nreturn perturbNormal(cotangentFrame,color,vBumpInfos.y);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\nreturn cotangent_frame(normal,p,uv,vTangentSpaceParams);\n}\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; i<iMaxSamples; i++)\n{\ncurrSampledHeight=texture2D(bumpSampler,vBumpUV+vCurrOffset).w;\n\nif (currSampledHeight>currRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/bumpFragmentMainFunctions.ts":
- /*!*************************************************************!*\
- !*** ./Shaders/ShadersInclude/bumpFragmentMainFunctions.ts ***!
- \*************************************************************/
- /*! exports provided: bumpFragmentMainFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"bumpFragmentMainFunctions",(function(){return o}));var n="bumpFragmentMainFunctions",i="#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#endif\nvec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)\n{\n#ifdef NORMALXYSCALE\nnormal=normalize(normal*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*normal);\n}\nvec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)\n{\nreturn perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)\n{\n\nuv=gl_FrontFacing ? uv : -uv;\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;\n\ntangent*=tangentSpaceParams.x;\nbitangent*=tangentSpaceParams.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(bitangent,bitangent)));\nreturn mat3(tangent*invmax,bitangent*invmax,normal);\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/bumpVertex.ts":
- /*!**********************************************!*\
- !*** ./Shaders/ShadersInclude/bumpVertex.ts ***!
- \**********************************************/
- /*! exports provided: bumpVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"bumpVertex",(function(){return i}));var n="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);\nvec3 tbnTangent=normalize(tangentUpdated.xyz);\nvec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;\nvTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.bumpVertex=n;var i={name:"bumpVertex",shader:n}},"./Shaders/ShadersInclude/bumpVertexDeclaration.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/ShadersInclude/bumpVertexDeclaration.ts ***!
- \*********************************************************/
- /*! exports provided: bumpVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"bumpVertexDeclaration",(function(){return o}));var n="bumpVertexDeclaration",i="#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneFragment.ts":
- /*!*****************************************************!*\
- !*** ./Shaders/ShadersInclude/clipPlaneFragment.ts ***!
- \*****************************************************/
- /*! exports provided: clipPlaneFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneFragment",(function(){return o}));var n="clipPlaneFragment",i="#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE2\nif (fClipDistance2>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE3\nif (fClipDistance3>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE4\nif (fClipDistance4>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE5\nif (fClipDistance5>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE6\nif (fClipDistance6>0.0)\n{\ndiscard;\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts":
- /*!****************************************************************!*\
- !*** ./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts ***!
- \****************************************************************/
- /*! exports provided: clipPlaneFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneFragmentDeclaration",(function(){return o}));var n="clipPlaneFragmentDeclaration",i="#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nvarying float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.ts":
- /*!*****************************************************************!*\
- !*** ./Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.ts ***!
- \*****************************************************************/
- /*! exports provided: clipPlaneFragmentDeclaration2 */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneFragmentDeclaration2",(function(){return o}));var n="clipPlaneFragmentDeclaration2",i="#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nin float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nin float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneVertex.ts":
- /*!***************************************************!*\
- !*** ./Shaders/ShadersInclude/clipPlaneVertex.ts ***!
- \***************************************************/
- /*! exports provided: clipPlaneVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneVertex",(function(){return o}));var n="clipPlaneVertex",i="#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts":
- /*!**************************************************************!*\
- !*** ./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts ***!
- \**************************************************************/
- /*! exports provided: clipPlaneVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneVertexDeclaration",(function(){return o}));var n="clipPlaneVertexDeclaration",i="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nvarying float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneVertexDeclaration2.ts":
- /*!***************************************************************!*\
- !*** ./Shaders/ShadersInclude/clipPlaneVertexDeclaration2.ts ***!
- \***************************************************************/
- /*! exports provided: clipPlaneVertexDeclaration2 */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneVertexDeclaration2",(function(){return o}));var n="clipPlaneVertexDeclaration2",i="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nout float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nout float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nout float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nout float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nout float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nout float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/defaultFragmentDeclaration.ts":
- /*!**************************************************************!*\
- !*** ./Shaders/ShadersInclude/defaultFragmentDeclaration.ts ***!
- \**************************************************************/
- /*! exports provided: defaultFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultFragmentDeclaration",(function(){return o}));var n="defaultFragmentDeclaration",i="uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/defaultUboDeclaration.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/ShadersInclude/defaultUboDeclaration.ts ***!
- \*********************************************************/
- /*! exports provided: defaultUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultUboDeclaration",(function(){return o}));var n="defaultUboDeclaration",i="layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor;\nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix;\nvec2 vTangentSpaceParams;\nfloat pointSize;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nfloat visibility;\nvec4 vDiffuseColor;\nvec4 vDetailInfos;\nmat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/defaultVertexDeclaration.ts":
- /*!************************************************************!*\
- !*** ./Shaders/ShadersInclude/defaultVertexDeclaration.ts ***!
- \************************************************************/
- /*! exports provided: defaultVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultVertexDeclaration",(function(){return o}));var n="defaultVertexDeclaration",i="\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef REFLECTION\nuniform mat4 reflectionMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/depthPrePass.ts":
- /*!************************************************!*\
- !*** ./Shaders/ShadersInclude/depthPrePass.ts ***!
- \************************************************/
- /*! exports provided: depthPrePass */function(e,t,r){"use strict";r.r(t),r.d(t,"depthPrePass",(function(){return i}));var n="#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.depthPrePass=n;var i={name:"depthPrePass",shader:n}},"./Shaders/ShadersInclude/diffusionProfile.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/diffusionProfile.ts ***!
- \****************************************************/
- /*! exports provided: diffusionProfile */function(e,t,r){"use strict";r.r(t),r.d(t,"diffusionProfile",(function(){return o}));var n="diffusionProfile",i="uniform vec3 diffusionS[5];\nuniform float diffusionD[5];\nuniform float filterRadii[5];";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/fibonacci.ts":
- /*!*********************************************!*\
- !*** ./Shaders/ShadersInclude/fibonacci.ts ***!
- \*********************************************/
- /*! exports provided: fibonacci */function(e,t,r){"use strict";r.r(t),r.d(t,"fibonacci",(function(){return i}));var n="#define rcp(x) 1./x\n#define GOLDEN_RATIO 1.618033988749895\n#define TWO_PI 6.2831855\n\n\nvec2 Golden2dSeq(int i,float n)\n{\n\n\nreturn vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));\n}\nvec2 SampleDiskGolden(int i,int sampleCount)\n{\nvec2 f=Golden2dSeq(i,float(sampleCount));\nreturn vec2(sqrt(f.x),TWO_PI*f.y);\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.fibonacci=n;var i={name:"fibonacci",shader:n}},"./Shaders/ShadersInclude/fogFragment.ts":
- /*!***********************************************!*\
- !*** ./Shaders/ShadersInclude/fogFragment.ts ***!
- \***********************************************/
- /*! exports provided: fogFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"fogFragment",(function(){return i}));var n="#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.fogFragment=n;var i={name:"fogFragment",shader:n}},"./Shaders/ShadersInclude/fogFragmentDeclaration.ts":
- /*!**********************************************************!*\
- !*** ./Shaders/ShadersInclude/fogFragmentDeclaration.ts ***!
- \**********************************************************/
- /*! exports provided: fogFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"fogFragmentDeclaration",(function(){return o}));var n="fogFragmentDeclaration",i="#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying vec3 vFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nfloat fogDistance=length(vFogDistance);\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/fogVertex.ts":
- /*!*********************************************!*\
- !*** ./Shaders/ShadersInclude/fogVertex.ts ***!
- \*********************************************/
- /*! exports provided: fogVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"fogVertex",(function(){return i}));var n="#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.fogVertex=n;var i={name:"fogVertex",shader:n}},"./Shaders/ShadersInclude/fogVertexDeclaration.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/fogVertexDeclaration.ts ***!
- \********************************************************/
- /*! exports provided: fogVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"fogVertexDeclaration",(function(){return o}));var n="fogVertexDeclaration",i="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/fresnelFunction.ts":
- /*!***************************************************!*\
- !*** ./Shaders/ShadersInclude/fresnelFunction.ts ***!
- \***************************************************/
- /*! exports provided: fresnelFunction */function(e,t,r){"use strict";r.r(t),r.d(t,"fresnelFunction",(function(){return o}));var n="fresnelFunction",i="#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/harmonicsFunctions.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/harmonicsFunctions.ts ***!
- \******************************************************/
- /*! exports provided: harmonicsFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"harmonicsFunctions",(function(){return o}));var n="harmonicsFunctions",i="#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;\nuniform vec3 vSphericalL1_1;\nuniform vec3 vSphericalL10;\nuniform vec3 vSphericalL11;\nuniform vec3 vSphericalL2_2;\nuniform vec3 vSphericalL2_1;\nuniform vec3 vSphericalL20;\nuniform vec3 vSphericalL21;\nuniform vec3 vSphericalL22;\n\n\n\n\n\n\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\nreturn vSphericalL00\n+vSphericalL1_1*(normal.y)\n+vSphericalL10*(normal.z)\n+vSphericalL11*(normal.x)\n+vSphericalL2_2*(normal.y*normal.x)\n+vSphericalL2_1*(normal.y*normal.z)\n+vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+vSphericalL21*(normal.z*normal.x)\n+vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));\n}\n#else\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX_ZZ;\nuniform vec3 vSphericalYY_ZZ;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\n\n\n\n\n\n\n\n\n\nfloat Nx=normal.x;\nfloat Ny=normal.y;\nfloat Nz=normal.z;\nvec3 C1=vSphericalZZ.rgb;\nvec3 Cx=vSphericalX.rgb;\nvec3 Cy=vSphericalY.rgb;\nvec3 Cz=vSphericalZ.rgb;\nvec3 Cxx_zz=vSphericalXX_ZZ.rgb;\nvec3 Cyy_zz=vSphericalYY_ZZ.rgb;\nvec3 Cxy=vSphericalXY.rgb;\nvec3 Cyz=vSphericalYZ.rgb;\nvec3 Czx=vSphericalZX.rgb;\nvec3 a1=Cyy_zz*Ny+Cy;\nvec3 a2=Cyz*Nz+a1;\nvec3 b1=Czx*Nz+Cx;\nvec3 b2=Cxy*Ny+b1;\nvec3 b3=Cxx_zz*Nx+b2;\nvec3 t1=Cz*Nz+C1;\nvec3 t2=a2*Ny+t1;\nvec3 t3=b3*Nx+t2;\nreturn t3;\n}\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/hdrFilteringFunctions.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/ShadersInclude/hdrFilteringFunctions.ts ***!
- \*********************************************************/
- /*! exports provided: hdrFilteringFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"hdrFilteringFunctions",(function(){return o}));var n="hdrFilteringFunctions",i="#ifdef NUM_SAMPLES\n#if NUM_SAMPLES>0\n#ifdef WEBGL2\n\n\nfloat radicalInverse_VdC(uint bits)\n{\nbits=(bits << 16u) | (bits >> 16u);\nbits=((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\nbits=((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\nbits=((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\nbits=((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\nreturn float(bits)*2.3283064365386963e-10;\n}\nvec2 hammersley(uint i,uint N)\n{\nreturn vec2(float(i)/float(N),radicalInverse_VdC(i));\n}\n#else\nfloat vanDerCorpus(int n,int base)\n{\nfloat invBase=1.0/float(base);\nfloat denom=1.0;\nfloat result=0.0;\nfor(int i=0; i<32; ++i)\n{\nif(n>0)\n{\ndenom=mod(float(n),2.0);\nresult+=denom*invBase;\ninvBase=invBase/2.0;\nn=int(float(n)/2.0);\n}\n}\nreturn result;\n}\nvec2 hammersley(int i,int N)\n{\nreturn vec2(float(i)/float(N),vanDerCorpus(i,2));\n}\n#endif\nfloat log4(float x) {\nreturn log2(x)/2.;\n}\nconst float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);\nconst float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;\nconst float K=4.;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#define inline\nvec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nvec3 result=vec3(0.0);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 Ls=hemisphereCosSample(Xi);\nLs=normalize(Ls);\nvec3 Ns=vec3(0.,0.,1.);\nfloat NoL=dot(Ns,Ls);\nif (NoL>0.) {\nfloat pdf_inversed=PI/NoL;\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(l,0.0,maxLevel);\nvec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c;\n}\n}\nresult=result*NUM_SAMPLES_FLOAT_INVERSED;\nreturn result;\n}\n#define inline\nvec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nif (alphaG == 0.) {\nvec3 c=textureCube(inputTexture,n).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nreturn c;\n}\nvec3 result=vec3(0.);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\nfloat weight=0.;\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);\nfloat NoV=1.;\nfloat NoH=H.z;\nfloat NoH2=H.z*H.z;\nfloat NoL=2.*NoH2-1.;\nvec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);\nL=normalize(L);\nif (NoL>0.) {\nfloat pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(float(l),0.0,maxLevel);\nweight+=NoL;\nvec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c*NoL;\n}\n}\nresult=result/weight;\nreturn result;\n}\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/helperFunctions.ts":
- /*!***************************************************!*\
- !*** ./Shaders/ShadersInclude/helperFunctions.ts ***!
- \***************************************************/
- /*! exports provided: helperFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"helperFunctions",(function(){return o}));var n="helperFunctions",i="const float PI=3.1415926535897932384626433832795;\nconst float HALF_MIN=5.96046448e-08;\nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nconst float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat toLinearSpace(float color)\n{\nreturn pow(color,LinearEncodePowerApprox);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec4 toLinearSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nvec4 toGammaSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n}\nfloat toGammaSpace(float color)\n{\nreturn pow(color,GammaEncodePowerApprox);\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat pow5(float value) {\nfloat sq=value*value;\nreturn sq*sq*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat dither=mix(-varianceAmount/255.0,varianceAmount/255.0,rand);\nreturn dither;\n}\n\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=maxEps(max(color.r,max(color.g,color.b)));\nfloat D=max(rgbdMaxRange/maxRGB,1.);\nD=clamp(floor(D)/255.0,0.,1.);\n\nvec3 rgb=color.rgb*D;\n\nrgb=toGammaSpace(rgb);\nreturn vec4(rgb,D);\n}\nvec3 fromRGBD(vec4 rgbd) {\n\nrgbd.rgb=toLinearSpace(rgbd.rgb);\n\nreturn rgbd.rgb/rgbd.a;\n}\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/imageProcessingDeclaration.ts":
- /*!**************************************************************!*\
- !*** ./Shaders/ShadersInclude/imageProcessingDeclaration.ts ***!
- \**************************************************************/
- /*! exports provided: imageProcessingDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"imageProcessingDeclaration",(function(){return o}));var n="imageProcessingDeclaration",i="#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/imageProcessingFunctions.ts":
- /*!************************************************************!*\
- !*** ./Shaders/ShadersInclude/imageProcessingFunctions.ts ***!
- \************************************************************/
- /*! exports provided: imageProcessingFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"imageProcessingFunctions",(function(){return o}));var n="imageProcessingFunctions",i="#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\n#define inline\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{\nfloat sliceSize=2.0*sampler3dSetting.x;\n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;\nsliceUV.x+=sliceInteger*sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice0Color=texture2D(colorTransform,sliceUV);\nsliceUV.x+=sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice1Color=texture2D(colorTransform,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;\n}\n#endif\n#ifdef TONEMAPPING_ACES\n\n\n\n\n\nconst mat3 ACESInputMat=mat3(\nvec3(0.59719,0.07600,0.02840),\nvec3(0.35458,0.90834,0.13383),\nvec3(0.04823,0.01566,0.83777)\n);\n\nconst mat3 ACESOutputMat=mat3(\nvec3( 1.60475,-0.10208,-0.00327),\nvec3(-0.53108,1.10813,-0.07276),\nvec3(-0.07367,-0.00605,1.07602)\n);\nvec3 RRTAndODTFit(vec3 v)\n{\nvec3 a=v*(v+0.0245786)-0.000090537;\nvec3 b=v*(0.983729*v+0.4329510)+0.238081;\nreturn a/b;\n}\nvec3 ACESFitted(vec3 color)\n{\ncolor=ACESInputMat*color;\n\ncolor=RRTAndODTFit(color);\ncolor=ACESOutputMat*color;\n\ncolor=saturate(color);\nreturn color;\n}\n#endif\nvec4 applyImageProcessing(vec4 result) {\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\n\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;\nviewportXY=viewportXY*2.0-1.0;\nvec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);\nfloat vignetteTerm=dot(vignetteXY1,vignetteXY1);\nfloat vignette=pow(vignetteTerm,vignetteSettings2.w);\n\nvec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);\nresult.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#ifdef TONEMAPPING\n#ifdef TONEMAPPING_ACES\nresult.rgb=ACESFitted(result.rgb);\n#else\nconst float tonemappingCalibration=1.590579;\nresult.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\n#endif\n\nresult.rgb=toGammaSpace(result.rgb);\nresult.rgb=saturate(result.rgb);\n#ifdef CONTRAST\n\nvec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);\nif (contrast<1.0) {\n\nresult.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);\n} else {\n\nresult.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);\n}\n#endif\n\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\n\nfloat luma=getLuminance(result.rgb);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\nreturn result;\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/importanceSampling.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/importanceSampling.ts ***!
- \******************************************************/
- /*! exports provided: importanceSampling */function(e,t,r){"use strict";r.r(t),r.d(t,"importanceSampling",(function(){return o}));var n="importanceSampling",i="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereCosSample(vec2 u) {\n\nfloat phi=2.*PI*u.x;\nfloat cosTheta2=1.-u.y;\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDggx(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\n\nfloat cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\nfloat sinTheta=pow(u.y,a/(2.*a+1.));\nfloat cosTheta=sqrt(1.-sinTheta*sinTheta);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/instancesDeclaration.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/instancesDeclaration.ts ***!
- \********************************************************/
- /*! exports provided: instancesDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"instancesDeclaration",(function(){return o}));var n="instancesDeclaration",i="#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#ifdef THIN_INSTANCES\nuniform mat4 world;\n#endif\n#else\nuniform mat4 world;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/instancesVertex.ts":
- /*!***************************************************!*\
- !*** ./Shaders/ShadersInclude/instancesVertex.ts ***!
- \***************************************************/
- /*! exports provided: instancesVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"instancesVertex",(function(){return o}));var n="instancesVertex",i="#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#ifdef THIN_INSTANCES\nfinalWorld=world*finalWorld;\n#endif\n#else\nmat4 finalWorld=world;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/kernelBlurFragment.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/kernelBlurFragment.ts ***!
- \******************************************************/
- /*! exports provided: kernelBlurFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"kernelBlurFragment",(function(){return o}));var n="kernelBlurFragment",i="#ifdef DOF\nfactor=sampleCoC(sampleCoord{X});\ncomputedWeight=KERNEL_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/kernelBlurFragment2.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/ShadersInclude/kernelBlurFragment2.ts ***!
- \*******************************************************/
- /*! exports provided: kernelBlurFragment2 */function(e,t,r){"use strict";r.r(t),r.d(t,"kernelBlurFragment2",(function(){return o}));var n="kernelBlurFragment2",i="#ifdef DOF\nfactor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});\ncomputedWeight=KERNEL_DEP_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/kernelBlurVaryingDeclaration.ts":
- /*!****************************************************************!*\
- !*** ./Shaders/ShadersInclude/kernelBlurVaryingDeclaration.ts ***!
- \****************************************************************/
- /*! exports provided: kernelBlurVaryingDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"kernelBlurVaryingDeclaration",(function(){return o}));var n="kernelBlurVaryingDeclaration",i="varying vec2 sampleCoord{X};";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/kernelBlurVertex.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/kernelBlurVertex.ts ***!
- \****************************************************/
- /*! exports provided: kernelBlurVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"kernelBlurVertex",(function(){return o}));var n="kernelBlurVertex",i="sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightFragment.ts":
- /*!*************************************************!*\
- !*** ./Shaders/ShadersInclude/lightFragment.ts ***!
- \*************************************************/
- /*! exports provided: lightFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"lightFragment",(function(){return o}));var n="lightFragment",i="#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n\n#else\n#ifdef PBR\n\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#endif\npreInfo.NdotV=NdotV;\n\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\npreInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\npreInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\n#elif defined(SS_TRANSLUCENCY)\ninfo.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef SPECULARTERM\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#endif\n\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\n\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef CLEARCOAT\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);\n#ifdef CLEARCOAT_TINT\n\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);\ninfo.diffuse*=absorption;\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\n\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)\n{\n#ifdef SHADOWCSM_RIGHTHANDED{X}\ndiff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;\n#else\ndiff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;\n#endif\nif (diff{X}>=0.) {\nindex{X}=i;\nbreak;\n}\n}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nfloat frustumLength=frustumLengths{X}[index{X}];\nfloat diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};\nif (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{\nindex{X}+=1;\nfloat nextShadow=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightFragmentDeclaration.ts":
- /*!************************************************************!*\
- !*** ./Shaders/ShadersInclude/lightFragmentDeclaration.ts ***!
- \************************************************************/
- /*! exports provided: lightFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"lightFragmentDeclaration",(function(){return o}));var n="lightFragmentDeclaration",i="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightUboDeclaration.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/ShadersInclude/lightUboDeclaration.ts ***!
- \*******************************************************/
- /*! exports provided: lightUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"lightUboDeclaration",(function(){return o}));var n="lightUboDeclaration",i="#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightsFragmentFunctions.ts":
- /*!***********************************************************!*\
- !*** ./Shaders/ShadersInclude/lightsFragmentFunctions.ts ***!
- \***********************************************************/
- /*! exports provided: lightsFragmentFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"lightsFragmentFunctions",(function(){return o}));var n="lightsFragmentFunctions",i="\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/logDepthDeclaration.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/ShadersInclude/logDepthDeclaration.ts ***!
- \*******************************************************/
- /*! exports provided: logDepthDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"logDepthDeclaration",(function(){return o}));var n="logDepthDeclaration",i="#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/logDepthFragment.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/logDepthFragment.ts ***!
- \****************************************************/
- /*! exports provided: logDepthFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"logDepthFragment",(function(){return o}));var n="logDepthFragment",i="#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/logDepthVertex.ts":
- /*!**************************************************!*\
- !*** ./Shaders/ShadersInclude/logDepthVertex.ts ***!
- \**************************************************/
- /*! exports provided: logDepthVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"logDepthVertex",(function(){return o}));var n="logDepthVertex",i="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/morphTargetsVertex.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/morphTargetsVertex.ts ***!
- \******************************************************/
- /*! exports provided: morphTargetsVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"morphTargetsVertex",(function(){return o}));var n="morphTargetsVertex",i="#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts":
- /*!*****************************************************************!*\
- !*** ./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts ***!
- \*****************************************************************/
- /*! exports provided: morphTargetsVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"morphTargetsVertexDeclaration",(function(){return o}));var n="morphTargetsVertexDeclaration",i="#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts":
- /*!***********************************************************************!*\
- !*** ./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts ***!
- \***********************************************************************/
- /*! exports provided: morphTargetsVertexGlobalDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"morphTargetsVertexGlobalDeclaration",(function(){return o}));var n="morphTargetsVertexGlobalDeclaration",i="#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/mrtFragmentDeclaration.ts":
- /*!**********************************************************!*\
- !*** ./Shaders/ShadersInclude/mrtFragmentDeclaration.ts ***!
- \**********************************************************/
- /*! exports provided: mrtFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"mrtFragmentDeclaration",(function(){return o}));var n="mrtFragmentDeclaration",i="#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/packingFunctions.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/packingFunctions.ts ***!
- \****************************************************/
- /*! exports provided: packingFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"packingFunctions",(function(){return o}));var n="packingFunctions",i="vec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBRDFFunctions.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBRDFFunctions.ts ***!
- \****************************************************/
- /*! exports provided: pbrBRDFFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBRDFFunctions",(function(){return o}));var n="pbrBRDFFunctions",i="\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\n\n\n\n#ifdef MS_BRDF_ENERGY_CONSERVATION\n\n\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\nreturn 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);\n}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {\n\nvec2 UV=vec2(NdotV,perceptualRoughness);\n\nvec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;\n}\n#endif\n\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nvec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n\nvec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {\nvec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;\nreturn sheenEnvironmentReflectance;\n}\n#endif\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\nfloat fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\n#ifdef CLEARCOAT\n\n\n\n\n\nvec3 getR0RemappedForClearCoat(vec3 f0) {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturate(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvec3 s=sqrt(f0);\nvec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);\nreturn t*t;\n#endif\n}\n#endif\n\n\n\n\n\n\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{\n\n\n\nfloat a2=square(alphaG);\nfloat d=NdotH*NdotH*(a2-1.0)+1.0;\nreturn a2/(PI*d*d);\n}\n#ifdef SHEEN\n\n\nfloat normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)\n{\nfloat invR=1./alphaG;\nfloat cos2h=NdotH*NdotH;\nfloat sin2h=1.-cos2h;\nreturn (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {\nfloat a2=alphaTB.x*alphaTB.y;\nvec3 v=vec3(alphaTB.y*TdotH,alphaTB.x*BdotH,a2*NdotH);\nfloat v2=dot(v,v);\nfloat w2=a2/v2;\nreturn a2*w2*w2*RECIPROCAL_PI;\n}\n#endif\n\n\n\n\n#ifdef BRDF_V_HEIGHT_CORRELATED\n\n\n\nfloat smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {\n#ifdef MOBILE\n\nfloat GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);\nfloat GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);\nreturn 0.5/(GGXV+GGXL);\n#else\nfloat a2=alphaG*alphaG;\nfloat GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);\nfloat GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);\nreturn 0.5/(GGXV+GGXL);\n#endif\n}\n#else\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfloat smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)\n{\n#ifdef MOBILE\n\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nfloat alphaSquared=alphaG*alphaG;\nreturn 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfloat smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)\n{\nfloat visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);\n\nreturn visibility;\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {\nfloat lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));\nfloat lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));\nfloat v=0.5/(lambdaV+lambdaL);\nreturn v;\n}\n#endif\n#ifdef CLEARCOAT\nfloat visibility_Kelemen(float VdotH) {\n\n\n\nreturn 0.25/(VdotH*VdotH);\n}\n#endif\n#ifdef SHEEN\n\n\n\nfloat visibility_Ashikhmin(float NdotL,float NdotV)\n{\nreturn 1./(4.*(NdotL+NdotV-NdotL*NdotV));\n}\n\n#endif\n\n\n\n\n\n\n\nfloat diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {\n\n\nfloat diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));\nfloat diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));\nfloat diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;\nfloat fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);\nreturn fresnel/PI;\n}\n#ifdef SS_TRANSLUCENCY\n\n\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {\nvec3 S=1./maxEps(diffusionDistance);\nvec3 temp=exp((-0.333333333*thickness)*S);\nreturn tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);\n}\n\n\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {\nfloat t=1.0+w;\nfloat invt2=1.0/square(t);\nreturn saturate((NdotL+w)*invt2);\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockAlbedoOpacity.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockAlbedoOpacity.ts ***!
- \*********************************************************/
- /*! exports provided: pbrBlockAlbedoOpacity */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockAlbedoOpacity",(function(){return o}));var n="pbrBlockAlbedoOpacity",i="struct albedoOpacityOutParams\n{\nvec3 surfaceAlbedo;\nfloat alpha;\n};\n#define pbr_inline\nvoid albedoOpacityBlock(\nconst in vec4 vAlbedoColor,\n#ifdef ALBEDO\nconst in vec4 albedoTexture,\nconst in vec2 albedoInfos,\n#endif\n#ifdef OPACITY\nconst in vec4 opacityMap,\nconst in vec2 vOpacityInfos,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout albedoOpacityOutParams outParams\n)\n{\n\nvec3 surfaceAlbedo=vAlbedoColor.rgb;\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\n#ifdef GAMMAALBEDO\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\n#else\nsurfaceAlbedo*=albedoTexture.rgb;\n#endif\nsurfaceAlbedo*=albedoInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nsurfaceAlbedo*=vColor.rgb;\n#endif\n#ifdef DETAIL\nfloat detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);\nsurfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALBEDO\n\n#ifdef OPACITY\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;\noutParams.alpha=alpha;\n}\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockAlphaFresnel.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockAlphaFresnel.ts ***!
- \********************************************************/
- /*! exports provided: pbrBlockAlphaFresnel */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockAlphaFresnel",(function(){return o}));var n="pbrBlockAlphaFresnel",i="#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nstruct alphaFresnelOutParams\n{\nfloat alpha;\n};\n#define pbr_inline\nvoid alphaFresnelBlock(\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nconst in float alpha,\nconst in float microSurface,\nout alphaFresnelOutParams outParams\n)\n{\n\n\n\nfloat opacityPerceptual=alpha;\n#ifdef LINEARALPHAFRESNEL\nfloat opacity0=opacityPerceptual;\n#else\nfloat opacity0=opacityPerceptual*opacityPerceptual;\n#endif\nfloat opacity90=fresnelGrazingReflectance(opacity0);\nvec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);\n\noutParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (outParams.alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\noutParams.alpha=1.0;\n#endif\n#endif\n}\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockAmbientOcclusion.ts":
- /*!************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockAmbientOcclusion.ts ***!
- \************************************************************/
- /*! exports provided: pbrBlockAmbientOcclusion */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockAmbientOcclusion",(function(){return o}));var n="pbrBlockAmbientOcclusion",i="struct ambientOcclusionOutParams\n{\nvec3 ambientOcclusionColor;\n#if DEBUGMODE>0\nvec3 ambientOcclusionColorMap;\n#endif\n};\n#define pbr_inline\nvoid ambientOcclusionBlock(\n#ifdef AMBIENT\nconst in vec3 ambientOcclusionColorMap_,\nconst in vec4 vAmbientInfos,\n#endif\nout ambientOcclusionOutParams outParams\n)\n{\nvec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#if DEBUGMODE>0\noutParams.ambientOcclusionColorMap=ambientOcclusionColorMap;\n#endif\n#endif\noutParams.ambientOcclusionColor=ambientOcclusionColor;\n}\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockAnisotropic.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockAnisotropic.ts ***!
- \*******************************************************/
- /*! exports provided: pbrBlockAnisotropic */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockAnisotropic",(function(){return o}));var n="pbrBlockAnisotropic",i="#ifdef ANISOTROPIC\nstruct anisotropicOutParams\n{\nfloat anisotropy;\nvec3 anisotropicTangent;\nvec3 anisotropicBitangent;\nvec3 anisotropicNormal;\n#if DEBUGMODE>0\nvec3 anisotropyMapData;\n#endif\n};\n#define pbr_inline\nvoid anisotropicBlock(\nconst in vec3 vAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nconst in vec3 anisotropyMapData,\n#endif\nconst in mat3 TBN,\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nout anisotropicOutParams outParams\n)\n{\nfloat anisotropy=vAnisotropy.b;\nvec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nanisotropy*=anisotropyMapData.b;\nanisotropyDirection.rg*=anisotropyMapData.rg*2.0-1.0;\n#if DEBUGMODE>0\noutParams.anisotropyMapData=anisotropyMapData;\n#endif\n#endif\nmat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));\nvec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);\nvec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));\noutParams.anisotropy=anisotropy;\noutParams.anisotropicTangent=anisotropicTangent;\noutParams.anisotropicBitangent=anisotropicBitangent;\noutParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy);\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockClearcoat.ts":
- /*!*****************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockClearcoat.ts ***!
- \*****************************************************/
- /*! exports provided: pbrBlockClearcoat */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockClearcoat",(function(){return o}));var n="pbrBlockClearcoat",i="struct clearcoatOutParams\n{\nvec3 specularEnvironmentR0;\nfloat conservationFactor;\nvec3 clearCoatNormalW;\nvec2 clearCoatAARoughnessFactors;\nfloat clearCoatIntensity;\nfloat clearCoatRoughness;\n#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;\nfloat clearCoatNdotVRefract;\nvec3 clearCoatColor;\nfloat clearCoatThickness;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\n#endif\n#if DEBUGMODE>0\nmat3 TBNClearCoat;\nvec2 clearCoatMapData;\nvec4 clearCoatTintMapData;\nvec4 environmentClearCoatRadiance;\nfloat clearCoatNdotV;\nvec3 clearCoatEnvironmentReflectance;\n#endif\n};\n#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nvoid clearcoatBlock(\nconst in vec3 vPositionW,\nconst in vec3 geometricNormalW,\nconst in vec3 viewDirectionW,\nconst in vec2 vClearCoatParams,\nconst in vec3 specularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nconst in vec2 clearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nconst in vec4 vClearCoatTintParams,\nconst in float clearCoatColorAtDistance,\nconst in vec4 vClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nconst in vec4 clearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nconst in vec2 vClearCoatBumpInfos,\nconst in vec4 clearCoatBumpMapData,\nconst in vec2 vClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nconst in mat3 vTBN,\n#else\nconst in vec2 vClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nconst in mat4 normalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nconst in vec3 faceNormal,\n#endif\n#ifdef REFLECTION\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nconst in float ambientMonochrome,\n#endif\n#endif\nout clearcoatOutParams outParams\n)\n{\n\nfloat clearCoatIntensity=vClearCoatParams.x;\nfloat clearCoatRoughness=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\nclearCoatRoughness*=clearCoatMapData.y;\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\n#endif\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;\noutParams.clearCoatRoughness=clearCoatRoughness;\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\nfloat clearCoatThickness=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatColor*=clearCoatTintMapData.rgb;\nclearCoatThickness*=clearCoatTintMapData.a;\n#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\n#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\noutParams.clearCoatThickness=clearCoatThickness;\n#endif\n\n\n\n\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\n\nvec3 clearCoatNormalW=geometricNormalW;\n#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\n#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\n#else\nmat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,vClearCoatBumpUV,vClearCoatTangentSpaceParams);\n#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz*2.0-1.0);\nclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=gl_FrontFacing ? clearCoatNormalW : -clearCoatNormalW;\n#endif\noutParams.clearCoatNormalW=clearCoatNormalW;\n\noutParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\n\nfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\n\nfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\n#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\n#endif\n#ifdef CLEARCOAT_TINT\n\nvec3 clearCoatVRefract=-refract(vPositionW,clearCoatNormalW,vClearCoatRefractionParams.y);\n\noutParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\n#endif\n\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\n\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\n#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);\nvec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\n#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\n#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\n#endif\nsampleReflectionTexture(\nclearCoatAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\n#endif\nreflectionSampler,\nclearCoatReflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\nenvironmentClearCoatRadiance\n);\n#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\n#endif\n\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\n#ifdef RADIANCEOCCLUSION\nfloat clearCoatSeo=environmentRadianceOcclusion(ambientMonochrome,clearCoatNdotVUnclamped);\nclearCoatEnvironmentReflectance*=clearCoatSeo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);\nclearCoatEnvironmentReflectance*=clearCoatEho;\n#endif\n#endif\n#endif\n#else\n\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\n#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\n#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\n#endif\noutParams.finalClearCoatRadianceScaled=\nenvironmentClearCoatRadiance.rgb *\nclearCoatEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(CLEARCOAT_TINT)\n\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#endif\n\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnelIBLClearCoat*=clearCoatIntensity;\noutParams.conservationFactor=(1.-fresnelIBLClearCoat);\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\n#endif\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockDirectLighting.ts":
- /*!**********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockDirectLighting.ts ***!
- \**********************************************************/
- /*! exports provided: pbrBlockDirectLighting */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockDirectLighting",(function(){return o}));var n="pbrBlockDirectLighting",i="vec3 diffuseBase=vec3(0.,0.,0.);\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#ifdef CLEARCOAT\nvec3 clearCoatBase=vec3(0.,0.,0.);\n#endif\n#ifdef SHEEN\nvec3 sheenBase=vec3(0.,0.,0.);\n#endif\n\npreLightingInfo preInfo;\nlightingInfo info;\nfloat shadow=1.;\n#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\nvec3 absorption=vec3(0.);\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockFinalColorComposition.ts":
- /*!*****************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockFinalColorComposition.ts ***!
- \*****************************************************************/
- /*! exports provided: pbrBlockFinalColorComposition */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockFinalColorComposition",(function(){return o}));var n="pbrBlockFinalColorComposition",i="vec4 finalColor=vec4(\nfinalAmbient +\nfinalDiffuse +\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance +\n#endif\n#ifdef SPECULARTERM\nfinalSpecularScaled +\n#endif\n#ifdef SHEEN\nfinalSheenScaled +\n#endif\n#ifdef CLEARCOAT\nfinalClearCoatScaled +\n#endif\n#ifdef REFLECTION\nfinalRadianceScaled +\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled +\n#endif\n#ifdef CLEARCOAT\nclearcoatOut.finalClearCoatRadianceScaled +\n#endif\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction +\n#endif\n#endif\nfinalEmissive,\nalpha);\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor.rgb;\n#else\nfinalColor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\n\nfinalColor=max(finalColor,0.0);\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockFinalLitComponents.ts":
- /*!**************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockFinalLitComponents.ts ***!
- \**************************************************************/
- /*! exports provided: pbrBlockFinalLitComponents */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockFinalLitComponents",(function(){return o}));var n="pbrBlockFinalLitComponents",i="\n\n\n\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n#ifndef METALLICWORKFLOW\n#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\n#endif\n#endif\n#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)\nsurfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;\n#endif\n\n#ifdef REFLECTION\nvec3 finalIrradiance=reflectionOut.environmentIrradiance;\n#if defined(CLEARCOAT)\nfinalIrradiance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nfinalIrradiance*=clearcoatOut.absorption;\n#endif\n#endif\n#if defined(SS_REFRACTION)\nfinalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;\n#endif\n#if defined(SS_TRANSLUCENCY)\nfinalIrradiance+=subSurfaceOut.refractionIrradiance;\n#endif\nfinalIrradiance*=surfaceAlbedo.rgb;\nfinalIrradiance*=vLightingIntensity.z;\nfinalIrradiance*=aoOut.ambientOcclusionColor;\n#endif\n\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;\nfinalSpecular=max(finalSpecular,0.0);\nvec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalSpecularScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef REFLECTION\nvec3 finalRadiance=reflectionOut.environmentRadiance.rgb;\nfinalRadiance*=subSurfaceOut.specularEnvironmentReflectance;\nvec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalRadianceScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef SHEEN\nvec3 finalSheen=sheenBase*sheenOut.sheenColor;\nfinalSheen=max(finalSheen,0.0);\nvec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef CLEARCOAT\nvec3 finalClearCoat=clearCoatBase;\nfinalClearCoat=max(finalClearCoat,0.0);\nvec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;\n#ifdef CLEARCOAT_TINT\nsubSurfaceOut.finalRefraction*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef ALPHABLEND\nfloat luminanceOverAlpha=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#if defined(CLEARCOAT)\nluminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);\n#endif\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalClearCoatScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA)\nalpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.ts":
- /*!****************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.ts ***!
- \****************************************************************/
- /*! exports provided: pbrBlockFinalUnlitComponents */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockFinalUnlitComponents",(function(){return o}));var n="pbrBlockFinalUnlitComponents",i="\nvec3 finalDiffuse=diffuseBase;\nfinalDiffuse*=surfaceAlbedo.rgb;\nfinalDiffuse=max(finalDiffuse,0.0);\nfinalDiffuse*=vLightingIntensity.x;\n\nvec3 finalAmbient=vAmbientColor;\nfinalAmbient*=surfaceAlbedo.rgb;\n\nvec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\nfinalEmissive*=vEmissiveInfos.y;\n#endif\nfinalEmissive*=vLightingIntensity.y;\n\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;\n#endif\nfinalAmbient*=aoOut.ambientOcclusionColor;\nfinalDiffuse*=ambientOcclusionForDirectDiffuse;\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockGeometryInfo.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockGeometryInfo.ts ***!
- \********************************************************/
- /*! exports provided: pbrBlockGeometryInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockGeometryInfo",(function(){return o}));var n="pbrBlockGeometryInfo",i="float NdotVUnclamped=dot(normalW,viewDirectionW);\n\nfloat NdotV=absEps(NdotVUnclamped);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);\n#ifdef SPECULARAA\n\nalphaG+=AARoughnessFactors.y;\n#endif\n#if defined(ENVIRONMENTBRDF)\n\nvec3 environmentBrdf=getBRDFLookup(NdotV,roughness);\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=aoOut.ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);\n#endif\n#endif\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockImageProcessing.ts":
- /*!***********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockImageProcessing.ts ***!
- \***********************************************************/
- /*! exports provided: pbrBlockImageProcessing */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockImageProcessing",(function(){return o}));var n="pbrBlockImageProcessing",i="#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\nfinalColor.rgb=clamp(finalColor.rgb,0.,30.0);\n#else\n\nfinalColor=applyImageProcessing(finalColor);\n#endif\nfinalColor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\nfinalColor.rgb*=finalColor.a;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockLightmapInit.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockLightmapInit.ts ***!
- \********************************************************/
- /*! exports provided: pbrBlockLightmapInit */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockLightmapInit",(function(){return o}));var n="pbrBlockLightmapInit",i="#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\n#ifdef GAMMALIGHTMAP\nlightmapColor.rgb=toLinearSpace(lightmapColor.rgb);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockNormalFinal.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockNormalFinal.ts ***!
- \*******************************************************/
- /*! exports provided: pbrBlockNormalFinal */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockNormalFinal",(function(){return o}));var n="pbrBlockNormalFinal",i="#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=gl_FrontFacing ? faceNormal : -faceNormal;\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockNormalGeometric.ts":
- /*!***********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockNormalGeometric.ts ***!
- \***********************************************************/
- /*! exports provided: pbrBlockNormalGeometric */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockNormalGeometric",(function(){return o}));var n="pbrBlockNormalGeometric",i="vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#endif\nvec3 geometricNormalW=normalW;\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\ngeometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockReflectance.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockReflectance.ts ***!
- \*******************************************************/
- /*! exports provided: pbrBlockReflectance */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockReflectance",(function(){return o}));var n="pbrBlockReflectance",i="#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);\n#ifdef RADIANCEOCCLUSION\nspecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nspecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\n\nvec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n#endif\n#ifdef CLEARCOAT\nspecularEnvironmentReflectance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nspecularEnvironmentReflectance*=clearcoatOut.absorption;\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockReflectance0.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockReflectance0.ts ***!
- \********************************************************/
- /*! exports provided: pbrBlockReflectance0 */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockReflectance0",(function(){return o}));var n="pbrBlockReflectance0",i="float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);\nvec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);\n#else\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef ALPHAFRESNEL\nfloat reflectance90=fresnelGrazingReflectance(reflectance);\nspecularEnvironmentR90=specularEnvironmentR90*reflectance90;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockReflection.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockReflection.ts ***!
- \******************************************************/
- /*! exports provided: pbrBlockReflection */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockReflection",(function(){return o}));var n="pbrBlockReflection",i="#ifdef REFLECTION\nstruct reflectionOutParams\n{\nvec4 environmentRadiance;\nvec3 environmentIrradiance;\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords;\n#else\nvec2 reflectionCoords;\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nvec3 irradianceVector;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nvoid createReflectionCoords(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REFLECTIONMAP_3D\nout vec3 reflectionCoords\n#else\nout vec2 reflectionCoords\n#endif\n)\n{\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n}\n#define pbr_inline\n#define inline\nvoid sampleReflectionTexture(\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst vec2 reflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\nout vec4 environmentRadiance\n)\n{\n\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);\nfloat requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);\nif (lodReflectionNormalizedDoubled<1.0){\nenvironmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nenvironmentRadiance=mix(\nenvironmentMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\n\nenvironmentRadiance.rgb*=vReflectionInfos.x;\nenvironmentRadiance.rgb*=vReflectionColor.rgb;\n}\n#define pbr_inline\n#define inline\nvoid reflectionBlock(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nconst in vec3 vEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in mat4 reflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\nout reflectionOutParams outParams\n)\n{\n\nvec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=vec3(0.);\n#else\nvec2 reflectionCoords=vec2(0.);\n#endif\ncreateReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\nreflectionCoords\n);\nsampleReflectionTexture(\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionSampler,\nreflectionCoords,\n#else\nreflectionSampler,\nreflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\nenvironmentRadiance\n);\n\nvec3 environmentIrradiance=vec3(0.,0.,0.);\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;\noutParams.environmentRadiance=environmentRadiance;\noutParams.environmentIrradiance=environmentIrradiance;\noutParams.reflectionCoords=reflectionCoords;\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockReflectivity.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockReflectivity.ts ***!
- \********************************************************/
- /*! exports provided: pbrBlockReflectivity */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockReflectivity",(function(){return o}));var n="pbrBlockReflectivity",i="struct reflectivityOutParams\n{\nfloat microSurface;\nfloat roughness;\nvec3 surfaceReflectivityColor;\n#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\n#endif\n#if DEBUGMODE>0\nvec4 surfaceMetallicColorMap;\nvec4 surfaceReflectivityColorMap;\nvec2 metallicRoughness;\nvec3 metallicF0;\n#endif\n};\n#define pbr_inline\nvoid reflectivityBlock(\nconst in vec4 vReflectivityColor,\n#ifdef METALLICWORKFLOW\nconst in vec3 surfaceAlbedo,\nconst in vec4 metallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nconst in vec3 reflectivityInfos,\nconst in vec4 surfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nconst in vec3 ambientOcclusionColorIn,\n#endif\n#ifdef MICROSURFACEMAP\nconst in vec4 microSurfaceTexel,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout reflectivityOutParams outParams\n)\n{\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\n#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);\noutParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,vReflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\n#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=2.0*mix(0.5,detailColor.b,vDetailInfos.w);\nmetallicRoughness.g=saturate(metallicRoughness.g*detailRoughness);\n#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n#if DEBUGMODE>0\noutParams.metallicRoughness=metallicRoughness;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\n\nmicroSurface=1.0-metallicRoughness.g;\n\nvec3 baseColor=surfaceAlbedo;\n#ifdef FROSTBITE_REFLECTANCE\n\n\n\n\n\n\noutParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\n#else\nvec3 metallicF0=metallicReflectanceFactors.rgb;\n#if DEBUGMODE>0\noutParams.metallicF0=metallicF0;\n#endif\n\noutParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);\n#endif\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\n#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;\nmicroSurface*=reflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\n#endif\n\nmicroSurface=saturate(microSurface);\n\nfloat roughness=1.-microSurface;\noutParams.microSurface=microSurface;\noutParams.roughness=roughness;\noutParams.surfaceReflectivityColor=surfaceReflectivityColor;\n}\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockSheen.ts":
- /*!*************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockSheen.ts ***!
- \*************************************************/
- /*! exports provided: pbrBlockSheen */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockSheen",(function(){return o}));var n="pbrBlockSheen",i="#ifdef SHEEN\nstruct sheenOutParams\n{\nfloat sheenIntensity;\nvec3 sheenColor;\nfloat sheenRoughness;\n#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\n#endif\n#if DEBUGMODE>0\nvec4 sheenMapData;\nvec3 sheenEnvironmentReflectance;\n#endif\n};\n#define pbr_inline\n#define inline\nvoid sheenBlock(\nconst in vec4 vSheenColor,\n#ifdef SHEEN_ROUGHNESS\nconst in float vSheenRoughness,\n#endif\nconst in float roughness,\n#ifdef SHEEN_TEXTURE\nconst in vec4 sheenMapData,\n#endif\nconst in float reflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nconst in vec3 baseColor,\nconst in vec3 surfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nconst in float NdotV,\nconst in vec3 environmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nconst in vec2 AARoughnessFactors,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst in vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst in vec2 reflectionCoords,\n#endif\nconst in float NdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nconst in float seo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nconst in float eho,\n#endif\n#endif\nout sheenOutParams outParams\n)\n{\nfloat sheenIntensity=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\n#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\nvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\nfloat sheenRoughness=sheenIntensity;\noutParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\nsheenColor.rgb*=sheenMapData.rgb;\n#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\n#ifdef SHEEN_TEXTURE\nsheenRoughness*=sheenMapData.a;\n#endif\n#else\nfloat sheenRoughness=roughness;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#endif\n\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\n#endif\n\nsheenColor*=sheenIntensity;\n#endif\n\n#ifdef ENVIRONMENTBRDF\n\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\n#else\nvec3 environmentSheenBrdf=environmentBrdf;\n#endif\n\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\n\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\nsampleReflectionTexture(\nsheenAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\n#endif\nreflectionSampler,\nreflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\nenvironmentSheenRadiance\n);\nvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\n#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\n#endif\noutParams.finalSheenRadianceScaled=\nenvironmentSheenRadiance.rgb *\nsheenEnvironmentReflectance *\nvLightingIntensity.z;\n\n\n\n\n\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\n\n\n\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\n#endif\n\noutParams.sheenIntensity=sheenIntensity;\noutParams.sheenColor=sheenColor;\noutParams.sheenRoughness=sheenRoughness;\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBlockSubSurface.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrBlockSubSurface.ts ***!
- \******************************************************/
- /*! exports provided: pbrBlockSubSurface */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBlockSubSurface",(function(){return o}));var n="pbrBlockSubSurface",i="struct subSurfaceOutParams\n{\nvec3 specularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nvec3 finalRefraction;\nvec3 surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\n#endif\n#ifdef REFLECTION\nfloat refractionFactorForIrradiance;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;\n#ifdef REFLECTION\nvec3 refractionIrradiance;\n#endif\n#endif\n#if DEBUGMODE>0\nvec4 thicknessMap;\nvec4 environmentRefraction;\nvec3 refractionTransmittance;\n#endif\n};\n#ifdef SUBSURFACE\n#define pbr_inline\n#define inline\nvoid subSurfaceBlock(\nconst in vec3 vSubSurfaceIntensity,\nconst in vec2 vThicknessParam,\nconst in vec4 vTintColor,\nconst in vec3 normalW,\nconst in vec3 specularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nconst in vec4 thicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nconst in mat4 reflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in vec3 irradianceVector_,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nconst in vec3 vPositionW,\nconst in vec3 viewDirectionW,\nconst in mat4 view,\nconst in vec3 surfaceAlbedo,\nconst in vec4 vRefractionInfos,\nconst in mat4 refractionMatrix,\nconst in vec3 vRefractionMicrosurfaceInfos,\nconst in vec4 vLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nconst in float alpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nconst in float NdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nconst in float roughness,\n#else\nconst in float alphaG,\n#endif\n#ifdef SS_REFRACTIONMAP_3D\nconst in samplerCube refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in samplerCube refractionSamplerLow,\nconst in samplerCube refractionSamplerHigh,\n#endif\n#else\nconst in sampler2D refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in sampler2D refractionSamplerLow,\nconst in sampler2D refractionSamplerHigh,\n#endif\n#endif\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nconst in vec3 vDiffusionDistance,\n#endif\nout subSurfaceOutParams outParams\n)\n{\noutParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\n\n\n\n#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);\n\noutParams.alpha=1.0;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\n#endif\n#ifdef SS_MASK_FROM_THICKNESS_TEXTURE\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.g;\n#endif\n#ifdef SS_TRANSLUCENCY\ntranslucencyIntensity*=thicknessMap.b;\n#endif\n#endif\n#else\nfloat thickness=vThicknessParam.y;\n#endif\n\n\n\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);\nvec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);\ntransmittance*=translucencyIntensity;\noutParams.transmittance=transmittance;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);\n#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n\n#ifdef SS_REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nvec3 refractionCoords=refractionVector;\nrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,roughness);\n#else\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef SS_LODINREFRACTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\nfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\n#else\nfloat requestedRefractionLOD=refractionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\n#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\n#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));\nfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\nvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\nif (lodRefractionNormalizedDoubled<1.0){\nenvironmentRefraction=mix(\nsampleRefraction(refractionSamplerHigh,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);\n} else {\nenvironmentRefraction=mix(\nenvironmentRefractionMid,\nsampleRefraction(refractionSamplerLow,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\n\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\n\n\n\n\n\nrefractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\n#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\n\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);\nvec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);\n\nenvironmentRefraction.rgb*=volumeAlbedo;\n#else\n\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\nrefractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\n#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\n\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\n#endif\n\noutParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);\n#ifdef REFLECTION\n\noutParams.refractionFactorForIrradiance=(1.-refractionIntensity);\n\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\noutParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\n\nrefractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;\n#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\n#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;\n#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\n#endif\n#endif\n\n\n\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#else\nvec3 irradianceVector=irradianceVector_;\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);\n#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\n#else\nvec2 irradianceCoords=irradianceVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\n#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\n#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\n#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\n#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\n#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\n#endif\nrefractionIrradiance.rgb*=transmittance;\noutParams.refractionIrradiance=refractionIrradiance.rgb;\n#endif\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrDebug.ts":
- /*!********************************************!*\
- !*** ./Shaders/ShadersInclude/pbrDebug.ts ***!
- \********************************************/
- /*! exports provided: pbrDebug */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrDebug",(function(){return i}));var n="#if DEBUGMODE>0\nif (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {\n\n#if DEBUGMODE == 1\ngl_FragColor.rgb=vPositionW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 2 && defined(NORMAL)\ngl_FragColor.rgb=vNormalW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 3 && defined(BUMP) || DEBUGMODE == 3 && defined(PARALLAX) || DEBUGMODE == 3 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 4 && defined(BUMP) || DEBUGMODE == 4 && defined(PARALLAX) || DEBUGMODE == 4 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 5\n\ngl_FragColor.rgb=normalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 6 && defined(MAINUV1)\ngl_FragColor.rgb=vec3(vMainUV1,0.0);\n#elif DEBUGMODE == 7 && defined(MAINUV2)\ngl_FragColor.rgb=vec3(vMainUV2,0.0);\n#elif DEBUGMODE == 8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 10 && defined(CLEARCOAT)\n\ngl_FragColor.rgb=clearcoatOut.clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 11 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 12 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 13 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicBitangent;\n#define DEBUGMODE_NORMALIZE\n\n#elif DEBUGMODE == 20 && defined(ALBEDO)\ngl_FragColor.rgb=albedoTexture.rgb;\n#elif DEBUGMODE == 21 && defined(AMBIENT)\ngl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;\n#elif DEBUGMODE == 22 && defined(OPACITY)\ngl_FragColor.rgb=opacityMap.rgb;\n#elif DEBUGMODE == 23 && defined(EMISSIVE)\ngl_FragColor.rgb=emissiveColorTex.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 24 && defined(LIGHTMAP)\ngl_FragColor.rgb=lightmapColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE == 26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);\n#elif DEBUGMODE == 28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ngl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;\n#elif DEBUGMODE == 29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ngl_FragColor.rgb=sheenOut.sheenMapData.rgb;\n#elif DEBUGMODE == 30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ngl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;\n#elif DEBUGMODE == 31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)\ngl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;\n\n#elif DEBUGMODE == 40 && defined(SS_REFRACTION)\n\ngl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 41 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 42 && defined(CLEARCOAT) && defined(REFLECTION)\ngl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 50\ngl_FragColor.rgb=diffuseBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 51 && defined(SPECULARTERM)\ngl_FragColor.rgb=specularBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 52 && defined(CLEARCOAT)\ngl_FragColor.rgb=clearCoatBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 53 && defined(SHEEN)\ngl_FragColor.rgb=sheenBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 54 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 60\ngl_FragColor.rgb=surfaceAlbedo.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 61\ngl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 62 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);\n#elif DEBUGMODE == 71 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.metallicF0;\n#elif DEBUGMODE == 63\ngl_FragColor.rgb=vec3(roughness);\n#elif DEBUGMODE == 64\ngl_FragColor.rgb=vec3(alphaG);\n#elif DEBUGMODE == 65\ngl_FragColor.rgb=vec3(NdotV);\n#elif DEBUGMODE == 66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ngl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 67 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);\n#elif DEBUGMODE == 68 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);\n#elif DEBUGMODE == 69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)\ngl_FragColor.rgb=subSurfaceOut.transmittance;\n#elif DEBUGMODE == 70 && defined(SUBSURFACE) && defined(SS_REFRACTION)\ngl_FragColor.rgb=subSurfaceOut.refractionTransmittance;\n\n#elif DEBUGMODE == 80 && defined(RADIANCEOCCLUSION)\ngl_FragColor.rgb=vec3(seo);\n#elif DEBUGMODE == 81 && defined(HORIZONOCCLUSION)\ngl_FragColor.rgb=vec3(eho);\n#elif DEBUGMODE == 82 && defined(MS_BRDF_ENERGY_CONSERVATION)\ngl_FragColor.rgb=vec3(energyConservationFactor);\n#elif DEBUGMODE == 83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=specularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 85 && defined(SHEEN) && defined(REFLECTION)\ngl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 86 && defined(ALPHABLEND)\ngl_FragColor.rgb=vec3(luminanceOverAlpha);\n#elif DEBUGMODE == 87\ngl_FragColor.rgb=vec3(alpha);\n#endif\ngl_FragColor.rgb*=vDebugMode.y;\n#ifdef DEBUGMODE_NORMALIZE\ngl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;\n#endif\n#ifdef DEBUGMODE_GAMMA\ngl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);\n#endif\ngl_FragColor.a=1.0;\n#ifdef PREPASS\ngl_FragData[0]=toLinearSpace(gl_FragColor);\ngl_FragData[1]=vec4(0.,0.,0.,0.);\n#endif\nreturn;\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore.pbrDebug=n;var i={name:"pbrDebug",shader:n}},"./Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.ts":
- /*!*********************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.ts ***!
- \*********************************************************************/
- /*! exports provided: pbrDirectLightingFalloffFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrDirectLightingFalloffFunctions",(function(){return o}));var n="pbrDirectLightingFalloffFunctions",i="float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)\n{\nreturn max(0.,1.0-length(lightOffset)/range);\n}\nfloat computeDistanceLightFalloff_Physical(float lightDistanceSquared)\n{\nreturn 1.0/maxEps(lightDistanceSquared);\n}\nfloat computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)\n{\nfloat lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);\nfloat factor=lightDistanceSquared*inverseSquaredRange;\nfloat attenuation=saturate(1.0-factor*factor);\nattenuation*=attenuation;\n\nlightDistanceFalloff*=attenuation;\nreturn lightDistanceFalloff;\n}\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfloat computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)\n{\nfloat falloff=0.0;\nfloat cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));\nif (cosAngle>=cosHalfAngle)\n{\nfalloff=max(0.,pow(cosAngle,exponent));\n}\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)\n{\nconst float kMinusLog2ConeAngleIntensityRatio=6.64385618977;\n\n\n\n\n\nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);\n\n\nvec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);\nfloat falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)\n{\n\n\n\nfloat cd=dot(-lightDirection,directionToLightCenterW);\nfloat falloff=saturate(cd*lightAngleScale+lightAngleOffset);\n\nfalloff*=falloff;\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrDirectLightingFunctions.ts":
- /*!**************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrDirectLightingFunctions.ts ***!
- \**************************************************************/
- /*! exports provided: pbrDirectLightingFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrDirectLightingFunctions",(function(){return o}));var n="pbrDirectLightingFunctions",i="#define CLEARCOATREFLECTANCE90 1.0\n\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef CLEARCOAT\n\n\nvec4 clearCoat;\n#endif\n#ifdef SHEEN\nvec3 sheen;\n#endif\n};\n\nfloat adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\n\nfloat lightRoughness=lightRadius/lightDistance;\n\nfloat totalRoughness=saturate(lightRoughness+roughness);\nreturn totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nvec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {\nreturn mix(groundColor,lightColor,info.NdotL);\n}\nvec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {\nfloat diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*info.attenuation*info.NdotL*lightColor;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn toLinearSpace(textureColor);\n}\n#ifdef SS_TRANSLUCENCY\nvec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {\nfloat NdotL=absEps(info.NdotLUnclamped);\n\nfloat wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);\n\nfloat trAdapt=step(0.,info.NdotLUnclamped);\nvec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);\nfloat diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;\n}\n#endif\n#ifdef SPECULARTERM\nvec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nfloat smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef ANISOTROPIC\nvec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat TdotH=dot(T,info.H);\nfloat BdotH=dot(B,info.H);\nfloat TdotV=dot(T,V);\nfloat BdotV=dot(B,V);\nfloat TdotL=dot(T,info.L);\nfloat BdotL=dot(B,info.L);\nfloat alphaG=convertRoughnessToAverageSlope(info.roughness);\nvec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);\nalphaTB=max(alphaTB,square(geometricRoughnessFactor));\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);\nfloat smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef CLEARCOAT\nvec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {\nfloat NccdotL=saturateEps(dot(Ncc,info.L));\nfloat NccdotH=saturateEps(dot(Ncc,info.H));\nfloat clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\nfloat fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnel*=clearCoatIntensity;\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);\nfloat kelemenVisibility=visibility_Kelemen(info.VdotH);\nfloat clearCoatTerm=fresnel*distribution*kelemenVisibility;\nreturn vec4(\nclearCoatTerm*info.attenuation*NccdotL*lightColor,\n1.0-fresnel\n);\n}\nvec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);\nfloat NdotLRefract=saturateEps(dot(Ncc,LRefract));\nvec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);\nreturn absorption;\n}\n#endif\n#ifdef SHEEN\nvec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\n\n\nfloat fresnel=1.;\nfloat distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);\n\nfloat visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);\n\nfloat sheenTerm=fresnel*distribution*visibility;\nreturn sheenTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.ts":
- /*!*******************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.ts ***!
- \*******************************************************************/
- /*! exports provided: pbrDirectLightingSetupFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrDirectLightingSetupFunctions",(function(){return o}));var n="pbrDirectLightingSetupFunctions",i="\nstruct preLightingInfo\n{\n\nvec3 lightOffset;\nfloat lightDistanceSquared;\nfloat lightDistance;\n\nfloat attenuation;\n\nvec3 L;\nvec3 H;\nfloat NdotV;\nfloat NdotLUnclamped;\nfloat NdotL;\nfloat VdotH;\nfloat roughness;\n};\npreLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightOffset=lightData.xyz-vPositionW;\nresult.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);\n\nresult.lightDistance=sqrt(result.lightDistanceSquared);\n\nresult.L=normalize(result.lightOffset);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightDistance=length(-lightData.xyz);\n\nresult.L=normalize(-lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\n\nresult.NdotL=dot(N,lightData.xyz)*0.5+0.5;\nresult.NdotL=saturateEps(result.NdotL);\nresult.NdotLUnclamped=result.NdotL;\n#ifdef SPECULARTERM\nresult.L=normalize(lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\n#endif\nreturn result;\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrFragmentDeclaration.ts":
- /*!**********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrFragmentDeclaration.ts ***!
- \**********************************************************/
- /*! exports provided: pbrFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrFragmentDeclaration",(function(){return o}));var n="pbrFragmentDeclaration",i="uniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\n\nuniform vec4 vLightingIntensity;\nuniform vec4 vReflectivityColor;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef ALBEDO\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\n#endif\n\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REALTIME_FILTERING\nuniform vec2 vReflectionFilteringInfo;\n#endif\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n\n#ifdef CLEARCOAT\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\n#ifdef CLEARCOAT_TEXTURE\nuniform vec2 vClearCoatInfos;\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n#endif\n\n#ifdef ANISOTROPIC\nuniform vec3 vAnisotropy;\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\nuniform vec4 vSheenColor;\n#ifdef SHEEN_ROUGHNESS\nuniform float vSheenRoughness;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform vec2 vSheenInfos;\nuniform mat4 sheenMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#ifdef REALTIME_FILTERING\nuniform vec2 vRefractionFilteringInfo;\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\n#ifdef SS_SCATTERING\nuniform float scatteringDiffusionProfile;\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrFragmentExtraDeclaration.ts":
- /*!***************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrFragmentExtraDeclaration.ts ***!
- \***************************************************************/
- /*! exports provided: pbrFragmentExtraDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrFragmentExtraDeclaration",(function(){return o}));var n="pbrFragmentExtraDeclaration",i="uniform vec4 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec4 vCameraInfos;\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nuniform vec2 vDebugMode;\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef PREPASS\nvarying vec3 vViewPos;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.ts":
- /*!******************************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.ts ***!
- \******************************************************************/
- /*! exports provided: pbrFragmentSamplersDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrFragmentSamplersDeclaration",(function(){return o}));var n="pbrFragmentSamplersDeclaration",i="#ifdef ALBEDO\n#if ALBEDODIRECTUV == 1\n#define vAlbedoUV vMainUV1\n#elif ALBEDODIRECTUV == 2\n#define vAlbedoUV vMainUV2\n#else\nvarying vec2 vAlbedoUV;\n#endif\nuniform sampler2D albedoSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFLECTIVITY\n#if REFLECTIVITYDIRECTUV == 1\n#define vReflectivityUV vMainUV1\n#elif REFLECTIVITYDIRECTUV == 2\n#define vReflectivityUV vMainUV2\n#else\nvarying vec2 vReflectivityUV;\n#endif\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef MICROSURFACEMAP\n#if MICROSURFACEMAPDIRECTUV == 1\n#define vMicroSurfaceSamplerUV vMainUV1\n#elif MICROSURFACEMAPDIRECTUV == 2\n#define vMicroSurfaceSamplerUV vMainUV2\n#else\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\nuniform sampler2D microSurfaceSampler;\n#endif\n#ifdef METALLIC_REFLECTANCE\n#if METALLIC_REFLECTANCEDIRECTUV == 1\n#define vMetallicReflectanceUV vMainUV1\n#elif METALLIC_REFLECTANCEDIRECTUV == 2\n#define vMetallicReflectanceUV vMainUV2\n#else\nvarying vec2 vMetallicReflectanceUV;\n#endif\nuniform sampler2D metallicReflectanceSampler;\n#endif\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\n#if CLEARCOAT_TEXTUREDIRECTUV == 1\n#define vClearCoatUV vMainUV1\n#elif CLEARCOAT_TEXTUREDIRECTUV == 2\n#define vClearCoatUV vMainUV2\n#else\nvarying vec2 vClearCoatUV;\n#endif\nuniform sampler2D clearCoatSampler;\n#endif\n#ifdef CLEARCOAT_BUMP\n#if CLEARCOAT_BUMPDIRECTUV == 1\n#define vClearCoatBumpUV vMainUV1\n#elif CLEARCOAT_BUMPDIRECTUV == 2\n#define vClearCoatBumpUV vMainUV2\n#else\nvarying vec2 vClearCoatBumpUV;\n#endif\nuniform sampler2D clearCoatBumpSampler;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\n#if CLEARCOAT_TINT_TEXTUREDIRECTUV == 1\n#define vClearCoatTintUV vMainUV1\n#elif CLEARCOAT_TINT_TEXTUREDIRECTUV == 2\n#define vClearCoatTintUV vMainUV2\n#else\nvarying vec2 vClearCoatTintUV;\n#endif\nuniform sampler2D clearCoatTintSampler;\n#endif\n#endif\n#ifdef SHEEN\n#ifdef SHEEN_TEXTURE\n#if SHEEN_TEXTUREDIRECTUV == 1\n#define vSheenUV vMainUV1\n#elif SHEEN_TEXTUREDIRECTUV == 2\n#define vSheenUV vMainUV2\n#else\nvarying vec2 vSheenUV;\n#endif\nuniform sampler2D sheenSampler;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\n#if ANISOTROPIC_TEXTUREDIRECTUV == 1\n#define vAnisotropyUV vMainUV1\n#elif ANISOTROPIC_TEXTUREDIRECTUV == 2\n#define vAnisotropyUV vMainUV2\n#else\nvarying vec2 vAnisotropyUV;\n#endif\nuniform sampler2D anisotropySampler;\n#endif\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform samplerCube irradianceSampler;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D reflectionSamplerLow;\nuniform sampler2D reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform sampler2D irradianceSampler;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D refractionSamplerLow;\nuniform sampler2D refractionSamplerHigh;\n#endif\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#if SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 1\n#define vThicknessUV vMainUV1\n#elif SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 2\n#define vThicknessUV vMainUV2\n#else\nvarying vec2 vThicknessUV;\n#endif\nuniform sampler2D thicknessSampler;\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrHelperFunctions.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrHelperFunctions.ts ***!
- \******************************************************/
- /*! exports provided: pbrHelperFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrHelperFunctions",(function(){return o}));var n="pbrHelperFunctions",i="\n#define RECIPROCAL_PI2 0.15915494\n#define RECIPROCAL_PI 0.31830988618\n\n#define MINIMUMVARIANCE 0.0005\nfloat convertRoughnessToAverageSlope(float roughness)\n{\n\nreturn square(roughness)+MINIMUMVARIANCE;\n}\nfloat fresnelGrazingReflectance(float reflectance0) {\n\n\nfloat reflectance90=saturate(reflectance0*25.0);\nreturn reflectance90;\n}\nvec2 getAARoughnessFactors(vec3 normalVector) {\n#ifdef SPECULARAA\nvec3 nDfdx=dFdx(normalVector.xyz);\nvec3 nDfdy=dFdy(normalVector.xyz);\nfloat slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));\n\nfloat geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);\n\nfloat geometricAlphaGFactor=sqrt(slopeSquare);\n\ngeometricAlphaGFactor*=0.75;\nreturn vec2(geometricRoughnessFactor,geometricAlphaGFactor);\n#else\nreturn vec2(0.);\n#endif\n}\n#ifdef ANISOTROPIC\n\n\nvec2 getAnisotropicRoughness(float alphaG,float anisotropy) {\nfloat alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);\nfloat alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);\nreturn vec2(alphaT,alphaB);\n}\n\n\nvec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy) {\nvec3 anisotropicFrameDirection=anisotropy>=0.0 ? B : T;\nvec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);\nvec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);\nvec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));\nreturn anisotropicNormal;\n\n}\n#endif\n#if defined(CLEARCOAT) || defined(SS_REFRACTION)\n\n\n\nvec3 cocaLambert(vec3 alpha,float distance) {\nreturn exp(-alpha*distance);\n}\n\nvec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {\nreturn cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));\n}\n\nvec3 computeColorAtDistanceInMedia(vec3 color,float distance) {\nreturn -log(color)/distance;\n}\nvec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 clearCoatAbsorption=mix(vec3(1.0),\ncocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),\nclearCoatIntensity);\nreturn clearCoatAbsorption;\n}\n#endif\n\n\n\n\n#ifdef MICROSURFACEAUTOMATIC\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{\nconst float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;\nfloat reflectivityLuminance=getLuminance(reflectivityColor);\nfloat reflectivityLuma=sqrt(reflectivityLuminance);\nmicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;\nreturn microSurface;\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrIBLFunctions.ts":
- /*!***************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrIBLFunctions.ts ***!
- \***************************************************/
- /*! exports provided: pbrIBLFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrIBLFunctions",(function(){return o}));var n="pbrIBLFunctions",i="#if defined(REFLECTION) || defined(SS_REFRACTION)\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {\nfloat microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;\nfloat lod=log2(microsurfaceAverageSlopeTexels);\nreturn lod;\n}\nfloat getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {\nfloat lod=log2(cubeMapDimensionPixels)*roughness;\nreturn lod;\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)\nfloat environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {\n\n\nfloat temp=NdotVUnclamped+ambientOcclusion;\nreturn saturate(square(temp)-1.0+ambientOcclusion);\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)\nfloat environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {\n\nvec3 reflection=reflect(view,normal);\nfloat temp=saturate(1.0+1.1*dot(reflection,geometricNormal));\nreturn square(temp);\n}\n#endif\n\n\n\n\n#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)\n\n\n#define UNPACK_LOD(x) (1.0-x)*255.0\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {\nfloat microsurfaceAverageSlope=alphaG;\n\n\n\n\n\n\nmicrosurfaceAverageSlope*=sqrt(abs(NdotV));\nreturn getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrUboDeclaration.ts":
- /*!*****************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrUboDeclaration.ts ***!
- \*****************************************************/
- /*! exports provided: pbrUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrUboDeclaration",(function(){return o}));var n="pbrUboDeclaration",i="layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec2 vAlbedoInfos;\nuniform vec4 vAmbientInfos;\nuniform vec2 vOpacityInfos;\nuniform vec2 vEmissiveInfos;\nuniform vec2 vLightmapInfos;\nuniform vec3 vReflectivityInfos;\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform vec2 vReflectionInfos;\nuniform vec2 vReflectionFilteringInfo;\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\nuniform vec3 vBumpInfos;\nuniform mat4 albedoMatrix;\nuniform mat4 ambientMatrix;\nuniform mat4 opacityMatrix;\nuniform mat4 emissiveMatrix;\nuniform mat4 lightmapMatrix;\nuniform mat4 reflectivityMatrix;\nuniform mat4 microSurfaceSamplerMatrix;\nuniform mat4 bumpMatrix;\nuniform vec2 vTangentSpaceParams;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\nuniform vec4 vLightingIntensity;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float pointSize;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\nuniform vec2 vClearCoatInfos;\nuniform mat4 clearCoatMatrix;\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\nuniform vec3 vAnisotropy;\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\nuniform vec4 vSheenColor;\nuniform float vSheenRoughness;\nuniform vec2 vSheenInfos;\nuniform mat4 sheenMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec2 vRefractionFilteringInfo;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\nuniform float scatteringDiffusionProfile;\nuniform vec4 vDetailInfos;\nuniform mat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrVertexDeclaration.ts":
- /*!********************************************************!*\
- !*** ./Shaders/ShadersInclude/pbrVertexDeclaration.ts ***!
- \********************************************************/
- /*! exports provided: pbrVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrVertexDeclaration",(function(){return o}));var n="pbrVertexDeclaration",i="uniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef ALBEDO\nuniform mat4 albedoMatrix;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\nuniform mat4 reflectivityMatrix;\n#endif\n#ifdef METALLIC_REFLECTANCE\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform mat4 microSurfaceSamplerMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\n#endif\n\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nuniform vec2 vClearCoatInfos;\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\n#ifdef SHEEN_TEXTURE\nuniform vec2 vSheenInfos;\nuniform mat4 sheenMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pointCloudVertex.ts":
- /*!****************************************************!*\
- !*** ./Shaders/ShadersInclude/pointCloudVertex.ts ***!
- \****************************************************/
- /*! exports provided: pointCloudVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"pointCloudVertex",(function(){return o}));var n="pointCloudVertex",i="#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/prePassDeclaration.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/prePassDeclaration.ts ***!
- \******************************************************/
- /*! exports provided: prePassDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"prePassDeclaration",(function(){return o}));var n="prePassDeclaration",i="#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out vec4 glFragData[{X}];\nvec4 gl_FragColor;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/reflectionFunction.ts":
- /*!******************************************************!*\
- !*** ./Shaders/ShadersInclude/reflectionFunction.ts ***!
- \******************************************************/
- /*! exports provided: reflectionFunction */function(e,t,r){"use strict";r.r(t),r.d(t,"reflectionFunction",(function(){return o}));var n="reflectionFunction",i="vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {\n\nvec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;\nvec3 halfSize=cubeSize*0.5;\nvec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;\nvec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;\n\nvec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);\n\nfloat distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);\n\nvec3 intersectPositionWS=vertexPos+origVec*distance;\n\nreturn intersectPositionWS-cubePos;\n}\nvec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(1.0-s,t,0);\n}\nvec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);\nvec3 r=normalize(reflect(cameraToVertex,worldNormal));\nr=vec3(reflectionMatrix*vec4(r,0));\nfloat lon=atan(r.z,r.x);\nfloat lat=acos(r.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr=vec3(reflectionMatrix*vec4(r,0));\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n}\nvec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=worldPos.xyz-eyePosition;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n}\nvec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*(view*worldPos));\n}\nvec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*vec4(positionW,1.));\n}\n#ifdef REFLECTION\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(vPositionUVW,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowMapFragment.ts":
- /*!*****************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowMapFragment.ts ***!
- \*****************************************************/
- /*! exports provided: shadowMapFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapFragment",(function(){return o}));var n="shadowMapFragment",i=" float depthSM=vDepthMetricSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\n#if SM_USEDISTANCE == 1\ndepthSM=clamp(((length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#else\ndepthSM=clamp(((zSM+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#endif\ngl_FragDepth=depthSM;\n#elif SM_USEDISTANCE == 1\ndepthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y)+biasAndScaleSM.x;\n#endif\n#if SM_ESM == 1\ndepthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);\n#endif\n#if SM_FLOAT == 1\ngl_FragColor=vec4(depthSM,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depthSM);\n#endif\nreturn;";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowMapFragmentDeclaration.ts":
- /*!****************************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowMapFragmentDeclaration.ts ***!
- \****************************************************************/
- /*! exports provided: shadowMapFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapFragmentDeclaration",(function(){return s}));var n=r(/*! ../../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./packingFunctions */"./Shaders/ShadersInclude/packingFunctions.ts"),r(/*! ./bayerDitherFunctions */"./Shaders/ShadersInclude/bayerDitherFunctions.ts"),"shadowMapFragmentDeclaration"),o="#if SM_FLOAT == 0\n#include<packingFunctions>\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#include<bayerDitherFunctions>\nuniform float softTransparentShadowSM;\n#endif\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nuniform vec3 lightDataSM;\nvarying vec3 vPositionWSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n";n.Effect.IncludesShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.ts":
- /*!**************************************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.ts ***!
- \**************************************************************************/
- /*! exports provided: shadowMapFragmentSoftTransparentShadow */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapFragmentSoftTransparentShadow",(function(){return o}));var n="shadowMapFragmentSoftTransparentShadow",i="#if SM_SOFTTRANSPARENTSHADOW == 1\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowMapVertexDeclaration.ts":
- /*!**************************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowMapVertexDeclaration.ts ***!
- \**************************************************************/
- /*! exports provided: shadowMapVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapVertexDeclaration",(function(){return o}));var n="shadowMapVertexDeclaration",i="#if SM_NORMALBIAS == 1\nuniform vec3 lightDataSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nvarying vec3 vPositionWSM;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowMapVertexMetric.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowMapVertexMetric.ts ***!
- \*********************************************************/
- /*! exports provided: shadowMapVertexMetric */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapVertexMetric",(function(){return o}));var n="shadowMapVertexMetric",i="#if SM_USEDISTANCE == 1\nvPositionWSM=worldPos.xyz;\n#endif\n#if SM_DEPTHTEXTURE == 1\n\ngl_Position.z+=biasAndScaleSM.x*gl_Position.w;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nzSM=gl_Position.z;\ngl_Position.z=0.0;\n#elif SM_USEDISTANCE == 0\n\nvDepthMetricSM=((gl_Position.z+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowMapVertexNormalBias.ts":
- /*!*************************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowMapVertexNormalBias.ts ***!
- \*************************************************************/
- /*! exports provided: shadowMapVertexNormalBias */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapVertexNormalBias",(function(){return o}));var n="shadowMapVertexNormalBias",i="\n#if SM_NORMALBIAS == 1\n#if SM_DIRECTIONINLIGHTDATA == 1\nvec3 worldLightDirSM=normalize(-lightDataSM.xyz);\n#else\nvec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;\nvec3 worldLightDirSM=normalize(directionToLightSM);\n#endif\nfloat ndlSM=dot(vNormalW,worldLightDirSM);\nfloat sinNLSM=sqrt(1.0-ndlSM*ndlSM);\nfloat normalBiasSM=biasAndScaleSM.y*sinNLSM;\nworldPos.xyz-=vNormalW*normalBiasSM;\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowsFragmentFunctions.ts":
- /*!************************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowsFragmentFunctions.ts ***!
- \************************************************************/
- /*! exports provided: shadowsFragmentFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowsFragmentFunctions",(function(){return o}));var n="shadowsFragmentFunctions",i="#ifdef SHADOWS\n#ifndef SHADOWFLOAT\n\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\n#define inline\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;\n}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);\n}\n#define inline\nfloat computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn esm;\n}\n#define inline\nfloat computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn esm;\n}\n#ifdef WEBGL2\n#define inline\nfloat computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nvec3 uvLayer=vec3(uv.x,uv.y,layer);\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uvLayer));\n#else\nfloat shadow=texture2D(shadowSampler,uvLayer).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadow=texture2D(shadowSampler,uv).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\n#ifndef SHADOWFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[1]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[2]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[3]*mapSize))<shadowPixelDepth) visibility-=0.25;\n#else\nif (texture2D(shadowSampler,uv+poissonDisk[0]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[1]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[2]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[3]*mapSize).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#ifdef WEBGL2\n#define GREATEST_LESS_THAN_ONE 0.99999994\n\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat shadow=texture(shadowSampler,uvDepthLayer);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat shadow=texture2D(shadowSampler,uvDepth);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.)\n);\nconst vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n\n\n\n\n\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);\nvec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec4 offset=vec4(poissonSamplers[i],0.);\n\noffset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);\nshadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n\n\n#define inline\nfloat computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);\nfloat filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec3 offset=poissonSamplers[i];\n\noffset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);\nshadow+=texture2D(shadowSampler,uvDepth+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,depthMetric-avgBlockerDepth);\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n}\n#define inline\nfloat computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);\n}\n#define inline\nfloat computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#endif\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/shadowsVertex.ts":
- /*!*************************************************!*\
- !*** ./Shaders/ShadersInclude/shadowsVertex.ts ***!
- \*************************************************/
- /*! exports provided: shadowsVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowsVertex",(function(){return o}));var n="shadowsVertex",i="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {\nvPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\nvDepthMetric{X}[i]=((vPositionFromLight{X}[i].z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\nvDepthMetric{X}=((vPositionFromLight{X}.z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/subSurfaceScatteringFunctions.ts":
- /*!*****************************************************************!*\
- !*** ./Shaders/ShadersInclude/subSurfaceScatteringFunctions.ts ***!
- \*****************************************************************/
- /*! exports provided: subSurfaceScatteringFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"subSurfaceScatteringFunctions",(function(){return o}));var n="subSurfaceScatteringFunctions",i="vec3 tagLightingForSSS(vec3 color) {\ncolor.b=max(color.b,HALF_MIN);\nreturn color;\n}\nbool testLightingForSSS(vec3 color)\n{\nreturn color.b>0.;\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/anaglyph.fragment.ts":
- /*!**************************************!*\
- !*** ./Shaders/anaglyph.fragment.ts ***!
- \**************************************/
- /*! exports provided: anaglyphPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"anaglyphPixelShader",(function(){return o}));var n="anaglyphPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/background.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/background.fragment.ts ***!
- \****************************************/
- /*! exports provided: backgroundPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/backgroundFragmentDeclaration */"./Shaders/ShadersInclude/backgroundFragmentDeclaration.ts"),r(/*! ./ShadersInclude/backgroundUboDeclaration */"./Shaders/ShadersInclude/backgroundUboDeclaration.ts"),r(/*! ./ShadersInclude/reflectionFunction */"./Shaders/ShadersInclude/reflectionFunction.ts"),r(/*! ./ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ./ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ./ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/lightsFragmentFunctions */"./Shaders/ShadersInclude/lightsFragmentFunctions.ts"),r(/*! ./ShadersInclude/shadowsFragmentFunctions */"./Shaders/ShadersInclude/shadowsFragmentFunctions.ts"),r(/*! ./ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts"),r(/*! ./ShadersInclude/fogFragmentDeclaration */"./Shaders/ShadersInclude/fogFragmentDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),r(/*! ./ShadersInclude/lightFragment */"./Shaders/ShadersInclude/lightFragment.ts"),r(/*! ./ShadersInclude/fogFragment */"./Shaders/ShadersInclude/fogFragment.ts"),"backgroundPixelShader"),o="#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#define RECIPROCAL_PI2 0.15915494\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<helperFunctions>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\n\nfloat shadow=1.;\nfloat globalShadow=0.;\nfloat shadowLightCount=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\n\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\n\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nreflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nreflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nreflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);\nreflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\n\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\n\nvec3 diffuseColor=vec3(1.,1.,1.);\nfloat finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\n\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;\nvec3 reflectionReflectance0=vReflectionControl.yyy;\nvec3 reflectionReflectance90=vReflectionControl.zzz;\nfloat VdotN=dot(normalize(vEyePosition),normalW);\nvec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);\nreflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);\nreflectionDistanceFalloff*=reflectionDistanceFalloff;\nreflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition-vBackgroundCenter));\n\nconst float startAngle=0.1;\nfloat fadeFactor=saturate(viewAngleToFloor/startAngle);\nfinalAlpha*=fadeFactor*fadeFactor;\n#endif\n\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\n\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#else\n\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);\ncolor=max(color,0.0);\n#endif\ngl_FragColor=color;\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/background.vertex.ts":
- /*!**************************************!*\
- !*** ./Shaders/background.vertex.ts ***!
- \**************************************/
- /*! exports provided: backgroundVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/backgroundVertexDeclaration */"./Shaders/ShadersInclude/backgroundVertexDeclaration.ts"),r(/*! ./ShadersInclude/backgroundUboDeclaration */"./Shaders/ShadersInclude/backgroundUboDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneVertexDeclaration */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts"),r(/*! ./ShadersInclude/fogVertexDeclaration */"./Shaders/ShadersInclude/fogVertexDeclaration.ts"),r(/*! ./ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ./ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),r(/*! ./ShadersInclude/fogVertex */"./Shaders/ShadersInclude/fogVertex.ts"),r(/*! ./ShadersInclude/shadowsVertex */"./Shaders/ShadersInclude/shadowsVertex.ts"),"backgroundVertexShader"),o="precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n} else {\ngl_Position=viewProjectionR*finalWorld*vec4(position,1.0);\n}\n#else\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));\nvec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));\nif (fFovMultiplier<=1.0) {\nvDirectionW=normalize(segment);\n} else {\nvDirectionW=normalize(vDirectionW+(vDirectionW-segment));\n}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/blackAndWhite.fragment.ts":
- /*!*******************************************!*\
- !*** ./Shaders/blackAndWhite.fragment.ts ***!
- \*******************************************/
- /*! exports provided: blackAndWhitePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"blackAndWhitePixelShader",(function(){return o}));var n="blackAndWhitePixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void)\n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11));\nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/bloomMerge.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/bloomMerge.fragment.ts ***!
- \****************************************/
- /*! exports provided: bloomMergePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"bloomMergePixelShader",(function(){return o}));var n="bloomMergePixelShader",i="uniform sampler2D textureSampler;\nuniform sampler2D bloomBlur;\nvarying vec2 vUV;\nuniform float bloomWeight;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec3 blurred=texture2D(bloomBlur,vUV).rgb;\ngl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight);\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/chromaticAberration.fragment.ts":
- /*!*************************************************!*\
- !*** ./Shaders/chromaticAberration.fragment.ts ***!
- \*************************************************/
- /*! exports provided: chromaticAberrationPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"chromaticAberrationPixelShader",(function(){return o}));var n="chromaticAberrationPixelShader",i="\nuniform sampler2D textureSampler;\n\nuniform float chromatic_aberration;\nuniform float radialIntensity;\nuniform vec2 direction;\nuniform vec2 centerPosition;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\nvoid main(void)\n{\nvec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);\nvec2 directionOfEffect=direction;\nif(directionOfEffect.x == 0. && directionOfEffect.y == 0.){\ndirectionOfEffect=normalize(centered_screen_pos);\n}\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+centered_screen_pos.y*centered_screen_pos.y;\nfloat radius=sqrt(radius2);\nvec4 original=texture2D(textureSampler,vUV);\n\nvec3 ref_indices=vec3(-0.3,0.0,0.3);\nfloat ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;\nfloat ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;\n\nvec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);\nvec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);\nvec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);\noriginal.r=texture2D(textureSampler,ref_coords_r).r;\noriginal.g=texture2D(textureSampler,ref_coords_g).g;\noriginal.b=texture2D(textureSampler,ref_coords_b).b;\noriginal.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);\ngl_FragColor=original;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/circleOfConfusion.fragment.ts":
- /*!***********************************************!*\
- !*** ./Shaders/circleOfConfusion.fragment.ts ***!
- \***********************************************/
- /*! exports provided: circleOfConfusionPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"circleOfConfusionPixelShader",(function(){return o}));var n="circleOfConfusionPixelShader",i="\nuniform sampler2D depthSampler;\n\nvarying vec2 vUV;\n\nuniform vec2 cameraMinMaxZ;\n\nuniform float focusDistance;\nuniform float cocPrecalculation;\nvoid main(void)\n{\nfloat depth=texture2D(depthSampler,vUV).r;\nfloat pixelDistance=(cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth)*1000.0;\nfloat coc=abs(cocPrecalculation* ((focusDistance-pixelDistance)/pixelDistance));\ncoc=clamp(coc,0.0,1.0);\ngl_FragColor=vec4(coc,depth,coc,1.0);\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/color.fragment.ts":
- /*!***********************************!*\
- !*** ./Shaders/color.fragment.ts ***!
- \***********************************/
- /*! exports provided: colorPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"colorPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),"colorPixelShader"),o="#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\n#ifdef VERTEXCOLOR\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/color.vertex.ts":
- /*!*********************************!*\
- !*** ./Shaders/color.vertex.ts ***!
- \*********************************/
- /*! exports provided: colorVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"colorVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneVertexDeclaration */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),"colorVertexShader"),o="\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<clipPlaneVertexDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include<clipPlaneVertex>\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/colorCorrection.fragment.ts":
- /*!*********************************************!*\
- !*** ./Shaders/colorCorrection.fragment.ts ***!
- \*********************************************/
- /*! exports provided: colorCorrectionPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"colorCorrectionPixelShader",(function(){return o}));var n="colorCorrectionPixelShader",i="\nuniform sampler2D textureSampler;\nuniform sampler2D colorTable;\n\nvarying vec2 vUV;\n\nconst float SLICE_COUNT=16.0;\n\nvec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {\nfloat sliceSize=1.0/width;\nfloat slicePixelSize=sliceSize/width;\nfloat sliceInnerSize=slicePixelSize*(width-1.0);\nfloat zSlice0=min(floor(uv.z*width),width-1.0);\nfloat zSlice1=min(zSlice0+1.0,width-1.0);\nfloat xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;\nfloat s0=xOffset+(zSlice0*sliceSize);\nfloat s1=xOffset+(zSlice1*sliceSize);\nvec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));\nvec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));\nfloat zOffset=mod(uv.z*width,1.0);\nvec4 result=mix(slice0Color,slice1Color,zOffset);\nreturn result;\n}\nvoid main(void)\n{\nvec4 screen_color=texture2D(textureSampler,vUV);\ngl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/convolution.fragment.ts":
- /*!*****************************************!*\
- !*** ./Shaders/convolution.fragment.ts ***!
- \*****************************************/
- /*! exports provided: convolutionPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"convolutionPixelShader",(function(){return o}));var n="convolutionPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform float kernel[9];\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];\nfloat kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];\nif (kernelWeight<=0.0) {\nkernelWeight=1.0;\n}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/default.fragment.ts":
- /*!*************************************!*\
- !*** ./Shaders/default.fragment.ts ***!
- \*************************************/
- /*! exports provided: defaultPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/defaultFragmentDeclaration */"./Shaders/ShadersInclude/defaultFragmentDeclaration.ts"),r(/*! ./ShadersInclude/defaultUboDeclaration */"./Shaders/ShadersInclude/defaultUboDeclaration.ts"),r(/*! ./ShadersInclude/prePassDeclaration */"./Shaders/ShadersInclude/prePassDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ./ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ./ShadersInclude/lightsFragmentFunctions */"./Shaders/ShadersInclude/lightsFragmentFunctions.ts"),r(/*! ./ShadersInclude/shadowsFragmentFunctions */"./Shaders/ShadersInclude/shadowsFragmentFunctions.ts"),r(/*! ./ShadersInclude/fresnelFunction */"./Shaders/ShadersInclude/fresnelFunction.ts"),r(/*! ./ShadersInclude/reflectionFunction */"./Shaders/ShadersInclude/reflectionFunction.ts"),r(/*! ./ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ./ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),r(/*! ./ShadersInclude/bumpFragmentMainFunctions */"./Shaders/ShadersInclude/bumpFragmentMainFunctions.ts"),r(/*! ./ShadersInclude/bumpFragmentFunctions */"./Shaders/ShadersInclude/bumpFragmentFunctions.ts"),r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts"),r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.ts"),r(/*! ./ShadersInclude/fogFragmentDeclaration */"./Shaders/ShadersInclude/fogFragmentDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),r(/*! ./ShadersInclude/bumpFragment */"./Shaders/ShadersInclude/bumpFragment.ts"),r(/*! ./ShadersInclude/depthPrePass */"./Shaders/ShadersInclude/depthPrePass.ts"),r(/*! ./ShadersInclude/lightFragment */"./Shaders/ShadersInclude/lightFragment.ts"),r(/*! ./ShadersInclude/logDepthFragment */"./Shaders/ShadersInclude/logDepthFragment.ts"),r(/*! ./ShadersInclude/fogFragment */"./Shaders/ShadersInclude/fogFragment.ts"),"defaultPixelShader"),o="#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef PREPASS\nvarying vec3 vViewPos;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\n#if SPECULARDIRECTUV == 1\n#define vSpecularUV vMainUV1\n#elif SPECULARDIRECTUV == 2\n#define vSpecularUV vMainUV2\n#else\nvarying vec2 vSpecularUV;\n#endif\nuniform sampler2D specularSampler;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n\n#include<fresnelFunction>\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec4 refractionColor=vec4(0.,0.,0.,1.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0) {\nrefractionColor=textureCube(refractionCubeSampler,refractionVector);\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\n#endif\nrefractionColor.rgb*=vRefractionInfos.x;\n#endif\n\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\ndiscard;\n#endif\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\n#else\ncolor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\n#endif\ncolor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\ngl_FragData[0]=color;\ngl_FragData[1]=vec4(0.0,0.0,0.0,1.0);\ngl_FragData[2]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\ngl_FragData[3]=vec4(0.0,0.0,0.0,1.0);\n#endif\ngl_FragColor=color;\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/default.vertex.ts":
- /*!***********************************!*\
- !*** ./Shaders/default.vertex.ts ***!
- \***********************************/
- /*! exports provided: defaultVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/defaultVertexDeclaration */"./Shaders/ShadersInclude/defaultVertexDeclaration.ts"),r(/*! ./ShadersInclude/defaultUboDeclaration */"./Shaders/ShadersInclude/defaultUboDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/bumpVertexDeclaration */"./Shaders/ShadersInclude/bumpVertexDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneVertexDeclaration */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts"),r(/*! ./ShadersInclude/fogVertexDeclaration */"./Shaders/ShadersInclude/fogVertexDeclaration.ts"),r(/*! ./ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ./ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/bumpVertex */"./Shaders/ShadersInclude/bumpVertex.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),r(/*! ./ShadersInclude/fogVertex */"./Shaders/ShadersInclude/fogVertex.ts"),r(/*! ./ShadersInclude/shadowsVertex */"./Shaders/ShadersInclude/shadowsVertex.ts"),r(/*! ./ShadersInclude/pointCloudVertex */"./Shaders/ShadersInclude/pointCloudVertex.ts"),r(/*! ./ShadersInclude/logDepthVertex */"./Shaders/ShadersInclude/logDepthVertex.ts"),"defaultVertexShader"),o="#include<__decl__defaultVertex>\n\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#ifdef PREPASS\nvarying vec3 vViewPos;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nvarying vec2 vSpecularUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\nvPositionW=vec3(worldPos);\n#ifdef PREPASS\nvViewPos=(view*worldPos).rgb;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n#include<pointCloudVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/depth.fragment.ts":
- /*!***********************************!*\
- !*** ./Shaders/depth.fragment.ts ***!
- \***********************************/
- /*! exports provided: depthPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"depthPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/packingFunctions */"./Shaders/ShadersInclude/packingFunctions.ts"),"depthPixelShader"),o="#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvarying float vDepthMetric;\n#ifdef PACKED\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef NONLINEARDEPTH\n#ifdef PACKED\ngl_FragColor=pack(gl_FragCoord.z);\n#else\ngl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);\n#endif\n#else\n#ifdef PACKED\ngl_FragColor=pack(vDepthMetric);\n#else\ngl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);\n#endif\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/depth.vertex.ts":
- /*!*********************************!*\
- !*** ./Shaders/depth.vertex.ts ***!
- \*********************************/
- /*! exports provided: depthVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"depthVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),"depthVertexShader"),o="\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/depthBoxBlur.fragment.ts":
- /*!******************************************!*\
- !*** ./Shaders/depthBoxBlur.fragment.ts ***!
- \******************************************/
- /*! exports provided: depthBoxBlurPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"depthBoxBlurPixelShader",(function(){return o}));var n="depthBoxBlurPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/depthOfField.fragment.ts":
- /*!******************************************!*\
- !*** ./Shaders/depthOfField.fragment.ts ***!
- \******************************************/
- /*! exports provided: depthOfFieldPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"depthOfFieldPixelShader",(function(){return o}));var n="depthOfFieldPixelShader",i="\n\n\n\n\nuniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\n\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\n\nuniform float screen_distance;\nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\n\nuniform float near;\nuniform float far;\n\nvarying vec2 vUV;\n\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1\n\nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\n\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\n\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion == 0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\n\nfloat sampleScreen(inout vec4 color,const in vec2 offset,const in float weight) {\n\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\n\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\n\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nif (size == 0.0) { return col; }\n\n\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight;\n\nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\n\n\n\n\nreturn col;\n}\nvoid main(void)\n{\n\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV);\nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height);\nfloat depth=texture2D(depthSampler,distorted_coords).r;\nfloat distance=near+(far-near)*depth;\nvec4 color=texture2D(textureSampler,vUV);\n\n\nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\n\nif (dof_enabled == false || coc<0.07) { coc=0.0; }\n\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\n\nfloat blur_amount=max(edge_blur_amount,coc);\n\nif (blur_amount == 0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\n\ngl_FragColor=getBlurColor(blur_amount*1.7);\n\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\n\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\n\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/depthOfFieldMerge.fragment.ts":
- /*!***********************************************!*\
- !*** ./Shaders/depthOfFieldMerge.fragment.ts ***!
- \***********************************************/
- /*! exports provided: depthOfFieldMergePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"depthOfFieldMergePixelShader",(function(){return o}));var n="depthOfFieldMergePixelShader",i="uniform sampler2D textureSampler;\nvarying vec2 vUV;\nuniform sampler2D circleOfConfusionSampler;\nuniform sampler2D blurStep0;\n#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\n#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\n#endif\nvoid main(void)\n{\nfloat coc=texture2D(circleOfConfusionSampler,vUV).r;\n#if BLUR_LEVEL == 0\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred0=texture2D(blurStep0,vUV);\ngl_FragColor=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL == 1\nif(coc<0.5){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(original,blurred1,coc/0.5);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);\n}\n#endif\n#if BLUR_LEVEL == 2\nif(coc<0.33){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(original,blurred2,coc/0.33);\n}else if(coc<0.66){\nvec4 blurred1=texture2D(blurStep1,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);\n}\n#endif\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/displayPass.fragment.ts":
- /*!*****************************************!*\
- !*** ./Shaders/displayPass.fragment.ts ***!
- \*****************************************/
- /*! exports provided: displayPassPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"displayPassPixelShader",(function(){return o}));var n="displayPassPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D passSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(passSampler,vUV);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/extractHighlights.fragment.ts":
- /*!***********************************************!*\
- !*** ./Shaders/extractHighlights.fragment.ts ***!
- \***********************************************/
- /*! exports provided: extractHighlightsPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"extractHighlightsPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),"extractHighlightsPixelShader"),o="#include<helperFunctions>\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float threshold;\nuniform float exposure;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nfloat luma=getLuminance(gl_FragColor.rgb*exposure);\ngl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/filter.fragment.ts":
- /*!************************************!*\
- !*** ./Shaders/filter.fragment.ts ***!
- \************************************/
- /*! exports provided: filterPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"filterPixelShader",(function(){return o}));var n="filterPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform mat4 kernelMatrix;\nvoid main(void)\n{\nvec3 baseColor=texture2D(textureSampler,vUV).rgb;\nvec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;\ngl_FragColor=vec4(updatedColor,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/fxaa.fragment.ts":
- /*!**********************************!*\
- !*** ./Shaders/fxaa.fragment.ts ***!
- \**********************************/
- /*! exports provided: fxaaPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"fxaaPixelShader",(function(){return o}));var n="fxaaPixelShader",i="uniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst float fxaaQualitySubpix=1.0;\nconst float fxaaQualityEdgeThreshold=0.166;\nconst float fxaaQualityEdgeThresholdMin=0.0833;\nconst vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){\nvec2 posM;\nposM.x=vUV.x;\nposM.y=vUV.y;\nvec4 rgbyM=texture2D(textureSampler,vUV,0.0);\nfloat lumaM=FxaaLuma(rgbyM);\nfloat lumaS=FxaaLuma(texture2D(textureSampler,sampleCoordS,0.0));\nfloat lumaE=FxaaLuma(texture2D(textureSampler,sampleCoordE,0.0));\nfloat lumaN=FxaaLuma(texture2D(textureSampler,sampleCoordN,0.0));\nfloat lumaW=FxaaLuma(texture2D(textureSampler,sampleCoordW,0.0));\nfloat maxSM=max(lumaS,lumaM);\nfloat minSM=min(lumaS,lumaM);\nfloat maxESM=max(lumaE,maxSM);\nfloat minESM=min(lumaE,minSM);\nfloat maxWN=max(lumaN,lumaW);\nfloat minWN=min(lumaN,lumaW);\nfloat rangeMax=max(maxWN,maxESM);\nfloat rangeMin=min(minWN,minESM);\nfloat rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;\nfloat range=rangeMax-rangeMin;\nfloat rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\nreturn;\n}\n#endif\nfloat lumaNW=FxaaLuma(texture2D(textureSampler,sampleCoordNW,0.0));\nfloat lumaSE=FxaaLuma(texture2D(textureSampler,sampleCoordSE,0.0));\nfloat lumaNE=FxaaLuma(texture2D(textureSampler,sampleCoordNE,0.0));\nfloat lumaSW=FxaaLuma(texture2D(textureSampler,sampleCoordSW,0.0));\nfloat lumaNS=lumaN+lumaS;\nfloat lumaWE=lumaW+lumaE;\nfloat subpixRcpRange=1.0/range;\nfloat subpixNSWE=lumaNS+lumaWE;\nfloat edgeHorz1=(-2.0*lumaM)+lumaNS;\nfloat edgeVert1=(-2.0*lumaM)+lumaWE;\nfloat lumaNESE=lumaNE+lumaSE;\nfloat lumaNWNE=lumaNW+lumaNE;\nfloat edgeHorz2=(-2.0*lumaE)+lumaNESE;\nfloat edgeVert2=(-2.0*lumaN)+lumaNWNE;\nfloat lumaNWSW=lumaNW+lumaSW;\nfloat lumaSWSE=lumaSW+lumaSE;\nfloat edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);\nfloat edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);\nfloat edgeHorz3=(-2.0*lumaW)+lumaNWSW;\nfloat edgeVert3=(-2.0*lumaS)+lumaSWSE;\nfloat edgeHorz=abs(edgeHorz3)+edgeHorz4;\nfloat edgeVert=abs(edgeVert3)+edgeVert4;\nfloat subpixNWSWNESE=lumaNWSW+lumaNESE;\nfloat lengthSign=texelSize.x;\nbool horzSpan=edgeHorz>=edgeVert;\nfloat subpixA=subpixNSWE*2.0+subpixNWSWNESE;\nif (!horzSpan)\n{\nlumaN=lumaW;\n}\nif (!horzSpan)\n{\nlumaS=lumaE;\n}\nif (horzSpan)\n{\nlengthSign=texelSize.y;\n}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;\nfloat gradientN=lumaN-lumaM;\nfloat gradientS=lumaS-lumaM;\nfloat lumaNN=lumaN+lumaM;\nfloat lumaSS=lumaS+lumaM;\nbool pairN=abs(gradientN)>=abs(gradientS);\nfloat gradient=max(abs(gradientN),abs(gradientS));\nif (pairN)\n{\nlengthSign=-lengthSign;\n}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);\nvec2 posB;\nposB.x=posM.x;\nposB.y=posM.y;\nvec2 offNP;\noffNP.x=(!horzSpan) ? 0.0 : texelSize.x;\noffNP.y=(horzSpan) ? 0.0 : texelSize.y;\nif (!horzSpan)\n{\nposB.x+=lengthSign*0.5;\n}\nif (horzSpan)\n{\nposB.y+=lengthSign*0.5;\n}\nvec2 posN;\nposN.x=posB.x-offNP.x*1.5;\nposN.y=posB.y-offNP.y*1.5;\nvec2 posP;\nposP.x=posB.x+offNP.x*1.5;\nposP.y=posB.y+offNP.y*1.5;\nfloat subpixD=((-2.0)*subpixC)+3.0;\nfloat lumaEndN=FxaaLuma(texture2D(textureSampler,posN,0.0));\nfloat subpixE=subpixC*subpixC;\nfloat lumaEndP=FxaaLuma(texture2D(textureSampler,posP,0.0));\nif (!pairN)\n{\nlumaNN=lumaSS;\n}\nfloat gradientScaled=gradient*1.0/4.0;\nfloat lumaMM=lumaM-lumaNN*0.5;\nfloat subpixF=subpixD*subpixE;\nbool lumaMLTZero=lumaMM<0.0;\nlumaEndN-=lumaNN*0.5;\nlumaEndP-=lumaNN*0.5;\nbool doneN=abs(lumaEndN)>=gradientScaled;\nbool doneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN)\n{\nposN.x-=offNP.x*3.0;\n}\nif (!doneN)\n{\nposN.y-=offNP.y*3.0;\n}\nbool doneNP=(!doneN) || (!doneP);\nif (!doneP)\n{\nposP.x+=offNP.x*3.0;\n}\nif (!doneP)\n{\nposP.y+=offNP.y*3.0;\n}\nif (doneNP)\n{\nif (!doneN) lumaEndN=FxaaLuma(texture2D(textureSampler,posN.xy,0.0));\nif (!doneP) lumaEndP=FxaaLuma(texture2D(textureSampler,posP.xy,0.0));\nif (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;\nif (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;\ndoneN=abs(lumaEndN)>=gradientScaled;\ndoneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) posN.x-=offNP.x*12.0;\nif (!doneN) posN.y-=offNP.y*12.0;\ndoneNP=(!doneN) || (!doneP);\nif (!doneP) posP.x+=offNP.x*12.0;\nif (!doneP) posP.y+=offNP.y*12.0;\n}\nfloat dstN=posM.x-posN.x;\nfloat dstP=posP.x-posM.x;\nif (!horzSpan)\n{\ndstN=posM.y-posN.y;\n}\nif (!horzSpan)\n{\ndstP=posP.y-posM.y;\n}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;\nfloat spanLength=(dstP+dstN);\nbool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;\nfloat spanLengthRcp=1.0/spanLength;\nbool directionN=dstN<dstP;\nfloat dst=min(dstN,dstP);\nbool goodSpan=directionN ? goodSpanN : goodSpanP;\nfloat subpixG=subpixF*subpixF;\nfloat pixelOffset=(dst*(-spanLengthRcp))+0.5;\nfloat subpixH=subpixG*fxaaQualitySubpix;\nfloat pixelOffsetGood=goodSpan ? pixelOffset : 0.0;\nfloat pixelOffsetSubpix=max(pixelOffsetGood,subpixH);\nif (!horzSpan)\n{\nposM.x+=pixelOffsetSubpix*lengthSign;\n}\nif (horzSpan)\n{\nposM.y+=pixelOffsetSubpix*lengthSign;\n}\n#ifdef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\n}\nelse\n{\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n}\n#else\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n#endif\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/fxaa.vertex.ts":
- /*!********************************!*\
- !*** ./Shaders/fxaa.vertex.ts ***!
- \********************************/
- /*! exports provided: fxaaVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"fxaaVertexShader",(function(){return o}));var n="fxaaVertexShader",i="\nattribute vec2 position;\nuniform vec2 texelSize;\n\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd);\nsampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;\nsampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;\nsampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;\nsampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;\nsampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;\nsampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;\nsampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;\nsampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;\ngl_Position=vec4(position,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/geometry.fragment.ts":
- /*!**************************************!*\
- !*** ./Shaders/geometry.fragment.ts ***!
- \**************************************/
- /*! exports provided: geometryPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"geometryPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/mrtFragmentDeclaration */"./Shaders/ShadersInclude/mrtFragmentDeclaration.ts"),r(/*! ./ShadersInclude/bumpFragmentMainFunctions */"./Shaders/ShadersInclude/bumpFragmentMainFunctions.ts"),r(/*! ./ShadersInclude/bumpFragmentFunctions */"./Shaders/ShadersInclude/bumpFragmentFunctions.ts"),r(/*! ./ShadersInclude/bumpFragment */"./Shaders/ShadersInclude/bumpFragment.ts"),"geometryPixelShader"),o="#extension GL_EXT_draw_buffers : require\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\nprecision highp float;\nprecision highp int;\n#ifdef BUMP\nvarying mat4 vWorldView;\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef NEED_UV\nvarying vec2 vUV;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef REFLECTIVITY\nvarying vec2 vReflectivityUV;\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef ALPHATEST\nuniform sampler2D diffuseSampler;\n#endif\n#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\n\n#ifdef BUMP\nvec3 normalW=normalize(vNormalW);\n#include<bumpFragment>\ngl_FragData[1]=vec4(normalize(vec3(vWorldView*vec4(normalW,0.0))),1.0);\n#else\ngl_FragData[1]=vec4(normalize(vNormalV),1.0);\n#endif\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef REFLECTIVITY\n#ifdef HAS_SPECULAR\n\nvec4 reflectivity=texture2D(reflectivitySampler,vReflectivityUV);\n#elif HAS_REFLECTIVITY\n\nvec4 reflectivity=vec4(texture2D(reflectivitySampler,vReflectivityUV).rgb,1.0);\n#else\nvec4 reflectivity=vec4(0.0,0.0,0.0,1.0);\n#endif\ngl_FragData[REFLECTIVITY_INDEX]=reflectivity;\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/geometry.vertex.ts":
- /*!************************************!*\
- !*** ./Shaders/geometry.vertex.ts ***!
- \************************************/
- /*! exports provided: geometryVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"geometryVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/bumpVertex */"./Shaders/ShadersInclude/bumpVertex.ts"),"geometryVertexShader"),o="precision highp float;\nprecision highp int;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef NEED_UV\nvarying vec2 vUV;\n#ifdef ALPHATEST\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef BUMP\nuniform mat4 bumpMatrix;\nvarying vec2 vBumpUV;\n#endif\n#ifdef REFLECTIVITY\nuniform mat4 reflectivityMatrix;\nvarying vec2 vReflectivityUV;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef BUMP\nvarying mat4 vWorldView;\n#endif\n#ifdef BUMP\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\n#ifdef BONES_VELOCITY_ENABLED\n#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if defined(VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 pos=vec4(finalWorld*vec4(positionUpdated,1.0));\n#ifdef BUMP\nvWorldView=view*finalWorld;\nvNormalW=normalUpdated;\n#else\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));\n#endif\nvViewPos=view*pos;\n#if defined(VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvPositionW=pos.xyz/pos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#ifdef NEED_UV\n#ifdef UV1\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#else\nvUV=uv;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#endif\n#ifdef UV2\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#else\nvUV=uv2;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/glowBlurPostProcess.fragment.ts":
- /*!*************************************************!*\
- !*** ./Shaders/glowBlurPostProcess.fragment.ts ***!
- \*************************************************/
- /*! exports provided: glowBlurPostProcessPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"glowBlurPostProcessPixelShader",(function(){return o}));var n="glowBlurPostProcessPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\n\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\n\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\n\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/glowMapGeneration.fragment.ts":
- /*!***********************************************!*\
- !*** ./Shaders/glowMapGeneration.fragment.ts ***!
- \***********************************************/
- /*! exports provided: glowMapGenerationPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"glowMapGenerationPixelShader",(function(){return o}));var n="glowMapGenerationPixelShader",i="#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;\nvoid main(void)\n{\nvec4 finalColor=glowColor;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\n#ifdef GLOW\n\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef HIGHLIGHT\n\nfinalColor.a=albedoTexture.a;\n#endif\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE)\ndiscard;\n#endif\n#ifdef EMISSIVE\ngl_FragColor=texture2D(emissiveSampler,vUVEmissive)*finalColor;\n#else\ngl_FragColor=finalColor;\n#endif\n#ifdef HIGHLIGHT\n\ngl_FragColor.a=glowColor.a;\n#endif\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/glowMapGeneration.vertex.ts":
- /*!*********************************************!*\
- !*** ./Shaders/glowMapGeneration.vertex.ts ***!
- \*********************************************/
- /*! exports provided: glowMapGenerationVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"glowMapGenerationVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),"glowMapGenerationVertexShader"),o="\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform mat4 opacityMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef VERTEXALPHA\nattribute vec4 color;\nvarying vec4 vColor;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(positionUpdated,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef DIFFUSE\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef OPACITY\n#ifdef OPACITYUV1\nvUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef OPACITYUV2\nvUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef VERTEXALPHA\nvColor=color;\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/glowMapMerge.fragment.ts":
- /*!******************************************!*\
- !*** ./Shaders/glowMapMerge.fragment.ts ***!
- \******************************************/
- /*! exports provided: glowMapMergePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"glowMapMergePixelShader",(function(){return o}));var n="glowMapMergePixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\n\nuniform float offset;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);\nbaseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);\nbaseColor.a=alpha;\nbaseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\ngl_FragColor=baseColor;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/glowMapMerge.vertex.ts":
- /*!****************************************!*\
- !*** ./Shaders/glowMapMerge.vertex.ts ***!
- \****************************************/
- /*! exports provided: glowMapMergeVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"glowMapMergeVertexShader",(function(){return o}));var n="glowMapMergeVertexShader",i="\nattribute vec2 position;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/gpuRenderParticles.fragment.ts":
- /*!************************************************!*\
- !*** ./Shaders/gpuRenderParticles.fragment.ts ***!
- \************************************************/
- /*! exports provided: gpuRenderParticlesPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"gpuRenderParticlesPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration2 */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.ts"),r(/*! ./ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),"gpuRenderParticlesPixelShader"),o="#version 300 es\nuniform sampler2D diffuseSampler;\nin vec2 vUV;\nin vec4 vColor;\nout vec4 outFragColor;\n#include<clipPlaneFragmentDeclaration2>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main() {\n#include<clipPlaneFragment>\nvec4 textureColor=texture(diffuseSampler,vUV);\noutFragColor=textureColor*vColor;\n#ifdef BLENDMULTIPLYMODE\nfloat alpha=vColor.a*textureColor.a;\noutFragColor.rgb=outFragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\noutFragColor=applyImageProcessing(outFragColor);\n#endif\n#endif\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/gpuRenderParticles.vertex.ts":
- /*!**********************************************!*\
- !*** ./Shaders/gpuRenderParticles.vertex.ts ***!
- \**********************************************/
- /*! exports provided: gpuRenderParticlesVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"gpuRenderParticlesVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/clipPlaneVertexDeclaration2 */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration2.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),"gpuRenderParticlesVertexShader"),o="#version 300 es\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\nuniform vec3 worldOffset;\n#ifdef LOCAL\nuniform mat4 emitterWM;\n#endif\n\nin vec3 position;\nin float age;\nin float life;\nin vec3 size;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef BILLBOARDSTRETCHED\nin vec3 direction;\n#endif\nin float angle;\n#ifdef ANIMATESHEET\nin float cellIndex;\n#endif\nin vec2 offset;\nin vec2 uv;\nout vec2 vUV;\nout vec4 vColor;\nout vec3 vPositionW;\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration2>\n#ifdef COLORGRADIENTS\nuniform sampler2D colorGradientSampler;\n#else\nuniform vec4 colorDead;\nin vec4 color;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 sheetInfos;\n#endif\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#endif\nvoid main() {\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/sheetInfos.z);\nfloat columnOffset=cellIndex-rowOffset*sheetInfos.z;\nvec2 uvScale=sheetInfos.xy;\nvec2 uvOffset=vec2(uv.x ,1.0-uv.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=uv;\n#endif\nfloat ratio=age/life;\n#ifdef COLORGRADIENTS\nvColor=texture(colorGradientSampler,vec2(ratio,0));\n#else\nvColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);\n#endif\nvec2 cornerPos=(offset-translationPivot)*size.yz*size.x+translationPivot;\n#ifdef BILLBOARD\nvec4 rotatedCorner;\nrotatedCorner.w=0.;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=(position+worldOffset)-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=(position+worldOffset)-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#else\n\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\n#ifdef LOCAL\nvec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;\n#else\nvec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;\n#endif\nvPositionW=(invView*viewPosition).xyz;\n#endif\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=0.;\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nvec3 yaxis=normalize(initialDirection);\nvPositionW=rotate(yaxis,rotatedCorner);\n\nvec4 viewPosition=view*vec4(vPositionW,1.0);\n#endif\ngl_Position=projection*viewPosition;\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/gpuUpdateParticles.fragment.ts":
- /*!************************************************!*\
- !*** ./Shaders/gpuUpdateParticles.fragment.ts ***!
- \************************************************/
- /*! exports provided: gpuUpdateParticlesPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"gpuUpdateParticlesPixelShader",(function(){return o}));var n="gpuUpdateParticlesPixelShader",i="#version 300 es\nvoid main() {\ndiscard;\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/gpuUpdateParticles.vertex.ts":
- /*!**********************************************!*\
- !*** ./Shaders/gpuUpdateParticles.vertex.ts ***!
- \**********************************************/
- /*! exports provided: gpuUpdateParticlesVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"gpuUpdateParticlesVertexShader",(function(){return o}));var n="gpuUpdateParticlesVertexShader",i="#version 300 es\n#define PI 3.14159\nuniform float currentCount;\nuniform float timeDelta;\nuniform float stopFactor;\n#ifndef LOCAL\nuniform mat4 emitterWM;\n#endif\nuniform vec2 lifeTime;\nuniform vec2 emitPower;\nuniform vec2 sizeRange;\nuniform vec4 scaleRange;\n#ifndef COLORGRADIENTS\nuniform vec4 color1;\nuniform vec4 color2;\n#endif\nuniform vec3 gravity;\nuniform sampler2D randomSampler;\nuniform sampler2D randomSampler2;\nuniform vec4 angleRange;\n#ifdef BOXEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\nuniform vec3 minEmitBox;\nuniform vec3 maxEmitBox;\n#endif\n#ifdef POINTEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#endif\n#ifdef HEMISPHERICEMITTER\nuniform float radius;\nuniform float radiusRange;\nuniform float directionRandomizer;\n#endif\n#ifdef SPHEREEMITTER\nuniform float radius;\nuniform float radiusRange;\n#ifdef DIRECTEDSPHEREEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nuniform float radius;\nuniform float height;\nuniform float radiusRange;\n#ifdef DIRECTEDCYLINDEREMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CONEEMITTER\nuniform vec2 radius;\nuniform float coneAngle;\nuniform vec2 height;\nuniform float directionRandomizer;\n#endif\n\nin vec3 position;\n#ifdef CUSTOMEMITTER\nin vec3 initialPosition;\n#endif\nin float age;\nin float life;\nin vec4 seed;\nin vec3 size;\n#ifndef COLORGRADIENTS\nin vec4 color;\n#endif\nin vec3 direction;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nin float angle;\n#else\nin vec2 angle;\n#endif\n#ifdef ANIMATESHEET\nin float cellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nin float cellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nin vec3 noiseCoordinates1;\nin vec3 noiseCoordinates2;\n#endif\n\nout vec3 outPosition;\n#ifdef CUSTOMEMITTER\nout vec3 outInitialPosition;\n#endif\nout float outAge;\nout float outLife;\nout vec4 outSeed;\nout vec3 outSize;\n#ifndef COLORGRADIENTS\nout vec4 outColor;\n#endif\nout vec3 outDirection;\n#ifndef BILLBOARD\nout vec3 outInitialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nout float outAngle;\n#else\nout vec2 outAngle;\n#endif\n#ifdef ANIMATESHEET\nout float outCellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nout float outCellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nout vec3 outNoiseCoordinates1;\nout vec3 outNoiseCoordinates2;\n#endif\n#ifdef SIZEGRADIENTS\nuniform sampler2D sizeGradientSampler;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nuniform sampler2D angularSpeedGradientSampler;\n#endif\n#ifdef VELOCITYGRADIENTS\nuniform sampler2D velocityGradientSampler;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nuniform sampler2D limitVelocityGradientSampler;\nuniform float limitVelocityDamping;\n#endif\n#ifdef DRAGGRADIENTS\nuniform sampler2D dragGradientSampler;\n#endif\n#ifdef NOISE\nuniform vec3 noiseStrength;\nuniform sampler2D noiseSampler;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 cellInfos;\n#endif\nvec3 getRandomVec3(float offset) {\nreturn texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;\n}\nvec4 getRandomVec4(float offset) {\nreturn texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));\n}\nvoid main() {\nfloat newAge=age+timeDelta;\n\nif (newAge>=life && stopFactor != 0.) {\nvec3 newPosition;\nvec3 newDirection;\n\nvec4 randoms=getRandomVec4(seed.x);\n\noutLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;\noutAge=newAge-life;\n\noutSeed=seed;\n\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(0,0)).r;\n#else\noutSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;\n#endif\noutSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;\noutSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a;\n#ifndef COLORGRADIENTS\n\noutColor=color1+(color2-color1)*randoms.b;\n#endif\n\n#ifndef ANGULARSPEEDGRADIENTS\noutAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;\noutAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#else\noutAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#endif\n\n#ifdef POINTEMITTER\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=vec3(0,0,0);\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(HEMISPHERICEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);\nnewDirection=newPosition+directionRandomizer*randoms3;\n#elif defined(SPHEREEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nnewDirection=newPosition+directionRandomizer*randoms3;\n#endif\n#elif defined(CYLINDEREMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat yPos=(randoms2.x-0.5)*height;\nfloat angle=randoms2.y*PI*2.;\nfloat inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));\nfloat positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));\nfloat xPos=positionRadius*cos(angle);\nfloat zPos=positionRadius*sin(angle);\nnewPosition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nangle=angle+((randoms3.x-0.5)*PI);\nnewDirection=vec3(cos(angle),randoms3.y-0.5,sin(angle));\nnewDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nfloat s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.0001;\n#else\nfloat h=randoms2.y*height.y;\n\nh=1.-h*h;\n#endif\nfloat lRadius=radius.x-radius.x*randoms2.z*radius.y;\nlRadius=lRadius*h;\nfloat randX=lRadius*sin(s);\nfloat randZ=lRadius*cos(s);\nfloat randY=h*height.x;\nnewPosition=vec3(randX,randY,randZ);\n\nif (abs(cos(coneAngle)) == 1.0) {\nnewDirection=vec3(0.,1.0,0.);\n} else {\nvec3 randoms3=getRandomVec3(seed.z);\nnewDirection=normalize(newPosition+directionRandomizer*randoms3);\n}\n#elif defined(CUSTOMEMITTER)\nnewPosition=initialPosition;\noutInitialPosition=initialPosition;\n#else\n\nnewPosition=vec3(0.,0.,0.);\n\nnewDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\n#ifdef LOCAL\noutPosition=newPosition;\n#else\noutPosition=(emitterWM*vec4(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#ifndef BILLBOARD\noutInitialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nvec3 initial=newDirection;\n#else\nvec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;\n#endif\noutDirection=initial*power;\n#ifndef BILLBOARD\noutInitialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET\noutCellIndex=cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=randoms.a*outLife;\n#endif\n#endif\n#ifdef NOISE\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n} else {\nfloat directionScale=timeDelta;\noutAge=newAge;\nfloat ageGradient=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#if defined(CUSTOMEMITTER)\noutPosition=position+(direction-position)*ageGradient;\noutInitialPosition=initialPosition;\n#else\noutPosition=position+direction*directionScale;\n#endif\noutLife=life;\noutSeed=seed;\n#ifndef COLORGRADIENTS\noutColor=color;\n#endif\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;\noutSize.yz=size.yz;\n#else\noutSize=size;\n#endif\n#ifndef BILLBOARD\noutInitialDirection=initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#else\nvec3 updatedDirection=direction+gravity*timeDelta;\n#ifdef LIMITVELOCITYGRADIENTS\nfloat limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;\nfloat currentVelocity=length(updatedDirection);\nif (currentVelocity>limitVelocity) {\nupdatedDirection=updatedDirection*limitVelocityDamping;\n}\n#endif\noutDirection=updatedDirection;\n#ifdef NOISE\nfloat fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;\nvec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;\noutDirection=outDirection+force*timeDelta;\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nfloat angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;\noutAngle=angle+angularSpeed*timeDelta;\n#else\noutAngle=vec2(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET\nfloat offsetAge=outAge;\nfloat dist=cellInfos.y-cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=cellStartOffset;\noffsetAge+=cellStartOffset;\n#else\nfloat cellStartOffset=0.;\n#endif\nfloat ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);\noutCellIndex=float(int(cellInfos.x+ratio*dist));\n#endif\n}\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/grain.fragment.ts":
- /*!***********************************!*\
- !*** ./Shaders/grain.fragment.ts ***!
- \***********************************/
- /*! exports provided: grainPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"grainPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),"grainPixelShader"),o="#include<helperFunctions>\n\nuniform sampler2D textureSampler;\n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/hdrFiltering.fragment.ts":
- /*!******************************************!*\
- !*** ./Shaders/hdrFiltering.fragment.ts ***!
- \******************************************/
- /*! exports provided: hdrFilteringPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"hdrFilteringPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/importanceSampling */"./Shaders/ShadersInclude/importanceSampling.ts"),r(/*! ./ShadersInclude/pbrBRDFFunctions */"./Shaders/ShadersInclude/pbrBRDFFunctions.ts"),r(/*! ./ShadersInclude/hdrFilteringFunctions */"./Shaders/ShadersInclude/hdrFilteringFunctions.ts"),"hdrFilteringPixelShader"),o="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform float alphaG;\nuniform samplerCube inputTexture;\nuniform vec2 vFilteringInfo;\nuniform float hdrScale;\nvarying vec3 direction;\nvoid main() {\nvec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);\ngl_FragColor=vec4(color*hdrScale,1.0);\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/hdrFiltering.vertex.ts":
- /*!****************************************!*\
- !*** ./Shaders/hdrFiltering.vertex.ts ***!
- \****************************************/
- /*! exports provided: hdrFilteringVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"hdrFilteringVertexShader",(function(){return o}));var n="hdrFilteringVertexShader",i="\nattribute vec2 position;\n\nvarying vec3 direction;\n\nuniform vec3 up;\nuniform vec3 right;\nuniform vec3 front;\nvoid main(void) {\nmat3 view=mat3(up,right,front);\ndirection=view*vec3(position,1.0);\ngl_Position=vec4(position,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/highlights.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/highlights.fragment.ts ***!
- \****************************************/
- /*! exports provided: highlightsPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"highlightsPixelShader",(function(){return o}));var n="highlightsPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void)\n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/imageProcessing.fragment.ts":
- /*!*********************************************!*\
- !*** ./Shaders/imageProcessing.fragment.ts ***!
- \*********************************************/
- /*! exports provided: imageProcessingPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"imageProcessingPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),"imageProcessingPixelShader"),o="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/kernelBlur.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/kernelBlur.fragment.ts ***!
- \****************************************/
- /*! exports provided: kernelBlurPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"kernelBlurPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/kernelBlurVaryingDeclaration */"./Shaders/ShadersInclude/kernelBlurVaryingDeclaration.ts"),r(/*! ./ShadersInclude/packingFunctions */"./Shaders/ShadersInclude/packingFunctions.ts"),r(/*! ./ShadersInclude/kernelBlurFragment */"./Shaders/ShadersInclude/kernelBlurFragment.ts"),r(/*! ./ShadersInclude/kernelBlurFragment2 */"./Shaders/ShadersInclude/kernelBlurFragment2.ts"),"kernelBlurPixelShader"),o="\nuniform sampler2D textureSampler;\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#ifdef DOF\nuniform sampler2D circleOfConfusionSampler;\nuniform vec2 cameraMinMaxZ;\nfloat sampleDistance(const in vec2 offset) {\nfloat depth=texture2D(circleOfConfusionSampler,offset).g;\nreturn cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth;\n}\nfloat sampleCoC(const in vec2 offset) {\nfloat coc=texture2D(circleOfConfusionSampler,offset).r;\nreturn coc;\n}\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\nfloat computedWeight=0.0;\n#ifdef PACKEDFLOAT\nfloat blend=0.;\n#else\nvec4 blend=vec4(0.);\n#endif\n#ifdef DOF\nfloat sumOfWeights=CENTER_WEIGHT;\nfloat factor=0.0;\n\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\ngl_FragColor=pack(blend);\n#else\ngl_FragColor=blend;\n#endif\n#ifdef DOF\ngl_FragColor/=sumOfWeights;\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/kernelBlur.vertex.ts":
- /*!**************************************!*\
- !*** ./Shaders/kernelBlur.vertex.ts ***!
- \**************************************/
- /*! exports provided: kernelBlurVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"kernelBlurVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/kernelBlurVaryingDeclaration */"./Shaders/ShadersInclude/kernelBlurVaryingDeclaration.ts"),r(/*! ./ShadersInclude/kernelBlurVertex */"./Shaders/ShadersInclude/kernelBlurVertex.ts"),"kernelBlurVertexShader"),o="\nattribute vec2 position;\n\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nsampleCenter=(position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\ngl_Position=vec4(position,0.0,1.0);\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/layer.fragment.ts":
- /*!***********************************!*\
- !*** ./Shaders/layer.fragment.ts ***!
- \***********************************/
- /*! exports provided: layerPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"layerPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),"layerPixelShader"),o="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\n\n#include<helperFunctions>\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef LINEAR\nbaseColor.rgb=toGammaSpace(baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/layer.vertex.ts":
- /*!*********************************!*\
- !*** ./Shaders/layer.vertex.ts ***!
- \*********************************/
- /*! exports provided: layerVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"layerVertexShader",(function(){return o}));var n="layerVertexShader",i="\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/lensFlare.fragment.ts":
- /*!***************************************!*\
- !*** ./Shaders/lensFlare.fragment.ts ***!
- \***************************************/
- /*! exports provided: lensFlarePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"lensFlarePixelShader",(function(){return o}));var n="lensFlarePixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/lensFlare.vertex.ts":
- /*!*************************************!*\
- !*** ./Shaders/lensFlare.vertex.ts ***!
- \*************************************/
- /*! exports provided: lensFlareVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"lensFlareVertexShader",(function(){return o}));var n="lensFlareVertexShader",i="\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/lensHighlights.fragment.ts":
- /*!********************************************!*\
- !*** ./Shaders/lensHighlights.fragment.ts ***!
- \********************************************/
- /*! exports provided: lensHighlightsPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"lensHighlightsPixelShader",(function(){return o}));var n="lensHighlightsPixelShader",i="\nuniform sampler2D textureSampler;\n\nuniform float gain;\nuniform float threshold;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\n\nvec4 highlightColor(vec4 color) {\nvec4 highlight=color;\nfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\nfloat lum_threshold;\nif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\n\nif (gain == -1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\n\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/line.fragment.ts":
- /*!**********************************!*\
- !*** ./Shaders/line.fragment.ts ***!
- \**********************************/
- /*! exports provided: linePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"linePixelShader",(function(){return o}));var n="linePixelShader",i="uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/line.vertex.ts":
- /*!********************************!*\
- !*** ./Shaders/line.vertex.ts ***!
- \********************************/
- /*! exports provided: lineVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"lineVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),"lineVertexShader"),o="#include<instancesDeclaration>\n\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 viewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\n#include<instancesVertex>\nmat4 worldViewProjection=viewProjection*finalWorld;\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/minmaxRedux.fragment.ts":
- /*!*****************************************!*\
- !*** ./Shaders/minmaxRedux.fragment.ts ***!
- \*****************************************/
- /*! exports provided: minmaxReduxPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"minmaxReduxPixelShader",(function(){return o}));var n="minmaxReduxPixelShader",i="attribute vec2 vUV;\nuniform sampler2D textureSampler;\n#if defined(INITIAL)\nuniform sampler2D sourceTexture;\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nfloat f1=texelFetch(sourceTexture,coord,0).r;\nfloat f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;\nfloat f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;\nfloat f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;\nfloat minz=min(min(min(f1,f2),f3),f4);\n#ifdef DEPTH_REDUX\nfloat maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);\n#else\nfloat maxz=max(max(max(f1,f2),f3),f4);\n#endif\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(MAIN)\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nvec2 f1=texelFetch(textureSampler,coord,0).rg;\nvec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;\nvec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;\nvec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;\nfloat minz=min(min(min(f1.x,f2.x),f3.x),f4.x);\nfloat maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(ONEBEFORELAST)\nuniform ivec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*vec2(texSize-1));\nvec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;\nvec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;\nvec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;\nvec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;\nfloat minz=min(f1.x,f2.x);\nfloat maxz=max(f1.y,f2.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(LAST)\nvoid main(void)\n{\ndiscard;\nglFragColor=vec4(0.);\n}\n#endif\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/motionBlur.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/motionBlur.fragment.ts ***!
- \****************************************/
- /*! exports provided: motionBlurPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"motionBlurPixelShader",(function(){return o}));var n="motionBlurPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D velocitySampler;\nuniform float motionStrength;\nuniform float motionScale;\nuniform vec2 screenSize;\nvoid main(void)\n{\n#ifdef GEOMETRY_SUPPORTED\nvec2 texelSize=1.0/screenSize;\nvec2 velocityColor=texture2D(velocitySampler,vUV).rg*2.0-1.0;\nvec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0));\nvelocity*=motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint samplesCount=int(clamp(speed,1.0,SAMPLES));\nvelocity=normalize(velocity)*texelSize;\nfloat hlim=float(-samplesCount)*0.5+0.5;\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i)\n{\nif (i>=samplesCount)\nbreak;\nvec2 offset=vUV+velocity*(hlim+float(i));\nresult+=texture2D(textureSampler,offset);\n}\ngl_FragColor=result/float(samplesCount);\ngl_FragColor.a=1.0;\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/noise.fragment.ts":
- /*!***********************************!*\
- !*** ./Shaders/noise.fragment.ts ***!
- \***********************************/
- /*! exports provided: noisePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"noisePixelShader",(function(){return o}));var n="noisePixelShader",i="\n\nuniform float brightness;\nuniform float persistence;\nuniform float timeScale;\n\nvarying vec2 vUV;\n\nvec2 hash22(vec2 p)\n{\np=p*mat2(127.1,311.7,269.5,183.3);\np=-1.0+2.0*fract(sin(p)*43758.5453123);\nreturn sin(p*6.283+timeScale);\n}\nfloat interpolationNoise(vec2 p)\n{\nvec2 pi=floor(p);\nvec2 pf=p-pi;\nvec2 w=pf*pf*(3.-2.*pf);\nfloat f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));\nfloat f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));\nfloat f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));\nfloat f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));\nfloat xm1=mix(f00,f10,w.x);\nfloat xm2=mix(f01,f11,w.x);\nfloat ym=mix(xm1,xm2,w.y);\nreturn ym;\n}\nfloat perlinNoise2D(float x,float y)\n{\nfloat sum=0.0;\nfloat frequency=0.0;\nfloat amplitude=0.0;\nfor(int i=0; i<OCTAVES; i++)\n{\nfrequency=pow(2.0,float(i));\namplitude=pow(persistence,float(i));\nsum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;\n}\nreturn sum;\n}\n\nvoid main(void)\n{\nfloat x=abs(vUV.x);\nfloat y=abs(vUV.y);\nfloat noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);\ngl_FragColor=vec4(noise,noise,noise,1.0);\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/outline.fragment.ts":
- /*!*************************************!*\
- !*** ./Shaders/outline.fragment.ts ***!
- \*************************************/
- /*! exports provided: outlinePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"outlinePixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.ts"),r(/*! ./ShadersInclude/logDepthFragment */"./Shaders/ShadersInclude/logDepthFragment.ts"),"outlinePixelShader"),o="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#include<logDepthFragment>\ngl_FragColor=color;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/outline.vertex.ts":
- /*!***********************************!*\
- !*** ./Shaders/outline.vertex.ts ***!
- \***********************************/
- /*! exports provided: outlineVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"outlineVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/logDepthVertex */"./Shaders/ShadersInclude/logDepthVertex.ts"),"outlineVertexShader"),o="\nattribute vec3 position;\nattribute vec3 normal;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\nuniform float offset;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<logDepthDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nvec3 offsetPosition=positionUpdated+(normalUpdated*offset);\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(offsetPosition,1.0);\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<logDepthVertex>\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/particles.fragment.ts":
- /*!***************************************!*\
- !*** ./Shaders/particles.fragment.ts ***!
- \***************************************/
- /*! exports provided: particlesPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"particlesPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts"),r(/*! ./ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),"particlesPixelShader"),o="\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/particles.vertex.ts":
- /*!*************************************!*\
- !*** ./Shaders/particles.vertex.ts ***!
- \*************************************/
- /*! exports provided: particlesVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"particlesVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/clipPlaneVertexDeclaration */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),"particlesVertexShader"),o="\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos;\n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\nvarying vec3 vPositionW;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration>\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#endif\nvoid main(void) {\nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD\n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\nvPositionW=(invView*vec4(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0);\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvPositionW=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(vPositionW,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset*particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/pass.fragment.ts":
- /*!**********************************!*\
- !*** ./Shaders/pass.fragment.ts ***!
- \**********************************/
- /*! exports provided: passPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"passPixelShader",(function(){return o}));var n="passPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/passCube.fragment.ts":
- /*!**************************************!*\
- !*** ./Shaders/passCube.fragment.ts ***!
- \**************************************/
- /*! exports provided: passCubePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"passCubePixelShader",(function(){return o}));var n="passCubePixelShader",i="\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nvoid main(void)\n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/pbr.fragment.ts":
- /*!*********************************!*\
- !*** ./Shaders/pbr.fragment.ts ***!
- \*********************************/
- /*! exports provided: pbrPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/prePassDeclaration */"./Shaders/ShadersInclude/prePassDeclaration.ts"),r(/*! ./ShadersInclude/pbrFragmentDeclaration */"./Shaders/ShadersInclude/pbrFragmentDeclaration.ts"),r(/*! ./ShadersInclude/pbrUboDeclaration */"./Shaders/ShadersInclude/pbrUboDeclaration.ts"),r(/*! ./ShadersInclude/pbrFragmentExtraDeclaration */"./Shaders/ShadersInclude/pbrFragmentExtraDeclaration.ts"),r(/*! ./ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ./ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ./ShadersInclude/pbrFragmentSamplersDeclaration */"./Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.ts"),r(/*! ./ShadersInclude/imageProcessingDeclaration */"./Shaders/ShadersInclude/imageProcessingDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts"),r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.ts"),r(/*! ./ShadersInclude/fogFragmentDeclaration */"./Shaders/ShadersInclude/fogFragmentDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/subSurfaceScatteringFunctions */"./Shaders/ShadersInclude/subSurfaceScatteringFunctions.ts"),r(/*! ./ShadersInclude/importanceSampling */"./Shaders/ShadersInclude/importanceSampling.ts"),r(/*! ./ShadersInclude/pbrHelperFunctions */"./Shaders/ShadersInclude/pbrHelperFunctions.ts"),r(/*! ./ShadersInclude/imageProcessingFunctions */"./Shaders/ShadersInclude/imageProcessingFunctions.ts"),r(/*! ./ShadersInclude/shadowsFragmentFunctions */"./Shaders/ShadersInclude/shadowsFragmentFunctions.ts"),r(/*! ./ShadersInclude/harmonicsFunctions */"./Shaders/ShadersInclude/harmonicsFunctions.ts"),r(/*! ./ShadersInclude/pbrDirectLightingSetupFunctions */"./Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.ts"),r(/*! ./ShadersInclude/pbrDirectLightingFalloffFunctions */"./Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.ts"),r(/*! ./ShadersInclude/pbrBRDFFunctions */"./Shaders/ShadersInclude/pbrBRDFFunctions.ts"),r(/*! ./ShadersInclude/hdrFilteringFunctions */"./Shaders/ShadersInclude/hdrFilteringFunctions.ts"),r(/*! ./ShadersInclude/pbrDirectLightingFunctions */"./Shaders/ShadersInclude/pbrDirectLightingFunctions.ts"),r(/*! ./ShadersInclude/pbrIBLFunctions */"./Shaders/ShadersInclude/pbrIBLFunctions.ts"),r(/*! ./ShadersInclude/bumpFragmentMainFunctions */"./Shaders/ShadersInclude/bumpFragmentMainFunctions.ts"),r(/*! ./ShadersInclude/bumpFragmentFunctions */"./Shaders/ShadersInclude/bumpFragmentFunctions.ts"),r(/*! ./ShadersInclude/reflectionFunction */"./Shaders/ShadersInclude/reflectionFunction.ts"),r(/*! ./ShadersInclude/pbrBlockAlbedoOpacity */"./Shaders/ShadersInclude/pbrBlockAlbedoOpacity.ts"),r(/*! ./ShadersInclude/pbrBlockReflectivity */"./Shaders/ShadersInclude/pbrBlockReflectivity.ts"),r(/*! ./ShadersInclude/pbrBlockAmbientOcclusion */"./Shaders/ShadersInclude/pbrBlockAmbientOcclusion.ts"),r(/*! ./ShadersInclude/pbrBlockAlphaFresnel */"./Shaders/ShadersInclude/pbrBlockAlphaFresnel.ts"),r(/*! ./ShadersInclude/pbrBlockAnisotropic */"./Shaders/ShadersInclude/pbrBlockAnisotropic.ts"),r(/*! ./ShadersInclude/pbrBlockReflection */"./Shaders/ShadersInclude/pbrBlockReflection.ts"),r(/*! ./ShadersInclude/pbrBlockSheen */"./Shaders/ShadersInclude/pbrBlockSheen.ts"),r(/*! ./ShadersInclude/pbrBlockClearcoat */"./Shaders/ShadersInclude/pbrBlockClearcoat.ts"),r(/*! ./ShadersInclude/pbrBlockSubSurface */"./Shaders/ShadersInclude/pbrBlockSubSurface.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),r(/*! ./ShadersInclude/pbrBlockNormalGeometric */"./Shaders/ShadersInclude/pbrBlockNormalGeometric.ts"),r(/*! ./ShadersInclude/bumpFragment */"./Shaders/ShadersInclude/bumpFragment.ts"),r(/*! ./ShadersInclude/pbrBlockNormalFinal */"./Shaders/ShadersInclude/pbrBlockNormalFinal.ts"),r(/*! ./ShadersInclude/depthPrePass */"./Shaders/ShadersInclude/depthPrePass.ts"),r(/*! ./ShadersInclude/pbrBlockLightmapInit */"./Shaders/ShadersInclude/pbrBlockLightmapInit.ts"),r(/*! ./ShadersInclude/pbrBlockGeometryInfo */"./Shaders/ShadersInclude/pbrBlockGeometryInfo.ts"),r(/*! ./ShadersInclude/pbrBlockReflectance0 */"./Shaders/ShadersInclude/pbrBlockReflectance0.ts"),r(/*! ./ShadersInclude/pbrBlockReflectance */"./Shaders/ShadersInclude/pbrBlockReflectance.ts"),r(/*! ./ShadersInclude/pbrBlockDirectLighting */"./Shaders/ShadersInclude/pbrBlockDirectLighting.ts"),r(/*! ./ShadersInclude/lightFragment */"./Shaders/ShadersInclude/lightFragment.ts"),r(/*! ./ShadersInclude/pbrBlockFinalLitComponents */"./Shaders/ShadersInclude/pbrBlockFinalLitComponents.ts"),r(/*! ./ShadersInclude/pbrBlockFinalUnlitComponents */"./Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.ts"),r(/*! ./ShadersInclude/pbrBlockFinalColorComposition */"./Shaders/ShadersInclude/pbrBlockFinalColorComposition.ts"),r(/*! ./ShadersInclude/logDepthFragment */"./Shaders/ShadersInclude/logDepthFragment.ts"),r(/*! ./ShadersInclude/fogFragment */"./Shaders/ShadersInclude/fogFragment.ts"),r(/*! ./ShadersInclude/pbrBlockImageProcessing */"./Shaders/ShadersInclude/pbrBlockImageProcessing.ts"),r(/*! ./ShadersInclude/pbrDebug */"./Shaders/ShadersInclude/pbrDebug.ts"),"pbrPixelShader"),o="#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE\n#endif\n\n#include<__decl__pbrFragment>\n#include<pbrFragmentExtraDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<pbrFragmentSamplersDeclaration>\n#include<imageProcessingDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<importanceSampling>\n#include<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<pbrBlockAlbedoOpacity>\n#include<pbrBlockReflectivity>\n#include<pbrBlockAmbientOcclusion>\n#include<pbrBlockAlphaFresnel>\n#include<pbrBlockAnisotropic>\n#include<pbrBlockReflection>\n#include<pbrBlockSheen>\n#include<pbrBlockClearcoat>\n#include<pbrBlockSubSurface>\n\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n\n#include<pbrBlockNormalGeometric>\n#include<bumpFragment>\n#include<pbrBlockNormalFinal>\n\nalbedoOpacityOutParams albedoOpacityOut;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#endif\nalbedoOpacityBlock(\nvAlbedoColor,\n#ifdef ALBEDO\nalbedoTexture,\nvAlbedoInfos,\n#endif\n#ifdef OPACITY\nopacityMap,\nvOpacityInfos,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nalbedoOpacityOut\n);\nvec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;\nfloat alpha=albedoOpacityOut.alpha;\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\n#include<depthPrePass>\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\nambientOcclusionOutParams aoOut;\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;\n#endif\nambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap,\nvAmbientInfos,\n#endif\naoOut\n);\n#include<pbrBlockLightmapInit>\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nvec3 baseColor=surfaceAlbedo;\nreflectivityOutParams reflectivityOut;\n#if defined(REFLECTIVITY)\nvec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\n#ifndef METALLICWORKFLOW\nsurfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);\nsurfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;\n#endif\n#endif\n#if defined(MICROSURFACEMAP)\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\n#endif\n#ifdef METALLICWORKFLOW\nvec4 metallicReflectanceFactors=vMetallicReflectanceFactors;\n#ifdef METALLIC_REFLECTANCE\nvec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);\nmetallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);\nmetallicReflectanceFactors*=metallicReflectanceFactorsMap;\n#endif\n#endif\nreflectivityBlock(\nvReflectivityColor,\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo,\nmetallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nvReflectivityInfos,\nsurfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor,\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurfaceTexel,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nreflectivityOut\n);\nfloat microSurface=reflectivityOut.microSurface;\nfloat roughness=reflectivityOut.roughness;\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo=reflectivityOut.surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;\n#endif\n\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nalphaFresnelOutParams alphaFresnelOut;\nalphaFresnelBlock(\nnormalW,\nviewDirectionW,\nalpha,\nmicroSurface,\nalphaFresnelOut\n);\nalpha=alphaFresnelOut.alpha;\n#endif\n#endif\n\n#include<pbrBlockGeometryInfo>\n\n#ifdef ANISOTROPIC\nanisotropicOutParams anisotropicOut;\n#ifdef ANISOTROPIC_TEXTURE\nvec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;\n#endif\nanisotropicBlock(\nvAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData,\n#endif\nTBN,\nnormalW,\nviewDirectionW,\nanisotropicOut\n);\n#endif\n\n#ifdef REFLECTION\nreflectionOutParams reflectionOut;\nreflectionBlock(\nvPositionW,\nnormalW,\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\nreflectionSampler,\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nvEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\nreflectionOut\n);\n#endif\n\n#include<pbrBlockReflectance0>\n\n#ifdef SHEEN\nsheenOutParams sheenOut;\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData=toLinearSpace(texture2D(sheenSampler,vSheenUV+uvOffset))*vSheenInfos.y;\n#endif\nsheenBlock(\nvSheenColor,\n#ifdef SHEEN_ROUGHNESS\nvSheenRoughness,\n#endif\nroughness,\n#ifdef SHEEN_TEXTURE\nsheenMapData,\n#endif\nreflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nbaseColor,\nsurfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nNdotV,\nenvironmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nAARoughnessFactors,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\nreflectionOut.reflectionCoords,\nNdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nseo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\neho,\n#endif\n#endif\nsheenOut\n);\n#ifdef SHEEN_LINKWITHALBEDO\nsurfaceAlbedo=sheenOut.surfaceAlbedo;\n#endif\n#endif\n\nclearcoatOutParams clearcoatOut;\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData=toLinearSpace(texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset));\n#endif\n#ifdef CLEARCOAT_BUMP\nvec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);\n#endif\nclearcoatBlock(\nvPositionW,\ngeometricNormalW,\nviewDirectionW,\nvClearCoatParams,\nspecularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nclearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nvClearCoatTintParams,\nclearCoatColorAtDistance,\nvClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nvClearCoatBumpInfos,\nclearCoatBumpMapData,\nvClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nvTBN,\n#else\nvClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nnormalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nfaceNormal,\n#endif\n#ifdef REFLECTION\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nambientMonochrome,\n#endif\n#endif\nclearcoatOut\n);\n#else\nclearcoatOut.specularEnvironmentR0=specularEnvironmentR0;\n#endif\n\n#include<pbrBlockReflectance>\n\nsubSurfaceOutParams subSurfaceOut;\n#ifdef SUBSURFACE\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);\n#endif\nsubSurfaceBlock(\nvSubSurfaceIntensity,\nvThicknessParam,\nvTintColor,\nnormalW,\nspecularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nthicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nreflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionOut.irradianceVector,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nvPositionW,\nviewDirectionW,\nview,\nsurfaceAlbedo,\nvRefractionInfos,\nrefractionMatrix,\nvRefractionMicrosurfaceInfos,\nvLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nNdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nroughness,\n#else\nalphaG,\n#endif\nrefractionSampler,\n#ifndef LODBASEDMICROSFURACE\nrefractionSamplerLow,\nrefractionSamplerHigh,\n#endif\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvDiffusionDistance,\n#endif\nsubSurfaceOut\n);\n#ifdef SS_REFRACTION\nsurfaceAlbedo=subSurfaceOut.surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha=subSurfaceOut.alpha;\n#endif\n#endif\n#else\nsubSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;\n#endif\n\n#include<pbrBlockDirectLighting>\n#include<lightFragment>[0..maxSimultaneousLights]\n\n#include<pbrBlockFinalLitComponents>\n#endif\n#include<pbrBlockFinalUnlitComponents>\n#include<pbrBlockFinalColorComposition>\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#include<pbrBlockImageProcessing>\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\nvec3 sqAlbedo=sqrt(surfaceAlbedo);\n\n#ifdef SS_SCATTERING\ngl_FragData[0]=vec4(finalColor.rgb-irradiance,finalColor.a);\nirradiance/=sqAlbedo;\ngl_FragData[1]=vec4(tagLightingForSSS(irradiance),scatteringDiffusionProfile/255.);\n#else\ngl_FragData[0]=vec4(finalColor.rgb,finalColor.a);\ngl_FragData[1]=vec4(0.0,0.0,0.0,1.0);\n#endif\ngl_FragData[2]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\ngl_FragData[3]=vec4(sqAlbedo,1.0);\n#endif\ngl_FragColor=finalColor;\n#include<pbrDebug>\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/pbr.vertex.ts":
- /*!*******************************!*\
- !*** ./Shaders/pbr.vertex.ts ***!
- \*******************************/
- /*! exports provided: pbrVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/pbrVertexDeclaration */"./Shaders/ShadersInclude/pbrVertexDeclaration.ts"),r(/*! ./ShadersInclude/pbrUboDeclaration */"./Shaders/ShadersInclude/pbrUboDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/harmonicsFunctions */"./Shaders/ShadersInclude/harmonicsFunctions.ts"),r(/*! ./ShadersInclude/bumpVertexDeclaration */"./Shaders/ShadersInclude/bumpVertexDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneVertexDeclaration */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts"),r(/*! ./ShadersInclude/fogVertexDeclaration */"./Shaders/ShadersInclude/fogVertexDeclaration.ts"),r(/*! ./ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ./ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/bumpVertex */"./Shaders/ShadersInclude/bumpVertex.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),r(/*! ./ShadersInclude/fogVertex */"./Shaders/ShadersInclude/fogVertex.ts"),r(/*! ./ShadersInclude/shadowsVertex */"./Shaders/ShadersInclude/shadowsVertex.ts"),r(/*! ./ShadersInclude/logDepthVertex */"./Shaders/ShadersInclude/logDepthVertex.ts"),"pbrVertexShader"),o="precision highp float;\n#include<__decl__pbrVertex>\n#define CUSTOM_VERTEX_BEGIN\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#ifdef PREPASS\nvarying vec3 vViewPos;\n#endif\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nvarying vec2 vAlbedoUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nvarying vec2 vReflectivityUV;\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nvarying vec2 vMetallicReflectanceUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatUV;\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nvarying vec2 vClearCoatBumpUV;\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatTintUV;\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nvarying vec2 vSheenUV;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nvarying vec2 vAnisotropyUV;\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nvarying vec2 vThicknessUV;\n#endif\n#endif\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#include<harmonicsFunctions>\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#ifdef PREPASS\nvViewPos=(view*worldPos).rgb;\n#endif\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#if DEBUGMODE>0\nvClipSpacePosition=gl_Position;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nif (vReflectivityInfos.x == 0.)\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nif (vMicroSurfaceSamplerInfos.x == 0.)\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nif (vMetallicReflectanceInfos.x == 0.)\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nif (vClearCoatInfos.x == 0.)\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nif (vClearCoatBumpInfos.x == 0.)\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nif (vClearCoatTintInfos.x == 0.)\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nif (vSheenInfos.x == 0.)\n{\nvSheenUV=vec2(sheenMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenUV=vec2(sheenMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nif (vAnisotropyInfos.x == 0.)\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nif (vThicknessInfos.x == 0.)\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n\n#include<bumpVertex>\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/postprocess.vertex.ts":
- /*!***************************************!*\
- !*** ./Shaders/postprocess.vertex.ts ***!
- \***************************************/
- /*! exports provided: postprocessVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"postprocessVertexShader",(function(){return o}));var n="postprocessVertexShader",i="\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/procedural.vertex.ts":
- /*!**************************************!*\
- !*** ./Shaders/procedural.vertex.ts ***!
- \**************************************/
- /*! exports provided: proceduralVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"proceduralVertexShader",(function(){return o}));var n="proceduralVertexShader",i="\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/refraction.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/refraction.fragment.ts ***!
- \****************************************/
- /*! exports provided: refractionPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"refractionPixelShader",(function(){return o}));var n="refractionPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D refractionSampler;\n\nuniform vec3 baseColor;\nuniform float depth;\nuniform float colorLevel;\nvoid main() {\nfloat ref=1.0-texture2D(refractionSampler,vUV).r;\nvec2 uv=vUV-vec2(0.5);\nvec2 offset=uv*depth*ref;\nvec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;\ngl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/rgbdDecode.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/rgbdDecode.fragment.ts ***!
- \****************************************/
- /*! exports provided: rgbdDecodePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"rgbdDecodePixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),"rgbdDecodePixelShader"),o="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/rgbdEncode.fragment.ts":
- /*!****************************************!*\
- !*** ./Shaders/rgbdEncode.fragment.ts ***!
- \****************************************/
- /*! exports provided: rgbdEncodePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"rgbdEncodePixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),"rgbdEncodePixelShader"),o="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/screenSpaceCurvature.fragment.ts":
- /*!**************************************************!*\
- !*** ./Shaders/screenSpaceCurvature.fragment.ts ***!
- \**************************************************/
- /*! exports provided: screenSpaceCurvaturePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"screenSpaceCurvaturePixelShader",(function(){return o}));var n="screenSpaceCurvaturePixelShader",i="\n\nprecision highp float;\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform float curvature_ridge;\nuniform float curvature_valley;\n#ifndef CURVATURE_OFFSET\n#define CURVATURE_OFFSET 1\n#endif\nfloat curvature_soft_clamp(float curvature,float control)\n{\nif (curvature<0.5/control)\nreturn curvature*(1.0-curvature*control);\nreturn 0.25/control;\n}\nfloat calculate_curvature(ivec2 texel,float ridge,float valley)\n{\nvec2 normal_up=texelFetchOffset(normalSampler,texel,0,ivec2(0,CURVATURE_OFFSET)).rb;\nvec2 normal_down=texelFetchOffset(normalSampler,texel,0,ivec2(0,-CURVATURE_OFFSET)).rb;\nvec2 normal_left=texelFetchOffset(normalSampler,texel,0,ivec2(-CURVATURE_OFFSET,0)).rb;\nvec2 normal_right=texelFetchOffset(normalSampler,texel,0,ivec2( CURVATURE_OFFSET,0)).rb;\nfloat normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));\nif (normal_diff<0.0)\nreturn -2.0*curvature_soft_clamp(-normal_diff,valley);\nreturn 2.0*curvature_soft_clamp(normal_diff,ridge);\n}\nvoid main(void)\n{\nivec2 texel=ivec2(gl_FragCoord.xy);\nvec4 baseColor=texture2D(textureSampler,vUV);\nfloat curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);\nbaseColor.rgb*=curvature+1.0;\ngl_FragColor=baseColor;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/screenSpaceReflection.fragment.ts":
- /*!***************************************************!*\
- !*** ./Shaders/screenSpaceReflection.fragment.ts ***!
- \***************************************************/
- /*! exports provided: screenSpaceReflectionPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"screenSpaceReflectionPixelShader",(function(){return o}));var n="screenSpaceReflectionPixelShader",i="\n\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform sampler2D positionSampler;\nuniform sampler2D reflectivitySampler;\nuniform mat4 view;\nuniform mat4 projection;\nuniform float step;\nuniform float strength;\nuniform float threshold;\nuniform float roughnessFactor;\nuniform float reflectionSpecularFalloffExponent;\n\nvarying vec2 vUV;\n\nstruct ReflectionInfo {\nvec3 color;\nvec4 coords;\n};\n\nvec3 fresnelSchlick(float cosTheta,vec3 F0)\n{\nreturn F0+(1.0-F0)*pow(1.0-cosTheta,5.0);\n}\n\nReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\ninfo.color=vec3(0.0);\nvec4 projectedCoord;\nfloat sampledDepth;\nfor(int i=0; i<SMOOTH_STEPS; i++)\n{\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\ndir*=0.5;\nif(depth>0.0)\nhitCoord-=dir;\nelse\nhitCoord+=dir;\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\n}\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\n\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,1.0);\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.color/=float(SMOOTH_STEPS+1);\nreturn info;\n}\n\nReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\nvec4 projectedCoord;\nfloat sampledDepth;\ndir*=step;\nfor(int i=0; i<REFLECTION_SAMPLES; i++)\n{\nhitCoord+=dir;\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\nif(((depth-dir.z)<threshold) && depth<=0.0)\n{\n#ifdef ENABLE_SMOOTH_REFLECTIONS\nreturn smoothReflectionInfo(dir,hitCoord);\n#else\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n#endif\n}\n}\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n}\nvec3 hash(vec3 a)\n{\na=fract(a*0.8);\na+=dot(a,a.yxz+19.19);\nreturn fract((a.xxy+a.yxx)*a.zyx);\n}\nvoid main()\n{\n#ifdef SSR_SUPPORTED\n\nvec4 albedoFull=texture2D(textureSampler,vUV);\nvec3 albedo=albedoFull.rgb;\nfloat spec=texture2D(reflectivitySampler,vUV).r;\nif (spec == 0.0) {\ngl_FragColor=albedoFull;\nreturn;\n}\n\nvec3 normal=(texture2D(normalSampler,vUV)).xyz;\nvec3 position=(view*texture2D(positionSampler,vUV)).xyz;\nvec3 reflected=normalize(reflect(normalize(position),normalize(normal)));\nfloat roughness=1.0-texture2D(reflectivitySampler,vUV).a;\nvec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;\nReflectionInfo info=getReflectionInfo(jitt+reflected,position);\n\nvec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));\nfloat screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\n\nvec3 F0=vec3(0.04);\nF0=mix(F0,albedo,spec);\nvec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);\n\nfloat reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);\nfloat albedoMultiplier=1.0-reflectionMultiplier;\nvec3 SSR=info.color*fresnel;\ngl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/shadowMap.fragment.ts":
- /*!***************************************!*\
- !*** ./Shaders/shadowMap.fragment.ts ***!
- \***************************************/
- /*! exports provided: shadowMapPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/shadowMapFragmentDeclaration */"./Shaders/ShadersInclude/shadowMapFragmentDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneFragmentDeclaration */"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneFragment */"./Shaders/ShadersInclude/clipPlaneFragment.ts"),r(/*! ./ShadersInclude/shadowMapFragment */"./Shaders/ShadersInclude/shadowMapFragment.ts"),"shadowMapPixelShader"),o="#include<shadowMapFragmentDeclaration>\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void)\n{\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nfloat alphaFromAlphaTexture=texture2D(diffuseSampler,vUV).a;\nif (alphaFromAlphaTexture<0.4)\ndiscard;\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#ifdef ALPHATEST\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alphaFromAlphaTexture) discard;\n#else\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM) discard;\n#endif\n#endif\n#include<shadowMapFragment>\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/shadowMap.vertex.ts":
- /*!*************************************!*\
- !*** ./Shaders/shadowMap.vertex.ts ***!
- \*************************************/
- /*! exports provided: shadowMapVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"shadowMapVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/shadowMapVertexDeclaration */"./Shaders/ShadersInclude/shadowMapVertexDeclaration.ts"),r(/*! ./ShadersInclude/clipPlaneVertexDeclaration */"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),r(/*! ./ShadersInclude/shadowMapVertexNormalBias */"./Shaders/ShadersInclude/shadowMapVertexNormalBias.ts"),r(/*! ./ShadersInclude/shadowMapVertexMetric */"./Shaders/ShadersInclude/shadowMapVertexMetric.ts"),r(/*! ./ShadersInclude/clipPlaneVertex */"./Shaders/ShadersInclude/clipPlaneVertex.ts"),"shadowMapVertexShader"),o="\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\n#include<helperFunctions>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<shadowMapVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normWorldSM=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));\nvNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvec3 vNormalW=normalize(normWorldSM*normalUpdated);\n#endif\n#endif\n#include<shadowMapVertexNormalBias>\n\ngl_Position=viewProjection*worldPos;\n#include<shadowMapVertexMetric>\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<clipPlaneVertex>\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/sharpen.fragment.ts":
- /*!*************************************!*\
- !*** ./Shaders/sharpen.fragment.ts ***!
- \*************************************/
- /*! exports provided: sharpenPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"sharpenPixelShader",(function(){return o}));var n="sharpenPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform vec2 sharpnessAmounts;\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 color=texture2D(textureSampler,vUV);\nvec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1)) -\ncolor*4.0;\ngl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/spriteMap.fragment.ts":
- /*!***************************************!*\
- !*** ./Shaders/spriteMap.fragment.ts ***!
- \***************************************/
- /*! exports provided: spriteMapPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"spriteMapPixelShader",(function(){return o}));var n="spriteMapPixelShader",i="precision highp float;\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nuniform float time;\nuniform float spriteCount;\nuniform sampler2D spriteSheet;\nuniform vec2 spriteMapSize;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform sampler2D frameMap;\nuniform sampler2D tileMaps[LAYERS];\nuniform sampler2D animationMap;\nuniform vec3 colorMul;\nfloat mt;\nconst float fdStep=1./4.;\nconst float aFrameSteps=1./MAX_ANIMATION_FRAMES;\nmat4 getFrameData(float frameID){\nfloat fX=frameID/spriteCount;\nreturn mat4(\ntexture2D(frameMap,vec2(fX,0.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*1.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*2.),0.),\nvec4(0.)\n);\n}\nvoid main(){\nvec4 color=vec4(0.);\nvec2 tileUV=fract(tUV);\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\nvec2 tileID=floor(tUV);\nvec2 sheetUnits=1./spriteMapSize;\nfloat spriteUnits=1./spriteCount;\nvec2 stageUnits=1./stageSize;\nfor(int i=0; i<LAYERS; i++) {\nfloat frameID;\n#define LAYER_ID_SWITCH\nvec4 animationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,0.),0.);\nif(animationData.y>0.) {\nmt=mod(time*animationData.z,1.0);\nfor(float f=0.; f<MAX_ANIMATION_FRAMES; f++){\nif(animationData.y>mt){\nframeID=animationData.x;\nbreak;\n}\nanimationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.);\n}\n}\n\nmat4 frameData=getFrameData(frameID+0.5);\nvec2 frameSize=(frameData[0].wz)/spriteMapSize;\nvec2 offset=frameData[0].xy*sheetUnits;\nvec2 ratio=frameData[2].xy/frameData[0].wz;\n\nif (frameData[2].z == 1.){\ntileUV.xy=tileUV.yx;\n}\nif (i == 0){\ncolor=texture2D(spriteSheet,tileUV*frameSize+offset);\n} else {\nvec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);\nfloat alpha=min(color.a+nc.a,1.0);\nvec3 mixed=mix(color.xyz,nc.xyz,nc.a);\ncolor=vec4(mixed,alpha);\n}\n}\ncolor.xyz*=colorMul;\ngl_FragColor=color;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/spriteMap.vertex.ts":
- /*!*************************************!*\
- !*** ./Shaders/spriteMap.vertex.ts ***!
- \*************************************/
- /*! exports provided: spriteMapVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"spriteMapVertexShader",(function(){return o}));var n="spriteMapVertexShader",i="precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nvarying vec2 stageUnits;\nvarying vec2 levelUnits;\nvarying vec2 tileID;\n\nuniform float time;\nuniform mat4 worldViewProjection;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform vec2 spriteMapSize;\nuniform float stageScale;\nvoid main() {\nvec4 p=vec4( position,1. );\nvPosition=p.xyz;\nvUV=uv;\ntUV=uv*stageSize;\ngl_Position=worldViewProjection*p;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/sprites.fragment.ts":
- /*!*************************************!*\
- !*** ./Shaders/sprites.fragment.ts ***!
- \*************************************/
- /*! exports provided: spritesPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"spritesPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/fogFragmentDeclaration */"./Shaders/ShadersInclude/fogFragmentDeclaration.ts"),r(/*! ./ShadersInclude/fogFragment */"./Shaders/ShadersInclude/fogFragment.ts"),"spritesPixelShader"),o="uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest)\n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include<fogFragment>\ngl_FragColor=color;\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/sprites.vertex.ts":
- /*!***********************************!*\
- !*** ./Shaders/sprites.vertex.ts ***!
- \***********************************/
- /*! exports provided: spritesVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"spritesVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/fogVertexDeclaration */"./Shaders/ShadersInclude/fogVertexDeclaration.ts"),"spritesVertexShader"),o="\nattribute vec4 position;\nattribute vec4 options;\nattribute vec2 inverts;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include<fogVertexDeclaration>\nvoid main(void) {\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz;\nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=options.zw;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0);\n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));\nvec2 uvPlace=cellInfo.xy;\nvec2 uvSize=cellInfo.zw;\nvUV.x=uvPlace.x+uvSize.x*uvOffset.x;\nvUV.y=uvPlace.y+uvSize.y*uvOffset.y;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/ssao.fragment.ts":
- /*!**********************************!*\
- !*** ./Shaders/ssao.fragment.ts ***!
- \**********************************/
- /*! exports provided: ssaoPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"ssaoPixelShader",(function(){return o}));var n="ssaoPixelShader",i="\nuniform sampler2D textureSampler;\nvarying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float radius;\nuniform float area;\nuniform float fallOff;\nuniform float base;\nvec3 normalFromDepth(float depth,vec2 coords)\n{\nvec2 offset1=vec2(0.0,radius);\nvec2 offset2=vec2(radius,0.0);\nfloat depth1=texture2D(textureSampler,coords+offset1).r;\nfloat depth2=texture2D(textureSampler,coords+offset2).r;\nvec3 p1=vec3(offset1,depth1-depth);\nvec3 p2=vec3(offset2,depth2-depth);\nvec3 normal=cross(p1,p2);\nnormal.z=-normal.z;\nreturn normalize(normal);\n}\nvoid main()\n{\nvec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);\nfloat depth=texture2D(textureSampler,vUV).r;\nvec3 position=vec3(vUV,depth);\nvec3 normal=normalFromDepth(depth,vUV);\nfloat radiusDepth=radius/depth;\nfloat occlusion=0.0;\nvec3 ray;\nvec3 hemiRay;\nfloat occlusionDepth;\nfloat difference;\nfor (int i=0; i<SAMPLES; i++)\n{\nray=radiusDepth*reflect(sampleSphere[i],random);\nhemiRay=position+sign(dot(ray,normal))*ray;\nocclusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;\ndifference=depth-occlusionDepth;\nocclusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));\n}\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor.r=result;\ngl_FragColor.g=result;\ngl_FragColor.b=result;\ngl_FragColor.a=1.0;\n}\n#endif\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ssao2.fragment.ts":
- /*!***********************************!*\
- !*** ./Shaders/ssao2.fragment.ts ***!
- \***********************************/
- /*! exports provided: ssao2PixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"ssao2PixelShader",(function(){return o}));var n="ssao2PixelShader",i="\nprecision highp float;\nuniform sampler2D textureSampler;\nuniform float near;\nuniform float far;\nuniform float radius;\nfloat scales[16]=float[16](\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);\nvarying vec2 vUV;\nfloat perspectiveDepthToViewZ( const in float invClipZ,const in float near,const in float far ) {\nreturn ( near*far )/( ( far-near )*invClipZ-far );\n}\nfloat viewZToPerspectiveDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( near*far/viewZ+far)/( far-near );\n}\nfloat viewZToOrthographicDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( viewZ+near )/( near-far );\n}\n#ifdef SSAO\nuniform sampler2D randomSampler;\n#ifndef GEOMETRYBUFFER\nuniform sampler2D depthNormalSampler;\n#else\nuniform sampler2D depthSampler;\nuniform sampler2D normalSampler;\n#endif\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float base;\nuniform float xViewport;\nuniform float yViewport;\nuniform float maxZ;\nuniform float minZAspect;\nuniform vec2 texelSize;\nuniform mat4 projection;\nvoid main()\n{\nvec3 random=texture2D(randomSampler,vUV*randTextureTiles).rgb;\n#ifndef GEOMETRYBUFFER\nfloat depth=texture2D(depthNormalSampler,vUV).r;\n#else\nfloat depth=texture2D(depthSampler,vUV).r;\n#endif\nfloat depthSign=depth/abs(depth);\ndepth=depth*depthSign;\n#ifndef GEOMETRYBUFFER\nvec3 normal=texture2D(depthNormalSampler,vUV).gba;\n#else\nvec3 normal=texture2D(normalSampler,vUV).rgb;\n#endif\nfloat occlusion=0.0;\nfloat correctedRadius=min(radius,minZAspect*depth/near);\nvec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);\nvec3 origin=vViewRay*depth;\nvec3 rvec=random*2.0-1.0;\nrvec.z=0.0;\n\nfloat dotProduct=dot(rvec,normal);\nrvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);\nvec3 tangent=normalize(rvec-normal*dot(rvec,normal));\nvec3 bitangent=cross(normal,tangent);\nmat3 tbn=mat3(tangent,bitangent,normal);\nfloat difference;\nfor (int i=0; i<SAMPLES; ++i) {\n\nvec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];\nsamplePosition=samplePosition*correctedRadius+origin;\n\nvec4 offset=vec4(samplePosition,1.0);\noffset=projection*offset;\noffset.xyz/=offset.w;\noffset.xy=offset.xy*0.5+0.5;\nif (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {\ncontinue;\n}\n\n#ifndef GEOMETRYBUFFER\nfloat sampleDepth=abs(texture2D(depthNormalSampler,offset.xy).r);\n#else\nfloat sampleDepth=abs(texture2D(depthSampler,offset.xy).r);\n#endif\n\ndifference=depthSign*samplePosition.z-sampleDepth;\nfloat rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);\nocclusion+=(difference>=0.0 ? 1.0 : 0.0)*rangeCheck;\n}\nocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor=vec4(vec3(result),1.0);\n}\n#endif\n#ifdef BILATERAL_BLUR\nuniform sampler2D depthNormalSampler;\nuniform float outSize;\nuniform float samplerOffsets[SAMPLES];\nvec4 blur9(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.3846153846)*direction;\nvec2 off2=vec2(3.2307692308)*direction;\ncolor+=texture2D(image,uv)*0.2270270270;\ncolor+=texture2D(image,uv+(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv-(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv+(off2/resolution))*0.0702702703;\ncolor+=texture2D(image,uv-(off2/resolution))*0.0702702703;\nreturn color;\n}\nvec4 blur13(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\ncolor+=texture2D(image,uv)*0.1964825501511404;\ncolor+=texture2D(image,uv+(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv-(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv+(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv-(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv+(off3/resolution))*0.010381362401148057;\ncolor+=texture2D(image,uv-(off3/resolution))*0.010381362401148057;\nreturn color;\n}\nvec4 blur13Bilateral(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\nfloat compareDepth=abs(texture2D(depthNormalSampler,uv).r);\nfloat sampleDepth;\nfloat weight;\nfloat weightSum=30.0;\ncolor+=texture2D(image,uv)*30.0;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off3/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off3/resolution))*weight;\nreturn color/weightSum;\n}\nvoid main()\n{\n#if EXPENSIVE\nfloat compareDepth=abs(texture2D(depthNormalSampler,vUV).r);\nfloat texelsize=1.0/outSize;\nfloat result=0.0;\nfloat weightSum=0.0;\nfor (int i=0; i<SAMPLES; ++i)\n{\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\nvec2 sampleOffset=vec2(texelsize*samplerOffsets[i],0.0);\n#else\nvec2 direction=vec2(0.0,1.0);\nvec2 sampleOffset=vec2(0.0,texelsize*samplerOffsets[i]);\n#endif\nvec2 samplePos=vUV+sampleOffset;\nfloat sampleDepth=abs(texture2D(depthNormalSampler,samplePos).r);\nfloat weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30000.0);\nresult+=texture2D(textureSampler,samplePos).r*weight;\nweightSum+=weight;\n}\nresult/=weightSum;\ngl_FragColor.rgb=vec3(result);\ngl_FragColor.a=1.0;\n#else\nvec4 color;\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#else\nvec2 direction=vec2(0.0,1.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#endif\ngl_FragColor.rgb=vec3(color.r);\ngl_FragColor.a=1.0;\n#endif\n}\n#endif\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ssaoCombine.fragment.ts":
- /*!*****************************************!*\
- !*** ./Shaders/ssaoCombine.fragment.ts ***!
- \*****************************************/
- /*! exports provided: ssaoCombinePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"ssaoCombinePixelShader",(function(){return o}));var n="ssaoCombinePixelShader",i="uniform sampler2D textureSampler;\nuniform sampler2D originalColor;\nuniform vec4 viewport;\nvarying vec2 vUV;\nvoid main(void) {\nvec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);\nvec4 sceneColor=texture2D(originalColor,vUV);\ngl_FragColor=sceneColor*ssaoColor;\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/standard.fragment.ts":
- /*!**************************************!*\
- !*** ./Shaders/standard.fragment.ts ***!
- \**************************************/
- /*! exports provided: standardPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"standardPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/packingFunctions */"./Shaders/ShadersInclude/packingFunctions.ts"),"standardPixelShader"),o="uniform sampler2D textureSampler;\nvarying vec2 vUV;\n#if defined(PASS_POST_PROCESS)\nvoid main(void)\n{\nvec4 color=texture2D(textureSampler,vUV);\ngl_FragColor=color;\n}\n#endif\n#if defined(DOWN_SAMPLE_X4)\nuniform vec2 dsOffsets[16];\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+dsOffsets[0]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[1]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[2]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[3]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[4]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[5]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[6]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[7]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[8]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[9]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[10]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[11]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[12]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[13]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[14]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[15]);\naverage/=16.0;\ngl_FragColor=average;\n}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];\nuniform float brightThreshold;\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));\naverage*=0.25;\nfloat luminance=length(average.rgb);\nif (luminance<brightThreshold) {\naverage=vec4(0.0,0.0,0.0,1.0);\n}\ngl_FragColor=average;\n}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;\nuniform sampler2D lensSampler;\nuniform float exposure;\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\ncolour*=exposure;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\ncolour+=colour*texture2D(lensSampler,vUV).rgb;\nvec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);\ngl_FragColor=finalColor;\n}\n#endif\n#if defined(VLS)\n#define PI 3.1415926535897932384626433832795\nuniform mat4 shadowViewProjection;\nuniform mat4 lightWorld;\nuniform vec3 cameraPosition;\nuniform vec3 sunDirection;\nuniform vec3 sunColor;\nuniform vec2 depthValues;\nuniform float scatteringCoefficient;\nuniform float scatteringPower;\nuniform sampler2D shadowMapSampler;\nuniform sampler2D positionSampler;\nfloat computeScattering(float lightDotView)\n{\nfloat result=1.0-scatteringCoefficient*scatteringCoefficient;\nresult/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));\nreturn result;\n}\nvoid main(void)\n{\n\nvec3 worldPos=texture2D(positionSampler,vUV).rgb;\nvec3 startPosition=cameraPosition;\nvec3 rayVector=worldPos-startPosition;\nfloat rayLength=length(rayVector);\nvec3 rayDirection=rayVector/rayLength;\nfloat stepLength=rayLength/NB_STEPS;\nvec3 stepL=rayDirection*stepLength;\nvec3 currentPosition=startPosition;\nvec3 accumFog=vec3(0.0);\nfor (int i=0; i<int(NB_STEPS); i++)\n{\nvec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);\nfloat depthMetric=(worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depthMetric,0.0,1.0);\nworldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;\nworldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);\nfloat shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;\nif (shadowMapValue>shadowPixelDepth)\naccumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));\ncurrentPosition+=stepL;\n}\naccumFog/=NB_STEPS;\nvec3 color=accumFog*scatteringPower;\ngl_FragColor=vec4(color*exp(color) ,1.0);\n}\n#endif\n#if defined(VLSMERGE)\nuniform sampler2D originalSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);\n}\n#endif\n#if defined(LUMINANCE)\nuniform vec2 lumOffsets[4];\nvoid main()\n{\nfloat average=0.0;\nvec4 color=vec4(0.0);\nfloat maximum=-1e20;\nvec3 weight=vec3(0.299,0.587,0.114);\nfor (int i=0; i<4; i++)\n{\ncolor=texture2D(textureSampler,vUV+ lumOffsets[i]);\n\nfloat GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));\n\n#ifdef WEIGHTED_AVERAGE\nfloat GreyValue=dot(color.rgb,weight);\n#endif\n#ifdef BRIGHTNESS\nfloat GreyValue=max(color.r,max(color.g,color.b));\n#endif\n#ifdef HSL_COMPONENT\nfloat GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));\n#endif\n#ifdef MAGNITUDE\nfloat GreyValue=length(color.rgb);\n#endif\nmaximum=max(maximum,GreyValue);\naverage+=(0.25*log(1e-5+GreyValue));\n}\naverage=exp(average);\ngl_FragColor=vec4(average,maximum,0.0,1.0);\n}\n#endif\n#if defined(LUMINANCE_DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];\nuniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLER\n#include<packingFunctions>\n#endif\nvoid main()\n{\nvec4 color=vec4(0.0);\nfloat average=0.0;\nfor (int i=0; i<9; i++)\n{\ncolor=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);\naverage+=color.r;\n}\naverage/=9.0;\n#ifdef FINAL_DOWN_SAMPLER\ngl_FragColor=pack(average);\n#else\ngl_FragColor=vec4(average,average,0.0,1.0);\n#endif\n}\n#endif\n#if defined(HDR)\nuniform sampler2D textureAdderSampler;\nuniform float averageLuminance;\nvoid main()\n{\nvec4 color=texture2D(textureAdderSampler,vUV);\n#ifndef AUTO_EXPOSURE\nvec4 adjustedColor=color/averageLuminance;\ncolor=adjustedColor;\ncolor.a=1.0;\n#endif\ngl_FragColor=color;\n}\n#endif\n#if defined(LENS_FLARE)\n#define GHOSTS 3\nuniform sampler2D lensColorSampler;\nuniform float strength;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform vec2 resolution;\nuniform float distortionStrength;\nfloat hash(vec2 p)\n{\nfloat h=dot(p,vec2(127.1,311.7));\nreturn -1.0+2.0*fract(sin(h)*43758.5453123);\n}\nfloat noise(in vec2 p)\n{\nvec2 i=floor(p);\nvec2 f=fract(p);\nvec2 u=f*f*(3.0-2.0*f);\nreturn mix(mix(hash(i+vec2(0.0,0.0)),\nhash(i+vec2(1.0,0.0)),u.x),\nmix(hash(i+vec2(0.0,1.0)),\nhash(i+vec2(1.0,1.0)),u.x),u.y);\n}\nfloat fbm(vec2 p)\n{\nfloat f=0.0;\nf+=0.5000*noise(p); p*=2.02;\nf+=0.2500*noise(p); p*=2.03;\nf+=0.1250*noise(p); p*=2.01;\nf+=0.0625*noise(p); p*=2.04;\nf/=0.9375;\nreturn f;\n}\nvec3 pattern(vec2 uv)\n{\nvec2 p=-1.0+2.0*uv;\nfloat p2=dot(p,p);\nfloat f=fbm(vec2(15.0*p2))/2.0;\nfloat r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));\nfloat g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));\nfloat b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));\nreturn (1.0-f)*vec3(r,g,b);\n}\nfloat luminance(vec3 color)\n{\nreturn dot(color.rgb,vec3(0.2126,0.7152,0.0722));\n}\nvec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)\n{\nreturn vec4(\ntexture2D(tex,texcoord+direction*distortion.r).r,\ntexture2D(tex,texcoord+direction*distortion.g).g,\ntexture2D(tex,texcoord+direction*distortion.b).b,\n1.0\n);\n}\nvoid main(void)\n{\nvec2 uv=-vUV+vec2(1.0);\nvec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;\nvec2 texelSize=1.0/resolution;\nvec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);\nvec4 result=vec4(0.0);\nfloat ghostIndice=1.0;\nfor (int i=0; i<GHOSTS; ++i)\n{\nvec2 offset=fract(uv+ghostDir*ghostIndice);\nfloat weight=length(vec2(0.5)-offset)/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;\nghostIndice+=1.0;\n}\nvec2 haloVec=normalize(ghostDir)*haloWidth;\nfloat weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;\nresult*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));\ngl_FragColor=result;\n}\n#endif\n#if defined(LENS_FLARE_COMPOSE)\nuniform sampler2D otherSampler;\nuniform sampler2D lensDirtSampler;\nuniform sampler2D lensStarSampler;\nuniform mat4 lensStarMatrix;\nvoid main(void)\n{\nvec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;\nvec4 lensMod=texture2D(lensDirtSampler,vUV);\nlensMod+=texture2D(lensStarSampler,vUV);\nvec4 result=texture2D(textureSampler,vUV)*lensMod;\ngl_FragColor=texture2D(otherSampler,vUV)+result;\n}\n#endif\n#if defined(DEPTH_OF_FIELD)\nuniform sampler2D otherSampler;\nuniform sampler2D depthSampler;\nuniform float distance;\nvoid main(void)\n{\nvec4 sharp=texture2D(otherSampler,vUV);\nvec4 blur=texture2D(textureSampler,vUV);\nfloat dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);\nfloat factor=0.0;\nif (dist<0.05)\nfactor=1.0;\nelse if (dist<0.1)\nfactor=20.0*(0.1-dist);\nelse if (dist<0.5)\nfactor=0.0;\nelse\nfactor=2.0*(dist-0.5);\nfactor=clamp(factor,0.0,0.90);\ngl_FragColor=mix(sharp,blur,factor);\n}\n#endif\n#if defined(MOTION_BLUR)\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\nuniform vec2 screenSize;\nuniform float motionScale;\nuniform float motionStrength;\nuniform sampler2D depthSampler;\nvoid main(void)\n{\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n}\n#endif\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/stereoscopicInterlace.fragment.ts":
- /*!***************************************************!*\
- !*** ./Shaders/stereoscopicInterlace.fragment.ts ***!
- \***************************************************/
- /*! exports provided: stereoscopicInterlacePixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"stereoscopicInterlacePixelShader",(function(){return o}));var n="stereoscopicInterlacePixelShader",i="const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamA;\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\n#ifdef IS_STEREOSCOPIC_INTERLACED\nfloat rowNum=floor(vUV.y/stepSize.y);\nuseCamA=mod(rowNum,2.0) == 1.0;\nuseCamB=mod(rowNum,2.0) == 0.0;\ntexCoord1=vec2(vUV.x,vUV.y);\ntexCoord2=vec2(vUV.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else if (useCamA){\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}else {\ndiscard;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/subSurfaceScattering.fragment.ts":
- /*!**************************************************!*\
- !*** ./Shaders/subSurfaceScattering.fragment.ts ***!
- \**************************************************/
- /*! exports provided: subSurfaceScatteringPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"subSurfaceScatteringPixelShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/fibonacci */"./Shaders/ShadersInclude/fibonacci.ts"),r(/*! ./ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ./ShadersInclude/subSurfaceScatteringFunctions */"./Shaders/ShadersInclude/subSurfaceScatteringFunctions.ts"),r(/*! ./ShadersInclude/diffusionProfile */"./Shaders/ShadersInclude/diffusionProfile.ts"),"subSurfaceScatteringPixelShader"),o="\n#include<fibonacci>\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<diffusionProfile>\nvarying vec2 vUV;\nuniform vec2 texelSize;\nuniform sampler2D textureSampler;\nuniform sampler2D irradianceSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D albedoSampler;\nuniform vec2 viewportSize;\nuniform float metersPerUnit;\nconst float LOG2_E=1.4426950408889634;\nconst float SSS_PIXELS_PER_SAMPLE=4.;\nconst int _SssSampleBudget=40;\n#define rcp(x) 1./x\n#define Sq(x) x*x\n#define SSS_BILATERAL_FILTER true\n\n\nvec3 EvalBurleyDiffusionProfile(float r,vec3 S)\n{\nvec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S);\nvec3 expSum=exp_13*(1.+exp_13*exp_13);\nreturn (S*rcp(8.*PI))*expSum;\n}\n\n\n\n\n\n\nvec2 SampleBurleyDiffusionProfile(float u,float rcpS)\n{\nu=1.-u;\nfloat g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));\nfloat n=exp2(log2(g)*(-1.0/3.0));\nfloat p=(g*n)*n;\nfloat c=1.+p+n;\nfloat d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u);\nfloat x=(3./LOG2_E)*log2(c)-d;\n\n\n\n\n\n\nfloat rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));\nfloat r=x*rcpS;\nfloat rcpPdf=(8.*PI*rcpS)*rcpExp;\nreturn vec2(r,rcpPdf);\n}\n\n\nvec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)\n{\n#ifndef SSS_BILATERAL_FILTER\nz=0.;\n#endif\n\n\n\nfloat r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));\nfloat area=rcpPdf;\n#if SSS_CLAMP_ARTIFACT\nreturn clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);\n#else\nreturn EvalBurleyDiffusionProfile(r,S)*area;\n#endif\n}\nvoid EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,\nfloat phase,inout vec3 totalIrradiance,inout vec3 totalWeight)\n{\n\nfloat scale=rcp(float(n));\nfloat offset=rcp(float(n))*0.5;\n\nfloat sinPhase,cosPhase;\nsinPhase=sin(phase);\ncosPhase=cos(phase);\nvec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);\nfloat r=bdp.x;\nfloat rcpPdf=bdp.y;\nfloat phi=SampleDiskGolden(i,n).y;\nfloat sinPhi,cosPhi;\nsinPhi=sin(phi);\ncosPhi=cos(phi);\nfloat sinPsi=cosPhase*sinPhi+sinPhase*cosPhi;\nfloat cosPsi=cosPhase*cosPhi-sinPhase*sinPhi;\nvec2 vec=r*vec2(cosPsi,sinPsi);\n\nvec2 position;\nfloat xy2;\nposition=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;\nxy2=r*r;\nvec4 textureSample=texture2D(irradianceSampler,position);\nfloat viewZ=texture2D(depthSampler,position).r;\nvec3 irradiance=textureSample.rgb;\nif (testLightingForSSS(irradiance))\n{\n\nfloat relZ=viewZ-centerPosVS.z;\nvec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);\ntotalIrradiance+=weight*irradiance;\ntotalWeight+=weight;\n}\nelse\n{\n\n\n\n\n\n\n}\n}\nvoid main(void)\n{\nvec4 irradianceAndDiffusionProfile=texture2D(irradianceSampler,vUV);\nvec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;\nint diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));\nfloat centerDepth=0.;\nvec4 inputColor=texture2D(textureSampler,vUV);\nbool passedStencilTest=testLightingForSSS(centerIrradiance);\nif (passedStencilTest)\n{\ncenterDepth=texture2D(depthSampler,vUV).r;\n}\nif (!passedStencilTest) {\ngl_FragColor=inputColor;\nreturn;\n}\nfloat distScale=1.;\nvec3 S=diffusionS[diffusionProfileIndex];\nfloat d=diffusionD[diffusionProfileIndex];\nfloat filterRadius=filterRadii[diffusionProfileIndex];\n\nvec2 centerPosNDC=vUV;\nvec2 cornerPosNDC=vUV+0.5*texelSize;\nvec3 centerPosVS=vec3(centerPosNDC*viewportSize,1.0)*centerDepth;\nvec3 cornerPosVS=vec3(cornerPosNDC*viewportSize,1.0)*centerDepth;\n\nfloat mmPerUnit=1000.*(metersPerUnit*rcp(distScale));\nfloat unitsPerMm=rcp(mmPerUnit);\n\n\nfloat unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);\nfloat pixelsPerMm=rcp(unitsPerPixel)*unitsPerMm;\n\nfloat filterArea=PI*Sq(filterRadius*pixelsPerMm);\nint sampleCount=int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));\nint sampleBudget=_SssSampleBudget;\nint texturingMode=0;\nvec3 albedo=texture2D(albedoSampler,vUV).rgb;\nif (distScale == 0. || sampleCount<1)\n{\n#ifdef DEBUG_SSS_SAMPLES\nvec3 green=vec3(0.,1.,0.);\ngl_FragColor=vec4(green,1.0);\nreturn;\n#endif\ngl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);\nreturn;\n}\n#ifdef DEBUG_SSS_SAMPLES\nvec3 red=vec3(1.,0.,0.);\nvec3 blue=vec3(0.,0.,1.);\ngl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);\nreturn;\n#endif\n\nfloat phase=0.;\nint n=min(sampleCount,sampleBudget);\n\nvec3 centerWeight=vec3(0.);\nvec3 totalIrradiance=vec3(0.);\nvec3 totalWeight=vec3(0.);\nfor (int i=0; i<n; i++)\n{\n\nEvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,\nphase,totalIrradiance,totalWeight);\n}\n\ntotalWeight=max(totalWeight,HALF_MIN);\ngl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);\n}";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/tonemap.fragment.ts":
- /*!*************************************!*\
- !*** ./Shaders/tonemap.fragment.ts ***!
- \*************************************/
- /*! exports provided: tonemapPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"tonemapPixelShader",(function(){return o}));var n="tonemapPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;\nconst float B=0.50;\nconst float C=0.10;\nconst float D=0.20;\nconst float E=0.02;\nconst float F=0.30;\nconst float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{\nreturn dot(c,vec3(0.22,0.707,0.071));\n}\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb);\nfloat lumTm=lum*_ExposureAdjustment;\nfloat scale=lumTm/(1.0+lumTm);\ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nconst float ExposureBias=2.0;\nvec3 x=ExposureBias*colour;\nvec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\nx=vec3(W,W,W);\nvec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);\ncolour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour=vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/volumetricLightScattering.fragment.ts":
- /*!*******************************************************!*\
- !*** ./Shaders/volumetricLightScattering.fragment.ts ***!
- \*******************************************************/
- /*! exports provided: volumetricLightScatteringPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"volumetricLightScatteringPixelShader",(function(){return o}));var n="volumetricLightScatteringPixelShader",i="uniform sampler2D textureSampler;\nuniform sampler2D lightScatteringSampler;\nuniform float decay;\nuniform float exposure;\nuniform float weight;\nuniform float density;\nuniform vec2 meshPositionOnScreen;\nvarying vec2 vUV;\nvoid main(void) {\nvec2 tc=vUV;\nvec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);\ndeltaTexCoord*=1.0/float(NUM_SAMPLES)*density;\nfloat illuminationDecay=1.0;\nvec4 color=texture2D(lightScatteringSampler,tc)*0.4;\nfor(int i=0; i<NUM_SAMPLES; i++) {\ntc-=deltaTexCoord;\nvec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;\ndataSample*=illuminationDecay*weight;\ncolor+=dataSample;\nilluminationDecay*=decay;\n}\nvec4 realColor=texture2D(textureSampler,vUV);\ngl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/volumetricLightScatteringPass.fragment.ts":
- /*!***********************************************************!*\
- !*** ./Shaders/volumetricLightScatteringPass.fragment.ts ***!
- \***********************************************************/
- /*! exports provided: volumetricLightScatteringPassPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"volumetricLightScatteringPassPixelShader",(function(){return o}));var n="volumetricLightScatteringPassPixelShader",i="#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\n#endif\n#if defined(ALPHATEST)\nuniform sampler2D diffuseSampler;\n#endif\nvoid main(void)\n{\n#if defined(ALPHATEST)\nvec4 diffuseColor=texture2D(diffuseSampler,vUV);\nif (diffuseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\n}\n";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/volumetricLightScatteringPass.vertex.ts":
- /*!*********************************************************!*\
- !*** ./Shaders/volumetricLightScatteringPass.vertex.ts ***!
- \*********************************************************/
- /*! exports provided: volumetricLightScatteringPassVertexShader */function(e,t,r){"use strict";r.r(t),r.d(t,"volumetricLightScatteringPassVertexShader",(function(){return s}));var n=r(/*! ../Materials/effect */"./Materials/effect.ts"),i=(r(/*! ./ShadersInclude/bonesDeclaration */"./Shaders/ShadersInclude/bonesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexGlobalDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertexDeclaration */"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts"),r(/*! ./ShadersInclude/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),"volumetricLightScatteringPassVertexShader"),o="\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n";n.Effect.ShadersStore[i]=o;var s={name:i,shader:o}},"./Shaders/vrDistortionCorrection.fragment.ts":
- /*!****************************************************!*\
- !*** ./Shaders/vrDistortionCorrection.fragment.ts ***!
- \****************************************************/
- /*! exports provided: vrDistortionCorrectionPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"vrDistortionCorrectionPixelShader",(function(){return o}));var n="vrDistortionCorrectionPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn;\nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/vrMultiviewToSingleview.fragment.ts":
- /*!*****************************************************!*\
- !*** ./Shaders/vrMultiviewToSingleview.fragment.ts ***!
- \*****************************************************/
- /*! exports provided: vrMultiviewToSingleviewPixelShader */function(e,t,r){"use strict";r.r(t),r.d(t,"vrMultiviewToSingleviewPixelShader",(function(){return o}));var n="vrMultiviewToSingleviewPixelShader",i="precision mediump sampler2DArray;\nvarying vec2 vUV;\nuniform sampler2DArray multiviewSampler;\nuniform int imageIndex;\nvoid main(void)\n{\ngl_FragColor=texture(multiviewSampler,vec3(vUV,imageIndex));\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./Sprites/ISprites.ts":
- /*!*****************************!*\
- !*** ./Sprites/ISprites.ts ***!
- \*****************************/
- /*! no static exports found */function(e,t){},"./Sprites/index.ts":
- /*!**************************!*\
- !*** ./Sprites/index.ts ***!
- \**************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./sprite */"./Sprites/sprite.ts");r.d(t,"Sprite",(function(){return n.Sprite}));var i=r(/*! ./ISprites */"./Sprites/ISprites.ts");for(var o in i)["Sprite","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(o);var s=r(/*! ./spriteManager */"./Sprites/spriteManager.ts");r.d(t,"SpriteManager",(function(){return s.SpriteManager}));var a=r(/*! ./spriteMap */"./Sprites/spriteMap.ts");r.d(t,"SpriteMap",(function(){return a.SpriteMap}));var l=r(/*! ./spritePackedManager */"./Sprites/spritePackedManager.ts");r.d(t,"SpritePackedManager",(function(){return l.SpritePackedManager}));var c=r(/*! ./spriteSceneComponent */"./Sprites/spriteSceneComponent.ts");r.d(t,"SpriteSceneComponent",(function(){return c.SpriteSceneComponent}))},"./Sprites/sprite.ts":
- /*!***************************!*\
- !*** ./Sprites/sprite.ts ***!
- \***************************/
- /*! exports provided: Sprite */function(e,t,r){"use strict";r.r(t),r.d(t,"Sprite",(function(){return s}));var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=function(){function e(e,t){this.name=e,this.color=new i.Color4(1,1,1,1),this.width=1,this.height=1,this.angle=0,this.invertU=!1,this.invertV=!1,this.animations=new Array,this.isPickable=!1,this.useAlphaForPicking=!1,this.onDisposeObservable=new o.Observable,this._animationStarted=!1,this._loopAnimation=!1,this._fromIndex=0,this._toIndex=0,this._delay=0,this._direction=1,this._time=0,this._onAnimationEnd=null,this.isVisible=!0,this._manager=t,this._manager.sprites.push(this),this.uniqueId=this._manager.scene.getUniqueId(),this.position=n.Vector3.Zero()}return Object.defineProperty(e.prototype,"size",{get:function(){return this.width},set:function(e){this.width=e,this.height=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationStarted",{get:function(){return this._animationStarted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"manager",{get:function(){return this._manager},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"Sprite"},Object.defineProperty(e.prototype,"fromIndex",{get:function(){return this._fromIndex},set:function(e){this.playAnimation(e,this._toIndex,this._loopAnimation,this._delay,this._onAnimationEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIndex",{get:function(){return this._toIndex},set:function(e){this.playAnimation(this._fromIndex,e,this._loopAnimation,this._delay,this._onAnimationEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopAnimation",{get:function(){return this._loopAnimation},set:function(e){this.playAnimation(this._fromIndex,this._toIndex,e,this._delay,this._onAnimationEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){return Math.max(this._delay,1)},set:function(e){this.playAnimation(this._fromIndex,this._toIndex,this._loopAnimation,e,this._onAnimationEnd)},enumerable:!1,configurable:!0}),e.prototype.playAnimation=function(e,t,r,n,i){void 0===i&&(i=null),this._fromIndex=e,this._toIndex=t,this._loopAnimation=r,this._delay=n||1,this._animationStarted=!0,e<t?this._direction=1:(this._direction=-1,this._toIndex=e,this._fromIndex=t),this.cellIndex=e,this._time=0,this._onAnimationEnd=i},e.prototype.stopAnimation=function(){this._animationStarted=!1},e.prototype._animate=function(e){this._animationStarted&&(this._time+=e,this._time>this._delay&&(this._time=this._time%this._delay,this.cellIndex+=this._direction,(this._direction>0&&this.cellIndex>this._toIndex||this._direction<0&&this.cellIndex<this._fromIndex)&&(this._loopAnimation?this.cellIndex=this._direction>0?this._fromIndex:this._toIndex:(this.cellIndex=this._toIndex,this._animationStarted=!1,this._onAnimationEnd&&this._onAnimationEnd(),this.disposeWhenFinishedAnimating&&this.dispose()))))},e.prototype.dispose=function(){for(var e=0;e<this._manager.sprites.length;e++)this._manager.sprites[e]==this&&this._manager.sprites.splice(e,1);this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},e.prototype.serialize=function(){var e={};return e.name=this.name,e.position=this.position.asArray(),e.color=this.color.asArray(),e.width=this.width,e.height=this.height,e.angle=this.angle,e.cellIndex=this.cellIndex,e.cellRef=this.cellRef,e.invertU=this.invertU,e.invertV=this.invertV,e.disposeWhenFinishedAnimating=this.disposeWhenFinishedAnimating,e.isPickable=this.isPickable,e.isVisible=this.isVisible,e.useAlphaForPicking=this.useAlphaForPicking,e.animationStarted=this.animationStarted,e.fromIndex=this.fromIndex,e.toIndex=this.toIndex,e.loopAnimation=this.loopAnimation,e.delay=this.delay,e},e.Parse=function(t,r){var o=new e(t.name,r);return o.position=n.Vector3.FromArray(t.position),o.color=i.Color4.FromArray(t.color),o.width=t.width,o.height=t.height,o.angle=t.angle,o.cellIndex=t.cellIndex,o.cellRef=t.cellRef,o.invertU=t.invertU,o.invertV=t.invertV,o.disposeWhenFinishedAnimating=t.disposeWhenFinishedAnimating,o.isPickable=t.isPickable,o.isVisible=t.isVisible,o.useAlphaForPicking=t.useAlphaForPicking,o.fromIndex=t.fromIndex,o.toIndex=t.toIndex,o.loopAnimation=t.loopAnimation,o.delay=t.delay,t.animationStarted&&o.playAnimation(o.fromIndex,o.toIndex,o.loopAnimation,o.delay),o},e}()},"./Sprites/spriteManager.ts":
- /*!**********************************!*\
- !*** ./Sprites/spriteManager.ts ***!
- \**********************************/
- /*! exports provided: SpriteManager */function(e,t,r){"use strict";r.r(t),r.d(t,"SpriteManager",(function(){return _}));var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./sprite */"./Sprites/sprite.ts"),l=r(/*! ./spriteSceneComponent */"./Sprites/spriteSceneComponent.ts"),c=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),u=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),d=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../sceneComponent */"./sceneComponent.ts"),f=r(/*! ../Engines/constants */"./Engines/constants.ts"),p=r(/*! ../Misc/logger */"./Misc/logger.ts"),m=(r(/*! ../Shaders/sprites.fragment */"./Shaders/sprites.fragment.ts"),r(/*! ../Shaders/sprites.vertex */"./Shaders/sprites.vertex.ts"),r(/*! ../Engines/engine */"./Engines/engine.ts")),g=r(/*! ../Misc/webRequest */"./Misc/webRequest.ts"),_=function(){function e(e,t,r,n,s,a,c,d,p){if(void 0===a&&(a=.01),void 0===c&&(c=u.Texture.TRILINEAR_SAMPLINGMODE),void 0===d&&(d=!1),void 0===p&&(p=null),this.name=e,this.sprites=new Array,this.renderingGroupId=0,this.layerMask=268435455,this.fogEnabled=!0,this.isPickable=!1,this._packedAndReady=!1,this.onDisposeObservable=new i.Observable,this._vertexBuffers={},this._blendMode=f.Constants.ALPHA_COMBINE,this.disableDepthWrite=!1,s||(s=m.Engine.LastCreatedScene),s._getComponent(h.SceneComponentConstants.NAME_SPRITE)||s._addComponent(new l.SpriteSceneComponent(s)),this._capacity=r,this._fromPacked=d,t&&(this._spriteTexture=new u.Texture(t,s,!0,!1,c),this._spriteTexture.wrapU=u.Texture.CLAMP_ADDRESSMODE,this._spriteTexture.wrapV=u.Texture.CLAMP_ADDRESSMODE),n.width&&n.height)this.cellWidth=n.width,this.cellHeight=n.height;else{if(void 0===n)return;this.cellWidth=n,this.cellHeight=n}this._epsilon=a,this._scene=s||m.Engine.LastCreatedScene,this._scene.spriteManagers.push(this),this.uniqueId=this.scene.getUniqueId();for(var g=[],_=0,v=0;v<r;v++)g.push(_),g.push(_+1),g.push(_+2),g.push(_),g.push(_+2),g.push(_+3),_+=4;this._indexBuffer=s.getEngine().createIndexBuffer(g),this._vertexData=new Float32Array(18*r*4),this._buffer=new o.Buffer(s.getEngine(),this._vertexData,!0,18);var y=this._buffer.createVertexBuffer(o.VertexBuffer.PositionKind,0,4),b=this._buffer.createVertexBuffer("options",4,4),A=this._buffer.createVertexBuffer("inverts",8,2),T=this._buffer.createVertexBuffer("cellInfo",10,4),M=this._buffer.createVertexBuffer(o.VertexBuffer.ColorKind,14,4);this._vertexBuffers[o.VertexBuffer.PositionKind]=y,this._vertexBuffers.options=b,this._vertexBuffers.inverts=A,this._vertexBuffers.cellInfo=T,this._vertexBuffers[o.VertexBuffer.ColorKind]=M,this._effectBase=this._scene.getEngine().createEffect("sprites",[o.VertexBuffer.PositionKind,"options","inverts","cellInfo",o.VertexBuffer.ColorKind],["view","projection","textureInfos","alphaTest"],["diffuseSampler"],""),this._effectFog=this._scene.getEngine().createEffect("sprites",[o.VertexBuffer.PositionKind,"options","inverts","cellInfo",o.VertexBuffer.ColorKind],["view","projection","textureInfos","alphaTest","vFogInfos","vFogColor"],["diffuseSampler"],"#define FOG"),this._fromPacked&&this._makePacked(t,p)}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.sprites},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capacity",{get:function(){return this._capacity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._spriteTexture},set:function(e){this._spriteTexture=e,this._spriteTexture.wrapU=u.Texture.CLAMP_ADDRESSMODE,this._spriteTexture.wrapV=u.Texture.CLAMP_ADDRESSMODE,this._textureContent=null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this._blendMode=e},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"SpriteManager"},e.prototype._makePacked=function(e,t){var r=this;if(null!==t)try{var n=void 0;if((n="string"==typeof t?JSON.parse(t):t).frames.length){for(var i={},o=0;o<n.frames.length;o++){var s=n.frames[o];if("string"!=typeof Object.keys(s)[0])throw new Error("Invalid JSON Format. Check the frame values and make sure the name is the first parameter.");i[s[Object.keys(s)[0]]]=s}n.frames=i}var a=Reflect.ownKeys(n.frames);this._spriteMap=a,this._packedAndReady=!0,this._cellData=n.frames}catch(e){throw this._fromPacked=!1,this._packedAndReady=!1,new Error("Invalid JSON from string. Spritesheet managed with constant cell size.")}else{var l=/\./g,c=void 0;do{c=l.lastIndex,l.test(e)}while(l.lastIndex>0);var u=e.substring(0,c-1)+".json",d=new XMLHttpRequest;d.open("GET",u,!0),d.onerror=function(){p.Logger.Error("JSON ERROR: Unable to load JSON file."),r._fromPacked=!1,r._packedAndReady=!1},d.onload=function(){try{var e=JSON.parse(d.response),t=Reflect.ownKeys(e.frames);r._spriteMap=t,r._packedAndReady=!0,r._cellData=e.frames}catch(e){throw r._fromPacked=!1,r._packedAndReady=!1,new Error("Invalid JSON format. Please check documentation for format specifications.")}},d.send()}},e.prototype._appendSpriteVertex=function(e,t,r,n,i){var o=18*e;if(0===r?r=this._epsilon:1===r&&(r=1-this._epsilon),0===n?n=this._epsilon:1===n&&(n=1-this._epsilon),this._vertexData[o]=t.position.x,this._vertexData[o+1]=t.position.y,this._vertexData[o+2]=t.position.z,this._vertexData[o+3]=t.angle,this._vertexData[o+4]=t.width,this._vertexData[o+5]=t.height,this._vertexData[o+6]=r,this._vertexData[o+7]=n,this._scene.useRightHandedSystem?this._vertexData[o+8]=t.invertU?0:1:this._vertexData[o+8]=t.invertU?1:0,this._vertexData[o+9]=t.invertV?1:0,this._packedAndReady){t.cellRef||(t.cellIndex=0);var s=t.cellIndex;"number"==typeof s&&isFinite(s)&&Math.floor(s)===s&&(t.cellRef=this._spriteMap[t.cellIndex]),t._xOffset=this._cellData[t.cellRef].frame.x/i.width,t._yOffset=this._cellData[t.cellRef].frame.y/i.height,t._xSize=this._cellData[t.cellRef].frame.w,t._ySize=this._cellData[t.cellRef].frame.h,this._vertexData[o+10]=t._xOffset,this._vertexData[o+11]=t._yOffset,this._vertexData[o+12]=t._xSize/i.width,this._vertexData[o+13]=t._ySize/i.height}else{t.cellIndex||(t.cellIndex=0);var a=i.width/this.cellWidth,l=t.cellIndex/a>>0;t._xOffset=(t.cellIndex-l*a)*this.cellWidth/i.width,t._yOffset=l*this.cellHeight/i.height,t._xSize=this.cellWidth,t._ySize=this.cellHeight,this._vertexData[o+10]=t._xOffset,this._vertexData[o+11]=t._yOffset,this._vertexData[o+12]=this.cellWidth/i.width,this._vertexData[o+13]=this.cellHeight/i.height}this._vertexData[o+14]=t.color.r,this._vertexData[o+15]=t.color.g,this._vertexData[o+16]=t.color.b,this._vertexData[o+17]=t.color.a},e.prototype._checkTextureAlpha=function(e,t,r,n,i){if(!e.useAlphaForPicking||!this._spriteTexture)return!0;var o=this._spriteTexture.getSize();this._textureContent||(this._textureContent=new Uint8Array(o.width*o.height*4),this._spriteTexture.readPixels(0,0,this._textureContent));var a=s.TmpVectors.Vector3[0];a.copyFrom(t.direction),a.normalize(),a.scaleInPlace(r),a.addInPlace(t.origin);var l=(a.x-n.x)/(i.x-n.x)-.5,c=1-(a.y-n.y)/(i.y-n.y)-.5,u=e.angle,d=l*Math.cos(u)-c*Math.sin(u)+.5,h=l*Math.sin(u)+c*Math.cos(u)+.5,f=e._xOffset*o.width+d*e._xSize|0,p=e._yOffset*o.height+h*e._ySize|0;return this._textureContent[4*(f+p*o.width)+3]>.5},e.prototype.intersects=function(e,t,r,n){for(var i=Math.min(this._capacity,this.sprites.length),o=s.Vector3.Zero(),a=s.Vector3.Zero(),l=Number.MAX_VALUE,u=null,d=s.TmpVectors.Vector3[0],h=s.TmpVectors.Vector3[1],f=t.getViewMatrix(),p=0;p<i;p++){var m=this.sprites[p];if(m){if(r){if(!r(m))continue}else if(!m.isPickable)continue;if(s.Vector3.TransformCoordinatesToRef(m.position,f,h),o.copyFromFloats(h.x-m.width/2,h.y-m.height/2,h.z),a.copyFromFloats(h.x+m.width/2,h.y+m.height/2,h.z),e.intersectsBoxMinMax(o,a)){var g=s.Vector3.Distance(h,e.origin);if(l>g){if(!this._checkTextureAlpha(m,e,g,o,a))continue;if(l=g,u=m,n)break}}}}if(u){var _=new c.PickingInfo;f.invertToRef(s.TmpVectors.Matrix[0]),_.hit=!0,_.pickedSprite=u,_.distance=l;var v=s.TmpVectors.Vector3[2];return v.copyFrom(e.direction),v.normalize(),v.scaleInPlace(l),e.origin.addToRef(v,d),_.pickedPoint=s.Vector3.TransformCoordinates(d,s.TmpVectors.Matrix[0]),_}return null},e.prototype.multiIntersects=function(e,t,r){for(var n,i=Math.min(this._capacity,this.sprites.length),o=s.Vector3.Zero(),a=s.Vector3.Zero(),l=[],u=s.TmpVectors.Vector3[0].copyFromFloats(0,0,0),d=s.TmpVectors.Vector3[1].copyFromFloats(0,0,0),h=t.getViewMatrix(),f=0;f<i;f++){var p=this.sprites[f];if(p){if(r){if(!r(p))continue}else if(!p.isPickable)continue;if(s.Vector3.TransformCoordinatesToRef(p.position,h,d),o.copyFromFloats(d.x-p.width/2,d.y-p.height/2,d.z),a.copyFromFloats(d.x+p.width/2,d.y+p.height/2,d.z),e.intersectsBoxMinMax(o,a)){if(n=s.Vector3.Distance(d,e.origin),!this._checkTextureAlpha(p,e,n,o,a))continue;var m=new c.PickingInfo;l.push(m),h.invertToRef(s.TmpVectors.Matrix[0]),m.hit=!0,m.pickedSprite=p,m.distance=n;var g=s.TmpVectors.Vector3[2];g.copyFrom(e.direction),g.normalize(),g.scaleInPlace(n),e.origin.addToRef(g,u),m.pickedPoint=s.Vector3.TransformCoordinates(u,s.TmpVectors.Matrix[0])}}}return l},e.prototype.render=function(){if(this._effectBase.isReady()&&this._effectFog.isReady()&&this._spriteTexture&&this._spriteTexture.isReady()&&this.sprites.length&&(!this._fromPacked||this._packedAndReady&&this._spriteMap&&this._cellData)){for(var e=this._scene.getEngine(),t=this._spriteTexture.getBaseSize(),r=e.getDeltaTime(),i=Math.min(this._capacity,this.sprites.length),o=0,s=!0,a=0;a<i;a++){var l=this.sprites[a];l&&l.isVisible&&(s=!1,l._animate(r),this._appendSpriteVertex(o++,l,0,0,t),this._appendSpriteVertex(o++,l,1,0,t),this._appendSpriteVertex(o++,l,1,1,t),this._appendSpriteVertex(o++,l,0,1,t))}if(!s){this._buffer.update(this._vertexData);var c=this._effectBase;this._scene.fogEnabled&&this._scene.fogMode!==n.Scene.FOGMODE_NONE&&this.fogEnabled&&(c=this._effectFog),e.enableEffect(c);var u=this._scene.getViewMatrix();c.setTexture("diffuseSampler",this._spriteTexture),c.setMatrix("view",u),c.setMatrix("projection",this._scene.getProjectionMatrix()),this._scene.fogEnabled&&this._scene.fogMode!==n.Scene.FOGMODE_NONE&&this.fogEnabled&&(c.setFloat4("vFogInfos",this._scene.fogMode,this._scene.fogStart,this._scene.fogEnd,this._scene.fogDensity),c.setColor3("vFogColor",this._scene.fogColor)),e.bindBuffers(this._vertexBuffers,this._indexBuffer,c);var h=e.depthCullingState.cull||!0,p=e.depthCullingState.zOffset;this._scene.useRightHandedSystem&&e.setState(h,p,!1,!1),e.setDepthFunctionToLessOrEqual(),this.disableDepthWrite||(c.setBool("alphaTest",!0),e.setColorWrite(!1),e.drawElementsType(d.Material.TriangleFillMode,0,o/4*6),e.setColorWrite(!0),c.setBool("alphaTest",!1)),e.setAlphaMode(this._blendMode),e.drawElementsType(d.Material.TriangleFillMode,0,o/4*6),e.setAlphaMode(f.Constants.ALPHA_DISABLE),this._scene.useRightHandedSystem&&e.setState(h,p,!1,!0)}}},e.prototype.dispose=function(){this._buffer&&(this._buffer.dispose(),this._buffer=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this._spriteTexture&&(this._spriteTexture.dispose(),this._spriteTexture=null),this._textureContent=null;var e=this._scene.spriteManagers.indexOf(this);this._scene.spriteManagers.splice(e,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},e.prototype.serialize=function(e){void 0===e&&(e=!1);var t={};t.name=this.name,t.capacity=this.capacity,t.cellWidth=this.cellWidth,t.cellHeight=this.cellHeight,this.texture&&(e?t.texture=this.texture.serialize():(t.textureUrl=this.texture.name,t.invertY=this.texture._invertY)),t.sprites=[];for(var r=0,n=this.sprites;r<n.length;r++){var i=n[r];t.sprites.push(i.serialize())}return t},e.Parse=function(t,r,n){var i=new e(t.name,"",t.capacity,{width:t.cellWidth,height:t.cellHeight},r);t.texture?i.texture=u.Texture.Parse(t.texture,r,n):t.textureName&&(i.texture=new u.Texture(n+t.textureUrl,r,!1,void 0===t.invertY||t.invertY));for(var o=0,s=t.sprites;o<s.length;o++){var l=s[o];a.Sprite.Parse(l,i)}return i},e.ParseFromFileAsync=function(t,r,n,i){return void 0===i&&(i=""),new Promise((function(o,s){var a=new g.WebRequest;a.addEventListener("readystatechange",(function(){if(4==a.readyState)if(200==a.status){var r=JSON.parse(a.responseText),l=e.Parse(r,n||m.Engine.LastCreatedScene,i);t&&(l.name=t),o(l)}else s("Unable to load the sprite manager")})),a.open("GET",r),a.send()}))},e.CreateFromSnippetAsync=function(t,r,n){var i=this;return void 0===n&&(n=""),"_BLANK"===t?Promise.resolve(new e("Default sprite manager","//playground.babylonjs.com/textures/player.png",500,64,r)):new Promise((function(o,s){var a=new g.WebRequest;a.addEventListener("readystatechange",(function(){if(4==a.readyState)if(200==a.status){var i=JSON.parse(JSON.parse(a.responseText).jsonPayload),l=JSON.parse(i.spriteManager),c=e.Parse(l,r||m.Engine.LastCreatedScene,n);c.snippetId=t,o(c)}else s("Unable to load the snippet "+t)})),a.open("GET",i.SnippetUrl+"/"+t.replace(/#/g,"/")),a.send()}))},e.SnippetUrl="https://snippet.babylonjs.com",e}()},"./Sprites/spriteMap.ts":
- /*!******************************!*\
- !*** ./Sprites/spriteMap.ts ***!
- \******************************/
- /*! exports provided: SpriteMap */function(e,t,r){"use strict";r.r(t),r.d(t,"SpriteMap",(function(){return u}));var n=r(/*! ../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),a=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Materials/effect */"./Materials/effect.ts"),u=(r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),r(/*! ../Shaders/spriteMap.fragment */"./Shaders/spriteMap.fragment.ts"),r(/*! ../Shaders/spriteMap.vertex */"./Shaders/spriteMap.vertex.ts"),function(){function e(e,t,r,n,o){var s=this;this.name=e,this.sprites=[],this.atlasJSON=t,this.sprites=this.atlasJSON.frames,this.spriteSheet=r,this.options=n,n.stageSize=n.stageSize||new i.Vector2(1,1),n.outputSize=n.outputSize||n.stageSize,n.outputPosition=n.outputPosition||i.Vector3.Zero(),n.outputRotation=n.outputRotation||i.Vector3.Zero(),n.layerCount=n.layerCount||1,n.maxAnimationFrames=n.maxAnimationFrames||0,n.baseTile=n.baseTile||0,n.flipU=n.flipU||!1,n.colorMultiply=n.colorMultiply||new i.Vector3(1,1,1),this._scene=o,this._frameMap=this._createFrameBuffer(),this._tileMaps=new Array;for(var u=0;u<n.layerCount;u++)this._tileMaps.push(this._createTileBuffer(null,u));this._animationMap=this._createTileAnimationBuffer(null);var d=[];d.push("#define LAYERS "+n.layerCount),n.flipU&&d.push("#define FLIPU"),d.push("#define MAX_ANIMATION_FRAMES "+n.maxAnimationFrames+".0");var h,f=c.Effect.ShadersStore.spriteMapPixelShader;if(1===this._scene.getEngine().webGLVersion)for(h="",u=0;u<n.layerCount;u++)h+="if ("+u+" == i) { frameID = texture2D(tileMaps["+u+"], (tileID + 0.5) / stageSize, 0.).x; }";else{for(h="switch(i) {",u=0;u<n.layerCount;u++)h+="case "+u+" : frameID = texture(tileMaps["+u+"], (tileID + 0.5) / stageSize, 0.).x;",h+="break;";h+="}"}c.Effect.ShadersStore["spriteMap"+this.name+"PixelShader"]=f.replace("#define LAYER_ID_SWITCH",h),this._material=new a.ShaderMaterial("spriteMap:"+this.name,this._scene,{vertex:"spriteMap",fragment:"spriteMap"+this.name},{defines:d,attributes:["position","normal","uv"],uniforms:["worldViewProjection","time","stageSize","outputSize","spriteMapSize","spriteCount","time","colorMul","mousePosition","curTile","flipU"],samplers:["spriteSheet","frameMap","tileMaps","animationMap"],needAlphaBlending:!0}),this._time=0,this._material.setFloat("spriteCount",this.spriteCount),this._material.setVector2("stageSize",n.stageSize),this._material.setVector2("outputSize",n.outputSize),this._material.setTexture("spriteSheet",this.spriteSheet),this._material.setVector2("spriteMapSize",new i.Vector2(1,1)),this._material.setVector3("colorMul",n.colorMultiply);var p=0,m=function(){s.spriteSheet&&s.spriteSheet.isReady()&&s.spriteSheet._texture?s._material.setVector2("spriteMapSize",new i.Vector2(s.spriteSheet._texture.baseWidth||1,s.spriteSheet._texture.baseHeight||1)):p<100&&setTimeout((function(){p++,m()}),100)};m(),this._material.setVector3("colorMul",n.colorMultiply),this._material.setTexture("frameMap",this._frameMap),this._material.setTextureArray("tileMaps",this._tileMaps),this._material.setTexture("animationMap",this._animationMap),this._material.setFloat("time",this._time),this._output=l.Mesh.CreatePlane(e+":output",1,o,!0),this._output.scaling.x=n.outputSize.x,this._output.scaling.y=n.outputSize.y,this._scene.onBeforeRenderObservable.add((function(){s._time+=s._scene.getEngine().getDeltaTime(),s._material.setFloat("time",s._time)})),this._output.material=this._material}return Object.defineProperty(e.prototype,"spriteCount",{get:function(){return this.sprites.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._output.position},set:function(e){this._output.position=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this._output.rotation},set:function(e){this._output.rotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationMap",{get:function(){return this._animationMap},set:function(e){var t=e._texture._bufferView,r=this._createTileAnimationBuffer(t);this._animationMap.dispose(),this._animationMap=r,this._material.setTexture("animationMap",this._animationMap)},enumerable:!1,configurable:!0}),e.prototype.getTileID=function(){var e=this.getMousePosition();return e.multiplyInPlace(this.options.stageSize||i.Vector2.Zero()),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e},e.prototype.getMousePosition=function(){var e=this._output,t=this._scene.pick(this._scene.pointerX,this._scene.pointerY,(function(t){return t===e}));if(!t||!t.hit||!t.getTextureCoordinates)return new i.Vector2(-1,-1);var r=t.getTextureCoordinates();return r||new i.Vector2(-1,-1)},e.prototype._createFrameBuffer=function(){for(var e=new Array,t=0;t<this.spriteCount;t++)e.push(0,0,0,0),e.push(0,0,0,0),e.push(0,0,0,0),e.push(0,0,0,0);for(t=0;t<this.spriteCount;t++){var r=this.sprites[t].frame,i=this.sprites[t].spriteSourceSize,a=this.sprites[t].sourceSize,l=this.sprites[t].rotated?1:0,c=this.sprites[t].trimmed?1:0;e[4*t]=r.x,e[4*t+1]=r.y,e[4*t+2]=r.w,e[4*t+3]=r.h,e[4*t+4*this.spriteCount]=i.x,e[4*t+1+4*this.spriteCount]=i.y,e[4*t+3+4*this.spriteCount]=i.h,e[4*t+8*this.spriteCount]=a.w,e[4*t+1+8*this.spriteCount]=a.h,e[4*t+2+8*this.spriteCount]=l,e[4*t+3+8*this.spriteCount]=c}var u=new Float32Array(e);return s.RawTexture.CreateRGBATexture(u,this.spriteCount,4,this._scene,!1,!1,o.Texture.NEAREST_NEAREST,n.Engine.TEXTURETYPE_FLOAT)},e.prototype._createTileBuffer=function(e,t){void 0===t&&(t=0);var r=new Array,i=this.options.stageSize.y||0,a=this.options.stageSize.x||0;if(e)r=e;else{var l=this.options.baseTile;0!=t&&(l=0);for(var c=0;c<i;c++)for(var u=0;u<4*a;u+=4)r.push(l,0,0,0)}var d=new Float32Array(r);return s.RawTexture.CreateRGBATexture(d,a,i,this._scene,!1,!1,o.Texture.NEAREST_NEAREST,n.Engine.TEXTURETYPE_FLOAT)},e.prototype.changeTiles=function(e,t,r){var n;if(void 0===e&&(e=0),void 0===r&&(r=0),null!==(n=this._tileMaps[e]._texture._bufferView)){var o=new Array;t instanceof i.Vector2?o.push(t):o=t;for(var s=this.options.stageSize.x||0,a=0;a<o.length;a++){var l=o[a];l.x=Math.floor(l.x),l.y=Math.floor(l.y),n[4*l.x+l.y*(4*s)]=r}var c=this._createTileBuffer(n);this._tileMaps[e].dispose(),this._tileMaps[e]=c,this._material.setTextureArray("tileMap",this._tileMaps)}},e.prototype._createTileAnimationBuffer=function(e){var t,r=new Array;if(e)t=e;else{for(var i=0;i<this.spriteCount;i++){r.push(0,0,0,0);for(var a=1;a<(this.options.maxAnimationFrames||4);)r.push(0,0,0,0),a++}t=new Float32Array(r)}return s.RawTexture.CreateRGBATexture(t,this.spriteCount,this.options.maxAnimationFrames||4,this._scene,!1,!1,o.Texture.NEAREST_NEAREST,n.Engine.TEXTURETYPE_FLOAT)},e.prototype.addAnimationToTile=function(e,t,r,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=1);var o=this._animationMap._texture._bufferView,s=4*e+4*this.spriteCount*t;if(o){o[s]=r,o[s+1]=n,o[s+2]=i;var a=this._createTileAnimationBuffer(o);this._animationMap.dispose(),this._animationMap=a,this._material.setTexture("animationMap",this._animationMap)}},e.prototype.saveTileMaps=function(){for(var e="",t=0;t<this._tileMaps.length;t++)t>0&&(e+="\n\r"),e+=this._tileMaps[t]._texture._bufferView.toString();var r=document.createElement("a");r.href="data:octet/stream;charset=utf-8,"+encodeURI(e),r.target="_blank",r.download=this.name+".tilemaps",r.click(),r.remove()},e.prototype.loadTileMaps=function(e){var t=this,r=new XMLHttpRequest;r.open("GET",e);var n=this.options.layerCount||0;r.onload=function(){for(var e=r.response.split("\n\r"),i=0;i<n;i++){var o=e[i].split(",").map(Number),s=t._createTileBuffer(o);t._tileMaps[i].dispose(),t._tileMaps[i]=s}t._material.setTextureArray("tileMap",t._tileMaps)},r.send()},e.prototype.dispose=function(){this._output.dispose(),this._material.dispose(),this._animationMap.dispose(),this._tileMaps.forEach((function(e){e.dispose()})),this._frameMap.dispose()},e}())},"./Sprites/spritePackedManager.ts":
- /*!****************************************!*\
- !*** ./Sprites/spritePackedManager.ts ***!
- \****************************************/
- /*! exports provided: SpritePackedManager */function(e,t,r){"use strict";r.r(t),r.d(t,"SpritePackedManager",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./spriteManager */"./Sprites/spriteManager.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=function(e){function t(t,r,n,i,s,a,l){void 0===s&&(s=null),void 0===a&&(a=.01),void 0===l&&(l=o.Texture.TRILINEAR_SAMPLINGMODE);var c=e.call(this,t,r,n,64,i,a,l,!0,s)||this;return c.name=t,c}return Object(n.__extends)(t,e),t}(i.SpriteManager)},"./Sprites/spriteSceneComponent.ts":
- /*!*****************************************!*\
- !*** ./Sprites/spriteSceneComponent.ts ***!
- \*****************************************/
- /*! exports provided: SpriteSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"SpriteSceneComponent",(function(){return u}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../scene */"./scene.ts"),o=r(/*! ../Culling/ray */"./Culling/ray.ts"),s=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),a=r(/*! ../sceneComponent */"./sceneComponent.ts"),l=r(/*! ../Actions/actionEvent */"./Actions/actionEvent.ts"),c=r(/*! ../Engines/constants */"./Engines/constants.ts");i.Scene.prototype._internalPickSprites=function(e,t,r,n){if(!s.PickingInfo)return null;var i=null;if(!n){if(!this.activeCamera)return null;n=this.activeCamera}if(this.spriteManagers.length>0)for(var o=0;o<this.spriteManagers.length;o++){var a=this.spriteManagers[o];if(a.isPickable){var l=a.intersects(e,n,t,r);if(l&&l.hit&&(r||null==i||!(l.distance>=i.distance))&&(i=l,r))break}}return i||new s.PickingInfo},i.Scene.prototype._internalMultiPickSprites=function(e,t,r){if(!s.PickingInfo)return null;var n=new Array;if(!r){if(!this.activeCamera)return null;r=this.activeCamera}if(this.spriteManagers.length>0)for(var i=0;i<this.spriteManagers.length;i++){var o=this.spriteManagers[i];if(o.isPickable){var a=o.multiIntersects(e,r,t);null!==a&&(n=n.concat(a))}}return n},i.Scene.prototype.pickSprite=function(e,t,r,n,i){return this.createPickingRayInCameraSpaceToRef(e,t,this._tempSpritePickingRay,i),this._internalPickSprites(this._tempSpritePickingRay,r,n,i)},i.Scene.prototype.pickSpriteWithRay=function(e,t,r,n){if(!this._tempSpritePickingRay)return null;if(!n){if(!this.activeCamera)return null;n=this.activeCamera}return o.Ray.TransformToRef(e,n.getViewMatrix(),this._tempSpritePickingRay),this._internalPickSprites(this._tempSpritePickingRay,t,r,n)},i.Scene.prototype.multiPickSprite=function(e,t,r,n){return this.createPickingRayInCameraSpaceToRef(e,t,this._tempSpritePickingRay,n),this._internalMultiPickSprites(this._tempSpritePickingRay,r,n)},i.Scene.prototype.multiPickSpriteWithRay=function(e,t,r){if(!this._tempSpritePickingRay)return null;if(!r){if(!this.activeCamera)return null;r=this.activeCamera}return o.Ray.TransformToRef(e,r.getViewMatrix(),this._tempSpritePickingRay),this._internalMultiPickSprites(this._tempSpritePickingRay,t,r)},i.Scene.prototype.setPointerOverSprite=function(e){this._pointerOverSprite!==e&&(this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(c.Constants.ACTION_OnPointerOutTrigger,l.ActionEvent.CreateNewFromSprite(this._pointerOverSprite,this)),this._pointerOverSprite=e,this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(c.Constants.ACTION_OnPointerOverTrigger,l.ActionEvent.CreateNewFromSprite(this._pointerOverSprite,this)))},i.Scene.prototype.getPointerOverSprite=function(){return this._pointerOverSprite};var u=function(){function e(e){this.name=a.SceneComponentConstants.NAME_SPRITE,this.scene=e,this.scene.spriteManagers=new Array,this.scene._tempSpritePickingRay=o.Ray?o.Ray.Zero():null,this.scene.onBeforeSpritesRenderingObservable=new n.Observable,this.scene.onAfterSpritesRenderingObservable=new n.Observable,this._spritePredicate=function(e){return!!e.actionManager&&e.isPickable&&e.actionManager.hasPointerTriggers}}return e.prototype.register=function(){this.scene._pointerMoveStage.registerStep(a.SceneComponentConstants.STEP_POINTERMOVE_SPRITE,this,this._pointerMove),this.scene._pointerDownStage.registerStep(a.SceneComponentConstants.STEP_POINTERDOWN_SPRITE,this,this._pointerDown),this.scene._pointerUpStage.registerStep(a.SceneComponentConstants.STEP_POINTERUP_SPRITE,this,this._pointerUp)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){this.scene.onBeforeSpritesRenderingObservable.clear(),this.scene.onAfterSpritesRenderingObservable.clear();for(var e=this.scene.spriteManagers;e.length;)e[0].dispose()},e.prototype._pickSpriteButKeepRay=function(e,t,r,n,i){var o=this.scene.pickSprite(t,r,this._spritePredicate,n,i);return o&&(o.ray=e?e.ray:null),o},e.prototype._pointerMove=function(e,t,r,n,i){var o=this.scene;return n?o.setPointerOverSprite(null):(r=this._pickSpriteButKeepRay(r,e,t,!1,o.cameraToUseForPointers||void 0))&&r.hit&&r.pickedSprite?(o.setPointerOverSprite(r.pickedSprite),o.doNotHandleCursors||(o._pointerOverSprite&&o._pointerOverSprite.actionManager&&o._pointerOverSprite.actionManager.hoverCursor?i.style.cursor=o._pointerOverSprite.actionManager.hoverCursor:i.style.cursor=o.hoverCursor)):o.setPointerOverSprite(null),r},e.prototype._pointerDown=function(e,t,r,n){var i=this.scene;if(i._pickedDownSprite=null,i.spriteManagers.length>0&&(r=i.pickSprite(e,t,this._spritePredicate,!1,i.cameraToUseForPointers||void 0))&&r.hit&&r.pickedSprite&&r.pickedSprite.actionManager){switch(i._pickedDownSprite=r.pickedSprite,n.button){case 0:r.pickedSprite.actionManager.processTrigger(c.Constants.ACTION_OnLeftPickTrigger,l.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n));break;case 1:r.pickedSprite.actionManager.processTrigger(c.Constants.ACTION_OnCenterPickTrigger,l.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n));break;case 2:r.pickedSprite.actionManager.processTrigger(c.Constants.ACTION_OnRightPickTrigger,l.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n))}r.pickedSprite.actionManager&&r.pickedSprite.actionManager.processTrigger(c.Constants.ACTION_OnPickDownTrigger,l.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n))}return r},e.prototype._pointerUp=function(e,t,r,n){var i=this.scene;if(i.spriteManagers.length>0){var o=i.pickSprite(e,t,this._spritePredicate,!1,i.cameraToUseForPointers||void 0);o&&(o.hit&&o.pickedSprite&&o.pickedSprite.actionManager&&(o.pickedSprite.actionManager.processTrigger(c.Constants.ACTION_OnPickUpTrigger,l.ActionEvent.CreateNewFromSprite(o.pickedSprite,i,n)),o.pickedSprite.actionManager&&(this.scene._inputManager._isPointerSwiping()||o.pickedSprite.actionManager.processTrigger(c.Constants.ACTION_OnPickTrigger,l.ActionEvent.CreateNewFromSprite(o.pickedSprite,i,n)))),i._pickedDownSprite&&i._pickedDownSprite.actionManager&&i._pickedDownSprite!==o.pickedSprite&&i._pickedDownSprite.actionManager.processTrigger(c.Constants.ACTION_OnPickOutTrigger,l.ActionEvent.CreateNewFromSprite(i._pickedDownSprite,i,n)))}return r},e}()},"./States/alphaCullingState.ts":
- /*!*************************************!*\
- !*** ./States/alphaCullingState.ts ***!
- \*************************************/
- /*! exports provided: AlphaState */function(e,t,r){"use strict";r.r(t),r.d(t,"AlphaState",(function(){return n}));var n=function(){function e(){this._isAlphaBlendDirty=!1,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1,this._alphaBlend=!1,this._blendFunctionParameters=new Array(4),this._blendEquationParameters=new Array(2),this._blendConstants=new Array(4),this.reset()}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isAlphaBlendDirty||this._isBlendFunctionParametersDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaBlend",{get:function(){return this._alphaBlend},set:function(e){this._alphaBlend!==e&&(this._alphaBlend=e,this._isAlphaBlendDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.setAlphaBlendConstants=function(e,t,r,n){this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===r&&this._blendConstants[3]===n||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=r,this._blendConstants[3]=n,this._isBlendConstantsDirty=!0)},e.prototype.setAlphaBlendFunctionParameters=function(e,t,r,n){this._blendFunctionParameters[0]===e&&this._blendFunctionParameters[1]===t&&this._blendFunctionParameters[2]===r&&this._blendFunctionParameters[3]===n||(this._blendFunctionParameters[0]=e,this._blendFunctionParameters[1]=t,this._blendFunctionParameters[2]=r,this._blendFunctionParameters[3]=n,this._isBlendFunctionParametersDirty=!0)},e.prototype.setAlphaEquationParameters=function(e,t){this._blendEquationParameters[0]===e&&this._blendEquationParameters[1]===t||(this._blendEquationParameters[0]=e,this._blendEquationParameters[1]=t,this._isBlendEquationParametersDirty=!0)},e.prototype.reset=function(){this._alphaBlend=!1,this._blendFunctionParameters[0]=null,this._blendFunctionParameters[1]=null,this._blendFunctionParameters[2]=null,this._blendFunctionParameters[3]=null,this._blendEquationParameters[0]=null,this._blendEquationParameters[1]=null,this._blendConstants[0]=null,this._blendConstants[1]=null,this._blendConstants[2]=null,this._blendConstants[3]=null,this._isAlphaBlendDirty=!0,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1},e.prototype.apply=function(e){this.isDirty&&(this._isAlphaBlendDirty&&(this._alphaBlend?e.enable(e.BLEND):e.disable(e.BLEND),this._isAlphaBlendDirty=!1),this._isBlendFunctionParametersDirty&&(e.blendFuncSeparate(this._blendFunctionParameters[0],this._blendFunctionParameters[1],this._blendFunctionParameters[2],this._blendFunctionParameters[3]),this._isBlendFunctionParametersDirty=!1),this._isBlendEquationParametersDirty&&(e.blendEquationSeparate(this._blendEquationParameters[0],this._blendEquationParameters[1]),this._isBlendEquationParametersDirty=!1),this._isBlendConstantsDirty&&(e.blendColor(this._blendConstants[0],this._blendConstants[1],this._blendConstants[2],this._blendConstants[3]),this._isBlendConstantsDirty=!1))},e}()},"./States/depthCullingState.ts":
- /*!*************************************!*\
- !*** ./States/depthCullingState.ts ***!
- \*************************************/
- /*! exports provided: DepthCullingState */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthCullingState",(function(){return n}));var n=function(){function e(){this._isDepthTestDirty=!1,this._isDepthMaskDirty=!1,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1,this.reset()}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isDepthFuncDirty||this._isDepthTestDirty||this._isDepthMaskDirty||this._isCullFaceDirty||this._isCullDirty||this._isZOffsetDirty||this._isFrontFaceDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zOffset",{get:function(){return this._zOffset},set:function(e){this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cullFace",{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cull",{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this._isCullDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthFunc",{get:function(){return this._depthFunc},set:function(e){this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return this._depthMask},set:function(e){this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontFace",{get:function(){return this._frontFace},set:function(e){this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._depthMask=!0,this._depthTest=!0,this._depthFunc=null,this._cullFace=null,this._cull=null,this._zOffset=0,this._frontFace=null,this._isDepthTestDirty=!0,this._isDepthMaskDirty=!0,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1},e.prototype.apply=function(e){this.isDirty&&(this._isCullDirty&&(this.cull?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this._isCullDirty=!1),this._isCullFaceDirty&&(e.cullFace(this.cullFace),this._isCullFaceDirty=!1),this._isDepthMaskDirty&&(e.depthMask(this.depthMask),this._isDepthMaskDirty=!1),this._isDepthTestDirty&&(this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._isDepthTestDirty=!1),this._isDepthFuncDirty&&(e.depthFunc(this.depthFunc),this._isDepthFuncDirty=!1),this._isZOffsetDirty&&(this.zOffset?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(this.zOffset,0)):e.disable(e.POLYGON_OFFSET_FILL),this._isZOffsetDirty=!1),this._isFrontFaceDirty&&(e.frontFace(this.frontFace),this._isFrontFaceDirty=!1))},e}()},"./States/index.ts":
- /*!*************************!*\
- !*** ./States/index.ts ***!
- \*************************/
- /*! exports provided: AlphaState, DepthCullingState, StencilState */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./alphaCullingState */"./States/alphaCullingState.ts");r.d(t,"AlphaState",(function(){return n.AlphaState}));var i=r(/*! ./depthCullingState */"./States/depthCullingState.ts");r.d(t,"DepthCullingState",(function(){return i.DepthCullingState}));var o=r(/*! ./stencilState */"./States/stencilState.ts");r.d(t,"StencilState",(function(){return o.StencilState}))},"./States/stencilState.ts":
- /*!********************************!*\
- !*** ./States/stencilState.ts ***!
- \********************************/
- /*! exports provided: StencilState */function(e,t,r){"use strict";r.r(t),r.d(t,"StencilState",(function(){return i}));var n=r(/*! ../Engines/constants */"./Engines/constants.ts"),i=function(){function e(){this._isStencilTestDirty=!1,this._isStencilMaskDirty=!1,this._isStencilFuncDirty=!1,this._isStencilOpDirty=!1,this.reset()}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return this._isStencilTestDirty||this._isStencilMaskDirty||this._isStencilFuncDirty||this._isStencilOpDirty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFunc",{get:function(){return this._stencilFunc},set:function(e){this._stencilFunc!==e&&(this._stencilFunc=e,this._isStencilFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFuncRef",{get:function(){return this._stencilFuncRef},set:function(e){this._stencilFuncRef!==e&&(this._stencilFuncRef=e,this._isStencilFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFuncMask",{get:function(){return this._stencilFuncMask},set:function(e){this._stencilFuncMask!==e&&(this._stencilFuncMask=e,this._isStencilFuncDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpStencilFail",{get:function(){return this._stencilOpStencilFail},set:function(e){this._stencilOpStencilFail!==e&&(this._stencilOpStencilFail=e,this._isStencilOpDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpDepthFail",{get:function(){return this._stencilOpDepthFail},set:function(e){this._stencilOpDepthFail!==e&&(this._stencilOpDepthFail=e,this._isStencilOpDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpStencilDepthPass",{get:function(){return this._stencilOpStencilDepthPass},set:function(e){this._stencilOpStencilDepthPass!==e&&(this._stencilOpStencilDepthPass=e,this._isStencilOpDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilMask",{get:function(){return this._stencilMask},set:function(e){this._stencilMask!==e&&(this._stencilMask=e,this._isStencilMaskDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilTest",{get:function(){return this._stencilTest},set:function(e){this._stencilTest!==e&&(this._stencilTest=e,this._isStencilTestDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._stencilTest=!1,this._stencilMask=255,this._stencilFunc=e.ALWAYS,this._stencilFuncRef=1,this._stencilFuncMask=255,this._stencilOpStencilFail=e.KEEP,this._stencilOpDepthFail=e.KEEP,this._stencilOpStencilDepthPass=e.REPLACE,this._isStencilTestDirty=!0,this._isStencilMaskDirty=!0,this._isStencilFuncDirty=!0,this._isStencilOpDirty=!0},e.prototype.apply=function(e){this.isDirty&&(this._isStencilTestDirty&&(this.stencilTest?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this._isStencilTestDirty=!1),this._isStencilMaskDirty&&(e.stencilMask(this.stencilMask),this._isStencilMaskDirty=!1),this._isStencilFuncDirty&&(e.stencilFunc(this.stencilFunc,this.stencilFuncRef,this.stencilFuncMask),this._isStencilFuncDirty=!1),this._isStencilOpDirty&&(e.stencilOp(this.stencilOpStencilFail,this.stencilOpDepthFail,this.stencilOpStencilDepthPass),this._isStencilOpDirty=!1))},e.ALWAYS=n.Constants.ALWAYS,e.KEEP=n.Constants.KEEP,e.REPLACE=n.Constants.REPLACE,e}()},"./XR/features/WebXRAbstractFeature.ts":
- /*!*********************************************!*\
- !*** ./XR/features/WebXRAbstractFeature.ts ***!
- \*********************************************/
- /*! exports provided: WebXRAbstractFeature */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRAbstractFeature",(function(){return n}));var n=function(){function e(e){this._xrSessionManager=e,this._attached=!1,this._removeOnDetach=[],this.disableAutoAttach=!1,this.xrNativeFeatureName=""}return Object.defineProperty(e.prototype,"attached",{get:function(){return this._attached},enumerable:!1,configurable:!0}),e.prototype.attach=function(e){var t=this;if(e)this.attached&&this.detach();else if(this.attached)return!1;return this._attached=!0,this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable,(function(e){return t._onXRFrame(e)})),!0},e.prototype.detach=function(){return this._attached?(this._attached=!1,this._removeOnDetach.forEach((function(e){e.observable.remove(e.observer)})),!0):(this.disableAutoAttach=!0,!1)},e.prototype.dispose=function(){this.detach()},e.prototype.isCompatible=function(){return!0},e.prototype._addNewAttachObserver=function(e,t){this._removeOnDetach.push({observable:e,observer:e.add(t)})},e}()},"./XR/features/WebXRAnchorSystem.ts":
- /*!******************************************!*\
- !*** ./XR/features/WebXRAnchorSystem.ts ***!
- \******************************************/
- /*! exports provided: WebXRAnchorSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRAnchorSystem",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),l=r(/*! ../../Misc/tools */"./Misc/tools.ts"),c=0,u=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this,t)||this;return n._options=r,n._lastFrameDetected=new Set,n._trackedAnchors=[],n._futureAnchors=[],n.onAnchorAddedObservable=new o.Observable,n.onAnchorRemovedObservable=new o.Observable,n.onAnchorUpdatedObservable=new o.Observable,n._tmpVector=new s.Vector3,n._tmpQuaternion=new s.Quaternion,n.xrNativeFeatureName="anchors",n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"referenceSpaceForFrameAnchors",{set:function(e){this._referenceSpaceForFrameAnchors=e},enumerable:!1,configurable:!0}),t.prototype._populateTmpTransformation=function(e,t){return this._tmpVector.copyFrom(e),this._tmpQuaternion.copyFrom(t),this._xrSessionManager.scene.useRightHandedSystem||(this._tmpVector.z*=-1,this._tmpQuaternion.z*=-1,this._tmpQuaternion.w*=-1),{position:this._tmpVector,rotationQuaternion:this._tmpQuaternion}},t.prototype.addAnchorPointUsingHitTestResultAsync=function(e,t,r){return void 0===t&&(t=new s.Vector3),void 0===r&&(r=new s.Quaternion),Object(n.__awaiter)(this,void 0,void 0,(function(){var i;return Object(n.__generator)(this,(function(n){if(this._populateTmpTransformation(t,r),i=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w}),!e.xrHitResult.createAnchor)throw this.detach(),new Error("Anchors not enabled in this environment/browser");try{return[2,e.xrHitResult.createAnchor(i)]}catch(e){throw new Error(e)}return[2]}))}))},t.prototype.addAnchorAtPositionAndRotationAsync=function(e,t,r){var n=this;void 0===t&&(t=new s.Quaternion),void 0===r&&(r=!1),this._populateTmpTransformation(e,t);var i=new XRRigidTransform({x:this._tmpVector.x,y:this._tmpVector.y,z:this._tmpVector.z},{x:this._tmpQuaternion.x,y:this._tmpQuaternion.y,z:this._tmpQuaternion.z,w:this._tmpQuaternion.w});return r&&this.attached&&this._xrSessionManager.currentFrame?this._createAnchorAtTransformation(i,this._xrSessionManager.currentFrame):new Promise((function(e,t){n._futureAnchors.push({xrTransformation:i,resolve:e,reject:t})}))},t.prototype.detach=function(){if(!e.prototype.detach.call(this))return!1;if(!this._options.doNotRemoveAnchorsOnSessionEnded)for(;this._trackedAnchors.length;){var t=this._trackedAnchors.pop();t&&this.onAnchorRemovedObservable.notifyObservers(t)}return!0},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onAnchorAddedObservable.clear(),this.onAnchorRemovedObservable.clear(),this.onAnchorUpdatedObservable.clear()},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&e){var r=e.trackedAnchors;if(r){var n=this._trackedAnchors.filter((function(e){return!r.has(e.xrAnchor)})).map((function(e){return t._trackedAnchors.indexOf(e)})),i=0;n.forEach((function(e){var r=t._trackedAnchors.splice(e-i,1)[0];t.onAnchorRemovedObservable.notifyObservers(r),i--})),r.forEach((function(r){if(t._lastFrameDetected.has(r)){var n=t._findIndexInAnchorArray(r);o=t._trackedAnchors[n];try{t._updateAnchorWithXRFrame(r,o,e),o.attachedNode&&(o.attachedNode.rotationQuaternion=o.attachedNode.rotationQuaternion||new s.Quaternion,o.transformationMatrix.decompose(o.attachedNode.scaling,o.attachedNode.rotationQuaternion,o.attachedNode.position)),t.onAnchorUpdatedObservable.notifyObservers(o)}catch(e){l.Tools.Warn("Anchor could not be updated")}}else{var i={id:c++,xrAnchor:r},o=t._updateAnchorWithXRFrame(r,i,e);t._trackedAnchors.push(o),t.onAnchorAddedObservable.notifyObservers(o)}})),this._lastFrameDetected=r}for(;this._futureAnchors.length;){var o=this._futureAnchors.pop();if(!o)return;e.createAnchor||o.reject("Anchors not enabled in this browser"),this._createAnchorAtTransformation(o.xrTransformation,e).then(o.resolve,o.reject)}}},t.prototype._findIndexInAnchorArray=function(e){for(var t=0;t<this._trackedAnchors.length;++t)if(this._trackedAnchors[t].xrAnchor===e)return t;return-1},t.prototype._updateAnchorWithXRFrame=function(e,t,r){var n=r.getPose(e.anchorSpace,this._xrSessionManager.referenceSpace);if(n){var i=t.transformationMatrix||new s.Matrix;s.Matrix.FromArrayToRef(n.transform.matrix,0,i),this._xrSessionManager.scene.useRightHandedSystem||i.toggleModelMatrixHandInPlace(),t.transformationMatrix=i,this._options.worldParentNode&&i.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),i)}return t},t.prototype._createAnchorAtTransformation=function(e,t){var r;return Object(n.__awaiter)(this,void 0,void 0,(function(){return Object(n.__generator)(this,(function(n){if(!t.createAnchor)throw this.detach(),new Error("Anchors are not enabled in your browser");try{return[2,t.createAnchor(e,null!==(r=this._referenceSpaceForFrameAnchors)&&void 0!==r?r:this._xrSessionManager.referenceSpace)]}catch(e){throw new Error(e)}return[2]}))}))},t.Name=i.WebXRFeatureName.ANCHOR_SYSTEM,t.Version=1,t}(a.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(u.Name,(function(e,t){return function(){return new u(e,t)}}),u.Version)},"./XR/features/WebXRBackgroundRemover.ts":
- /*!***********************************************!*\
- !*** ./XR/features/WebXRBackgroundRemover.ts ***!
- \***********************************************/
- /*! exports provided: WebXRBackgroundRemover */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRBackgroundRemover",(function(){return s}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this,t)||this;return n.options=r,n.onBackgroundStateChangedObservable=new o.Observable,n}return Object(n.__extends)(t,e),t.prototype.attach=function(){return this._setBackgroundState(!1),e.prototype.attach.call(this)},t.prototype.detach=function(){return this._setBackgroundState(!0),e.prototype.detach.call(this)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onBackgroundStateChangedObservable.clear()},t.prototype._onXRFrame=function(e){},t.prototype._setBackgroundState=function(e){var t=this._xrSessionManager.scene;if(!this.options.ignoreEnvironmentHelper)if(this.options.environmentHelperRemovalFlags){if(this.options.environmentHelperRemovalFlags.skyBox){var r=t.getMeshByName("BackgroundSkybox");r&&r.setEnabled(e)}if(this.options.environmentHelperRemovalFlags.ground){var n=t.getMeshByName("BackgroundPlane");n&&n.setEnabled(e)}}else{var i=t.getMeshByName("BackgroundHelper");i&&i.setEnabled(e)}this.options.backgroundMeshes&&this.options.backgroundMeshes.forEach((function(t){return t.setEnabled(e)})),this.onBackgroundStateChangedObservable.notifyObservers(e)},t.Name=i.WebXRFeatureName.BACKGROUND_REMOVER,t.Version=1,t}(r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts").WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(s.Name,(function(e,t){return function(){return new s(e,t)}}),s.Version,!0)},"./XR/features/WebXRControllerPhysics.ts":
- /*!***********************************************!*\
- !*** ./XR/features/WebXRControllerPhysics.ts ***!
- \***********************************************/
- /*! exports provided: IWebXRControllerPhysicsOptions, WebXRControllerPhysics */function(e,t,r){"use strict";r.r(t),r.d(t,"IWebXRControllerPhysicsOptions",(function(){return u})),r.d(t,"WebXRControllerPhysics",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),o=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),a=r(/*! ../../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),l=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),c=r(/*! ../../Misc/logger */"./Misc/logger.ts"),u=function(){},d=function(e){function t(t,r){var i=e.call(this,t)||this;return i._options=r,i._attachController=function(e){if(!i._controllers[e.uniqueId])if(i._xrSessionManager.scene.isPhysicsEnabled()||c.Logger.Warn("physics engine not enabled, skipped. Please add this controller manually."),i._options.physicsProperties.useControllerMesh&&e.inputSource.gamepad)e.onMotionControllerInitObservable.addOnce((function(t){t.onModelLoadedObservable.addOnce((function(){var r=new s.PhysicsImpostor(t.rootMesh,s.PhysicsImpostor.MeshImpostor,Object(n.__assign)({mass:0},i._options.physicsProperties)),o=e.grip||e.pointer;i._controllers[e.uniqueId]={xrController:e,impostor:r,oldPos:o.position.clone(),oldRotation:o.rotationQuaternion.clone()}}))}));else{var t=i._options.physicsProperties.impostorType||s.PhysicsImpostor.SphereImpostor,r=i._options.physicsProperties.impostorSize||.1,l=a.SphereBuilder.CreateSphere("impostor-mesh-"+e.uniqueId,{diameterX:"number"==typeof r?r:r.width,diameterY:"number"==typeof r?r:r.height,diameterZ:"number"==typeof r?r:r.depth});l.isVisible=i._debugMode,l.isPickable=!1,l.rotationQuaternion=new o.Quaternion;var u=e.grip||e.pointer;l.position.copyFrom(u.position),l.rotationQuaternion.copyFrom(u.rotationQuaternion);var d=new s.PhysicsImpostor(l,t,Object(n.__assign)({mass:0},i._options.physicsProperties));i._controllers[e.uniqueId]={xrController:e,impostor:d,impostorMesh:l}}},i._controllers={},i._debugMode=!1,i._delta=0,i._lastTimestamp=0,i._tmpQuaternion=new o.Quaternion,i._tmpVector=new o.Vector3,i._options.physicsProperties||(i._options.physicsProperties={}),i}return Object(n.__extends)(t,e),t.prototype._enablePhysicsDebug=function(){var e=this;this._debugMode=!0,Object.keys(this._controllers).forEach((function(t){var r=e._controllers[t];r.impostorMesh&&(r.impostorMesh.isVisible=!0)}))},t.prototype.addController=function(e){this._attachController(e)},t.prototype.attach=function(){var t=this;if(!e.prototype.attach.call(this))return!1;if(!this._options.xrInput)return!0;if(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,(function(e){t._detachController(e.uniqueId)})),this._options.enableHeadsetImpostor){var r=this._options.headsetImpostorParams||{impostorType:s.PhysicsImpostor.SphereImpostor,restitution:.8,impostorSize:.3},i=r.impostorSize||.3;this._headsetMesh=a.SphereBuilder.CreateSphere("headset-mesh",{diameterX:"number"==typeof i?i:i.width,diameterY:"number"==typeof i?i:i.height,diameterZ:"number"==typeof i?i:i.depth}),this._headsetMesh.rotationQuaternion=new o.Quaternion,this._headsetMesh.isVisible=!1,this._headsetImpostor=new s.PhysicsImpostor(this._headsetMesh,r.impostorType,Object(n.__assign)({mass:0},r))}return!0},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach((function(e){t._detachController(e)})),this._headsetMesh&&this._headsetMesh.dispose(),!0)},t.prototype.getHeadsetImpostor=function(){return this._headsetImpostor},t.prototype.getImpostorForController=function(e){var t="string"==typeof e?e:e.uniqueId;return this._controllers[t]?this._controllers[t].impostor:null},t.prototype.setPhysicsProperties=function(e){this._options.physicsProperties=Object(n.__assign)(Object(n.__assign)({},this._options.physicsProperties),e)},t.prototype._onXRFrame=function(e){var t=this;this._delta=this._xrSessionManager.currentTimestamp-this._lastTimestamp,this._lastTimestamp=this._xrSessionManager.currentTimestamp,this._headsetMesh&&(this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.position),this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion)),Object.keys(this._controllers).forEach((function(e){var r=t._controllers[e],n=r.xrController.grip||r.xrController.pointer,i=r.oldPos||r.impostorMesh.position,o=r.oldRotation||r.impostorMesh.rotationQuaternion;if(n.position.subtractToRef(i,t._tmpVector),t._tmpVector.scaleInPlace(1e3/t._delta),r.impostor.setLinearVelocity(t._tmpVector),t._debugMode&&console.log(t._tmpVector,"linear"),!o.equalsWithEpsilon(n.rotationQuaternion)){o.conjugateInPlace().multiplyToRef(n.rotationQuaternion,t._tmpQuaternion);var s=Math.sqrt(t._tmpQuaternion.x*t._tmpQuaternion.x+t._tmpQuaternion.y*t._tmpQuaternion.y+t._tmpQuaternion.z*t._tmpQuaternion.z);if(t._tmpVector.set(t._tmpQuaternion.x,t._tmpQuaternion.y,t._tmpQuaternion.z),s<.001)t._tmpVector.scaleInPlace(2);else{var a=2*Math.atan2(s,t._tmpQuaternion.w);t._tmpVector.scaleInPlace(a/(s*(t._delta/1e3)))}r.impostor.setAngularVelocity(t._tmpVector),t._debugMode&&console.log(t._tmpVector,t._tmpQuaternion,"angular")}i.copyFrom(n.position),o.copyFrom(n.rotationQuaternion)}))},t.prototype._detachController=function(e){var t=this._controllers[e];t&&(t.impostorMesh&&t.impostorMesh.dispose(),delete this._controllers[e])},t.Name=l.WebXRFeatureName.PHYSICS_CONTROLLERS,t.Version=1,t}(i.WebXRAbstractFeature);l.WebXRFeaturesManager.AddWebXRFeature(d.Name,(function(e,t){return function(){return new d(e,t)}}),d.Version,!0)},"./XR/features/WebXRControllerPointerSelection.ts":
- /*!********************************************************!*\
- !*** ./XR/features/WebXRControllerPointerSelection.ts ***!
- \********************************************************/
- /*! exports provided: WebXRControllerPointerSelection */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRControllerPointerSelection",(function(){return m}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts"),l=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),c=r(/*! ../../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),u=r(/*! ../../Meshes/Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),d=r(/*! ../../Culling/ray */"./Culling/ray.ts"),h=r(/*! ../../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),f=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),p=r(/*! ../../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),m=function(e){function t(r,n){var i=e.call(this,r)||this;return i._options=n,i._attachController=function(e){if(!i._controllers[e.uniqueId]){var r=i._generateNewMeshPair(e.pointer),n=r.laserPointer,s=r.selectionMesh;switch(i._controllers[e.uniqueId]={xrController:e,laserPointer:n,selectionMesh:s,meshUnderPointer:null,pick:null,tmpRay:new d.Ray(new o.Vector3,new o.Vector3),id:t._idCounter++},e.inputSource.targetRayMode){case"tracked-pointer":return i._attachTrackedPointerRayMode(e);case"gaze":return i._attachGazeMode(e);case"screen":return i._attachScreenRayMode(e)}}},i._controllers={},i._tmpVectorForPickCompare=new o.Vector3,i.disablePointerLighting=!0,i.disableSelectionMeshLighting=!0,i.displayLaserPointer=!0,i.displaySelectionMesh=!0,i.laserPointerPickedColor=new s.Color3(.9,.9,.9),i.laserPointerDefaultColor=new s.Color3(.7,.7,.7),i.selectionMeshDefaultColor=new s.Color3(.8,.8,.8),i.selectionMeshPickedColor=new s.Color3(.3,.3,1),i._scene=i._xrSessionManager.scene,i}return Object(n.__extends)(t,e),t.prototype.attach=function(){var r=this;if(!e.prototype.attach.call(this))return!1;if(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,(function(e){r._detachController(e.uniqueId)})),this._scene.constantlyUpdateMeshUnderPointer=!0,this._options.gazeCamera){var n=this._options.gazeCamera,i=this._generateNewMeshPair(n),s=i.laserPointer,a=i.selectionMesh;this._controllers.camera={webXRCamera:n,laserPointer:s,selectionMesh:a,meshUnderPointer:null,pick:null,tmpRay:new d.Ray(new o.Vector3,new o.Vector3),id:t._idCounter++},this._attachGazeMode()}return!0},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach((function(e){t._detachController(e)})),!0)},t.prototype.getMeshUnderPointer=function(e){return this._controllers[e]?this._controllers[e].meshUnderPointer:null},t.prototype.getXRControllerByPointerId=function(e){for(var t=Object.keys(this._controllers),r=0;r<t.length;++r)if(this._controllers[t[r]].id===e)return this._controllers[t[r]].xrController||null;return null},t.prototype._onXRFrame=function(e){var t=this;Object.keys(this._controllers).forEach((function(e){var r=t._controllers[e];if(r.xrController)r.xrController.getWorldPointerRayToRef(r.tmpRay);else{if(!r.webXRCamera)return;r.webXRCamera.getForwardRayToRef(r.tmpRay)}r.pick=t._scene.pickWithRay(r.tmpRay,t._scene.pointerMovePredicate||t.raySelectionPredicate);var n=r.pick;if(n&&n.pickedPoint&&n.hit){t._updatePointerDistance(r.laserPointer,n.distance),r.selectionMesh.position.copyFrom(n.pickedPoint),r.selectionMesh.scaling.x=Math.sqrt(n.distance),r.selectionMesh.scaling.y=Math.sqrt(n.distance),r.selectionMesh.scaling.z=Math.sqrt(n.distance);var i=t._convertNormalToDirectionOfRay(n.getNormal(!0),r.tmpRay);if(r.selectionMesh.position.copyFrom(n.pickedPoint),i){var s=o.Vector3.Cross(a.Axis.Y,i),l=o.Vector3.Cross(i,s);o.Vector3.RotationFromAxisToRef(l,i,s,r.selectionMesh.rotation),r.selectionMesh.position.addInPlace(i.scale(.001))}r.selectionMesh.isVisible=t.displaySelectionMesh,r.meshUnderPointer=n.pickedMesh}else r.selectionMesh.isVisible=!1,r.meshUnderPointer=null}))},t.prototype._attachGazeMode=function(e){var t=this,r=this._controllers[e&&e.uniqueId||"camera"],n=this._options.timeToSelect||3e3,i=this._options.useUtilityLayer?this._options.customUtilityLayerScene||p.UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene:this._scene,o=new h.PickingInfo,s=u.TorusBuilder.CreateTorus("selection",{diameter:.0525,thickness:.015,tessellation:20},i);s.isVisible=!1,s.isPickable=!1,s.parent=r.selectionMesh;var a=0,l=!1;r.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add((function(){if(r.pick){if(r.laserPointer.material.alpha=0,s.isVisible=!1,r.pick.hit)if(t._pickingMoved(o,r.pick))l&&(t._options.disablePointerUpOnTouchOut||t._scene.simulatePointerUp(r.pick,{pointerId:r.id})),l=!1,a=0;else if(a>n/10&&(s.isVisible=!0),(a+=t._scene.getEngine().getDeltaTime())>=n)t._scene.simulatePointerDown(r.pick,{pointerId:r.id}),l=!0,t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id}),s.isVisible=!1;else{var e=1-a/n;s.scaling.set(e,e,e)}else l=!1,a=0;t._scene.simulatePointerMove(r.pick,{pointerId:r.id}),o=r.pick}})),void 0!==this._options.renderingGroupId&&(s.renderingGroupId=this._options.renderingGroupId),e&&e.onDisposeObservable.addOnce((function(){r.pick&&!t._options.disablePointerUpOnTouchOut&&l&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id}),s.dispose()}))},t.prototype._attachScreenRayMode=function(e){var t=this,r=this._controllers[e.uniqueId],n=!1;r.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add((function(){!r.pick||t._options.disablePointerUpOnTouchOut&&n||(n?t._scene.simulatePointerMove(r.pick,{pointerId:r.id}):(t._scene.simulatePointerDown(r.pick,{pointerId:r.id}),n=!0,t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id})))})),e.onDisposeObservable.addOnce((function(){r.pick&&n&&!t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id})}))},t.prototype._attachTrackedPointerRayMode=function(e){var t=this,r=this._controllers[e.uniqueId];if(this._options.forceGazeMode)return this._attachGazeMode(e);if(r.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add((function(){r.laserPointer.isVisible=t.displayLaserPointer,r.laserPointer.material.disableLighting=t.disablePointerLighting,r.selectionMesh.material.disableLighting=t.disableSelectionMeshLighting,r.pick&&t._scene.simulatePointerMove(r.pick,{pointerId:r.id})})),e.inputSource.gamepad){var n=function(e){t._options.overrideButtonId&&(r.selectionComponent=e.getComponent(t._options.overrideButtonId)),r.selectionComponent||(r.selectionComponent=e.getMainComponent()),r.onButtonChangedObserver=r.selectionComponent.onButtonStateChangedObservable.add((function(e){if(e.changes.pressed){var n=e.changes.pressed.current;r.pick&&(n?(t._scene.simulatePointerDown(r.pick,{pointerId:r.id}),r.selectionMesh.material.emissiveColor=t.selectionMeshPickedColor,r.laserPointer.material.emissiveColor=t.laserPointerPickedColor):(t._scene.simulatePointerUp(r.pick,{pointerId:r.id}),r.selectionMesh.material.emissiveColor=t.selectionMeshDefaultColor,r.laserPointer.material.emissiveColor=t.laserPointerDefaultColor))}}))};e.motionController?n(e.motionController):e.onMotionControllerInitObservable.add(n)}else{var i=function(e){r.xrController&&e.inputSource===r.xrController.inputSource&&r.pick&&(t._scene.simulatePointerDown(r.pick,{pointerId:r.id}),r.selectionMesh.material.emissiveColor=t.selectionMeshPickedColor,r.laserPointer.material.emissiveColor=t.laserPointerPickedColor)},o=function(e){r.xrController&&e.inputSource===r.xrController.inputSource&&r.pick&&(t._scene.simulatePointerUp(r.pick,{pointerId:r.id}),r.selectionMesh.material.emissiveColor=t.selectionMeshDefaultColor,r.laserPointer.material.emissiveColor=t.laserPointerDefaultColor)};r.eventListeners={selectend:o,selectstart:i},this._xrSessionManager.session.addEventListener("selectstart",i),this._xrSessionManager.session.addEventListener("selectend",o)}},t.prototype._convertNormalToDirectionOfRay=function(e,t){return e&&Math.acos(o.Vector3.Dot(e,t.direction))<Math.PI/2&&e.scaleInPlace(-1),e},t.prototype._detachController=function(e){var t=this,r=this._controllers[e];r&&(r.selectionComponent&&r.onButtonChangedObserver&&r.selectionComponent.onButtonStateChangedObservable.remove(r.onButtonChangedObserver),r.onFrameObserver&&this._xrSessionManager.onXRFrameObservable.remove(r.onFrameObserver),r.eventListeners&&Object.keys(r.eventListeners).forEach((function(e){var n=r.eventListeners&&r.eventListeners[e];n&&t._xrSessionManager.session.removeEventListener(e,n)})),r.selectionMesh.dispose(),r.laserPointer.dispose(),delete this._controllers[e])},t.prototype._generateNewMeshPair=function(e){var t=this._options.useUtilityLayer?this._options.customUtilityLayerScene||p.UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene:this._scene,r=c.CylinderBuilder.CreateCylinder("laserPointer",{height:1,diameterTop:2e-4,diameterBottom:.004,tessellation:20,subdivisions:1},t);r.parent=e;var n=new l.StandardMaterial("laserPointerMat",t);n.emissiveColor=this.laserPointerDefaultColor,n.alpha=.7,r.material=n,r.rotation.x=Math.PI/2,this._updatePointerDistance(r,1),r.isPickable=!1;var i=u.TorusBuilder.CreateTorus("gazeTracker",{diameter:.0105,thickness:.0075,tessellation:20},t);i.bakeCurrentTransformIntoVertices(),i.isPickable=!1,i.isVisible=!1;var o=new l.StandardMaterial("targetMat",t);return o.specularColor=s.Color3.Black(),o.emissiveColor=this.selectionMeshDefaultColor,o.backFaceCulling=!1,i.material=o,void 0!==this._options.renderingGroupId&&(r.renderingGroupId=this._options.renderingGroupId,i.renderingGroupId=this._options.renderingGroupId),{laserPointer:r,selectionMesh:i}},t.prototype._pickingMoved=function(e,t){var r;if(!e.hit||!t.hit)return!0;if(!(e.pickedMesh&&e.pickedPoint&&t.pickedMesh&&t.pickedPoint))return!0;if(e.pickedMesh!==t.pickedMesh)return!0;null===(r=e.pickedPoint)||void 0===r||r.subtractToRef(t.pickedPoint,this._tmpVectorForPickCompare),this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x),Math.abs(this._tmpVectorForPickCompare.y),Math.abs(this._tmpVectorForPickCompare.z));var n=.01*(this._options.gazeModePointerMovedFactor||1)*t.distance;return this._tmpVectorForPickCompare.length()>n},t.prototype._updatePointerDistance=function(e,t){void 0===t&&(t=100),e.scaling.y=t,this._scene.useRightHandedSystem&&(t*=-1),e.position.z=t/2+.05},Object.defineProperty(t.prototype,"lasterPointerDefaultColor",{get:function(){return this.laserPointerDefaultColor},enumerable:!1,configurable:!0}),t._idCounter=0,t.Name=i.WebXRFeatureName.POINTER_SELECTION,t.Version=1,t}(f.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(m.Name,(function(e,t){return function(){return new m(e,t)}}),m.Version,!0)},"./XR/features/WebXRControllerTeleportation.ts":
- /*!*****************************************************!*\
- !*** ./XR/features/WebXRControllerTeleportation.ts ***!
- \*****************************************************/
- /*! exports provided: WebXRMotionControllerTeleportation */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRMotionControllerTeleportation",(function(){return M}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../motionController/webXRControllerComponent */"./XR/motionController/webXRControllerComponent.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Culling/ray */"./Culling/ray.ts"),l=r(/*! ../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),c=r(/*! ../../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),u=r(/*! ../../Animations/easing */"./Animations/easing.ts"),d=r(/*! ../../Animations/animation */"./Animations/animation.ts"),h=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts"),f=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),p=r(/*! ../../Meshes/Builders/groundBuilder */"./Meshes/Builders/groundBuilder.ts"),m=r(/*! ../../Meshes/Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),g=r(/*! ../../Maths/math.path */"./Maths/math.path.ts"),_=r(/*! ../../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),v=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),y=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),b=r(/*! ../../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),A=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),T=r(/*! ../../Misc/timer */"./Misc/timer.ts"),M=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n._controllers={},n._snappedToPoint=!1,n._tmpRay=new a.Ray(new s.Vector3,new s.Vector3),n._tmpVector=new s.Vector3,n.backwardsMovementEnabled=!0,n.backwardsTeleportationDistance=.7,n.parabolicCheckRadius=5,n.parabolicRayEnabled=!0,n.rotationAngle=Math.PI/8,n.rotationEnabled=!0,n._attachController=function(e){if(!n._controllers[e.uniqueId]){n._controllers[e.uniqueId]={xrController:e,teleportationState:{forward:!1,backwards:!1,rotating:!1,currentRotation:0,baseRotation:0}};var t=n._controllers[e.uniqueId];"tracked-pointer"===t.xrController.inputSource.targetRayMode&&t.xrController.inputSource.gamepad?e.onMotionControllerInitObservable.addOnce((function(){if(e.motionController){var r=e.motionController.getComponentOfType(o.WebXRControllerComponent.THUMBSTICK_TYPE)||e.motionController.getComponentOfType(o.WebXRControllerComponent.TOUCHPAD_TYPE);if(!r||n._options.useMainComponentOnly){var i=e.motionController.getMainComponent();if(!i)return;t.onButtonChangedObserver=i.onButtonStateChangedObservable.add((function(){if(i.changes.pressed)if(i.changes.pressed.current){t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0;var r=n._options.timeToTeleport||3e3;Object(T.setAndStartTimer)({timeout:r,contextObservable:n._xrSessionManager.onXRFrameObservable,breakCondition:function(){return!i.pressed},onEnded:function(){n._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&n._teleportForward(e.uniqueId)}})}else t.teleportationState.forward=!1,n._currentTeleportationControllerId=""}))}else t.onAxisChangedObserver=r.onAxisValueChangedObservable.add((function(r){if(r.y<=.7&&t.teleportationState.backwards&&(t.teleportationState.backwards=!1),r.y>.7&&!t.teleportationState.forward&&n.backwardsMovementEnabled&&!n.snapPointsOnly&&!t.teleportationState.backwards){t.teleportationState.backwards=!0,n._tmpVector.set(0,0,n.backwardsTeleportationDistance*(n._xrSessionManager.scene.useRightHandedSystem?-1:1)),n._tmpVector.rotateByQuaternionToRef(n._options.xrInput.xrCamera.rotationQuaternion,n._tmpVector),n._tmpVector.addInPlace(n._options.xrInput.xrCamera.position),n._options.xrInput.xrCamera.position.subtractToRef(n._tmpVector,n._tmpVector),n._tmpRay.origin.copyFrom(n._tmpVector),n._tmpRay.direction.set(0,n._xrSessionManager.scene.useRightHandedSystem?1:-1,0);var i=n._xrSessionManager.scene.pickWithRay(n._tmpRay,(function(e){return-1!==n._floorMeshes.indexOf(e)}));i&&i.pickedPoint&&n._options.xrInput.xrCamera.position.addInPlace(i.pickedPoint)}if(r.y<-.7&&!n._currentTeleportationControllerId&&!t.teleportationState.rotating&&(t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y),r.x){if(t.teleportationState.forward)n._currentTeleportationControllerId===t.xrController.uniqueId&&(n.rotationEnabled?setTimeout((function(){t.teleportationState.currentRotation=Math.atan2(r.x,r.y*(n._xrSessionManager.scene.useRightHandedSystem?1:-1))})):t.teleportationState.currentRotation=0);else if(!t.teleportationState.rotating&&Math.abs(r.x)>.7){t.teleportationState.rotating=!0;var o=n.rotationAngle*(r.x>0?1:-1)*(n._xrSessionManager.scene.useRightHandedSystem?-1:1);n._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(s.Quaternion.FromEulerAngles(0,o,0))}}else t.teleportationState.rotating=!1;0===r.x&&0===r.y&&t.teleportationState.forward&&n._teleportForward(e.uniqueId)}))}})):n._xrSessionManager.scene.onPointerObservable.add((function(r){if(r.type===A.PointerEventTypes.POINTERDOWN){t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0;var i=n._options.timeToTeleport||3e3;Object(T.setAndStartTimer)({timeout:i,contextObservable:n._xrSessionManager.onXRFrameObservable,onEnded:function(){n._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&n._teleportForward(e.uniqueId)}})}else r.type===A.PointerEventTypes.POINTERUP&&(t.teleportationState.forward=!1,n._currentTeleportationControllerId="")}))}},n._options.teleportationTargetMesh||n._createDefaultTargetMesh(),n._floorMeshes=n._options.floorMeshes||[],n._snapToPositions=n._options.snapPositions||[],n._setTargetMeshVisibility(!1),n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"snapPointsOnly",{get:function(){return!!this._options.snapPointsOnly},set:function(e){this._options.snapPointsOnly=e},enumerable:!1,configurable:!0}),t.prototype.addFloorMesh=function(e){this._floorMeshes.push(e)},t.prototype.addSnapPoint=function(e){this._snapToPositions.push(e)},t.prototype.attach=function(){var t=this;return!!e.prototype.attach.call(this)&&(this._currentTeleportationControllerId="",this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,(function(e){t._detachController(e.uniqueId)})),!0)},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach((function(e){t._detachController(e)})),this._setTargetMeshVisibility(!1),this._currentTeleportationControllerId="",!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.dispose(!1,!0)},t.prototype.removeFloorMesh=function(e){var t=this._floorMeshes.indexOf(e);-1!==t&&this._floorMeshes.splice(t,1)},t.prototype.removeFloorMeshByName=function(e){var t=this._xrSessionManager.scene.getMeshByName(e);t&&this.removeFloorMesh(t)},t.prototype.removeSnapPoint=function(e){var t=this._snapToPositions.indexOf(e);if(-1===t)for(var r=0;r<this._snapToPositions.length;++r)if(this._snapToPositions[r].equals(e)){t=r;break}return-1!==t&&(this._snapToPositions.splice(t,1),!0)},t.prototype.setSelectionFeature=function(e){this._selectionFeature=e},t.prototype._onXRFrame=function(e){var t=this,r=this._xrSessionManager.currentFrame,n=this._xrSessionManager.scene;if(this.attach&&r){var i=this._options.teleportationTargetMesh;if(this._currentTeleportationControllerId){if(!i)return;i.rotationQuaternion=i.rotationQuaternion||new s.Quaternion;var o=this._controllers[this._currentTeleportationControllerId];if(o.teleportationState.forward){s.Quaternion.RotationYawPitchRollToRef(o.teleportationState.currentRotation+o.teleportationState.baseRotation,0,0,i.rotationQuaternion);var a=!1;o.xrController.getWorldPointerRayToRef(this._tmpRay);var l=n.pickWithRay(this._tmpRay,(function(e){var r=t._floorMeshes.indexOf(e);return-1!==r&&t._floorMeshes[r].absolutePosition.y<t._options.xrInput.xrCamera.position.y}));if(l&&l.pickedPoint)a=!0,this._setTargetMeshPosition(l.pickedPoint),this._setTargetMeshVisibility(!0),this._showParabolicPath(l);else if(this.parabolicRayEnabled){var c=o.xrController.pointer.rotationQuaternion.toEulerAngles().x,u=Math.PI/2-Math.abs(c)+1,d=this.parabolicCheckRadius*u;this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(2*d),this._tmpVector),this._tmpVector.y=this._tmpRay.origin.y,this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(d)),this._tmpVector.subtractToRef(this._tmpRay.origin,this._tmpRay.direction),this._tmpRay.direction.normalize();var h=n.pickWithRay(this._tmpRay,(function(e){return-1!==t._floorMeshes.indexOf(e)}));h&&h.pickedPoint&&(a=!0,this._setTargetMeshPosition(h.pickedPoint),this._setTargetMeshVisibility(!0),this._showParabolicPath(h))}this._setTargetMeshVisibility(a)}else this._setTargetMeshVisibility(!1)}else this._setTargetMeshVisibility(!1)}},t.prototype._createDefaultTargetMesh=function(){this._options.defaultTargetMeshOptions=this._options.defaultTargetMeshOptions||{};var e=this._options.useUtilityLayer?this._options.customUtilityLayerScene||b.UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene:this._xrSessionManager.scene,t=p.GroundBuilder.CreateGround("teleportationTarget",{width:2,height:2,subdivisions:2},e);t.isPickable=!1;var r=new l.DynamicTexture("teleportationPlaneDynamicTexture",512,e,!0);r.hasAlpha=!0;var n=r.getContext();n.beginPath(),n.arc(256,256,200,0,2*Math.PI,!1),n.fillStyle=this._options.defaultTargetMeshOptions.teleportationFillColor||"#444444",n.fill(),n.lineWidth=10,n.strokeStyle=this._options.defaultTargetMeshOptions.teleportationBorderColor||"#FFFFFF",n.stroke(),n.closePath(),r.update();var i=new f.StandardMaterial("teleportationPlaneMaterial",e);i.diffuseTexture=r,t.material=i;var o=m.TorusBuilder.CreateTorus("torusTeleportation",{diameter:.75,thickness:.1,tessellation:20},e);if(o.isPickable=!1,o.parent=t,!this._options.defaultTargetMeshOptions.disableAnimation){var s=new d.Animation("animationInnerCircle","position.y",30,d.Animation.ANIMATIONTYPE_FLOAT,d.Animation.ANIMATIONLOOPMODE_CYCLE),a=[];a.push({frame:0,value:0}),a.push({frame:30,value:.4}),a.push({frame:60,value:0}),s.setKeys(a);var g=new u.SineEase;g.setEasingMode(u.EasingFunction.EASINGMODE_EASEINOUT),s.setEasingFunction(g),o.animations=[],o.animations.push(s),e.beginAnimation(o,0,60,!0)}var _=c.CylinderBuilder.CreateCylinder("cone",{diameterTop:0,tessellation:4},e);if(_.isPickable=!1,_.scaling.set(.5,.12,.2),_.rotate(h.Axis.X,Math.PI/2),_.position.z=.6,_.parent=o,this._options.defaultTargetMeshOptions.torusArrowMaterial)o.material=this._options.defaultTargetMeshOptions.torusArrowMaterial,_.material=this._options.defaultTargetMeshOptions.torusArrowMaterial;else{var v=new f.StandardMaterial("torusConsMat",e);v.disableLighting=!!this._options.defaultTargetMeshOptions.disableLighting,v.disableLighting?v.emissiveColor=new y.Color3(.3,.3,1):v.diffuseColor=new y.Color3(.3,.3,1),v.alpha=.9,o.material=v,_.material=v,this._teleportationRingMaterial=v}void 0!==this._options.renderingGroupId&&(t.renderingGroupId=this._options.renderingGroupId,o.renderingGroupId=this._options.renderingGroupId,_.renderingGroupId=this._options.renderingGroupId),this._options.teleportationTargetMesh=t},t.prototype._detachController=function(e){var t=this._controllers[e];t&&(t.teleportationComponent&&(t.onAxisChangedObserver&&t.teleportationComponent.onAxisValueChangedObservable.remove(t.onAxisChangedObserver),t.onButtonChangedObserver&&t.teleportationComponent.onButtonStateChangedObservable.remove(t.onButtonChangedObserver)),delete this._controllers[e])},t.prototype._findClosestSnapPointWithRadius=function(e,t){void 0===t&&(t=this._options.snapToPositionRadius||.8);var r=null,n=Number.MAX_VALUE;if(this._snapToPositions.length){var i=t*t;this._snapToPositions.forEach((function(t){var o=s.Vector3.DistanceSquared(t,e);o<=i&&o<n&&(n=o,r=t)}))}return r},t.prototype._setTargetMeshPosition=function(e){if(this._options.teleportationTargetMesh){var t=this._findClosestSnapPointWithRadius(e);this._snappedToPoint=!!t,this.snapPointsOnly&&!this._snappedToPoint&&this._teleportationRingMaterial?this._teleportationRingMaterial.diffuseColor.set(1,.3,.3):this.snapPointsOnly&&this._snappedToPoint&&this._teleportationRingMaterial&&this._teleportationRingMaterial.diffuseColor.set(.3,.3,1),this._options.teleportationTargetMesh.position.copyFrom(t||e),this._options.teleportationTargetMesh.position.y+=.01}},t.prototype._setTargetMeshVisibility=function(e){this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.isVisible!==e&&(this._options.teleportationTargetMesh.isVisible=e,this._options.teleportationTargetMesh.getChildren(void 0,!1).forEach((function(t){t.isVisible=e})),e?this._selectionFeature&&this._selectionFeature.detach():(this._quadraticBezierCurve&&this._quadraticBezierCurve.dispose(),this._selectionFeature&&this._selectionFeature.attach()))},t.prototype._showParabolicPath=function(e){if(e.pickedPoint){var t=this._controllers[this._currentTeleportationControllerId],r=g.Curve3.CreateQuadraticBezier(t.xrController.pointer.absolutePosition,e.ray.origin,e.pickedPoint,25);this._quadraticBezierCurve&&this._quadraticBezierCurve.dispose(),this._quadraticBezierCurve=_.LinesBuilder.CreateLines("path line",{points:r.getPoints()}),this._quadraticBezierCurve.isPickable=!1}},t.prototype._teleportForward=function(e){var t=this._controllers[e];if(t.teleportationState.forward&&(t.teleportationState.forward=!1,this._currentTeleportationControllerId="",(!this.snapPointsOnly||this._snappedToPoint)&&this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.isVisible)){var r=this._options.xrInput.xrCamera.realWorldHeight;this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position),this._options.xrInput.xrCamera.position.y+=r,this._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(s.Quaternion.FromEulerAngles(0,t.teleportationState.currentRotation-(this._xrSessionManager.scene.useRightHandedSystem?Math.PI:0),0))}},t.Name=i.WebXRFeatureName.TELEPORTATION,t.Version=1,t}(v.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(M.Name,(function(e,t){return function(){return new M(e,t)}}),M.Version,!0)},"./XR/features/WebXRHitTest.ts":
- /*!*************************************!*\
- !*** ./XR/features/WebXRHitTest.ts ***!
- \*************************************/
- /*! exports provided: WebXRHitTest */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRHitTest",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),l=r(/*! ../../Misc/tools */"./Misc/tools.ts"),c=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this,t)||this;return n.options=r,n._tmpMat=new s.Matrix,n._tmpPos=new s.Vector3,n._tmpQuat=new s.Quaternion,n.initHitTestSource=function(e){if(e){var t=new XRRay(n.options.offsetRay||{}),r={space:n.options.useReferenceSpace?e:n._xrSessionManager.viewerReferenceSpace,offsetRay:t};r.space?n._xrSessionManager.session.requestHitTestSource(r).then((function(e){n._xrHitTestSource&&n._xrHitTestSource.cancel(),n._xrHitTestSource=e})):l.Tools.Warn("waiting for viewer reference space to initialize")}},n.autoCloneTransformation=!1,n.onHitTestResultObservable=new o.Observable,n.paused=!1,n.xrNativeFeatureName="hit-test",l.Tools.Warn("Hit test is an experimental and unstable feature."),n}return Object(n.__extends)(t,e),t.prototype.attach=function(){var t=this;if(!e.prototype.attach.call(this))return!1;if(!this._xrSessionManager.session.requestHitTestSource)return!1;if(this.options.disablePermanentHitTest||(this._xrSessionManager.referenceSpace&&this.initHitTestSource(this._xrSessionManager.referenceSpace),this._xrSessionManager.onXRReferenceSpaceChanged.add(this.initHitTestSource)),this.options.enableTransientHitTest){var r=new XRRay(this.options.transientOffsetRay||{});this._xrSessionManager.session.requestHitTestSourceForTransientInput({profile:"generic-touchscreen",offsetRay:r}).then((function(e){t._transientXrHitTestSource=e}))}return!0},t.prototype.detach=function(){return!!e.prototype.detach.call(this)&&(this._xrHitTestSource&&(this._xrHitTestSource.cancel(),this._xrHitTestSource=null),this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this.initHitTestSource),this._transientXrHitTestSource&&(this._transientXrHitTestSource.cancel(),this._transientXrHitTestSource=null),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&!this.paused){if(this._xrHitTestSource){var r=e.getHitTestResults(this._xrHitTestSource);r.length&&this._processWebXRHitTestResult(r)}this._transientXrHitTestSource&&e.getHitTestResultsForTransientInput(this._transientXrHitTestSource).forEach((function(e){e.results.length>0&&t._processWebXRHitTestResult(e.results,e.inputSource)}))}},t.prototype._processWebXRHitTestResult=function(e,t){var r=this,n=[];e.forEach((function(e){var i=e.getPose(r._xrSessionManager.referenceSpace);if(i){var o=i.transform.position,a=i.transform.orientation;r._tmpPos.set(o.x,o.y,o.z),r._tmpQuat.set(a.x,a.y,a.z,a.w),s.Matrix.FromFloat32ArrayToRefScaled(i.transform.matrix,0,1,r._tmpMat),r._xrSessionManager.scene.useRightHandedSystem||(r._tmpPos.z*=-1,r._tmpQuat.z*=-1,r._tmpQuat.w*=-1,r._tmpMat.toggleModelMatrixHandInPlace());var l={position:r.autoCloneTransformation?r._tmpPos.clone():r._tmpPos,rotationQuaternion:r.autoCloneTransformation?r._tmpQuat.clone():r._tmpQuat,transformationMatrix:r.autoCloneTransformation?r._tmpMat.clone():r._tmpMat,inputSource:t,isTransient:!!t,xrHitResult:e};n.push(l)}})),n.length&&this.onHitTestResultObservable.notifyObservers(n)},t.Name=i.WebXRFeatureName.HIT_TEST,t.Version=2,t}(a.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(c.Name,(function(e,t){return function(){return new c(e,t)}}),c.Version,!1)},"./XR/features/WebXRHitTestLegacy.ts":
- /*!*******************************************!*\
- !*** ./XR/features/WebXRHitTestLegacy.ts ***!
- \*******************************************/
- /*! exports provided: WebXRHitTestLegacy */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRHitTestLegacy",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),l=r(/*! ../../Misc/tools */"./Misc/tools.ts"),c=function(e){function t(r,n){void 0===n&&(n={});var i=e.call(this,r)||this;return i.options=n,i._direction=new s.Vector3(0,0,-1),i._mat=new s.Matrix,i._onSelectEnabled=!1,i._origin=new s.Vector3(0,0,0),i.lastNativeXRHitResults=[],i.onHitTestResultObservable=new o.Observable,i._onHitTestResults=function(e){var t=e.map((function(e){var t=s.Matrix.FromArray(e.hitMatrix);return i._xrSessionManager.scene.useRightHandedSystem||t.toggleModelMatrixHandInPlace(),i.options.worldParentNode&&t.multiplyToRef(i.options.worldParentNode.getWorldMatrix(),t),{xrHitResult:e,transformationMatrix:t}}));i.lastNativeXRHitResults=e,i.onHitTestResultObservable.notifyObservers(t)},i._onSelect=function(e){i._onSelectEnabled&&t.XRHitTestWithSelectEvent(e,i._xrSessionManager.referenceSpace)},i.xrNativeFeatureName="hit-test",l.Tools.Warn("A newer version of this plugin is available"),i}return Object(n.__extends)(t,e),t.XRHitTestWithRay=function(e,t,r,n){return e.requestHitTest(t,r).then((function(e){var t=n||function(e){return!!e.hitMatrix};return e.filter(t)}))},t.XRHitTestWithSelectEvent=function(e,t){var r=e.frame.getPose(e.inputSource.targetRaySpace,t);if(!r)return Promise.resolve([]);var n=new XRRay(r.transform);return this.XRHitTestWithRay(e.frame.session,n,t)},t.prototype.attach=function(){return!!e.prototype.attach.call(this)&&(this.options.testOnPointerDownOnly&&this._xrSessionManager.session.addEventListener("select",this._onSelect,!1),!0)},t.prototype.detach=function(){return!!e.prototype.detach.call(this)&&(this._onSelectEnabled=!1,this._xrSessionManager.session.removeEventListener("select",this._onSelect),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onHitTestResultObservable.clear()},t.prototype._onXRFrame=function(e){if(this.attached&&!this.options.testOnPointerDownOnly){var r=e.getViewerPose(this._xrSessionManager.referenceSpace);if(r){s.Matrix.FromArrayToRef(r.transform.matrix,0,this._mat),s.Vector3.TransformCoordinatesFromFloatsToRef(0,0,0,this._mat,this._origin),s.Vector3.TransformCoordinatesFromFloatsToRef(0,0,-1,this._mat,this._direction),this._direction.subtractInPlace(this._origin),this._direction.normalize();var n=new XRRay({x:this._origin.x,y:this._origin.y,z:this._origin.z,w:0},{x:this._direction.x,y:this._direction.y,z:this._direction.z,w:0});t.XRHitTestWithRay(this._xrSessionManager.session,n,this._xrSessionManager.referenceSpace).then(this._onHitTestResults)}}},t.Name=i.WebXRFeatureName.HIT_TEST,t.Version=1,t}(a.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(c.Name,(function(e,t){return function(){return new c(e,t)}}),c.Version,!1)},"./XR/features/WebXRPlaneDetector.ts":
- /*!*******************************************!*\
- !*** ./XR/features/WebXRPlaneDetector.ts ***!
- \*******************************************/
- /*! exports provided: WebXRPlaneDetector */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRPlaneDetector",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),l=0,c=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this,t)||this;return n._options=r,n._detectedPlanes=[],n._enabled=!1,n._lastFrameDetected=new Set,n.onPlaneAddedObservable=new o.Observable,n.onPlaneRemovedObservable=new o.Observable,n.onPlaneUpdatedObservable=new o.Observable,n._xrSessionManager.session?n._init():n._xrSessionManager.onXRSessionInit.addOnce((function(){n._init()})),n}return Object(n.__extends)(t,e),t.prototype.detach=function(){if(!e.prototype.detach.call(this))return!1;if(!this._options.doNotRemovePlanesOnSessionEnded)for(;this._detectedPlanes.length;){var t=this._detectedPlanes.pop();t&&this.onPlaneRemovedObservable.notifyObservers(t)}return!0},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onPlaneAddedObservable.clear(),this.onPlaneRemovedObservable.clear(),this.onPlaneUpdatedObservable.clear()},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&this._enabled&&e){var r=e.worldInformation.detectedPlanes;if(r){var n=this._detectedPlanes.filter((function(e){return!r.has(e.xrPlane)})).map((function(e){return t._detectedPlanes.indexOf(e)})),i=0;n.forEach((function(e){var r=t._detectedPlanes.splice(e-i,1)[0];t.onPlaneRemovedObservable.notifyObservers(r),i--})),r.forEach((function(r){if(t._lastFrameDetected.has(r)){if(r.lastChangedTime===t._xrSessionManager.currentTimestamp){var n=t.findIndexInPlaneArray(r);o=t._detectedPlanes[n],t._updatePlaneWithXRPlane(r,o,e),t.onPlaneUpdatedObservable.notifyObservers(o)}}else{var i={id:l++,xrPlane:r,polygonDefinition:[]},o=t._updatePlaneWithXRPlane(r,i,e);t._detectedPlanes.push(o),t.onPlaneAddedObservable.notifyObservers(o)}})),this._lastFrameDetected=r}}},t.prototype._init=function(){this._xrSessionManager.session.updateWorldTrackingState&&(this._xrSessionManager.session.updateWorldTrackingState({planeDetectionState:{enabled:!0}}),this._enabled=!0,this._detectedPlanes.length&&(this._detectedPlanes=[]))},t.prototype._updatePlaneWithXRPlane=function(e,t,r){var n=this;t.polygonDefinition=e.polygon.map((function(e){var t=n._xrSessionManager.scene.useRightHandedSystem?1:-1;return new s.Vector3(e.x,e.y,e.z*t)}));var i=r.getPose(e.planeSpace,this._xrSessionManager.referenceSpace);if(i){var o=t.transformationMatrix||new s.Matrix;s.Matrix.FromArrayToRef(i.transform.matrix,0,o),this._xrSessionManager.scene.useRightHandedSystem||o.toggleModelMatrixHandInPlace(),t.transformationMatrix=o,this._options.worldParentNode&&o.multiplyToRef(this._options.worldParentNode.getWorldMatrix(),o)}return t},t.prototype.findIndexInPlaneArray=function(e){for(var t=0;t<this._detectedPlanes.length;++t)if(this._detectedPlanes[t].xrPlane===e)return t;return-1},t.Name=i.WebXRFeatureName.PLANE_DETECTION,t.Version=1,t}(a.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(c.Name,(function(e,t){return function(){return new c(e,t)}}),c.Version)},"./XR/features/index.ts":
- /*!******************************!*\
- !*** ./XR/features/index.ts ***!
- \******************************/
- /*! exports provided: WebXRHitTestLegacy, WebXRAnchorSystem, WebXRPlaneDetector, WebXRBackgroundRemover, WebXRMotionControllerTeleportation, WebXRControllerPointerSelection, IWebXRControllerPhysicsOptions, WebXRControllerPhysics, WebXRHitTest */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./WebXRHitTestLegacy */"./XR/features/WebXRHitTestLegacy.ts");r.d(t,"WebXRHitTestLegacy",(function(){return n.WebXRHitTestLegacy}));var i=r(/*! ./WebXRAnchorSystem */"./XR/features/WebXRAnchorSystem.ts");r.d(t,"WebXRAnchorSystem",(function(){return i.WebXRAnchorSystem}));var o=r(/*! ./WebXRPlaneDetector */"./XR/features/WebXRPlaneDetector.ts");r.d(t,"WebXRPlaneDetector",(function(){return o.WebXRPlaneDetector}));var s=r(/*! ./WebXRBackgroundRemover */"./XR/features/WebXRBackgroundRemover.ts");r.d(t,"WebXRBackgroundRemover",(function(){return s.WebXRBackgroundRemover}));var a=r(/*! ./WebXRControllerTeleportation */"./XR/features/WebXRControllerTeleportation.ts");r.d(t,"WebXRMotionControllerTeleportation",(function(){return a.WebXRMotionControllerTeleportation}));var l=r(/*! ./WebXRControllerPointerSelection */"./XR/features/WebXRControllerPointerSelection.ts");r.d(t,"WebXRControllerPointerSelection",(function(){return l.WebXRControllerPointerSelection}));var c=r(/*! ./WebXRControllerPhysics */"./XR/features/WebXRControllerPhysics.ts");r.d(t,"IWebXRControllerPhysicsOptions",(function(){return c.IWebXRControllerPhysicsOptions})),r.d(t,"WebXRControllerPhysics",(function(){return c.WebXRControllerPhysics}));var u=r(/*! ./WebXRHitTest */"./XR/features/WebXRHitTest.ts");r.d(t,"WebXRHitTest",(function(){return u.WebXRHitTest}))},"./XR/index.ts":
- /*!*********************!*\
- !*** ./XR/index.ts ***!
- \*********************/
- /*! exports provided: WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRExperienceHelper, WebXRInput, WebXRInputSource, WebXRManagedOutputCanvasOptions, WebXRManagedOutputCanvas, WebXRState, WebXRSessionManager, WebXRDefaultExperienceOptions, WebXRDefaultExperience, WebXRFeatureName, WebXRFeaturesManager, WebXRHitTestLegacy, WebXRAnchorSystem, WebXRPlaneDetector, WebXRBackgroundRemover, WebXRMotionControllerTeleportation, WebXRControllerPointerSelection, IWebXRControllerPhysicsOptions, WebXRControllerPhysics, WebXRHitTest, WebXRAbstractMotionController, WebXRControllerComponent, WebXRGenericTriggerMotionController, WebXRMicrosoftMixedRealityController, WebXRMotionControllerManager, WebXROculusTouchMotionController, WebXRHTCViveMotionController, WebXRProfiledMotionController */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./webXRCamera */"./XR/webXRCamera.ts");r.d(t,"WebXRCamera",(function(){return n.WebXRCamera}));var i=r(/*! ./webXREnterExitUI */"./XR/webXREnterExitUI.ts");r.d(t,"WebXREnterExitUIButton",(function(){return i.WebXREnterExitUIButton})),r.d(t,"WebXREnterExitUIOptions",(function(){return i.WebXREnterExitUIOptions})),r.d(t,"WebXREnterExitUI",(function(){return i.WebXREnterExitUI}));var o=r(/*! ./webXRExperienceHelper */"./XR/webXRExperienceHelper.ts");r.d(t,"WebXRExperienceHelper",(function(){return o.WebXRExperienceHelper}));var s=r(/*! ./webXRInput */"./XR/webXRInput.ts");r.d(t,"WebXRInput",(function(){return s.WebXRInput}));var a=r(/*! ./webXRInputSource */"./XR/webXRInputSource.ts");r.d(t,"WebXRInputSource",(function(){return a.WebXRInputSource}));var l=r(/*! ./webXRManagedOutputCanvas */"./XR/webXRManagedOutputCanvas.ts");r.d(t,"WebXRManagedOutputCanvasOptions",(function(){return l.WebXRManagedOutputCanvasOptions})),r.d(t,"WebXRManagedOutputCanvas",(function(){return l.WebXRManagedOutputCanvas}));var c=r(/*! ./webXRTypes */"./XR/webXRTypes.ts");r.d(t,"WebXRState",(function(){return c.WebXRState}));var u=r(/*! ./webXRSessionManager */"./XR/webXRSessionManager.ts");r.d(t,"WebXRSessionManager",(function(){return u.WebXRSessionManager}));var d=r(/*! ./webXRDefaultExperience */"./XR/webXRDefaultExperience.ts");r.d(t,"WebXRDefaultExperienceOptions",(function(){return d.WebXRDefaultExperienceOptions})),r.d(t,"WebXRDefaultExperience",(function(){return d.WebXRDefaultExperience}));var h=r(/*! ./webXRFeaturesManager */"./XR/webXRFeaturesManager.ts");r.d(t,"WebXRFeatureName",(function(){return h.WebXRFeatureName})),r.d(t,"WebXRFeaturesManager",(function(){return h.WebXRFeaturesManager}));var f=r(/*! ./features/index */"./XR/features/index.ts");r.d(t,"WebXRHitTestLegacy",(function(){return f.WebXRHitTestLegacy})),r.d(t,"WebXRAnchorSystem",(function(){return f.WebXRAnchorSystem})),r.d(t,"WebXRPlaneDetector",(function(){return f.WebXRPlaneDetector})),r.d(t,"WebXRBackgroundRemover",(function(){return f.WebXRBackgroundRemover})),r.d(t,"WebXRMotionControllerTeleportation",(function(){return f.WebXRMotionControllerTeleportation})),r.d(t,"WebXRControllerPointerSelection",(function(){return f.WebXRControllerPointerSelection})),r.d(t,"IWebXRControllerPhysicsOptions",(function(){return f.IWebXRControllerPhysicsOptions})),r.d(t,"WebXRControllerPhysics",(function(){return f.WebXRControllerPhysics})),r.d(t,"WebXRHitTest",(function(){return f.WebXRHitTest}));var p=r(/*! ./motionController/index */"./XR/motionController/index.ts");r.d(t,"WebXRAbstractMotionController",(function(){return p.WebXRAbstractMotionController})),r.d(t,"WebXRControllerComponent",(function(){return p.WebXRControllerComponent})),r.d(t,"WebXRGenericTriggerMotionController",(function(){return p.WebXRGenericTriggerMotionController})),r.d(t,"WebXRMicrosoftMixedRealityController",(function(){return p.WebXRMicrosoftMixedRealityController})),r.d(t,"WebXRMotionControllerManager",(function(){return p.WebXRMotionControllerManager})),r.d(t,"WebXROculusTouchMotionController",(function(){return p.WebXROculusTouchMotionController})),r.d(t,"WebXRHTCViveMotionController",(function(){return p.WebXRHTCViveMotionController})),r.d(t,"WebXRProfiledMotionController",(function(){return p.WebXRProfiledMotionController}))},"./XR/motionController/index.ts":
- /*!**************************************!*\
- !*** ./XR/motionController/index.ts ***!
- \**************************************/
- /*! exports provided: WebXRAbstractMotionController, WebXRControllerComponent, WebXRGenericTriggerMotionController, WebXRMicrosoftMixedRealityController, WebXRMotionControllerManager, WebXROculusTouchMotionController, WebXRHTCViveMotionController, WebXRProfiledMotionController */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./webXRAbstractMotionController */"./XR/motionController/webXRAbstractMotionController.ts");r.d(t,"WebXRAbstractMotionController",(function(){return n.WebXRAbstractMotionController}));var i=r(/*! ./webXRControllerComponent */"./XR/motionController/webXRControllerComponent.ts");r.d(t,"WebXRControllerComponent",(function(){return i.WebXRControllerComponent}));var o=r(/*! ./webXRGenericMotionController */"./XR/motionController/webXRGenericMotionController.ts");r.d(t,"WebXRGenericTriggerMotionController",(function(){return o.WebXRGenericTriggerMotionController}));var s=r(/*! ./webXRMicrosoftMixedRealityController */"./XR/motionController/webXRMicrosoftMixedRealityController.ts");r.d(t,"WebXRMicrosoftMixedRealityController",(function(){return s.WebXRMicrosoftMixedRealityController}));var a=r(/*! ./webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts");r.d(t,"WebXRMotionControllerManager",(function(){return a.WebXRMotionControllerManager}));var l=r(/*! ./webXROculusTouchMotionController */"./XR/motionController/webXROculusTouchMotionController.ts");r.d(t,"WebXROculusTouchMotionController",(function(){return l.WebXROculusTouchMotionController}));var c=r(/*! ./webXRHTCViveMotionController */"./XR/motionController/webXRHTCViveMotionController.ts");r.d(t,"WebXRHTCViveMotionController",(function(){return c.WebXRHTCViveMotionController}));var u=r(/*! ./webXRProfiledMotionController */"./XR/motionController/webXRProfiledMotionController.ts");r.d(t,"WebXRProfiledMotionController",(function(){return u.WebXRProfiledMotionController}))},"./XR/motionController/webXRAbstractMotionController.ts":
- /*!**************************************************************!*\
- !*** ./XR/motionController/webXRAbstractMotionController.ts ***!
- \**************************************************************/
- /*! exports provided: WebXRAbstractMotionController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRAbstractMotionController",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRControllerComponent */"./XR/motionController/webXRControllerComponent.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),l=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),u=function(){function e(e,t,r,n,s){var a=this;void 0===s&&(s=!1),this.scene=e,this.layout=t,this.gamepadObject=r,this.handedness=n,this._initComponent=function(e){if(e){var t=a.layout.components[e],r=t.type,n=t.gamepadIndices.button,o=[];void 0!==t.gamepadIndices.xAxis&&void 0!==t.gamepadIndices.yAxis&&o.push(t.gamepadIndices.xAxis,t.gamepadIndices.yAxis),a.components[e]=new i.WebXRControllerComponent(e,r,n,o)}},this._modelReady=!1,this.components={},this.disableAnimation=!1,this.onModelLoadedObservable=new o.Observable,t.components&&Object.keys(t.components).forEach(this._initComponent)}return e.prototype.dispose=function(){var e=this;this.getComponentIds().forEach((function(t){return e.getComponent(t).dispose()})),this.rootMesh&&this.rootMesh.dispose()},e.prototype.getAllComponentsOfType=function(e){var t=this;return this.getComponentIds().map((function(e){return t.components[e]})).filter((function(t){return t.type===e}))},e.prototype.getComponent=function(e){return this.components[e]},e.prototype.getComponentIds=function(){return Object.keys(this.components)},e.prototype.getComponentOfType=function(e){return this.getAllComponentsOfType(e)[0]||null},e.prototype.getMainComponent=function(){return this.getComponent(this.layout.selectComponentId)},e.prototype.loadModel=function(){return Object(n.__awaiter)(this,void 0,void 0,(function(){var e,t,r=this;return Object(n.__generator)(this,(function(n){return e=!this._getModelLoadingConstraints(),t=this._getGenericFilenameAndPath(),e?s.Logger.Warn("Falling back to generic models"):t=this._getFilenameAndPath(),[2,new Promise((function(n,i){a.SceneLoader.ImportMesh("",t.path,t.filename,r.scene,(function(t){e?r._getGenericParentMesh(t):r._setRootMesh(t),r._processLoadedModel(t),r._modelReady=!0,r.onModelLoadedObservable.notifyObservers(r),n(!0)}),null,(function(e,n){s.Logger.Log(n),s.Logger.Warn("Failed to retrieve controller model of type "+r.profileId+" from the remote server: "+t.path+t.filename),i(n)}))}))]}))}))},e.prototype.updateFromXRFrame=function(e){var t=this;this.getComponentIds().forEach((function(e){return t.getComponent(e).update(t.gamepadObject)})),this.updateModel(e)},Object.defineProperty(e.prototype,"handness",{get:function(){return this.handedness},enumerable:!1,configurable:!0}),e.prototype.pulse=function(e,t,r){return void 0===r&&(r=0),this.gamepadObject.hapticActuators&&this.gamepadObject.hapticActuators[r]?this.gamepadObject.hapticActuators[r].pulse(e,t):Promise.resolve(!1)},e.prototype._getChildByName=function(e,t){return e.getChildren((function(e){return e.name===t}),!1)[0]},e.prototype._getImmediateChildByName=function(e,t){return e.getChildren((function(e){return e.name==t}),!0)[0]},e.prototype._lerpTransform=function(e,t,r){if(e.minMesh&&e.maxMesh&&e.minMesh.rotationQuaternion&&e.maxMesh.rotationQuaternion&&e.valueMesh.rotationQuaternion){var n=r?.5*t+.5:t;l.Quaternion.SlerpToRef(e.minMesh.rotationQuaternion,e.maxMesh.rotationQuaternion,n,e.valueMesh.rotationQuaternion),l.Vector3.LerpToRef(e.minMesh.position,e.maxMesh.position,n,e.valueMesh.position)}},e.prototype.updateModel=function(e){this._modelReady&&this._updateModel(e)},e.prototype._getGenericFilenameAndPath=function(){return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}},e.prototype._getGenericParentMesh=function(e){var t=this;this.rootMesh=new c.Mesh(this.profileId+" "+this.handedness,this.scene),e.forEach((function(e){e.parent||(e.isPickable=!1,e.setParent(t.rootMesh))})),this.rootMesh.rotationQuaternion=l.Quaternion.FromEulerAngles(0,Math.PI,0)},e}()},"./XR/motionController/webXRControllerComponent.ts":
- /*!*********************************************************!*\
- !*** ./XR/motionController/webXRControllerComponent.ts ***!
- \*********************************************************/
- /*! exports provided: WebXRControllerComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRControllerComponent",(function(){return i}));var n=r(/*! ../../Misc/observable */"./Misc/observable.ts"),i=function(){function e(e,t,r,i){void 0===r&&(r=-1),void 0===i&&(i=[]),this.id=e,this.type=t,this._buttonIndex=r,this._axesIndices=i,this._axes={x:0,y:0},this._changes={},this._currentValue=0,this._hasChanges=!1,this._pressed=!1,this._touched=!1,this.onAxisValueChangedObservable=new n.Observable,this.onButtonStateChangedObservable=new n.Observable}return Object.defineProperty(e.prototype,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changes",{get:function(){return this._changes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasChanges",{get:function(){return this._hasChanges},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pressed",{get:function(){return this._pressed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"touched",{get:function(){return this._touched},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.onAxisValueChangedObservable.clear(),this.onButtonStateChangedObservable.clear()},e.prototype.isAxes=function(){return 0!==this._axesIndices.length},e.prototype.isButton=function(){return-1!==this._buttonIndex},e.prototype.update=function(e){var t=!1,r=!1;if(this._hasChanges=!1,this._changes={},this.isButton()){var n=e.buttons[this._buttonIndex];if(!n)return;this._currentValue!==n.value&&(this.changes.value={current:n.value,previous:this._currentValue},t=!0,this._currentValue=n.value),this._touched!==n.touched&&(this.changes.touched={current:n.touched,previous:this._touched},t=!0,this._touched=n.touched),this._pressed!==n.pressed&&(this.changes.pressed={current:n.pressed,previous:this._pressed},t=!0,this._pressed=n.pressed)}this.isAxes()&&(this._axes.x!==e.axes[this._axesIndices[0]]&&(this.changes.axes={current:{x:e.axes[this._axesIndices[0]],y:this._axes.y},previous:{x:this._axes.x,y:this._axes.y}},this._axes.x=e.axes[this._axesIndices[0]],r=!0),this._axes.y!==e.axes[this._axesIndices[1]]&&(this.changes.axes?this.changes.axes.current.y=e.axes[this._axesIndices[1]]:this.changes.axes={current:{x:this._axes.x,y:e.axes[this._axesIndices[1]]},previous:{x:this._axes.x,y:this._axes.y}},this._axes.y=e.axes[this._axesIndices[1]],r=!0)),t&&(this._hasChanges=!0,this.onButtonStateChangedObservable.notifyObservers(this)),r&&(this._hasChanges=!0,this.onAxisValueChangedObservable.notifyObservers(this._axes))},e.BUTTON_TYPE="button",e.SQUEEZE_TYPE="squeeze",e.THUMBSTICK_TYPE="thumbstick",e.TOUCHPAD_TYPE="touchpad",e.TRIGGER_TYPE="trigger",e}()},"./XR/motionController/webXRGenericMotionController.ts":
- /*!*************************************************************!*\
- !*** ./XR/motionController/webXRGenericMotionController.ts ***!
- \*************************************************************/
- /*! exports provided: WebXRGenericTriggerMotionController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRGenericTriggerMotionController",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRAbstractMotionController */"./XR/motionController/webXRAbstractMotionController.ts"),o=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=function(e){function t(r,n,i){var o=e.call(this,r,l[i],n,i)||this;return o.profileId=t.ProfileId,o}return Object(n.__extends)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:"generic.babylon",path:"https://controllers.babylonjs.com/generic/"}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){},t.prototype._setRootMesh=function(e){var t=this;this.rootMesh=new o.Mesh(this.profileId+" "+this.handedness,this.scene),e.forEach((function(e){e.isPickable=!1,e.parent||e.setParent(t.rootMesh)})),this.rootMesh.rotationQuaternion=s.Quaternion.FromEulerAngles(0,Math.PI,0)},t.prototype._updateModel=function(){},t.ProfileId="generic-trigger",t}(i.WebXRAbstractMotionController),l={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-right",assetPath:"right.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"generic-trigger-none",assetPath:"none.glb"}}},"./XR/motionController/webXRHTCViveMotionController.ts":
- /*!*************************************************************!*\
- !*** ./XR/motionController/webXRHTCViveMotionController.ts ***!
- \*************************************************************/
- /*! exports provided: WebXRHTCViveMotionController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRHTCViveMotionController",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRAbstractMotionController */"./XR/motionController/webXRAbstractMotionController.ts"),o=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts"),l=function(e){function t(t,r,n){var i=e.call(this,t,c[n],r,n)||this;return i.profileId="htc-vive",i}return Object(n.__extends)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:t.MODEL_FILENAME,path:t.MODEL_BASE_URL}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var t=this;this.getComponentIds().forEach((function(e){var r=e&&t.getComponent(e);r&&r.onButtonStateChangedObservable.add((function(r){if(t.rootMesh&&!t.disableAnimation)switch(e){case"xr-standard-trigger":return void(t._modelRootNode.getChildren()[6].rotation.x=.15*-r.value);case"xr-standard-touchpad":case"xr-standard-squeeze":return}}),void 0,!0)}))},t.prototype._setRootMesh=function(e){this.rootMesh=new o.Mesh(this.profileId+" "+this.handedness,this.scene),e.forEach((function(e){e.isPickable=!1})),this._modelRootNode=e[1],this._modelRootNode.parent=this.rootMesh,this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=s.Quaternion.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/vive/",t.MODEL_FILENAME="wand.babylon",t}(i.WebXRAbstractMotionController);a.WebXRMotionControllerManager.RegisterController("htc-vive",(function(e,t){return new l(t,e.gamepad,e.handedness)}));var c={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc_vive_none",assetPath:"none.glb"},none:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{}},menu:{type:"button",gamepadIndices:{button:4},rootNodeName:"menu",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"htc-vive-none",assetPath:"none.glb"}}},"./XR/motionController/webXRMicrosoftMixedRealityController.ts":
- /*!*********************************************************************!*\
- !*** ./XR/motionController/webXRMicrosoftMixedRealityController.ts ***!
- \*********************************************************************/
- /*! exports provided: WebXRMicrosoftMixedRealityController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRMicrosoftMixedRealityController",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRAbstractMotionController */"./XR/motionController/webXRAbstractMotionController.ts"),o=r(/*! ./webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts"),s=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),c=r(/*! ../../Misc/logger */"./Misc/logger.ts"),u=function(e){function t(t,r,n){var i=e.call(this,t,d["left-right"],r,n)||this;return i._mapping={defaultButton:{valueNodeName:"VALUE",unpressedNodeName:"UNPRESSED",pressedNodeName:"PRESSED"},defaultAxis:{valueNodeName:"VALUE",minNodeName:"MIN",maxNodeName:"MAX"},buttons:{"xr-standard-trigger":{rootNodeName:"SELECT",componentProperty:"button",states:["default","touched","pressed"]},"xr-standard-squeeze":{rootNodeName:"GRASP",componentProperty:"state",states:["pressed"]},"xr-standard-touchpad":{rootNodeName:"TOUCHPAD_PRESS",labelAnchorNodeName:"squeeze-label",touchPointNodeName:"TOUCH"},"xr-standard-thumbstick":{rootNodeName:"THUMBSTICK_PRESS",componentProperty:"state",states:["pressed"]}},axes:{"xr-standard-touchpad":{"x-axis":{rootNodeName:"TOUCHPAD_TOUCH_X"},"y-axis":{rootNodeName:"TOUCHPAD_TOUCH_Y"}},"xr-standard-thumbstick":{"x-axis":{rootNodeName:"THUMBSTICK_X"},"y-axis":{rootNodeName:"THUMBSTICK_Y"}}}},i.profileId="microsoft-mixed-reality",i}return Object(n.__extends)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:"left"===this.handedness?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,path:t.MODEL_BASE_URL+"default/"}},t.prototype._getModelLoadingConstraints=function(){var e=l.SceneLoader.IsPluginForExtensionAvailable(".glb");return e||c.Logger.Warn("glTF / glb loaded was not registered, using generic controller instead"),e},t.prototype._processLoadedModel=function(e){var t=this;this.rootMesh&&(this.getComponentIds().forEach((function(e,r){if(!t.disableAnimation&&e&&t.rootMesh){var n=t._mapping.buttons[e],i=n.rootNodeName;if(!i)return void c.Logger.Log("Skipping unknown button at index: "+r+" with mapped name: "+e);var o=t._getChildByName(t.rootMesh,i);if(!o)return void c.Logger.Warn("Missing button mesh with name: "+i);if(n.valueMesh=t._getImmediateChildByName(o,t._mapping.defaultButton.valueNodeName),n.pressedMesh=t._getImmediateChildByName(o,t._mapping.defaultButton.pressedNodeName),n.unpressedMesh=t._getImmediateChildByName(o,t._mapping.defaultButton.unpressedNodeName),n.valueMesh&&n.pressedMesh&&n.unpressedMesh){var s=t.getComponent(e);s&&s.onButtonStateChangedObservable.add((function(e){t._lerpTransform(n,e.value)}),void 0,!0)}else c.Logger.Warn("Missing button submesh under mesh with name: "+i)}})),this.getComponentIds().forEach((function(e,r){var n=t.getComponent(e);n.isAxes()&&["x-axis","y-axis"].forEach((function(r){if(t.rootMesh){var i=t._mapping.axes[e][r],o=t._getChildByName(t.rootMesh,i.rootNodeName);o?(i.valueMesh=t._getImmediateChildByName(o,t._mapping.defaultAxis.valueNodeName),i.minMesh=t._getImmediateChildByName(o,t._mapping.defaultAxis.minNodeName),i.maxMesh=t._getImmediateChildByName(o,t._mapping.defaultAxis.maxNodeName),i.valueMesh&&i.minMesh&&i.maxMesh?n&&n.onAxisValueChangedObservable.add((function(e){var n="x-axis"===r?e.x:e.y;t._lerpTransform(i,n,!0)}),void 0,!0):c.Logger.Warn("Missing axis submesh under mesh with name: "+i.rootNodeName)):c.Logger.Warn("Missing axis mesh with name: "+i.rootNodeName)}}))})))},t.prototype._setRootMesh=function(e){var t;this.rootMesh=new s.Mesh(this.profileId+" "+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(var r=0;r<e.length;r++){var n=e[r];n.isPickable=!1,n.parent||(t=n)}t&&t.setParent(this.rootMesh),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=a.Quaternion.FromEulerAngles(0,Math.PI,0))},t.prototype._updateModel=function(){},t.MODEL_BASE_URL="https://controllers.babylonjs.com/microsoft/",t.MODEL_LEFT_FILENAME="left.glb",t.MODEL_RIGHT_FILENAME="right.glb",t}(i.WebXRAbstractMotionController);o.WebXRMotionControllerManager.RegisterController("windows-mixed-reality",(function(e,t){return new u(t,e.gamepad,e.handedness)}));var d={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{xr_standard_trigger_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_trigger_pressed_value",minNodeName:"xr_standard_trigger_pressed_min",maxNodeName:"xr_standard_trigger_pressed_max"}}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{xr_standard_squeeze_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_squeeze_pressed_value",minNodeName:"xr_standard_squeeze_pressed_min",maxNodeName:"xr_standard_squeeze_pressed_max"}}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{xr_standard_touchpad_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_pressed_value",minNodeName:"xr_standard_touchpad_pressed_min",maxNodeName:"xr_standard_touchpad_pressed_max"},xr_standard_touchpad_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_pressed_value",minNodeName:"xr_standard_touchpad_xaxis_pressed_min",maxNodeName:"xr_standard_touchpad_xaxis_pressed_max"},xr_standard_touchpad_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_pressed_value",minNodeName:"xr_standard_touchpad_yaxis_pressed_min",maxNodeName:"xr_standard_touchpad_yaxis_pressed_max"},xr_standard_touchpad_xaxis_touched:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_touched_value",minNodeName:"xr_standard_touchpad_xaxis_touched_min",maxNodeName:"xr_standard_touchpad_xaxis_touched_max"},xr_standard_touchpad_yaxis_touched:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_touched_value",minNodeName:"xr_standard_touchpad_yaxis_touched_min",maxNodeName:"xr_standard_touchpad_yaxis_touched_max"},xr_standard_touchpad_axes_touched:{componentProperty:"state",states:["touched","pressed"],valueNodeProperty:"visibility",valueNodeName:"xr_standard_touchpad_axes_touched_value"}},touchPointNodeName:"xr_standard_touchpad_axes_touched_value"},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{xr_standard_thumbstick_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_pressed_value",minNodeName:"xr_standard_thumbstick_pressed_min",maxNodeName:"xr_standard_thumbstick_pressed_max"},xr_standard_thumbstick_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_xaxis_pressed_value",minNodeName:"xr_standard_thumbstick_xaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_xaxis_pressed_max"},xr_standard_thumbstick_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_yaxis_pressed_value",minNodeName:"xr_standard_thumbstick_yaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_yaxis_pressed_max"}}}},gamepadMapping:"xr-standard",rootNodeName:"microsoft-mixed-reality-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{xr_standard_trigger_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_trigger_pressed_value",minNodeName:"xr_standard_trigger_pressed_min",maxNodeName:"xr_standard_trigger_pressed_max"}}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{xr_standard_squeeze_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_squeeze_pressed_value",minNodeName:"xr_standard_squeeze_pressed_min",maxNodeName:"xr_standard_squeeze_pressed_max"}}},"xr-standard-touchpad":{type:"touchpad",gamepadIndices:{button:2,xAxis:0,yAxis:1},rootNodeName:"xr_standard_touchpad",visualResponses:{xr_standard_touchpad_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_pressed_value",minNodeName:"xr_standard_touchpad_pressed_min",maxNodeName:"xr_standard_touchpad_pressed_max"},xr_standard_touchpad_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_pressed_value",minNodeName:"xr_standard_touchpad_xaxis_pressed_min",maxNodeName:"xr_standard_touchpad_xaxis_pressed_max"},xr_standard_touchpad_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_pressed_value",minNodeName:"xr_standard_touchpad_yaxis_pressed_min",maxNodeName:"xr_standard_touchpad_yaxis_pressed_max"},xr_standard_touchpad_xaxis_touched:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_xaxis_touched_value",minNodeName:"xr_standard_touchpad_xaxis_touched_min",maxNodeName:"xr_standard_touchpad_xaxis_touched_max"},xr_standard_touchpad_yaxis_touched:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_touchpad_yaxis_touched_value",minNodeName:"xr_standard_touchpad_yaxis_touched_min",maxNodeName:"xr_standard_touchpad_yaxis_touched_max"},xr_standard_touchpad_axes_touched:{componentProperty:"state",states:["touched","pressed"],valueNodeProperty:"visibility",valueNodeName:"xr_standard_touchpad_axes_touched_value"}},touchPointNodeName:"xr_standard_touchpad_axes_touched_value"},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{xr_standard_thumbstick_pressed:{componentProperty:"button",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_pressed_value",minNodeName:"xr_standard_thumbstick_pressed_min",maxNodeName:"xr_standard_thumbstick_pressed_max"},xr_standard_thumbstick_xaxis_pressed:{componentProperty:"xAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_xaxis_pressed_value",minNodeName:"xr_standard_thumbstick_xaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_xaxis_pressed_max"},xr_standard_thumbstick_yaxis_pressed:{componentProperty:"yAxis",states:["default","touched","pressed"],valueNodeProperty:"transform",valueNodeName:"xr_standard_thumbstick_yaxis_pressed_value",minNodeName:"xr_standard_thumbstick_yaxis_pressed_min",maxNodeName:"xr_standard_thumbstick_yaxis_pressed_max"}}}},gamepadMapping:"xr-standard",rootNodeName:"microsoft-mixed-reality-right",assetPath:"right.glb"}}},"./XR/motionController/webXRMotionControllerManager.ts":
- /*!*************************************************************!*\
- !*** ./XR/motionController/webXRMotionControllerManager.ts ***!
- \*************************************************************/
- /*! exports provided: WebXRMotionControllerManager */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRMotionControllerManager",(function(){return s}));var n=r(/*! ./webXRGenericMotionController */"./XR/motionController/webXRGenericMotionController.ts"),i=r(/*! ../../Misc/tools */"./Misc/tools.ts"),o=r(/*! ./webXRProfiledMotionController */"./XR/motionController/webXRProfiledMotionController.ts"),s=function(){function e(){}return e.ClearProfilesCache=function(){delete this._ProfilesList,this._ProfileLoadingPromises={}},e.DefaultFallbacks=function(){this.RegisterFallbacksForProfileId("google-daydream",["generic-touchpad"]),this.RegisterFallbacksForProfileId("htc-vive-focus",["generic-trigger-touchpad"]),this.RegisterFallbacksForProfileId("htc-vive",["generic-trigger-squeeze-touchpad"]),this.RegisterFallbacksForProfileId("magicleap-one",["generic-trigger-squeeze-touchpad"]),this.RegisterFallbacksForProfileId("windows-mixed-reality",["generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("microsoft-mixed-reality",["windows-mixed-reality","generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("oculus-go",["generic-trigger-touchpad"]),this.RegisterFallbacksForProfileId("oculus-touch-v2",["oculus-touch","generic-trigger-squeeze-thumbstick"]),this.RegisterFallbacksForProfileId("oculus-touch",["generic-trigger-squeeze-thumbstick"]),this.RegisterFallbacksForProfileId("samsung-gearvr",["windows-mixed-reality","generic-trigger-squeeze-touchpad-thumbstick"]),this.RegisterFallbacksForProfileId("samsung-odyssey",["generic-touchpad"]),this.RegisterFallbacksForProfileId("valve-index",["generic-trigger-squeeze-touchpad-thumbstick"])},e.FindFallbackWithProfileId=function(e){var t=this._Fallbacks[e]||[];return t.unshift(e),t},e.GetMotionControllerWithXRInput=function(e,t,r){var n=this,i=[];if(r&&i.push(r),i.push.apply(i,e.profiles||[]),i.length&&!i[0]&&i.pop(),e.gamepad&&e.gamepad.id)switch(e.gamepad.id){case e.gamepad.id.match(/oculus touch/gi)?e.gamepad.id:void 0:i.push("oculus-touch-v2")}var o=i.indexOf("windows-mixed-reality");if(-1!==o&&i.splice(o,0,"microsoft-mixed-reality"),i.length||i.push("generic-trigger"),this.UseOnlineRepository){var s=this.PrioritizeOnlineRepository?this._LoadProfileFromRepository:this._LoadProfilesFromAvailableControllers,a=this.PrioritizeOnlineRepository?this._LoadProfilesFromAvailableControllers:this._LoadProfileFromRepository;return s.call(this,i,e,t).catch((function(){return a.call(n,i,e,t)}))}return this._LoadProfilesFromAvailableControllers(i,e,t)},e.RegisterController=function(e,t){this._AvailableControllers[e]=t},e.RegisterFallbacksForProfileId=function(e,t){var r;this._Fallbacks[e]?(r=this._Fallbacks[e]).push.apply(r,t):this._Fallbacks[e]=t},e.UpdateProfilesList=function(){return this._ProfilesList=i.Tools.LoadFileAsync(this.BaseRepositoryUrl+"/profiles/profilesList.json",!1).then((function(e){return JSON.parse(e.toString())})),this._ProfilesList},e._LoadProfileFromRepository=function(e,t,r){var n=this;return Promise.resolve().then((function(){return n._ProfilesList?n._ProfilesList:n.UpdateProfilesList()})).then((function(t){for(var r=0;r<e.length;++r)if(e[r]&&t[e[r]])return e[r];throw new Error("neither controller "+e[0]+" nor all fallbacks were found in the repository,")})).then((function(e){return n._ProfileLoadingPromises[e]||(n._ProfileLoadingPromises[e]=i.Tools.LoadFileAsync(n.BaseRepositoryUrl+"/profiles/"+e+"/profile.json",!1).then((function(e){return JSON.parse(e)}))),n._ProfileLoadingPromises[e]})).then((function(e){return new o.WebXRProfiledMotionController(r,t,e,n.BaseRepositoryUrl)}))},e._LoadProfilesFromAvailableControllers=function(e,t,r){for(var n=0;n<e.length;++n)if(e[n])for(var i=this.FindFallbackWithProfileId(e[n]),o=0;o<i.length;++o){var s=this._AvailableControllers[i[o]];if(s)return Promise.resolve(s(t,r))}throw new Error("no controller requested was found in the available controllers list")},e._AvailableControllers={},e._Fallbacks={},e._ProfileLoadingPromises={},e.BaseRepositoryUrl="https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist",e.PrioritizeOnlineRepository=!0,e.UseOnlineRepository=!0,e}();s.RegisterController(n.WebXRGenericTriggerMotionController.ProfileId,(function(e,t){return new n.WebXRGenericTriggerMotionController(t,e.gamepad,e.handedness)})),s.DefaultFallbacks()},"./XR/motionController/webXROculusTouchMotionController.ts":
- /*!*****************************************************************!*\
- !*** ./XR/motionController/webXROculusTouchMotionController.ts ***!
- \*****************************************************************/
- /*! exports provided: WebXROculusTouchMotionController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXROculusTouchMotionController",(function(){return l}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRAbstractMotionController */"./XR/motionController/webXRAbstractMotionController.ts"),o=r(/*! ./webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts"),s=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),l=function(e){function t(t,r,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=!1);var s=e.call(this,t,c[n],r,n)||this;return s._forceLegacyControllers=o,s.profileId="oculus-touch",s}return Object(n.__extends)(t,e),t.prototype._getFilenameAndPath=function(){return{filename:"left"===this.handedness?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,path:this._isQuest()?t.QUEST_MODEL_BASE_URL:t.MODEL_BASE_URL}},t.prototype._getModelLoadingConstraints=function(){return!0},t.prototype._processLoadedModel=function(e){var t=this,r=this._isQuest(),n="right"===this.handedness?-1:1;this.getComponentIds().forEach((function(e){var i=e&&t.getComponent(e);i&&i.onButtonStateChangedObservable.add((function(i){if(t.rootMesh&&!t.disableAnimation)switch(e){case"xr-standard-trigger":return void(r||(t._modelRootNode.getChildren()[3].rotation.x=.2*-i.value,t._modelRootNode.getChildren()[3].position.y=.005*-i.value,t._modelRootNode.getChildren()[3].position.z=.005*-i.value));case"xr-standard-squeeze":return void(r||(t._modelRootNode.getChildren()[4].position.x=n*i.value*.0035));case"xr-standard-thumbstick":return;case"a-button":case"x-button":return void(r||(i.pressed?t._modelRootNode.getChildren()[1].position.y=-.001:t._modelRootNode.getChildren()[1].position.y=0));case"b-button":case"y-button":return void(r||(i.pressed?t._modelRootNode.getChildren()[2].position.y=-.001:t._modelRootNode.getChildren()[2].position.y=0))}}),void 0,!0)}))},t.prototype._setRootMesh=function(e){this.rootMesh=new s.Mesh(this.profileId+" "+this.handedness,this.scene),this.scene.useRightHandedSystem||(this.rootMesh.rotationQuaternion=a.Quaternion.FromEulerAngles(0,Math.PI,0)),e.forEach((function(e){e.isPickable=!1})),this._isQuest()?this._modelRootNode=e[0]:(this._modelRootNode=e[1],this.rootMesh.position.y=.034,this.rootMesh.position.z=.052),this._modelRootNode.parent=this.rootMesh},t.prototype._updateModel=function(){},t.prototype._isQuest=function(){return!!navigator.userAgent.match(/Quest/gi)&&!this._forceLegacyControllers},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t.QUEST_MODEL_BASE_URL="https://controllers.babylonjs.com/oculusQuest/",t}(i.WebXRAbstractMotionController);o.WebXRMotionControllerManager.RegisterController("oculus-touch",(function(e,t){return new l(t,e.gamepad,e.handedness)})),o.WebXRMotionControllerManager.RegisterController("oculus-touch-legacy",(function(e,t){return new l(t,e.gamepad,e.handedness,!0)}));var c={left:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"x-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"x_button",visualResponses:{}},"y-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"y_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-left",assetPath:"left.glb"},right:{selectComponentId:"xr-standard-trigger",components:{"xr-standard-trigger":{type:"trigger",gamepadIndices:{button:0},rootNodeName:"xr_standard_trigger",visualResponses:{}},"xr-standard-squeeze":{type:"squeeze",gamepadIndices:{button:1},rootNodeName:"xr_standard_squeeze",visualResponses:{}},"xr-standard-thumbstick":{type:"thumbstick",gamepadIndices:{button:3,xAxis:2,yAxis:3},rootNodeName:"xr_standard_thumbstick",visualResponses:{}},"a-button":{type:"button",gamepadIndices:{button:4},rootNodeName:"a_button",visualResponses:{}},"b-button":{type:"button",gamepadIndices:{button:5},rootNodeName:"b_button",visualResponses:{}},thumbrest:{type:"button",gamepadIndices:{button:6},rootNodeName:"thumbrest",visualResponses:{}}},gamepadMapping:"xr-standard",rootNodeName:"oculus-touch-v2-right",assetPath:"right.glb"}}},"./XR/motionController/webXRProfiledMotionController.ts":
- /*!**************************************************************!*\
- !*** ./XR/motionController/webXRProfiledMotionController.ts ***!
- \**************************************************************/
- /*! exports provided: WebXRProfiledMotionController */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRProfiledMotionController",(function(){return f}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRAbstractMotionController */"./XR/motionController/webXRAbstractMotionController.ts"),o=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),s=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts"),l=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ./webXRControllerComponent */"./XR/motionController/webXRControllerComponent.ts"),u=r(/*! ../../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),d=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),h=r(/*! ../../Misc/logger */"./Misc/logger.ts"),f=function(e){function t(t,r,n,i){var o=e.call(this,t,n.layouts[r.handedness||"none"],r.gamepad,r.handedness)||this;return o._repositoryUrl=i,o._buttonMeshMapping={},o._touchDots={},o.profileId=n.profileId,o}return Object(n.__extends)(t,e),t.prototype.dispose=function(){var t=this;e.prototype.dispose.call(this),Object.keys(this._touchDots).forEach((function(e){t._touchDots[e].dispose()}))},t.prototype._getFilenameAndPath=function(){return{filename:this.layout.assetPath,path:this._repositoryUrl+"/profiles/"+this.profileId+"/"}},t.prototype._getModelLoadingConstraints=function(){var e=o.SceneLoader.IsPluginForExtensionAvailable(".glb");return e||h.Logger.Warn("glTF / glb loaded was not registered, using generic controller instead"),e},t.prototype._processLoadedModel=function(e){var t=this;this.getComponentIds().forEach((function(e){var r=t.layout.components[e];t._buttonMeshMapping[e]={mainMesh:t._getChildByName(t.rootMesh,r.rootNodeName),states:{}},Object.keys(r.visualResponses).forEach((function(n){var i=r.visualResponses[n];if("transform"===i.valueNodeProperty)t._buttonMeshMapping[e].states[n]={valueMesh:t._getChildByName(t.rootMesh,i.valueNodeName),minMesh:t._getChildByName(t.rootMesh,i.minNodeName),maxMesh:t._getChildByName(t.rootMesh,i.maxNodeName)};else{var o=r.type===c.WebXRControllerComponent.TOUCHPAD_TYPE&&r.touchPointNodeName?r.touchPointNodeName:i.valueNodeName;if(t._buttonMeshMapping[e].states[n]={valueMesh:t._getChildByName(t.rootMesh,o)},r.type===c.WebXRControllerComponent.TOUCHPAD_TYPE&&!t._touchDots[n]){var s=u.SphereBuilder.CreateSphere(n+"dot",{diameter:.0015,segments:8},t.scene);s.material=new d.StandardMaterial(n+"mat",t.scene),s.material.diffuseColor=l.Color3.Red(),s.parent=t._buttonMeshMapping[e].states[n].valueMesh,s.isVisible=!1,t._touchDots[n]=s}}}))}))},t.prototype._setRootMesh=function(e){var t;this.rootMesh=new s.Mesh(this.profileId+"-"+this.handedness,this.scene),this.rootMesh.isPickable=!1;for(var r=0;r<e.length;r++){var n=e[r];n.isPickable=!1,n.parent||(t=n)}t&&t.setParent(this.rootMesh),this.scene.useRightHandedSystem||this.rootMesh.rotate(a.Axis.Y,Math.PI,a.Space.WORLD)},t.prototype._updateModel=function(e){var t=this;this.disableAnimation||this.getComponentIds().forEach((function(e){var r=t.getComponent(e);if(r.hasChanges){var n=t._buttonMeshMapping[e],i=t.layout.components[e];Object.keys(i.visualResponses).forEach((function(e){var o=i.visualResponses[e],s=r.value;"xAxis"===o.componentProperty?s=r.axes.x:"yAxis"===o.componentProperty&&(s=r.axes.y),"transform"===o.valueNodeProperty?t._lerpTransform(n.states[e],s,"button"!==o.componentProperty):(n.states[e].valueMesh.isVisible=r.touched||r.pressed,t._touchDots[e]&&(t._touchDots[e].isVisible=r.touched||r.pressed))}))}}))},t}(i.WebXRAbstractMotionController)},"./XR/webXRCamera.ts":
- /*!***************************!*\
- !*** ./XR/webXRCamera.ts ***!
- \***************************/
- /*! exports provided: WebXRCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRCamera",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),s=r(/*! ../Cameras/freeCamera */"./Cameras/freeCamera.ts"),a=r(/*! ../Cameras/targetCamera */"./Cameras/targetCamera.ts"),l=r(/*! ../Maths/math.viewport */"./Maths/math.viewport.ts"),c=function(e){function t(t,r,n){var s=e.call(this,t,i.Vector3.Zero(),r)||this;return s._xrSessionManager=n,s._firstFrame=!1,s._referenceQuaternion=i.Quaternion.Identity(),s._referencedPosition=new i.Vector3,s._xrInvPositionCache=new i.Vector3,s._xrInvQuaternionCache=i.Quaternion.Identity(),s.compensateOnFirstFrame=!0,s._rotate180=new i.Quaternion(0,1,0,0),s.minZ=.1,s.rotationQuaternion=new i.Quaternion,s.cameraRigMode=o.Camera.RIG_MODE_CUSTOM,s.updateUpVectorFromRotation=!0,s._updateNumberOfRigCameras(1),s._xrSessionManager.onXRSessionInit.add((function(){s._referencedPosition.copyFromFloats(0,0,0),s._referenceQuaternion.copyFromFloats(0,0,0,1),s._firstFrame=s.compensateOnFirstFrame})),s._xrSessionManager.onXRFrameObservable.add((function(e){s._firstFrame&&s._updateFromXRSession(),s._updateReferenceSpace(),s._updateFromXRSession()}),void 0,!0),s}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"realWorldHeight",{get:function(){var e=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);return e&&e.transform?e.transform.position.y:0},enumerable:!1,configurable:!0}),t.prototype._updateForDualEyeDebugging=function(){this._updateNumberOfRigCameras(2),this.rigCameras[0].viewport=new l.Viewport(0,0,.5,1),this.rigCameras[0].outputRenderTarget=null,this.rigCameras[1].viewport=new l.Viewport(.5,0,.5,1),this.rigCameras[1].outputRenderTarget=null},t.prototype.setTransformationFromNonVRCamera=function(e,t){void 0===e&&(e=this.getScene().activeCamera),void 0===t&&(t=!0),e&&e!==this&&(e.computeWorldMatrix().decompose(void 0,this.rotationQuaternion,this.position),this.position.y=0,i.Quaternion.FromEulerAnglesToRef(0,this.rotationQuaternion.toEulerAngles().y,0,this.rotationQuaternion),this._firstFrame=!0,t&&this._xrSessionManager.resetReferenceSpace())},t.prototype.getClassName=function(){return"WebXRCamera"},t.prototype._updateFromXRSession=function(){var e=this,t=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);if(t){if(t.transform){var r=t.transform.position;this._referencedPosition.set(r.x,r.y,r.z);var n=t.transform.orientation;this._referenceQuaternion.set(n.x,n.y,n.z,n.w),this._scene.useRightHandedSystem||(this._referencedPosition.z*=-1,this._referenceQuaternion.z*=-1,this._referenceQuaternion.w*=-1),this._firstFrame?(this._firstFrame=!1,this.position.y+=this._referencedPosition.y,this._referenceQuaternion.copyFromFloats(0,0,0,1)):(this.rotationQuaternion.copyFrom(this._referenceQuaternion),this.position.copyFrom(this._referencedPosition))}this.rigCameras.length!==t.views.length&&this._updateNumberOfRigCameras(t.views.length),t.views.forEach((function(t,r){var n=e.rigCameras[r];n.isLeftCamera||n.isRightCamera||("right"===t.eye?n._isRightCamera=!0:"left"===t.eye&&(n._isLeftCamera=!0));var o=t.transform.position,s=t.transform.orientation;if(n.position.set(o.x,o.y,o.z),n.rotationQuaternion.set(s.x,s.y,s.z,s.w),e._scene.useRightHandedSystem?n.rotationQuaternion.multiplyInPlace(e._rotate180):(n.position.z*=-1,n.rotationQuaternion.z*=-1,n.rotationQuaternion.w*=-1),i.Matrix.FromFloat32ArrayToRefScaled(t.projectionMatrix,0,1,n._projectionMatrix),e._scene.useRightHandedSystem||n._projectionMatrix.toggleProjectionMatrixHandInPlace(),e._xrSessionManager.session.renderState.baseLayer){var a=e._xrSessionManager.session.renderState.baseLayer.getViewport(t),l=e._xrSessionManager.session.renderState.baseLayer.framebufferWidth,c=e._xrSessionManager.session.renderState.baseLayer.framebufferHeight;n.viewport.width=a.width/l,n.viewport.height=a.height/c,n.viewport.x=a.x/l,n.viewport.y=a.y/c}n.outputRenderTarget=e._xrSessionManager.getRenderTargetTextureForEye(t.eye)}))}},t.prototype._updateNumberOfRigCameras=function(e){for(void 0===e&&(e=1);this.rigCameras.length<e;){var t=new a.TargetCamera("XR-RigCamera: "+this.rigCameras.length,i.Vector3.Zero(),this.getScene());t.minZ=.1,t.rotationQuaternion=new i.Quaternion,t.updateUpVectorFromRotation=!0,t.isRigCamera=!0,t.rigParent=this,t.freezeProjectionMatrix(),this.rigCameras.push(t)}for(;this.rigCameras.length>e;){var r=this.rigCameras.pop();r&&r.dispose()}},t.prototype._updateReferenceSpace=function(){this.position.equals(this._referencedPosition)&&this.rotationQuaternion.equals(this._referenceQuaternion)||(this.position.subtractToRef(this._referencedPosition,this._referencedPosition),this._referenceQuaternion.conjugateInPlace(),this._referenceQuaternion.multiplyToRef(this.rotationQuaternion,this._referenceQuaternion),this._updateReferenceSpaceOffset(this._referencedPosition,this._referenceQuaternion.normalize()))},t.prototype._updateReferenceSpaceOffset=function(e,t,r){if(void 0===r&&(r=!1),this._xrSessionManager.referenceSpace&&this._xrSessionManager.currentFrame){this._xrInvPositionCache.copyFrom(e),t?this._xrInvQuaternionCache.copyFrom(t):this._xrInvQuaternionCache.copyFromFloats(0,0,0,1),this._scene.useRightHandedSystem||(this._xrInvPositionCache.z*=-1,this._xrInvQuaternionCache.z*=-1,this._xrInvQuaternionCache.w*=-1),this._xrInvPositionCache.negateInPlace(),this._xrInvQuaternionCache.conjugateInPlace(),this._xrInvPositionCache.rotateByQuaternionToRef(this._xrInvQuaternionCache,this._xrInvPositionCache),r&&(this._xrInvPositionCache.y=0);var n=new XRRigidTransform({x:this._xrInvPositionCache.x,y:this._xrInvPositionCache.y,z:this._xrInvPositionCache.z},{x:this._xrInvQuaternionCache.x,y:this._xrInvQuaternionCache.y,z:this._xrInvQuaternionCache.z,w:this._xrInvQuaternionCache.w}),o=this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(n),s=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(o);if(s){var a=new i.Vector3(s.transform.position.x,s.transform.position.y,s.transform.position.z);this._scene.useRightHandedSystem||(a.z*=-1),this.position.subtractToRef(a,a),this._scene.useRightHandedSystem||(a.z*=-1),a.negateInPlace();var l=new XRRigidTransform({x:a.x,y:a.y,z:a.z});this._xrSessionManager.referenceSpace=o.getOffsetReferenceSpace(l)}}},t}(s.FreeCamera)},"./XR/webXRDefaultExperience.ts":
- /*!**************************************!*\
- !*** ./XR/webXRDefaultExperience.ts ***!
- \**************************************/
- /*! exports provided: WebXRDefaultExperienceOptions, WebXRDefaultExperience */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRDefaultExperienceOptions",(function(){return u})),r.d(t,"WebXRDefaultExperience",(function(){return d}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./webXRExperienceHelper */"./XR/webXRExperienceHelper.ts"),o=r(/*! ./webXRInput */"./XR/webXRInput.ts"),s=r(/*! ./features/WebXRControllerPointerSelection */"./XR/features/WebXRControllerPointerSelection.ts"),a=r(/*! ./webXREnterExitUI */"./XR/webXREnterExitUI.ts"),l=r(/*! ./features/WebXRControllerTeleportation */"./XR/features/WebXRControllerTeleportation.ts"),c=r(/*! ../Misc/logger */"./Misc/logger.ts"),u=function(){},d=function(){function e(){}return e.CreateAsync=function(t,r){void 0===r&&(r={});var u=new e;return i.WebXRExperienceHelper.CreateAsync(t).then((function(e){if(u.baseExperience=e,r.ignoreNativeCameraTransformation&&(u.baseExperience.camera.compensateOnFirstFrame=!1),u.input=new o.WebXRInput(e.sessionManager,e.camera,Object(n.__assign)({controllerOptions:{renderingGroupId:r.renderingGroupId}},r.inputOptions||{})),u.pointerSelection=u.baseExperience.featuresManager.enableFeature(s.WebXRControllerPointerSelection.Name,r.useStablePlugins?"stable":"latest",{xrInput:u.input,renderingGroupId:r.renderingGroupId}),r.disableTeleportation||(u.teleportation=u.baseExperience.featuresManager.enableFeature(l.WebXRMotionControllerTeleportation.Name,r.useStablePlugins?"stable":"latest",{floorMeshes:r.floorMeshes,xrInput:u.input,renderingGroupId:r.renderingGroupId}),u.teleportation.setSelectionFeature(u.pointerSelection)),u.renderTarget=u.baseExperience.sessionManager.getWebXRRenderTarget(r.outputCanvasOptions),!r.disableDefaultUI){var i=Object(n.__assign)({renderTarget:u.renderTarget},r.uiOptions||{});return r.optionalFeatures&&("boolean"==typeof r.optionalFeatures?i.optionalFeatures=["hit-test","anchors","planes","hand-tracking"]:i.optionalFeatures=r.optionalFeatures),a.WebXREnterExitUI.CreateAsync(t,u.baseExperience,i).then((function(e){u.enterExitUI=e}))}})).then((function(){return u})).catch((function(e){return c.Logger.Error("Error initializing XR"),c.Logger.Error(e),u}))},e.prototype.dispose=function(){this.baseExperience&&this.baseExperience.dispose(),this.input&&this.input.dispose(),this.enterExitUI&&this.enterExitUI.dispose(),this.renderTarget&&this.renderTarget.dispose()},e}()},"./XR/webXREnterExitUI.ts":
- /*!********************************!*\
- !*** ./XR/webXREnterExitUI.ts ***!
- \********************************/
- /*! exports provided: WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXREnterExitUIButton",(function(){return a})),r.d(t,"WebXREnterExitUIOptions",(function(){return l})),r.d(t,"WebXREnterExitUI",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ./webXRTypes */"./XR/webXRTypes.ts"),s=r(/*! ../Misc/tools */"./Misc/tools.ts"),a=function(){function e(e,t,r){this.element=e,this.sessionMode=t,this.referenceSpaceType=r}return e.prototype.update=function(e){},e}(),l=function(){},c=function(){function e(e,t){var r=this;if(this.scene=e,this.options=t,this._activeButton=null,this._buttons=[],this.activeButtonChangedObservable=new i.Observable,this._overlay=document.createElement("div"),this._overlay.style.cssText="z-index:11;position: absolute; right: 20px;bottom: 50px;","undefined"!=typeof window&&window.location&&"http:"===window.location.protocol&&s.Tools.Warn("WebXR can only be served over HTTPS"),t.customButtons)this._buttons=t.customButtons;else{var n=t.sessionMode||"immersive-vr",o=t.referenceSpaceType||"local-floor",l=".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A":"https://cdn.babylonjs.com/Assets/vrButton.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";l+='.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: "EXIT"} .xr-error::after { content: "ERROR"}';var c=document.createElement("style");c.appendChild(document.createTextNode(l)),document.getElementsByTagName("head")[0].appendChild(c);var u=document.createElement("button");u.className="babylonVRicon",u.title=n+" - "+o,this._buttons.push(new a(u,n,o)),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",u.className="babylonVRicon"+(e===this?" vrdisplaypresenting":"")},this._updateButtons(null)}var d=e.getEngine().getInputElement();d&&d.parentNode&&(d.parentNode.appendChild(this._overlay),e.onDisposeObservable.addOnce((function(){r.dispose()})))}return e.CreateAsync=function(t,r,i){var a=this,l=new e(t,i),c=l._buttons.map((function(e){return r.sessionManager.isSessionSupportedAsync(e.sessionMode)}));return r.onStateChangedObservable.add((function(e){e==o.WebXRState.NOT_IN_XR&&l._updateButtons(null)})),Promise.all(c).then((function(e){return e.forEach((function(e,t){e?(l._overlay.appendChild(l._buttons[t].element),l._buttons[t].element.onclick=function(){return Object(n.__awaiter)(a,void 0,void 0,(function(){var e,s;return Object(n.__generator)(this,(function(n){switch(n.label){case 0:return r.state!=o.WebXRState.IN_XR?[3,2]:[4,r.exitXRAsync()];case 1:return n.sent(),l._updateButtons(null),[3,6];case 2:if(r.state!=o.WebXRState.NOT_IN_XR)return[3,6];if(!i.renderTarget)return[3,6];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,r.enterXRAsync(l._buttons[t].sessionMode,l._buttons[t].referenceSpaceType,i.renderTarget,{optionalFeatures:i.optionalFeatures,requiredFeatures:i.requiredFeatures})];case 4:return n.sent(),l._updateButtons(l._buttons[t]),[3,6];case 5:return n.sent(),l._updateButtons(null),e=l._buttons[t].element,s=e.title,e.title="Error entering XR session : "+s,e.classList.add("xr-error"),[3,6];case 6:return[2]}}))}))}):s.Tools.Warn('Session mode "'+l._buttons[t].sessionMode+'" not supported in browser')})),l}))},e.prototype.dispose=function(){var e=this.scene.getEngine().getInputElement();e&&e.parentNode&&e.parentNode.contains(this._overlay)&&e.parentNode.removeChild(this._overlay),this.activeButtonChangedObservable.clear()},e.prototype._updateButtons=function(e){var t=this;this._activeButton=e,this._buttons.forEach((function(e){e.update(t._activeButton)})),this.activeButtonChangedObservable.notifyObservers(this._activeButton)},e}()},"./XR/webXRExperienceHelper.ts":
- /*!*************************************!*\
- !*** ./XR/webXRExperienceHelper.ts ***!
- \*************************************/
- /*! exports provided: WebXRExperienceHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRExperienceHelper",(function(){return c}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ./webXRSessionManager */"./XR/webXRSessionManager.ts"),o=r(/*! ./webXRCamera */"./XR/webXRCamera.ts"),s=r(/*! ./webXRTypes */"./XR/webXRTypes.ts"),a=r(/*! ./webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),l=r(/*! ../Misc/logger */"./Misc/logger.ts"),c=function(){function e(e){var t=this;this.scene=e,this._nonVRCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this.onInitialXRPoseSetObservable=new n.Observable,this.onStateChangedObservable=new n.Observable,this.state=s.WebXRState.NOT_IN_XR,this.sessionManager=new i.WebXRSessionManager(e),this.camera=new o.WebXRCamera("",e,this.sessionManager),this.featuresManager=new a.WebXRFeaturesManager(this.sessionManager),e.onDisposeObservable.add((function(){t.exitXRAsync()}))}return e.CreateAsync=function(t){var r=new e(t);return r.sessionManager.initializeAsync().then((function(){return r._supported=!0,r})).catch((function(e){throw r._setState(s.WebXRState.NOT_IN_XR),r.dispose(),e}))},e.prototype.dispose=function(){this.camera.dispose(),this.onStateChangedObservable.clear(),this.onInitialXRPoseSetObservable.clear(),this.sessionManager.dispose(),this._nonVRCamera&&(this.scene.activeCamera=this._nonVRCamera)},e.prototype.enterXRAsync=function(e,t,r,n){var i=this;if(void 0===r&&(r=this.sessionManager.getWebXRRenderTarget()),void 0===n&&(n={}),!this._supported)throw"WebXR not supported in this browser or environment";return this._setState(s.WebXRState.ENTERING_XR),"viewer"!==t&&"local"!==t&&(n.optionalFeatures=n.optionalFeatures||[],n.optionalFeatures.push(t)),this.featuresManager.extendXRSessionInitObject(n),"immersive-ar"===e&&"unbounded"!==t&&l.Logger.Warn("We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode"),this.sessionManager.initializeSessionAsync(e,n).then((function(){return i.sessionManager.setReferenceSpaceTypeAsync(t)})).then((function(){return r.initializeXRLayerAsync(i.sessionManager.session)})).then((function(){return i.sessionManager.updateRenderStateAsync({depthFar:i.camera.maxZ,depthNear:i.camera.minZ,baseLayer:r.xrLayer})})).then((function(){return i.sessionManager.runXRRenderLoop(),i._originalSceneAutoClear=i.scene.autoClear,i._nonVRCamera=i.scene.activeCamera,i.scene.activeCamera=i.camera,"immersive-ar"!==e?i._nonXRToXRCamera():(i.scene.autoClear=!1,i.camera.compensateOnFirstFrame=!1),i.sessionManager.onXRSessionEnded.addOnce((function(){i.camera.rigCameras.forEach((function(e){e.outputRenderTarget=null})),i.scene.autoClear=i._originalSceneAutoClear,i.scene.activeCamera=i._nonVRCamera,"immersive-ar"!==e&&i.camera.compensateOnFirstFrame&&(i._nonVRCamera.setPosition?i._nonVRCamera.setPosition(i.camera.position):i._nonVRCamera.position.copyFrom(i.camera.position)),i._setState(s.WebXRState.NOT_IN_XR)})),i.sessionManager.onXRFrameObservable.addOnce((function(){i._setState(s.WebXRState.IN_XR)})),i.sessionManager})).catch((function(e){throw console.log(e),console.log(e.message),i._setState(s.WebXRState.NOT_IN_XR),e}))},e.prototype.exitXRAsync=function(){return this.state!==s.WebXRState.IN_XR?Promise.resolve():(this._setState(s.WebXRState.EXITING_XR),this.sessionManager.exitXRAsync())},e.prototype._nonXRToXRCamera=function(){this.camera.setTransformationFromNonVRCamera(this._nonVRCamera),this.onInitialXRPoseSetObservable.notifyObservers(this.camera)},e.prototype._setState=function(e){this.state!==e&&(this.state=e,this.onStateChangedObservable.notifyObservers(this.state))},e}()},"./XR/webXRFeaturesManager.ts":
- /*!************************************!*\
- !*** ./XR/webXRFeaturesManager.ts ***!
- \************************************/
- /*! exports provided: WebXRFeatureName, WebXRFeaturesManager */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRFeatureName",(function(){return i})),r.d(t,"WebXRFeaturesManager",(function(){return o}));var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=function(){function e(){}return e.ANCHOR_SYSTEM="xr-anchor-system",e.BACKGROUND_REMOVER="xr-background-remover",e.HIT_TEST="xr-hit-test",e.PHYSICS_CONTROLLERS="xr-physics-controller",e.PLANE_DETECTION="xr-plane-detection",e.POINTER_SELECTION="xr-controller-pointer-selection",e.TELEPORTATION="xr-controller-teleportation",e}(),o=function(){function e(e){var t=this;this._xrSessionManager=e,this._features={},this._xrSessionManager.onXRSessionInit.add((function(){t.getEnabledFeatures().forEach((function(e){var r=t._features[e];!r.enabled||r.featureImplementation.attached||r.featureImplementation.disableAutoAttach||t.attachFeature(e)}))})),this._xrSessionManager.onXRSessionEnded.add((function(){t.getEnabledFeatures().forEach((function(e){var r=t._features[e];r.enabled&&r.featureImplementation.attached&&t.detachFeature(e)}))}))}return e.AddWebXRFeature=function(e,t,r,n){void 0===r&&(r=1),void 0===n&&(n=!1),this._AvailableFeatures[e]=this._AvailableFeatures[e]||{latest:r},r>this._AvailableFeatures[e].latest&&(this._AvailableFeatures[e].latest=r),n&&(this._AvailableFeatures[e].stable=r),this._AvailableFeatures[e][r]=t},e.ConstructFeature=function(e,t,r,n){void 0===t&&(t=1);var i=this._AvailableFeatures[e][t];if(!i)throw new Error("feature not found");return i(r,n)},e.GetAvailableFeatures=function(){return Object.keys(this._AvailableFeatures)},e.GetAvailableVersions=function(e){return Object.keys(this._AvailableFeatures[e])},e.GetLatestVersionOfFeature=function(e){return this._AvailableFeatures[e]&&this._AvailableFeatures[e].latest||-1},e.GetStableVersionOfFeature=function(e){return this._AvailableFeatures[e]&&this._AvailableFeatures[e].stable||-1},e.prototype.attachFeature=function(e){var t=this._features[e];t&&t.enabled&&!t.featureImplementation.attached&&t.featureImplementation.attach()},e.prototype.detachFeature=function(e){var t=this._features[e];t&&t.featureImplementation.attached&&t.featureImplementation.detach()},e.prototype.disableFeature=function(e){var t="string"==typeof e?e:e.Name,r=this._features[t];return!(!r||!r.enabled||(r.enabled=!1,this.detachFeature(t),r.featureImplementation.dispose(),0))},e.prototype.dispose=function(){var e=this;this.getEnabledFeatures().forEach((function(t){e.disableFeature(t),e._features[t].featureImplementation.dispose()}))},e.prototype.enableFeature=function(t,r,i,o,s){void 0===r&&(r="latest"),void 0===i&&(i={}),void 0===o&&(o=!0),void 0===s&&(s=!0);var a="string"==typeof t?t:t.Name,l=0;if("string"==typeof r){if(!r)throw new Error("Error in provided version - "+a+" ("+r+")");if(-1===(l="stable"===r?e.GetStableVersionOfFeature(a):"latest"===r?e.GetLatestVersionOfFeature(a):+r)||isNaN(l))throw new Error("feature not found - "+a+" ("+r+")")}else l=r;var c=this._features[a],u=e.ConstructFeature(a,l,this._xrSessionManager,i);if(!u)throw new Error("feature not found - "+a);c&&this.disableFeature(a);var d=u();if(d.isCompatible())return this._features[a]={featureImplementation:d,enabled:!0,version:l,required:s},o?this._xrSessionManager.session&&!c.featureImplementation.attached&&this.attachFeature(a):this._features[a].featureImplementation.disableAutoAttach=!0,this._features[a].featureImplementation;if(s)throw new Error("required feature not compatible");return n.Tools.Warn("Feature "+a+" not compatible with the current environment/browser and was not enabled."),d},e.prototype.getEnabledFeature=function(e){return this._features[e]&&this._features[e].featureImplementation},e.prototype.getEnabledFeatures=function(){return Object.keys(this._features)},e.prototype.extendXRSessionInitObject=function(e){var t=this;return this.getEnabledFeatures().forEach((function(r){var n=t._features[r],i=n.featureImplementation.xrNativeFeatureName;i&&(n.required?(e.requiredFeatures=e.requiredFeatures||[],-1===e.requiredFeatures.indexOf(i)&&e.requiredFeatures.push(i)):(e.optionalFeatures=e.optionalFeatures||[],-1===e.optionalFeatures.indexOf(i)&&e.optionalFeatures.push(i)))})),e},e._AvailableFeatures={},e}()},"./XR/webXRInput.ts":
- /*!**************************!*\
- !*** ./XR/webXRInput.ts ***!
- \**************************/
- /*! exports provided: WebXRInput */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRInput",(function(){return a}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ./webXRInputSource */"./XR/webXRInputSource.ts"),s=r(/*! ./motionController/webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts"),a=function(){function e(e,t,r){var n=this;void 0===r&&(r={}),this.xrSessionManager=e,this.xrCamera=t,this.options=r,this.controllers=[],this.onControllerAddedObservable=new i.Observable,this.onControllerRemovedObservable=new i.Observable,this._onInputSourcesChange=function(e){n._addAndRemoveControllers(e.added,e.removed)},this._sessionEndedObserver=this.xrSessionManager.onXRSessionEnded.add((function(){n._addAndRemoveControllers([],n.controllers.map((function(e){return e.inputSource})))})),this._sessionInitObserver=this.xrSessionManager.onXRSessionInit.add((function(e){e.addEventListener("inputsourceschange",n._onInputSourcesChange)})),this._frameObserver=this.xrSessionManager.onXRFrameObservable.add((function(e){n.controllers.forEach((function(t){t.updateFromXRFrame(e,n.xrSessionManager.referenceSpace)}))})),this.options.customControllersRepositoryURL&&(s.WebXRMotionControllerManager.BaseRepositoryUrl=this.options.customControllersRepositoryURL),this.options.disableOnlineControllerRepository?s.WebXRMotionControllerManager.UseOnlineRepository=!1:(s.WebXRMotionControllerManager.UseOnlineRepository=!0,s.WebXRMotionControllerManager.UpdateProfilesList())}return e.prototype._addAndRemoveControllers=function(e,t){for(var r=this,i=this.controllers.map((function(e){return e.inputSource})),s=0,a=e;s<a.length;s++){var l=a[s];if(-1===i.indexOf(l)){var c=new o.WebXRInputSource(this.xrSessionManager.scene,l,Object(n.__assign)(Object(n.__assign)({},this.options.controllerOptions||{}),{forceControllerProfile:this.options.forceInputProfile,doNotLoadControllerMesh:this.options.doNotLoadControllerMeshes,disableMotionControllerAnimation:this.options.disableControllerAnimation}));this.controllers.push(c),this.onControllerAddedObservable.notifyObservers(c)}}var u=[],d=[];this.controllers.forEach((function(e){-1===t.indexOf(e.inputSource)?u.push(e):d.push(e)})),this.controllers=u,d.forEach((function(e){r.onControllerRemovedObservable.notifyObservers(e),e.dispose()}))},e.prototype.dispose=function(){this.controllers.forEach((function(e){e.dispose()})),this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver),this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver),this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver),this.onControllerAddedObservable.clear(),this.onControllerRemovedObservable.clear()},e}()},"./XR/webXRInputSource.ts":
- /*!********************************!*\
- !*** ./XR/webXRInputSource.ts ***!
- \********************************/
- /*! exports provided: WebXRInputSource */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRInputSource",(function(){return c}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ./motionController/webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts"),a=r(/*! ../Misc/tools */"./Misc/tools.ts"),l=0,c=function(){function e(e,t,r){var c=this;void 0===r&&(r={}),this._scene=e,this.inputSource=t,this._options=r,this._tmpVector=new o.Vector3,this.onDisposeObservable=new n.Observable,this.onMeshLoadedObservable=new n.Observable,this.onMotionControllerInitObservable=new n.Observable,this._uniqueId="controller-"+l+++"-"+t.targetRayMode+"-"+t.handedness,this.pointer=new i.AbstractMesh(this._uniqueId+"-pointer",e),this.pointer.rotationQuaternion=new o.Quaternion,this.inputSource.gripSpace&&(this.grip=new i.AbstractMesh(this._uniqueId+"-grip",this._scene),this.grip.rotationQuaternion=new o.Quaternion),this._tmpVector.set(0,0,this._scene.useRightHandedSystem?-1:1),this.inputSource.gamepad&&s.WebXRMotionControllerManager.GetMotionControllerWithXRInput(t,e,this._options.forceControllerProfile).then((function(e){c.motionController=e,c.onMotionControllerInitObservable.notifyObservers(e),c._options.doNotLoadControllerMesh||c.motionController.loadModel().then((function(e){e&&c.motionController&&c.motionController.rootMesh&&(c._options.renderingGroupId&&(c.motionController.rootMesh.renderingGroupId=c._options.renderingGroupId,c.motionController.rootMesh.getChildMeshes(!1).forEach((function(e){return e.renderingGroupId=c._options.renderingGroupId}))),c.onMeshLoadedObservable.notifyObservers(c.motionController.rootMesh),c.motionController.rootMesh.parent=c.grip||c.pointer,c.motionController.disableAnimation=!!c._options.disableMotionControllerAnimation)}))}),(function(){a.Tools.Warn("Could not find a matching motion controller for the registered input source")}))}return Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.grip&&this.grip.dispose(),this.motionController&&this.motionController.dispose(),this.pointer.dispose(),this.onMotionControllerInitObservable.clear(),this.onMeshLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},e.prototype.getWorldPointerRayToRef=function(e,t){void 0===t&&(t=!1);var r=t&&this.grip?this.grip:this.pointer;o.Vector3.TransformNormalToRef(this._tmpVector,r.getWorldMatrix(),e.direction),e.direction.normalize(),e.origin.copyFrom(r.absolutePosition),e.length=1e3},e.prototype.updateFromXRFrame=function(e,t){var r=e.getPose(this.inputSource.targetRaySpace,t);if(r){var n=r.transform.position;this.pointer.position.set(n.x,n.y,n.z);var i=r.transform.orientation;this.pointer.rotationQuaternion.set(i.x,i.y,i.z,i.w),this._scene.useRightHandedSystem||(this.pointer.position.z*=-1,this.pointer.rotationQuaternion.z*=-1,this.pointer.rotationQuaternion.w*=-1)}if(this.inputSource.gripSpace&&this.grip){var o=e.getPose(this.inputSource.gripSpace,t);if(o){n=o.transform.position;var s=o.transform.orientation;this.grip.position.set(n.x,n.y,n.z),this.grip.rotationQuaternion.set(s.x,s.y,s.z,s.w),this._scene.useRightHandedSystem||(this.grip.position.z*=-1,this.grip.rotationQuaternion.z*=-1,this.grip.rotationQuaternion.w*=-1)}}this.motionController&&this.motionController.updateFromXRFrame(e)},e}()},"./XR/webXRManagedOutputCanvas.ts":
- /*!****************************************!*\
- !*** ./XR/webXRManagedOutputCanvas.ts ***!
- \****************************************/
- /*! exports provided: WebXRManagedOutputCanvasOptions, WebXRManagedOutputCanvas */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRManagedOutputCanvasOptions",(function(){return i})),r.d(t,"WebXRManagedOutputCanvas",(function(){return o}));var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=function(){function e(){}return e.GetDefaults=function(){var t=new e;return t.canvasOptions={antialias:!0,depth:!0,stencil:!1,alpha:!0,multiview:!1,framebufferScaleFactor:1},t.newCanvasCssStyle="position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;",t},e}(),o=function(){function e(e,t){var r=this;if(void 0===t&&(t=i.GetDefaults()),this._options=t,this._canvas=null,this.xrLayer=null,this.onXRLayerInitObservable=new n.Observable,this._engine=e.scene.getEngine(),t.canvasElement)this._setManagedOutputCanvas(t.canvasElement);else{var o=document.createElement("canvas");o.style.cssText=this._options.newCanvasCssStyle||"position:absolute; bottom:0px;right:0px;",this._setManagedOutputCanvas(o)}e.onXRSessionInit.add((function(){r._addCanvas()})),e.onXRSessionEnded.add((function(){r._removeCanvas()}))}return e.prototype.dispose=function(){this._removeCanvas(),this._setManagedOutputCanvas(null)},e.prototype.initializeXRLayerAsync=function(e){var t=this,r=function(){var r=new XRWebGLLayer(e,t.canvasContext,t._options.canvasOptions);return t.onXRLayerInitObservable.notifyObservers(r),r};return this.canvasContext.makeXRCompatible?this.canvasContext.makeXRCompatible().then((function(){return t.xrLayer=r(),t.xrLayer})):(this.xrLayer=r(),Promise.resolve(this.xrLayer))},e.prototype._addCanvas=function(){var e=this;this._canvas&&this._canvas!==this._engine.getRenderingCanvas()&&document.body.appendChild(this._canvas),this.xrLayer?this._setCanvasSize(!0):this.onXRLayerInitObservable.addOnce((function(t){e._setCanvasSize(!0,t)}))},e.prototype._removeCanvas=function(){this._canvas&&document.body.contains(this._canvas)&&this._canvas!==this._engine.getRenderingCanvas()&&document.body.removeChild(this._canvas),this._setCanvasSize(!1)},e.prototype._setCanvasSize=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=this.xrLayer),this._canvas&&(e?t&&(this._canvas!==this._engine.getRenderingCanvas()?(this._canvas.style.width=t.framebufferWidth+"px",this._canvas.style.height=t.framebufferHeight+"px"):this._engine.setSize(t.framebufferWidth,t.framebufferHeight)):this._originalCanvasSize&&(this._canvas!==this._engine.getRenderingCanvas()?(this._canvas.style.width=this._originalCanvasSize.width+"px",this._canvas.style.height=this._originalCanvasSize.height+"px"):this._engine.setSize(this._originalCanvasSize.width,this._originalCanvasSize.height)))},e.prototype._setManagedOutputCanvas=function(e){this._removeCanvas(),e?(this._originalCanvasSize={width:e.offsetWidth,height:e.offsetHeight},this._canvas=e,this.canvasContext=this._canvas.getContext("webgl2"),this.canvasContext||(this.canvasContext=this._canvas.getContext("webgl"))):(this._canvas=null,this.canvasContext=null)},e}()},"./XR/webXRSessionManager.ts":
- /*!***********************************!*\
- !*** ./XR/webXRSessionManager.ts ***!
- \***********************************/
- /*! exports provided: WebXRSessionManager */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRSessionManager",(function(){return l}));var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),a=r(/*! ./webXRManagedOutputCanvas */"./XR/webXRManagedOutputCanvas.ts"),l=function(){function e(e){this.scene=e,this._sessionEnded=!1,this.baseLayer=null,this.currentTimestamp=-1,this.defaultHeightCompensation=1.7,this.onXRFrameObservable=new i.Observable,this.onXRReferenceSpaceChanged=new i.Observable,this.onXRSessionEnded=new i.Observable,this.onXRSessionInit=new i.Observable}return Object.defineProperty(e.prototype,"referenceSpace",{get:function(){return this._referenceSpace},set:function(e){this._referenceSpace=e,this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._sessionEnded||this.exitXRAsync(),this.onXRFrameObservable.clear(),this.onXRSessionEnded.clear(),this.onXRReferenceSpaceChanged.clear(),this.onXRSessionInit.clear()},e.prototype.exitXRAsync=function(){return this.session&&!this._sessionEnded?this.session.end().catch((function(e){n.Logger.Warn("could not end XR session. It has ended already.")})):Promise.resolve()},e.prototype.getRenderTargetTextureForEye=function(e){return this._rttProvider.getRenderTargetForEye(e)},e.prototype.getWebXRRenderTarget=function(e){var t=this.scene.getEngine();return this._xrNavigator.xr.native?this._xrNavigator.xr.getWebXRRenderTarget(t):((e=e||{}).canvasElement=t.getRenderingCanvas()||void 0,new a.WebXRManagedOutputCanvas(this,e))},e.prototype.initializeAsync=function(){return this._xrNavigator=navigator,this._xrNavigator.xr?Promise.resolve():Promise.reject("WebXR not available")},e.prototype.initializeSessionAsync=function(e,t){var r=this;return void 0===e&&(e="immersive-vr"),void 0===t&&(t={}),this._xrNavigator.xr.requestSession(e,t).then((function(e){return r.session=e,r.onXRSessionInit.notifyObservers(e),r._sessionEnded=!1,r.session.addEventListener("end",(function(){var e=r.scene.getEngine();r._sessionEnded=!0,r._rttProvider=null,e.framebufferDimensionsObject=null,e.restoreDefaultFramebuffer(),e.customAnimationFrameRequester=null,r.onXRSessionEnded.notifyObservers(null),e._renderLoop()}),{once:!0}),r.session}))},e.prototype.isSessionSupportedAsync=function(t){return e.IsSessionSupportedAsync(t)},e.prototype.resetReferenceSpace=function(){this.referenceSpace=this.baseReferenceSpace},e.prototype.runXRRenderLoop=function(){var e=this,t=this.scene.getEngine();if(t.customAnimationFrameRequester={requestAnimationFrame:this.session.requestAnimationFrame.bind(this.session),renderFunction:function(r,n){e._sessionEnded||(e.currentFrame=n,e.currentTimestamp=r,n&&(t.framebufferDimensionsObject=e.baseLayer,e.onXRFrameObservable.notifyObservers(n),t._renderLoop(),t.framebufferDimensionsObject=null))}},this._xrNavigator.xr.native)this._rttProvider=this._xrNavigator.xr.getNativeRenderTargetProvider(this.session,this._createRenderTargetTexture.bind(this));else{var r=this._createRenderTargetTexture(this.baseLayer.framebufferWidth,this.baseLayer.framebufferHeight,this.baseLayer.framebuffer);this._rttProvider={getRenderTargetForEye:function(){return r}},t.framebufferDimensionsObject=this.baseLayer}window.cancelAnimationFrame&&window.cancelAnimationFrame(t._frameHandler),t._renderLoop()},e.prototype.setReferenceSpaceTypeAsync=function(e){var t=this;return void 0===e&&(e="local-floor"),this.session.requestReferenceSpace(e).then((function(e){return e}),(function(e){return n.Logger.Error("XR.requestReferenceSpace failed for the following reason: "),n.Logger.Error(e),n.Logger.Log('Defaulting to universally-supported "viewer" reference space type.'),t.session.requestReferenceSpace("viewer").then((function(e){var r=new XRRigidTransform({x:0,y:-t.defaultHeightCompensation,z:0});return e.getOffsetReferenceSpace(r)}),(function(e){throw n.Logger.Error(e),'XR initialization failed: required "viewer" reference space type not supported.'}))})).then((function(e){return t.session.requestReferenceSpace("viewer").then((function(r){return t.viewerReferenceSpace=r,e}))})).then((function(e){return t.referenceSpace=t.baseReferenceSpace=e,t.referenceSpace}))},e.prototype.updateRenderStateAsync=function(e){return e.baseLayer&&(this.baseLayer=e.baseLayer),this.session.updateRenderState(e)},e.IsSessionSupportedAsync=function(e){if(!navigator.xr)return Promise.resolve(!1);var t=navigator.xr.isSessionSupported||navigator.xr.supportsSession;return t?t.call(navigator.xr,e).then((function(e){var t=void 0===e||e;return Promise.resolve(t)})).catch((function(e){return n.Logger.Warn(e),Promise.resolve(!1)})):Promise.resolve(!1)},e.prototype._createRenderTargetTexture=function(e,t,r){void 0===r&&(r=null);var n=new o.InternalTexture(this.scene.getEngine(),o.InternalTextureSource.Unknown,!0);n.width=e,n.height=t,n._framebuffer=r;var i=new s.RenderTargetTexture("XR renderTargetTexture",{width:e,height:t},this.scene,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0);return i._texture=n,i},e}()},"./XR/webXRTypes.ts":
- /*!**************************!*\
- !*** ./XR/webXRTypes.ts ***!
- \**************************/
- /*! exports provided: WebXRState */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"WebXRState",(function(){return n})),function(e){e[e.ENTERING_XR=0]="ENTERING_XR",e[e.EXITING_XR=1]="EXITING_XR",e[e.IN_XR=2]="IN_XR",e[e.NOT_IN_XR=3]="NOT_IN_XR"}(n||(n={}))},"./abstractScene.ts":
- /*!**************************!*\
- !*** ./abstractScene.ts ***!
- \**************************/
- /*! exports provided: AbstractScene */function(e,t,r){"use strict";r.r(t),r.d(t,"AbstractScene",(function(){return n}));var n=function(){function e(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this.environmentTexture=null}return e.AddParser=function(e,t){this._BabylonFileParsers[e]=t},e.GetParser=function(e){return this._BabylonFileParsers[e]?this._BabylonFileParsers[e]:null},e.AddIndividualParser=function(e,t){this._IndividualBabylonFileParsers[e]=t},e.GetIndividualParser=function(e){return this._IndividualBabylonFileParsers[e]?this._IndividualBabylonFileParsers[e]:null},e.Parse=function(e,t,r,n){for(var i in this._BabylonFileParsers)this._BabylonFileParsers.hasOwnProperty(i)&&this._BabylonFileParsers[i](e,t,r,n)},e.prototype.getNodes=function(){var e=new Array;return e=(e=(e=(e=e.concat(this.meshes)).concat(this.lights)).concat(this.cameras)).concat(this.transformNodes),this.skeletons.forEach((function(t){return e=e.concat(t.bones)})),e},e._BabylonFileParsers={},e._IndividualBabylonFileParsers={},e}()},"./assetContainer.ts":
- /*!***************************!*\
- !*** ./assetContainer.ts ***!
- \***************************/
- /*! exports provided: KeepAssets, InstantiatedEntries, AssetContainer */function(e,t,r){"use strict";r.r(t),r.d(t,"KeepAssets",(function(){return l})),r.d(t,"InstantiatedEntries",(function(){return c})),r.d(t,"AssetContainer",(function(){return u}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./abstractScene */"./abstractScene.ts"),o=r(/*! ./Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ./Misc/logger */"./Misc/logger.ts"),a=r(/*! ./Engines/engineStore */"./Engines/engineStore.ts"),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t}(i.AbstractScene),c=function(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]},u=function(e){function t(t){var r=e.call(this)||this;return r._wasAddedToScene=!1,r.scene=t,r.sounds=[],r.effectLayers=[],r.layers=[],r.lensFlareSystems=[],r.proceduralTextures=[],r.reflectionProbes=[],t.onDisposeObservable.add((function(){r._wasAddedToScene||r.dispose()})),r}return Object(n.__extends)(t,e),t.prototype.instantiateModelsToScene=function(e,t){var r=this;void 0===t&&(t=!1);var n={},i={},s=new c,a=[],l=[],u={doNotInstantiate:!0},d=function(t,r){if(n[t.uniqueId]=r.uniqueId,i[r.uniqueId]=r,e&&(r.name=e(t.name)),r instanceof o.Mesh){var s=r;if(s.morphTargetManager){var a=t.morphTargetManager;s.morphTargetManager=a.clone();for(var l=0;l<a.numTargets;l++){var c=a.getTarget(l),u=s.morphTargetManager.getTarget(l);n[c.uniqueId]=u.uniqueId,i[u.uniqueId]=u}}}};return this.transformNodes.forEach((function(e){if(!e.parent){var t=e.instantiateHierarchy(null,u,(function(e,t){d(e,t)}));t&&s.rootNodes.push(t)}})),this.meshes.forEach((function(o){if(!o.parent){var a=o.instantiateHierarchy(null,u,(function(o,s){if(d(o,s),s.material){var a=s;if(a.material)if(t){var c=o.material;if(-1===l.indexOf(c)){var u=c.clone(e?e(c.name):"Clone of "+c.name);if(l.push(c),n[c.uniqueId]=u.uniqueId,i[u.uniqueId]=u,"MultiMaterial"===c.getClassName()){for(var h=c,f=0,p=h.subMaterials;f<p.length;f++){var m=p[f];m&&(u=m.clone(e?e(m.name):"Clone of "+m.name),l.push(m),n[m.uniqueId]=u.uniqueId,i[u.uniqueId]=u)}h.subMaterials=h.subMaterials.map((function(e){return e&&i[n[e.uniqueId]]}))}}a.material=i[n[c.uniqueId]]}else"MultiMaterial"===a.material.getClassName()?-1===r.scene.multiMaterials.indexOf(a.material)&&r.scene.addMultiMaterial(a.material):-1===r.scene.materials.indexOf(a.material)&&r.scene.addMaterial(a.material)}}));a&&s.rootNodes.push(a)}})),this.skeletons.forEach((function(t){var o=t.clone(e?e(t.name):"Clone of "+t.name);t.overrideMesh&&(o.overrideMesh=i[n[t.overrideMesh.uniqueId]]);for(var l=0,c=r.meshes;l<c.length;l++){var u=c[l];if(u.skeleton===t&&!u.isAnInstance){if(i[n[u.uniqueId]].skeleton=o,-1!==a.indexOf(o))continue;a.push(o);for(var d=0,h=o.bones;d<h.length;d++){var f=h[d];f._linkedTransformNode&&(f._linkedTransformNode=i[n[f._linkedTransformNode.uniqueId]])}}}s.skeletons.push(o)})),this.animationGroups.forEach((function(e){var t=e.clone(e.name,(function(e){return i[n[e.uniqueId]]||e}));s.animationGroups.push(t)})),s},t.prototype.addAllToScene=function(){var e=this;this._wasAddedToScene=!0,this.cameras.forEach((function(t){e.scene.addCamera(t)})),this.lights.forEach((function(t){e.scene.addLight(t)})),this.meshes.forEach((function(t){e.scene.addMesh(t)})),this.skeletons.forEach((function(t){e.scene.addSkeleton(t)})),this.animations.forEach((function(t){e.scene.addAnimation(t)})),this.animationGroups.forEach((function(t){e.scene.addAnimationGroup(t)})),this.multiMaterials.forEach((function(t){e.scene.addMultiMaterial(t)})),this.materials.forEach((function(t){e.scene.addMaterial(t)})),this.morphTargetManagers.forEach((function(t){e.scene.addMorphTargetManager(t)})),this.geometries.forEach((function(t){e.scene.addGeometry(t)})),this.transformNodes.forEach((function(t){e.scene.addTransformNode(t)})),this.actionManagers.forEach((function(t){e.scene.addActionManager(t)})),this.textures.forEach((function(t){e.scene.addTexture(t)})),this.reflectionProbes.forEach((function(t){e.scene.addReflectionProbe(t)})),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(var t=0,r=this.scene._serializableComponents;t<r.length;t++)r[t].addFromContainer(this)},t.prototype.removeAllFromScene=function(){var e=this;this._wasAddedToScene=!1,this.cameras.forEach((function(t){e.scene.removeCamera(t)})),this.lights.forEach((function(t){e.scene.removeLight(t)})),this.meshes.forEach((function(t){e.scene.removeMesh(t)})),this.skeletons.forEach((function(t){e.scene.removeSkeleton(t)})),this.animations.forEach((function(t){e.scene.removeAnimation(t)})),this.animationGroups.forEach((function(t){e.scene.removeAnimationGroup(t)})),this.multiMaterials.forEach((function(t){e.scene.removeMultiMaterial(t)})),this.materials.forEach((function(t){e.scene.removeMaterial(t)})),this.morphTargetManagers.forEach((function(t){e.scene.removeMorphTargetManager(t)})),this.geometries.forEach((function(t){e.scene.removeGeometry(t)})),this.transformNodes.forEach((function(t){e.scene.removeTransformNode(t)})),this.actionManagers.forEach((function(t){e.scene.removeActionManager(t)})),this.textures.forEach((function(t){e.scene.removeTexture(t)})),this.reflectionProbes.forEach((function(t){e.scene.removeReflectionProbe(t)})),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(var t=0,r=this.scene._serializableComponents;t<r.length;t++)r[t].removeFromContainer(this)},t.prototype.dispose=function(){this.cameras.forEach((function(e){e.dispose()})),this.cameras=[],this.lights.forEach((function(e){e.dispose()})),this.lights=[],this.meshes.forEach((function(e){e.dispose()})),this.meshes=[],this.skeletons.forEach((function(e){e.dispose()})),this.skeletons=[],this.animationGroups.forEach((function(e){e.dispose()})),this.animationGroups=[],this.multiMaterials.forEach((function(e){e.dispose()})),this.multiMaterials=[],this.materials.forEach((function(e){e.dispose()})),this.materials=[],this.geometries.forEach((function(e){e.dispose()})),this.geometries=[],this.transformNodes.forEach((function(e){e.dispose()})),this.transformNodes=[],this.actionManagers.forEach((function(e){e.dispose()})),this.actionManagers=[],this.textures.forEach((function(e){e.dispose()})),this.textures=[],this.reflectionProbes.forEach((function(e){e.dispose()})),this.reflectionProbes=[],this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(var e=0,t=this.scene._serializableComponents;e<t.length;e++)t[e].removeFromContainer(this,!0)},t.prototype._moveAssets=function(e,t,r){if(e)for(var n=0,i=e;n<i.length;n++){var o=i[n],s=!0;if(r)for(var a=0,l=r;a<l.length;a++)if(o===l[a]){s=!1;break}s&&t.push(o)}},t.prototype.moveAllFromScene=function(e){for(var t in this._wasAddedToScene=!1,void 0===e&&(e=new l),this)this.hasOwnProperty(t)&&(this[t]=this[t]||("environmentTexture"===t?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.removeAllFromScene()},t.prototype.createRootMesh=function(){var e=new o.Mesh("assetContainerRootMesh",this.scene);return this.meshes.forEach((function(t){t.parent||e.addChild(t)})),this.meshes.unshift(e),e},t.prototype.mergeAnimationsTo=function(e,t,r){if(void 0===e&&(e=a.EngineStore.LastCreatedScene),void 0===r&&(r=null),!e)return s.Logger.Error("No scene available to merge animations to"),[];var n=r||function(t){var r=null,n=t.animations.length?t.animations[0].targetProperty:"",i=t.name.split(".").join("").split("_primitive")[0];switch(n){case"position":case"rotationQuaternion":r=e.getTransformNodeByName(t.name)||e.getTransformNodeByName(i);break;case"influence":r=e.getMorphTargetByName(t.name)||e.getMorphTargetByName(i);break;default:r=e.getNodeByName(t.name)||e.getNodeByName(i)}return r};this.getNodes().forEach((function(e){var t=n(e);if(null!==t){for(var r=function(e){for(var r=0,n=t.animations.filter((function(t){return t.targetProperty===e.targetProperty}));r<n.length;r++){var i=n[r],o=t.animations.indexOf(i,0);o>-1&&t.animations.splice(o,1)}},i=0,o=e.animations;i<o.length;i++)r(o[i]);t.animations=t.animations.concat(e.animations)}}));var i=new Array;return this.animationGroups.slice().forEach((function(e){i.push(e.clone(e.name,n)),e.animatables.forEach((function(e){e.stop()}))})),t.forEach((function(t){var r=n(t.target);r&&(e.beginAnimation(r,t.fromFrame,t.toFrame,t.loopAnimation,t.speedRatio,t.onAnimationEnd?t.onAnimationEnd:void 0,void 0,!0,void 0,t.onAnimationLoop?t.onAnimationLoop:void 0),e.stopAnimation(t.target))})),i},t}(i.AbstractScene)},"./index.ts":
- /*!******************!*\
- !*** ./index.ts ***!
- \******************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./abstractScene */"./abstractScene.ts");r.d(t,"AbstractScene",(function(){return n.AbstractScene}));var i=r(/*! ./Actions/index */"./Actions/index.ts");r.d(t,"AbstractActionManager",(function(){return i.AbstractActionManager})),r.d(t,"Action",(function(){return i.Action})),r.d(t,"ActionEvent",(function(){return i.ActionEvent})),r.d(t,"ActionManager",(function(){return i.ActionManager})),r.d(t,"Condition",(function(){return i.Condition})),r.d(t,"ValueCondition",(function(){return i.ValueCondition})),r.d(t,"PredicateCondition",(function(){return i.PredicateCondition})),r.d(t,"StateCondition",(function(){return i.StateCondition})),r.d(t,"SwitchBooleanAction",(function(){return i.SwitchBooleanAction})),r.d(t,"SetStateAction",(function(){return i.SetStateAction})),r.d(t,"SetValueAction",(function(){return i.SetValueAction})),r.d(t,"IncrementValueAction",(function(){return i.IncrementValueAction})),r.d(t,"PlayAnimationAction",(function(){return i.PlayAnimationAction})),r.d(t,"StopAnimationAction",(function(){return i.StopAnimationAction})),r.d(t,"DoNothingAction",(function(){return i.DoNothingAction})),r.d(t,"CombineAction",(function(){return i.CombineAction})),r.d(t,"ExecuteCodeAction",(function(){return i.ExecuteCodeAction})),r.d(t,"SetParentAction",(function(){return i.SetParentAction})),r.d(t,"PlaySoundAction",(function(){return i.PlaySoundAction})),r.d(t,"StopSoundAction",(function(){return i.StopSoundAction})),r.d(t,"InterpolateValueAction",(function(){return i.InterpolateValueAction}));var o=r(/*! ./Animations/index */"./Animations/index.ts");for(var s in o)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(s);var a=r(/*! ./assetContainer */"./assetContainer.ts");r.d(t,"KeepAssets",(function(){return a.KeepAssets})),r.d(t,"InstantiatedEntries",(function(){return a.InstantiatedEntries})),r.d(t,"AssetContainer",(function(){return a.AssetContainer}));var l=r(/*! ./Audio/index */"./Audio/index.ts");r.d(t,"Analyser",(function(){return l.Analyser})),r.d(t,"AudioEngine",(function(){return l.AudioEngine})),r.d(t,"AudioSceneComponent",(function(){return l.AudioSceneComponent})),r.d(t,"Sound",(function(){return l.Sound})),r.d(t,"SoundTrack",(function(){return l.SoundTrack})),r.d(t,"WeightedSound",(function(){return l.WeightedSound}));var c=r(/*! ./Behaviors/index */"./Behaviors/index.ts");for(var s in c)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return c[e]}))}(s);var u=r(/*! ./Bones/index */"./Bones/index.ts");r.d(t,"Bone",(function(){return u.Bone})),r.d(t,"BoneIKController",(function(){return u.BoneIKController})),r.d(t,"BoneLookController",(function(){return u.BoneLookController})),r.d(t,"Skeleton",(function(){return u.Skeleton}));var d=r(/*! ./Cameras/index */"./Cameras/index.ts");r.d(t,"ArcRotateCameraGamepadInput",(function(){return d.ArcRotateCameraGamepadInput})),r.d(t,"ArcRotateCameraKeyboardMoveInput",(function(){return d.ArcRotateCameraKeyboardMoveInput})),r.d(t,"ArcRotateCameraMouseWheelInput",(function(){return d.ArcRotateCameraMouseWheelInput})),r.d(t,"ArcRotateCameraPointersInput",(function(){return d.ArcRotateCameraPointersInput})),r.d(t,"ArcRotateCameraVRDeviceOrientationInput",(function(){return d.ArcRotateCameraVRDeviceOrientationInput})),r.d(t,"FlyCameraKeyboardInput",(function(){return d.FlyCameraKeyboardInput})),r.d(t,"FlyCameraMouseInput",(function(){return d.FlyCameraMouseInput})),r.d(t,"FollowCameraKeyboardMoveInput",(function(){return d.FollowCameraKeyboardMoveInput})),r.d(t,"FollowCameraMouseWheelInput",(function(){return d.FollowCameraMouseWheelInput})),r.d(t,"FollowCameraPointersInput",(function(){return d.FollowCameraPointersInput})),r.d(t,"FreeCameraDeviceOrientationInput",(function(){return d.FreeCameraDeviceOrientationInput})),r.d(t,"FreeCameraGamepadInput",(function(){return d.FreeCameraGamepadInput})),r.d(t,"FreeCameraKeyboardMoveInput",(function(){return d.FreeCameraKeyboardMoveInput})),r.d(t,"FreeCameraMouseInput",(function(){return d.FreeCameraMouseInput})),r.d(t,"FreeCameraTouchInput",(function(){return d.FreeCameraTouchInput})),r.d(t,"FreeCameraVirtualJoystickInput",(function(){return d.FreeCameraVirtualJoystickInput})),r.d(t,"CameraInputTypes",(function(){return d.CameraInputTypes})),r.d(t,"CameraInputsManager",(function(){return d.CameraInputsManager})),r.d(t,"Camera",(function(){return d.Camera})),r.d(t,"TargetCamera",(function(){return d.TargetCamera})),r.d(t,"FreeCamera",(function(){return d.FreeCamera})),r.d(t,"FreeCameraInputsManager",(function(){return d.FreeCameraInputsManager})),r.d(t,"TouchCamera",(function(){return d.TouchCamera})),r.d(t,"ArcRotateCamera",(function(){return d.ArcRotateCamera})),r.d(t,"ArcRotateCameraInputsManager",(function(){return d.ArcRotateCameraInputsManager})),r.d(t,"DeviceOrientationCamera",(function(){return d.DeviceOrientationCamera})),r.d(t,"FlyCamera",(function(){return d.FlyCamera})),r.d(t,"FlyCameraInputsManager",(function(){return d.FlyCameraInputsManager})),r.d(t,"FollowCamera",(function(){return d.FollowCamera})),r.d(t,"ArcFollowCamera",(function(){return d.ArcFollowCamera})),r.d(t,"FollowCameraInputsManager",(function(){return d.FollowCameraInputsManager})),r.d(t,"GamepadCamera",(function(){return d.GamepadCamera})),r.d(t,"AnaglyphArcRotateCamera",(function(){return d.AnaglyphArcRotateCamera})),r.d(t,"AnaglyphFreeCamera",(function(){return d.AnaglyphFreeCamera})),r.d(t,"AnaglyphGamepadCamera",(function(){return d.AnaglyphGamepadCamera})),r.d(t,"AnaglyphUniversalCamera",(function(){return d.AnaglyphUniversalCamera})),r.d(t,"StereoscopicArcRotateCamera",(function(){return d.StereoscopicArcRotateCamera})),r.d(t,"StereoscopicFreeCamera",(function(){return d.StereoscopicFreeCamera})),r.d(t,"StereoscopicGamepadCamera",(function(){return d.StereoscopicGamepadCamera})),r.d(t,"StereoscopicUniversalCamera",(function(){return d.StereoscopicUniversalCamera})),r.d(t,"UniversalCamera",(function(){return d.UniversalCamera})),r.d(t,"VirtualJoysticksCamera",(function(){return d.VirtualJoysticksCamera})),r.d(t,"VRCameraMetrics",(function(){return d.VRCameraMetrics})),r.d(t,"VRDeviceOrientationArcRotateCamera",(function(){return d.VRDeviceOrientationArcRotateCamera})),r.d(t,"VRDeviceOrientationFreeCamera",(function(){return d.VRDeviceOrientationFreeCamera})),r.d(t,"VRDeviceOrientationGamepadCamera",(function(){return d.VRDeviceOrientationGamepadCamera})),r.d(t,"OnAfterEnteringVRObservableEvent",(function(){return d.OnAfterEnteringVRObservableEvent})),r.d(t,"VRExperienceHelper",(function(){return d.VRExperienceHelper})),r.d(t,"WebVRFreeCamera",(function(){return d.WebVRFreeCamera}));var h=r(/*! ./Collisions/index */"./Collisions/index.ts");r.d(t,"Collider",(function(){return h.Collider})),r.d(t,"DefaultCollisionCoordinator",(function(){return h.DefaultCollisionCoordinator})),r.d(t,"PickingInfo",(function(){return h.PickingInfo})),r.d(t,"IntersectionInfo",(function(){return h.IntersectionInfo})),r.d(t,"_MeshCollisionData",(function(){return h._MeshCollisionData}));var f=r(/*! ./Culling/index */"./Culling/index.ts");r.d(t,"BoundingBox",(function(){return f.BoundingBox})),r.d(t,"BoundingInfo",(function(){return f.BoundingInfo})),r.d(t,"BoundingSphere",(function(){return f.BoundingSphere})),r.d(t,"Octree",(function(){return f.Octree})),r.d(t,"OctreeBlock",(function(){return f.OctreeBlock})),r.d(t,"OctreeSceneComponent",(function(){return f.OctreeSceneComponent})),r.d(t,"Ray",(function(){return f.Ray}));var p=r(/*! ./Debug/index */"./Debug/index.ts");r.d(t,"AxesViewer",(function(){return p.AxesViewer})),r.d(t,"BoneAxesViewer",(function(){return p.BoneAxesViewer})),r.d(t,"DebugLayerTab",(function(){return p.DebugLayerTab})),r.d(t,"DebugLayer",(function(){return p.DebugLayer})),r.d(t,"PhysicsViewer",(function(){return p.PhysicsViewer})),r.d(t,"RayHelper",(function(){return p.RayHelper})),r.d(t,"SkeletonViewer",(function(){return p.SkeletonViewer}));var m=r(/*! ./DeviceInput/index */"./DeviceInput/index.ts");for(var s in m)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return m[e]}))}(s);var g=r(/*! ./Engines/index */"./Engines/index.ts");for(var s in g)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return g[e]}))}(s);var _=r(/*! ./Events/index */"./Events/index.ts");r.d(t,"KeyboardEventTypes",(function(){return _.KeyboardEventTypes})),r.d(t,"KeyboardInfo",(function(){return _.KeyboardInfo})),r.d(t,"KeyboardInfoPre",(function(){return _.KeyboardInfoPre})),r.d(t,"PointerEventTypes",(function(){return _.PointerEventTypes})),r.d(t,"PointerInfoBase",(function(){return _.PointerInfoBase})),r.d(t,"PointerInfoPre",(function(){return _.PointerInfoPre})),r.d(t,"PointerInfo",(function(){return _.PointerInfo})),r.d(t,"ClipboardEventTypes",(function(){return _.ClipboardEventTypes})),r.d(t,"ClipboardInfo",(function(){return _.ClipboardInfo}));var v=r(/*! ./Gamepads/index */"./Gamepads/index.ts");r.d(t,"DaydreamController",(function(){return v.DaydreamController})),r.d(t,"GearVRController",(function(){return v.GearVRController})),r.d(t,"GenericController",(function(){return v.GenericController})),r.d(t,"OculusTouchController",(function(){return v.OculusTouchController})),r.d(t,"PoseEnabledControllerType",(function(){return v.PoseEnabledControllerType})),r.d(t,"PoseEnabledControllerHelper",(function(){return v.PoseEnabledControllerHelper})),r.d(t,"PoseEnabledController",(function(){return v.PoseEnabledController})),r.d(t,"ViveController",(function(){return v.ViveController})),r.d(t,"WebVRController",(function(){return v.WebVRController})),r.d(t,"WindowsMotionController",(function(){return v.WindowsMotionController})),r.d(t,"XRWindowsMotionController",(function(){return v.XRWindowsMotionController})),r.d(t,"StickValues",(function(){return v.StickValues})),r.d(t,"Gamepad",(function(){return v.Gamepad})),r.d(t,"GenericPad",(function(){return v.GenericPad})),r.d(t,"GamepadManager",(function(){return v.GamepadManager})),r.d(t,"GamepadSystemSceneComponent",(function(){return v.GamepadSystemSceneComponent})),r.d(t,"Xbox360Button",(function(){return v.Xbox360Button})),r.d(t,"Xbox360Dpad",(function(){return v.Xbox360Dpad})),r.d(t,"Xbox360Pad",(function(){return v.Xbox360Pad})),r.d(t,"DualShockButton",(function(){return v.DualShockButton})),r.d(t,"DualShockDpad",(function(){return v.DualShockDpad})),r.d(t,"DualShockPad",(function(){return v.DualShockPad}));var y=r(/*! ./Gizmos/index */"./Gizmos/index.ts");r.d(t,"AxisDragGizmo",(function(){return y.AxisDragGizmo})),r.d(t,"AxisScaleGizmo",(function(){return y.AxisScaleGizmo})),r.d(t,"BoundingBoxGizmo",(function(){return y.BoundingBoxGizmo})),r.d(t,"Gizmo",(function(){return y.Gizmo})),r.d(t,"GizmoManager",(function(){return y.GizmoManager})),r.d(t,"PlaneRotationGizmo",(function(){return y.PlaneRotationGizmo})),r.d(t,"PositionGizmo",(function(){return y.PositionGizmo})),r.d(t,"RotationGizmo",(function(){return y.RotationGizmo})),r.d(t,"ScaleGizmo",(function(){return y.ScaleGizmo})),r.d(t,"LightGizmo",(function(){return y.LightGizmo})),r.d(t,"PlaneDragGizmo",(function(){return y.PlaneDragGizmo}));var b=r(/*! ./Helpers/index */"./Helpers/index.ts");r.d(t,"EnvironmentHelper",(function(){return b.EnvironmentHelper})),r.d(t,"PhotoDome",(function(){return b.PhotoDome})),r.d(t,"_forceSceneHelpersToBundle",(function(){return b._forceSceneHelpersToBundle})),r.d(t,"VideoDome",(function(){return b.VideoDome}));var A=r(/*! ./Instrumentation/index */"./Instrumentation/index.ts");r.d(t,"EngineInstrumentation",(function(){return A.EngineInstrumentation})),r.d(t,"SceneInstrumentation",(function(){return A.SceneInstrumentation})),r.d(t,"_TimeToken",(function(){return A._TimeToken}));var T=r(/*! ./Layers/index */"./Layers/index.ts");r.d(t,"EffectLayer",(function(){return T.EffectLayer})),r.d(t,"EffectLayerSceneComponent",(function(){return T.EffectLayerSceneComponent})),r.d(t,"GlowLayer",(function(){return T.GlowLayer})),r.d(t,"HighlightLayer",(function(){return T.HighlightLayer})),r.d(t,"Layer",(function(){return T.Layer})),r.d(t,"LayerSceneComponent",(function(){return T.LayerSceneComponent}));var M=r(/*! ./LensFlares/index */"./LensFlares/index.ts");r.d(t,"LensFlare",(function(){return M.LensFlare})),r.d(t,"LensFlareSystem",(function(){return M.LensFlareSystem})),r.d(t,"LensFlareSystemSceneComponent",(function(){return M.LensFlareSystemSceneComponent}));var P=r(/*! ./Lights/index */"./Lights/index.ts");r.d(t,"Light",(function(){return P.Light})),r.d(t,"ShadowLight",(function(){return P.ShadowLight})),r.d(t,"ShadowGenerator",(function(){return P.ShadowGenerator})),r.d(t,"CascadedShadowGenerator",(function(){return P.CascadedShadowGenerator})),r.d(t,"ShadowGeneratorSceneComponent",(function(){return P.ShadowGeneratorSceneComponent})),r.d(t,"DirectionalLight",(function(){return P.DirectionalLight})),r.d(t,"HemisphericLight",(function(){return P.HemisphericLight})),r.d(t,"PointLight",(function(){return P.PointLight})),r.d(t,"SpotLight",(function(){return P.SpotLight}));var S=r(/*! ./Loading/index */"./Loading/index.ts");r.d(t,"DefaultLoadingScreen",(function(){return S.DefaultLoadingScreen})),r.d(t,"_BabylonLoaderRegistered",(function(){return S._BabylonLoaderRegistered})),r.d(t,"BabylonFileLoaderConfiguration",(function(){return S.BabylonFileLoaderConfiguration})),r.d(t,"SceneLoaderAnimationGroupLoadingMode",(function(){return S.SceneLoaderAnimationGroupLoadingMode})),r.d(t,"SceneLoader",(function(){return S.SceneLoader})),r.d(t,"SceneLoaderFlags",(function(){return S.SceneLoaderFlags}));var E=r(/*! ./Materials/index */"./Materials/index.ts");for(var s in E)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return E[e]}))}(s);var C=r(/*! ./Maths/index */"./Maths/index.ts");r.d(t,"Scalar",(function(){return C.Scalar})),r.d(t,"Space",(function(){return C.Space})),r.d(t,"Axis",(function(){return C.Axis})),r.d(t,"Color3",(function(){return C.Color3})),r.d(t,"Color4",(function(){return C.Color4})),r.d(t,"TmpColors",(function(){return C.TmpColors})),r.d(t,"ToGammaSpace",(function(){return C.ToGammaSpace})),r.d(t,"ToLinearSpace",(function(){return C.ToLinearSpace})),r.d(t,"Epsilon",(function(){return C.Epsilon})),r.d(t,"Frustum",(function(){return C.Frustum})),r.d(t,"Orientation",(function(){return C.Orientation})),r.d(t,"BezierCurve",(function(){return C.BezierCurve})),r.d(t,"Angle",(function(){return C.Angle})),r.d(t,"Arc2",(function(){return C.Arc2})),r.d(t,"Path2",(function(){return C.Path2})),r.d(t,"Path3D",(function(){return C.Path3D})),r.d(t,"Curve3",(function(){return C.Curve3})),r.d(t,"Plane",(function(){return C.Plane})),r.d(t,"Size",(function(){return C.Size})),r.d(t,"Vector2",(function(){return C.Vector2})),r.d(t,"Vector3",(function(){return C.Vector3})),r.d(t,"Vector4",(function(){return C.Vector4})),r.d(t,"Quaternion",(function(){return C.Quaternion})),r.d(t,"Matrix",(function(){return C.Matrix})),r.d(t,"TmpVectors",(function(){return C.TmpVectors})),r.d(t,"PositionNormalVertex",(function(){return C.PositionNormalVertex})),r.d(t,"PositionNormalTextureVertex",(function(){return C.PositionNormalTextureVertex})),r.d(t,"Viewport",(function(){return C.Viewport})),r.d(t,"SphericalHarmonics",(function(){return C.SphericalHarmonics})),r.d(t,"SphericalPolynomial",(function(){return C.SphericalPolynomial}));var x=r(/*! ./Meshes/index */"./Meshes/index.ts");r.d(t,"AbstractMesh",(function(){return x.AbstractMesh})),r.d(t,"Buffer",(function(){return x.Buffer})),r.d(t,"VertexBuffer",(function(){return x.VertexBuffer})),r.d(t,"DracoCompression",(function(){return x.DracoCompression})),r.d(t,"CSG",(function(){return x.CSG})),r.d(t,"Geometry",(function(){return x.Geometry})),r.d(t,"GroundMesh",(function(){return x.GroundMesh})),r.d(t,"TrailMesh",(function(){return x.TrailMesh})),r.d(t,"InstancedMesh",(function(){return x.InstancedMesh})),r.d(t,"LinesMesh",(function(){return x.LinesMesh})),r.d(t,"InstancedLinesMesh",(function(){return x.InstancedLinesMesh})),r.d(t,"_CreationDataStorage",(function(){return x._CreationDataStorage})),r.d(t,"_InstancesBatch",(function(){return x._InstancesBatch})),r.d(t,"Mesh",(function(){return x.Mesh})),r.d(t,"VertexData",(function(){return x.VertexData})),r.d(t,"MeshBuilder",(function(){return x.MeshBuilder})),r.d(t,"SimplificationSettings",(function(){return x.SimplificationSettings})),r.d(t,"SimplificationQueue",(function(){return x.SimplificationQueue})),r.d(t,"SimplificationType",(function(){return x.SimplificationType})),r.d(t,"QuadraticErrorSimplification",(function(){return x.QuadraticErrorSimplification})),r.d(t,"SimplicationQueueSceneComponent",(function(){return x.SimplicationQueueSceneComponent})),r.d(t,"Polygon",(function(){return x.Polygon})),r.d(t,"PolygonMeshBuilder",(function(){return x.PolygonMeshBuilder})),r.d(t,"SubMesh",(function(){return x.SubMesh})),r.d(t,"MeshLODLevel",(function(){return x.MeshLODLevel})),r.d(t,"TransformNode",(function(){return x.TransformNode})),r.d(t,"BoxBuilder",(function(){return x.BoxBuilder})),r.d(t,"TiledBoxBuilder",(function(){return x.TiledBoxBuilder})),r.d(t,"DiscBuilder",(function(){return x.DiscBuilder})),r.d(t,"RibbonBuilder",(function(){return x.RibbonBuilder})),r.d(t,"SphereBuilder",(function(){return x.SphereBuilder})),r.d(t,"HemisphereBuilder",(function(){return x.HemisphereBuilder})),r.d(t,"CylinderBuilder",(function(){return x.CylinderBuilder})),r.d(t,"TorusBuilder",(function(){return x.TorusBuilder})),r.d(t,"TorusKnotBuilder",(function(){return x.TorusKnotBuilder})),r.d(t,"LinesBuilder",(function(){return x.LinesBuilder})),r.d(t,"PolygonBuilder",(function(){return x.PolygonBuilder})),r.d(t,"ShapeBuilder",(function(){return x.ShapeBuilder})),r.d(t,"LatheBuilder",(function(){return x.LatheBuilder})),r.d(t,"PlaneBuilder",(function(){return x.PlaneBuilder})),r.d(t,"TiledPlaneBuilder",(function(){return x.TiledPlaneBuilder})),r.d(t,"GroundBuilder",(function(){return x.GroundBuilder})),r.d(t,"TubeBuilder",(function(){return x.TubeBuilder})),r.d(t,"PolyhedronBuilder",(function(){return x.PolyhedronBuilder})),r.d(t,"IcoSphereBuilder",(function(){return x.IcoSphereBuilder})),r.d(t,"DecalBuilder",(function(){return x.DecalBuilder})),r.d(t,"DataBuffer",(function(){return x.DataBuffer})),r.d(t,"WebGLDataBuffer",(function(){return x.WebGLDataBuffer}));var R=r(/*! ./Morph/index */"./Morph/index.ts");r.d(t,"MorphTarget",(function(){return R.MorphTarget})),r.d(t,"MorphTargetManager",(function(){return R.MorphTargetManager}));var O=r(/*! ./Navigation/index */"./Navigation/index.ts");for(var s in O)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return O[e]}))}(s);var I=r(/*! ./node */"./node.ts");r.d(t,"Node",(function(){return I.Node}));var D=r(/*! ./Offline/index */"./Offline/index.ts");for(var s in D)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","Node","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return D[e]}))}(s);var B=r(/*! ./Particles/index */"./Particles/index.ts");for(var s in B)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","Node","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return B[e]}))}(s);var N=r(/*! ./Physics/index */"./Physics/index.ts");for(var s in N)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","Node","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return N[e]}))}(s);var L=r(/*! ./PostProcesses/index */"./PostProcesses/index.ts");r.d(t,"AnaglyphPostProcess",(function(){return L.AnaglyphPostProcess})),r.d(t,"BlackAndWhitePostProcess",(function(){return L.BlackAndWhitePostProcess})),r.d(t,"BloomEffect",(function(){return L.BloomEffect})),r.d(t,"BloomMergePostProcess",(function(){return L.BloomMergePostProcess})),r.d(t,"BlurPostProcess",(function(){return L.BlurPostProcess})),r.d(t,"ChromaticAberrationPostProcess",(function(){return L.ChromaticAberrationPostProcess})),r.d(t,"CircleOfConfusionPostProcess",(function(){return L.CircleOfConfusionPostProcess})),r.d(t,"ColorCorrectionPostProcess",(function(){return L.ColorCorrectionPostProcess})),r.d(t,"ConvolutionPostProcess",(function(){return L.ConvolutionPostProcess})),r.d(t,"DepthOfFieldBlurPostProcess",(function(){return L.DepthOfFieldBlurPostProcess})),r.d(t,"DepthOfFieldEffectBlurLevel",(function(){return L.DepthOfFieldEffectBlurLevel})),r.d(t,"DepthOfFieldEffect",(function(){return L.DepthOfFieldEffect})),r.d(t,"DepthOfFieldMergePostProcessOptions",(function(){return L.DepthOfFieldMergePostProcessOptions})),r.d(t,"DepthOfFieldMergePostProcess",(function(){return L.DepthOfFieldMergePostProcess})),r.d(t,"DisplayPassPostProcess",(function(){return L.DisplayPassPostProcess})),r.d(t,"ExtractHighlightsPostProcess",(function(){return L.ExtractHighlightsPostProcess})),r.d(t,"FilterPostProcess",(function(){return L.FilterPostProcess})),r.d(t,"FxaaPostProcess",(function(){return L.FxaaPostProcess})),r.d(t,"GrainPostProcess",(function(){return L.GrainPostProcess})),r.d(t,"HighlightsPostProcess",(function(){return L.HighlightsPostProcess})),r.d(t,"ImageProcessingPostProcess",(function(){return L.ImageProcessingPostProcess})),r.d(t,"MotionBlurPostProcess",(function(){return L.MotionBlurPostProcess})),r.d(t,"PassPostProcess",(function(){return L.PassPostProcess})),r.d(t,"PassCubePostProcess",(function(){return L.PassCubePostProcess})),r.d(t,"PostProcess",(function(){return L.PostProcess})),r.d(t,"PostProcessManager",(function(){return L.PostProcessManager})),r.d(t,"RefractionPostProcess",(function(){return L.RefractionPostProcess})),r.d(t,"DefaultRenderingPipeline",(function(){return L.DefaultRenderingPipeline})),r.d(t,"LensRenderingPipeline",(function(){return L.LensRenderingPipeline})),r.d(t,"SSAO2RenderingPipeline",(function(){return L.SSAO2RenderingPipeline})),r.d(t,"SSAORenderingPipeline",(function(){return L.SSAORenderingPipeline})),r.d(t,"StandardRenderingPipeline",(function(){return L.StandardRenderingPipeline})),r.d(t,"PostProcessRenderEffect",(function(){return L.PostProcessRenderEffect})),r.d(t,"PostProcessRenderPipeline",(function(){return L.PostProcessRenderPipeline})),r.d(t,"PostProcessRenderPipelineManager",(function(){return L.PostProcessRenderPipelineManager})),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",(function(){return L.PostProcessRenderPipelineManagerSceneComponent})),r.d(t,"SharpenPostProcess",(function(){return L.SharpenPostProcess})),r.d(t,"StereoscopicInterlacePostProcessI",(function(){return L.StereoscopicInterlacePostProcessI})),r.d(t,"StereoscopicInterlacePostProcess",(function(){return L.StereoscopicInterlacePostProcess})),r.d(t,"TonemappingOperator",(function(){return L.TonemappingOperator})),r.d(t,"TonemapPostProcess",(function(){return L.TonemapPostProcess})),r.d(t,"VolumetricLightScatteringPostProcess",(function(){return L.VolumetricLightScatteringPostProcess})),r.d(t,"VRDistortionCorrectionPostProcess",(function(){return L.VRDistortionCorrectionPostProcess})),r.d(t,"VRMultiviewToSingleviewPostProcess",(function(){return L.VRMultiviewToSingleviewPostProcess})),r.d(t,"ScreenSpaceReflectionPostProcess",(function(){return L.ScreenSpaceReflectionPostProcess})),r.d(t,"ScreenSpaceCurvaturePostProcess",(function(){return L.ScreenSpaceCurvaturePostProcess}));var w=r(/*! ./Probes/index */"./Probes/index.ts");r.d(t,"ReflectionProbe",(function(){return w.ReflectionProbe}));var F=r(/*! ./Rendering/index */"./Rendering/index.ts");r.d(t,"BoundingBoxRenderer",(function(){return F.BoundingBoxRenderer})),r.d(t,"DepthRenderer",(function(){return F.DepthRenderer})),r.d(t,"DepthRendererSceneComponent",(function(){return F.DepthRendererSceneComponent})),r.d(t,"EdgesRenderer",(function(){return F.EdgesRenderer})),r.d(t,"LineEdgesRenderer",(function(){return F.LineEdgesRenderer})),r.d(t,"GeometryBufferRenderer",(function(){return F.GeometryBufferRenderer})),r.d(t,"GeometryBufferRendererSceneComponent",(function(){return F.GeometryBufferRendererSceneComponent})),r.d(t,"PrePassRenderer",(function(){return F.PrePassRenderer})),r.d(t,"PrePassRendererSceneComponent",(function(){return F.PrePassRendererSceneComponent})),r.d(t,"OutlineRenderer",(function(){return F.OutlineRenderer})),r.d(t,"RenderingGroup",(function(){return F.RenderingGroup})),r.d(t,"RenderingGroupInfo",(function(){return F.RenderingGroupInfo})),r.d(t,"RenderingManager",(function(){return F.RenderingManager})),r.d(t,"UtilityLayerRenderer",(function(){return F.UtilityLayerRenderer}));var V=r(/*! ./scene */"./scene.ts");r.d(t,"Scene",(function(){return V.Scene}));var k=r(/*! ./sceneComponent */"./sceneComponent.ts");r.d(t,"SceneComponentConstants",(function(){return k.SceneComponentConstants})),r.d(t,"Stage",(function(){return k.Stage}));var U=r(/*! ./Sprites/index */"./Sprites/index.ts");for(var s in U)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","Node","AnaglyphPostProcess","BlackAndWhitePostProcess","BloomEffect","BloomMergePostProcess","BlurPostProcess","ChromaticAberrationPostProcess","CircleOfConfusionPostProcess","ColorCorrectionPostProcess","ConvolutionPostProcess","DepthOfFieldBlurPostProcess","DepthOfFieldEffectBlurLevel","DepthOfFieldEffect","DepthOfFieldMergePostProcessOptions","DepthOfFieldMergePostProcess","DisplayPassPostProcess","ExtractHighlightsPostProcess","FilterPostProcess","FxaaPostProcess","GrainPostProcess","HighlightsPostProcess","ImageProcessingPostProcess","MotionBlurPostProcess","PassPostProcess","PassCubePostProcess","PostProcess","PostProcessManager","RefractionPostProcess","DefaultRenderingPipeline","LensRenderingPipeline","SSAO2RenderingPipeline","SSAORenderingPipeline","StandardRenderingPipeline","PostProcessRenderEffect","PostProcessRenderPipeline","PostProcessRenderPipelineManager","PostProcessRenderPipelineManagerSceneComponent","SharpenPostProcess","StereoscopicInterlacePostProcessI","StereoscopicInterlacePostProcess","TonemappingOperator","TonemapPostProcess","VolumetricLightScatteringPostProcess","VRDistortionCorrectionPostProcess","VRMultiviewToSingleviewPostProcess","ScreenSpaceReflectionPostProcess","ScreenSpaceCurvaturePostProcess","ReflectionProbe","BoundingBoxRenderer","DepthRenderer","DepthRendererSceneComponent","EdgesRenderer","LineEdgesRenderer","GeometryBufferRenderer","GeometryBufferRendererSceneComponent","PrePassRenderer","PrePassRendererSceneComponent","OutlineRenderer","RenderingGroup","RenderingGroupInfo","RenderingManager","UtilityLayerRenderer","Scene","SceneComponentConstants","Stage","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return U[e]}))}(s);var z=r(/*! ./States/index */"./States/index.ts");r.d(t,"AlphaState",(function(){return z.AlphaState})),r.d(t,"DepthCullingState",(function(){return z.DepthCullingState})),r.d(t,"StencilState",(function(){return z.StencilState}));var G=r(/*! ./Misc/index */"./Misc/index.ts");for(var s in G)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","Node","AnaglyphPostProcess","BlackAndWhitePostProcess","BloomEffect","BloomMergePostProcess","BlurPostProcess","ChromaticAberrationPostProcess","CircleOfConfusionPostProcess","ColorCorrectionPostProcess","ConvolutionPostProcess","DepthOfFieldBlurPostProcess","DepthOfFieldEffectBlurLevel","DepthOfFieldEffect","DepthOfFieldMergePostProcessOptions","DepthOfFieldMergePostProcess","DisplayPassPostProcess","ExtractHighlightsPostProcess","FilterPostProcess","FxaaPostProcess","GrainPostProcess","HighlightsPostProcess","ImageProcessingPostProcess","MotionBlurPostProcess","PassPostProcess","PassCubePostProcess","PostProcess","PostProcessManager","RefractionPostProcess","DefaultRenderingPipeline","LensRenderingPipeline","SSAO2RenderingPipeline","SSAORenderingPipeline","StandardRenderingPipeline","PostProcessRenderEffect","PostProcessRenderPipeline","PostProcessRenderPipelineManager","PostProcessRenderPipelineManagerSceneComponent","SharpenPostProcess","StereoscopicInterlacePostProcessI","StereoscopicInterlacePostProcess","TonemappingOperator","TonemapPostProcess","VolumetricLightScatteringPostProcess","VRDistortionCorrectionPostProcess","VRMultiviewToSingleviewPostProcess","ScreenSpaceReflectionPostProcess","ScreenSpaceCurvaturePostProcess","ReflectionProbe","BoundingBoxRenderer","DepthRenderer","DepthRendererSceneComponent","EdgesRenderer","LineEdgesRenderer","GeometryBufferRenderer","GeometryBufferRendererSceneComponent","PrePassRenderer","PrePassRendererSceneComponent","OutlineRenderer","RenderingGroup","RenderingGroupInfo","RenderingManager","UtilityLayerRenderer","Scene","SceneComponentConstants","Stage","AlphaState","DepthCullingState","StencilState","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return G[e]}))}(s);var j=r(/*! ./XR/index */"./XR/index.ts");r.d(t,"WebXRCamera",(function(){return j.WebXRCamera})),r.d(t,"WebXREnterExitUIButton",(function(){return j.WebXREnterExitUIButton})),r.d(t,"WebXREnterExitUIOptions",(function(){return j.WebXREnterExitUIOptions})),r.d(t,"WebXREnterExitUI",(function(){return j.WebXREnterExitUI})),r.d(t,"WebXRExperienceHelper",(function(){return j.WebXRExperienceHelper})),r.d(t,"WebXRInput",(function(){return j.WebXRInput})),r.d(t,"WebXRInputSource",(function(){return j.WebXRInputSource})),r.d(t,"WebXRManagedOutputCanvasOptions",(function(){return j.WebXRManagedOutputCanvasOptions})),r.d(t,"WebXRManagedOutputCanvas",(function(){return j.WebXRManagedOutputCanvas})),r.d(t,"WebXRState",(function(){return j.WebXRState})),r.d(t,"WebXRSessionManager",(function(){return j.WebXRSessionManager})),r.d(t,"WebXRDefaultExperienceOptions",(function(){return j.WebXRDefaultExperienceOptions})),r.d(t,"WebXRDefaultExperience",(function(){return j.WebXRDefaultExperience})),r.d(t,"WebXRFeatureName",(function(){return j.WebXRFeatureName})),r.d(t,"WebXRFeaturesManager",(function(){return j.WebXRFeaturesManager})),r.d(t,"WebXRHitTestLegacy",(function(){return j.WebXRHitTestLegacy})),r.d(t,"WebXRAnchorSystem",(function(){return j.WebXRAnchorSystem})),r.d(t,"WebXRPlaneDetector",(function(){return j.WebXRPlaneDetector})),r.d(t,"WebXRBackgroundRemover",(function(){return j.WebXRBackgroundRemover})),r.d(t,"WebXRMotionControllerTeleportation",(function(){return j.WebXRMotionControllerTeleportation})),r.d(t,"WebXRControllerPointerSelection",(function(){return j.WebXRControllerPointerSelection})),r.d(t,"IWebXRControllerPhysicsOptions",(function(){return j.IWebXRControllerPhysicsOptions})),r.d(t,"WebXRControllerPhysics",(function(){return j.WebXRControllerPhysics})),r.d(t,"WebXRHitTest",(function(){return j.WebXRHitTest})),r.d(t,"WebXRAbstractMotionController",(function(){return j.WebXRAbstractMotionController})),r.d(t,"WebXRControllerComponent",(function(){return j.WebXRControllerComponent})),r.d(t,"WebXRGenericTriggerMotionController",(function(){return j.WebXRGenericTriggerMotionController})),r.d(t,"WebXRMicrosoftMixedRealityController",(function(){return j.WebXRMicrosoftMixedRealityController})),r.d(t,"WebXRMotionControllerManager",(function(){return j.WebXRMotionControllerManager})),r.d(t,"WebXROculusTouchMotionController",(function(){return j.WebXROculusTouchMotionController})),r.d(t,"WebXRHTCViveMotionController",(function(){return j.WebXRHTCViveMotionController})),r.d(t,"WebXRProfiledMotionController",(function(){return j.WebXRProfiledMotionController}));var H=r(/*! ./types */"./types.ts");for(var s in H)["AbstractScene","AbstractActionManager","Action","ActionEvent","ActionManager","Condition","ValueCondition","PredicateCondition","StateCondition","SwitchBooleanAction","SetStateAction","SetValueAction","IncrementValueAction","PlayAnimationAction","StopAnimationAction","DoNothingAction","CombineAction","ExecuteCodeAction","SetParentAction","PlaySoundAction","StopSoundAction","InterpolateValueAction","KeepAssets","InstantiatedEntries","AssetContainer","Analyser","AudioEngine","AudioSceneComponent","Sound","SoundTrack","WeightedSound","Bone","BoneIKController","BoneLookController","Skeleton","ArcRotateCameraGamepadInput","ArcRotateCameraKeyboardMoveInput","ArcRotateCameraMouseWheelInput","ArcRotateCameraPointersInput","ArcRotateCameraVRDeviceOrientationInput","FlyCameraKeyboardInput","FlyCameraMouseInput","FollowCameraKeyboardMoveInput","FollowCameraMouseWheelInput","FollowCameraPointersInput","FreeCameraDeviceOrientationInput","FreeCameraGamepadInput","FreeCameraKeyboardMoveInput","FreeCameraMouseInput","FreeCameraTouchInput","FreeCameraVirtualJoystickInput","CameraInputTypes","CameraInputsManager","Camera","TargetCamera","FreeCamera","FreeCameraInputsManager","TouchCamera","ArcRotateCamera","ArcRotateCameraInputsManager","DeviceOrientationCamera","FlyCamera","FlyCameraInputsManager","FollowCamera","ArcFollowCamera","FollowCameraInputsManager","GamepadCamera","AnaglyphArcRotateCamera","AnaglyphFreeCamera","AnaglyphGamepadCamera","AnaglyphUniversalCamera","StereoscopicArcRotateCamera","StereoscopicFreeCamera","StereoscopicGamepadCamera","StereoscopicUniversalCamera","UniversalCamera","VirtualJoysticksCamera","VRCameraMetrics","VRDeviceOrientationArcRotateCamera","VRDeviceOrientationFreeCamera","VRDeviceOrientationGamepadCamera","OnAfterEnteringVRObservableEvent","VRExperienceHelper","WebVRFreeCamera","Collider","DefaultCollisionCoordinator","PickingInfo","IntersectionInfo","_MeshCollisionData","BoundingBox","BoundingInfo","BoundingSphere","Octree","OctreeBlock","OctreeSceneComponent","Ray","AxesViewer","BoneAxesViewer","DebugLayerTab","DebugLayer","PhysicsViewer","RayHelper","SkeletonViewer","KeyboardEventTypes","KeyboardInfo","KeyboardInfoPre","PointerEventTypes","PointerInfoBase","PointerInfoPre","PointerInfo","ClipboardEventTypes","ClipboardInfo","DaydreamController","GearVRController","GenericController","OculusTouchController","PoseEnabledControllerType","PoseEnabledControllerHelper","PoseEnabledController","ViveController","WebVRController","WindowsMotionController","XRWindowsMotionController","StickValues","Gamepad","GenericPad","GamepadManager","GamepadSystemSceneComponent","Xbox360Button","Xbox360Dpad","Xbox360Pad","DualShockButton","DualShockDpad","DualShockPad","AxisDragGizmo","AxisScaleGizmo","BoundingBoxGizmo","Gizmo","GizmoManager","PlaneRotationGizmo","PositionGizmo","RotationGizmo","ScaleGizmo","LightGizmo","PlaneDragGizmo","EnvironmentHelper","PhotoDome","_forceSceneHelpersToBundle","VideoDome","EngineInstrumentation","SceneInstrumentation","_TimeToken","EffectLayer","EffectLayerSceneComponent","GlowLayer","HighlightLayer","Layer","LayerSceneComponent","LensFlare","LensFlareSystem","LensFlareSystemSceneComponent","Light","ShadowLight","ShadowGenerator","CascadedShadowGenerator","ShadowGeneratorSceneComponent","DirectionalLight","HemisphericLight","PointLight","SpotLight","DefaultLoadingScreen","_BabylonLoaderRegistered","BabylonFileLoaderConfiguration","SceneLoaderAnimationGroupLoadingMode","SceneLoader","SceneLoaderFlags","Scalar","Space","Axis","Color3","Color4","TmpColors","ToGammaSpace","ToLinearSpace","Epsilon","Frustum","Orientation","BezierCurve","Angle","Arc2","Path2","Path3D","Curve3","Plane","Size","Vector2","Vector3","Vector4","Quaternion","Matrix","TmpVectors","PositionNormalVertex","PositionNormalTextureVertex","Viewport","SphericalHarmonics","SphericalPolynomial","AbstractMesh","Buffer","VertexBuffer","DracoCompression","CSG","Geometry","GroundMesh","TrailMesh","InstancedMesh","LinesMesh","InstancedLinesMesh","_CreationDataStorage","_InstancesBatch","Mesh","VertexData","MeshBuilder","SimplificationSettings","SimplificationQueue","SimplificationType","QuadraticErrorSimplification","SimplicationQueueSceneComponent","Polygon","PolygonMeshBuilder","SubMesh","MeshLODLevel","TransformNode","BoxBuilder","TiledBoxBuilder","DiscBuilder","RibbonBuilder","SphereBuilder","HemisphereBuilder","CylinderBuilder","TorusBuilder","TorusKnotBuilder","LinesBuilder","PolygonBuilder","ShapeBuilder","LatheBuilder","PlaneBuilder","TiledPlaneBuilder","GroundBuilder","TubeBuilder","PolyhedronBuilder","IcoSphereBuilder","DecalBuilder","DataBuffer","WebGLDataBuffer","MorphTarget","MorphTargetManager","Node","AnaglyphPostProcess","BlackAndWhitePostProcess","BloomEffect","BloomMergePostProcess","BlurPostProcess","ChromaticAberrationPostProcess","CircleOfConfusionPostProcess","ColorCorrectionPostProcess","ConvolutionPostProcess","DepthOfFieldBlurPostProcess","DepthOfFieldEffectBlurLevel","DepthOfFieldEffect","DepthOfFieldMergePostProcessOptions","DepthOfFieldMergePostProcess","DisplayPassPostProcess","ExtractHighlightsPostProcess","FilterPostProcess","FxaaPostProcess","GrainPostProcess","HighlightsPostProcess","ImageProcessingPostProcess","MotionBlurPostProcess","PassPostProcess","PassCubePostProcess","PostProcess","PostProcessManager","RefractionPostProcess","DefaultRenderingPipeline","LensRenderingPipeline","SSAO2RenderingPipeline","SSAORenderingPipeline","StandardRenderingPipeline","PostProcessRenderEffect","PostProcessRenderPipeline","PostProcessRenderPipelineManager","PostProcessRenderPipelineManagerSceneComponent","SharpenPostProcess","StereoscopicInterlacePostProcessI","StereoscopicInterlacePostProcess","TonemappingOperator","TonemapPostProcess","VolumetricLightScatteringPostProcess","VRDistortionCorrectionPostProcess","VRMultiviewToSingleviewPostProcess","ScreenSpaceReflectionPostProcess","ScreenSpaceCurvaturePostProcess","ReflectionProbe","BoundingBoxRenderer","DepthRenderer","DepthRendererSceneComponent","EdgesRenderer","LineEdgesRenderer","GeometryBufferRenderer","GeometryBufferRendererSceneComponent","PrePassRenderer","PrePassRendererSceneComponent","OutlineRenderer","RenderingGroup","RenderingGroupInfo","RenderingManager","UtilityLayerRenderer","Scene","SceneComponentConstants","Stage","AlphaState","DepthCullingState","StencilState","WebXRCamera","WebXREnterExitUIButton","WebXREnterExitUIOptions","WebXREnterExitUI","WebXRExperienceHelper","WebXRInput","WebXRInputSource","WebXRManagedOutputCanvasOptions","WebXRManagedOutputCanvas","WebXRState","WebXRSessionManager","WebXRDefaultExperienceOptions","WebXRDefaultExperience","WebXRFeatureName","WebXRFeaturesManager","WebXRHitTestLegacy","WebXRAnchorSystem","WebXRPlaneDetector","WebXRBackgroundRemover","WebXRMotionControllerTeleportation","WebXRControllerPointerSelection","IWebXRControllerPhysicsOptions","WebXRControllerPhysics","WebXRHitTest","WebXRAbstractMotionController","WebXRControllerComponent","WebXRGenericTriggerMotionController","WebXRMicrosoftMixedRealityController","WebXRMotionControllerManager","WebXROculusTouchMotionController","WebXRHTCViveMotionController","WebXRProfiledMotionController","default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return H[e]}))}(s)},"./node.ts":
- /*!*****************!*\
- !*** ./node.ts ***!
- \*****************/
- /*! exports provided: Node */function(e,t,r){"use strict";r.r(t),r.d(t,"Node",(function(){return c}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ./Misc/observable */"./Misc/observable.ts"),a=r(/*! ./Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ./Misc/devTools */"./Misc/devTools.ts"),c=function(){function e(e,t){void 0===t&&(t=null),this.state="",this.metadata=null,this.reservedDataStore=null,this._doNotSerialize=!1,this._isDisposed=!1,this.animations=new Array,this._ranges={},this.onReady=null,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=i.Matrix.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._sceneRootNodesIndex=-1,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new s.Observable,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||a.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache()}return e.AddNodeConstructor=function(e,t){this._NodeConstructors[e]=t},e.Construct=function(e,t,r,n){var i=this._NodeConstructors[e];return i?i(t,r,n):null},Object.defineProperty(e.prototype,"doNotSerialize",{get:function(){return!!this._doNotSerialize||!!this._parentNode&&this._parentNode.doNotSerialize},set:function(e){this._doNotSerialize=e},enumerable:!1,configurable:!0}),e.prototype.isDisposed=function(){return this._isDisposed},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parentNode},set:function(e){if(this._parentNode!==e){var t=this._parentNode;if(this._parentNode&&void 0!==this._parentNode._children&&null!==this._parentNode._children){var r=this._parentNode._children.indexOf(this);-1!==r&&this._parentNode._children.splice(r,1),e||this._isDisposed||this._addToSceneRootNodes()}this._parentNode=e,this._parentNode&&(void 0!==this._parentNode._children&&null!==this._parentNode._children||(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}},enumerable:!1,configurable:!0}),e.prototype._addToSceneRootNodes=function(){-1===this._sceneRootNodesIndex&&(this._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))},e.prototype._removeFromSceneRootNodes=function(){if(-1!==this._sceneRootNodesIndex){var e=this._scene.rootNodes,t=e.length-1;e[this._sceneRootNodesIndex]=e[t],e[this._sceneRootNodesIndex]._sceneRootNodesIndex=this._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._sceneRootNodesIndex=-1}},Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"Node"},Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEngine=function(){return this._scene.getEngine()},e.prototype.addBehavior=function(e,t){var r=this;return void 0===t&&(t=!1),-1!==this._behaviors.indexOf(e)||(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce((function(){e.attach(r)})):e.attach(this),this._behaviors.push(e)),this},e.prototype.removeBehavior=function(e){var t=this._behaviors.indexOf(e);return-1===t||(this._behaviors[t].detach(),this._behaviors.splice(t,1)),this},Object.defineProperty(e.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),e.prototype.getBehaviorByName=function(e){for(var t=0,r=this._behaviors;t<r.length;t++){var n=r[t];if(n.name===e)return n}return null},e.prototype.getWorldMatrix=function(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix},e.prototype._getWorldMatrixDeterminant=function(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant},Object.defineProperty(e.prototype,"worldMatrixFromCache",{get:function(){return this._worldMatrix},enumerable:!1,configurable:!0}),e.prototype._initCache=function(){this._cache={},this._cache.parent=void 0},e.prototype.updateCache=function(e){!e&&this.isSynchronized()||(this._cache.parent=this.parent,this._updateCache())},e.prototype._getActionManagerForTrigger=function(e,t){return void 0===t&&(t=!0),this.parent?this.parent._getActionManagerForTrigger(e,!1):null},e.prototype._updateCache=function(e){},e.prototype._isSynchronized=function(){return!0},e.prototype._markSyncedWithParent=function(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)},e.prototype.isSynchronizedWithParent=function(){return!this._parentNode||this._parentUpdateId===this._parentNode._childUpdateId&&this._parentNode.isSynchronized()},e.prototype.isSynchronized=function(){return this._cache.parent!=this._parentNode?(this._cache.parent=this._parentNode,!1):!(this._parentNode&&!this.isSynchronizedWithParent())&&this._isSynchronized()},e.prototype.isReady=function(e){return void 0===e&&(e=!1),this._isReady},e.prototype.isEnabled=function(e){return void 0===e&&(e=!0),!1===e?this._isEnabled:!!this._isEnabled&&this._isParentEnabled},e.prototype._syncParentEnabledState=function(){this._isParentEnabled=!this._parentNode||this._parentNode.isEnabled(),this._children&&this._children.forEach((function(e){e._syncParentEnabledState()}))},e.prototype.setEnabled=function(e){this._isEnabled=e,this._syncParentEnabledState()},e.prototype.isDescendantOf=function(e){return!!this.parent&&(this.parent===e||this.parent.isDescendantOf(e))},e.prototype._getDescendants=function(e,t,r){if(void 0===t&&(t=!1),this._children)for(var n=0;n<this._children.length;n++){var i=this._children[n];r&&!r(i)||e.push(i),t||i._getDescendants(e,!1,r)}},e.prototype.getDescendants=function(e,t){var r=new Array;return this._getDescendants(r,e,t),r},e.prototype.getChildMeshes=function(e,t){var r=[];return this._getDescendants(r,e,(function(e){return(!t||t(e))&&void 0!==e.cullingStrategy})),r},e.prototype.getChildren=function(e,t){return void 0===t&&(t=!0),this.getDescendants(t,e)},e.prototype._setReady=function(e){e!==this._isReady&&(e?(this.onReady&&this.onReady(this),this._isReady=!0):this._isReady=!1)},e.prototype.getAnimationByName=function(e){for(var t=0;t<this.animations.length;t++){var r=this.animations[t];if(r.name===e)return r}return null},e.prototype.createAnimationRange=function(t,r,n){if(!this._ranges[t]){this._ranges[t]=e._AnimationRangeFactory(t,r,n);for(var i=0,o=this.animations.length;i<o;i++)this.animations[i]&&this.animations[i].createRange(t,r,n)}},e.prototype.deleteAnimationRange=function(e,t){void 0===t&&(t=!0);for(var r=0,n=this.animations.length;r<n;r++)this.animations[r]&&this.animations[r].deleteRange(e,t);this._ranges[e]=null},e.prototype.getAnimationRange=function(e){return this._ranges[e]||null},e.prototype.getAnimationRanges=function(){var e,t=[];for(e in this._ranges)t.push(this._ranges[e]);return t},e.prototype.beginAnimation=function(e,t,r,n){var i=this.getAnimationRange(e);return i?this._scene.beginAnimation(this,i.from,i.to,t,r,n):null},e.prototype.serializeAnimationRanges=function(){var e=[];for(var t in this._ranges){var r=this._ranges[t];if(r){var n={};n.name=t,n.from=r.from,n.to=r.to,e.push(n)}}return e},e.prototype.computeWorldMatrix=function(e){return this._worldMatrix||(this._worldMatrix=i.Matrix.Identity()),this._worldMatrix},e.prototype.dispose=function(e,t){if(void 0===t&&(t=!1),this._isDisposed=!0,!e)for(var r=0,n=this.getDescendants(!0);r<n.length;r++)n[r].dispose(e,t);this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear();for(var i=0,o=this._behaviors;i<o.length;i++)o[i].detach();this._behaviors=[]},e.ParseAnimationRanges=function(e,t,r){if(t.ranges)for(var n=0;n<t.ranges.length;n++){var i=t.ranges[n];e.createAnimationRange(i.name,i.from,i.to)}},e.prototype.getHierarchyBoundingVectors=function(e,t){var r,n;if(void 0===e&&(e=!0),void 0===t&&(t=null),this.getScene().incrementRenderId(),this.computeWorldMatrix(!0),this.getBoundingInfo&&this.subMeshes){var o=this.getBoundingInfo();r=o.boundingBox.minimumWorld.clone(),n=o.boundingBox.maximumWorld.clone()}else r=new i.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new i.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(e)for(var s=0,a=this.getDescendants(!1);s<a.length;s++){var l=a[s];if(l.computeWorldMatrix(!0),(!t||t(l))&&l.getBoundingInfo&&0!==l.getTotalVertices()){var c=l.getBoundingInfo().boundingBox,u=c.minimumWorld,d=c.maximumWorld;i.Vector3.CheckExtends(u,r,n),i.Vector3.CheckExtends(d,r,n)}}return{min:r,max:n}},e._AnimationRangeFactory=function(e,t,r){throw l._DevTools.WarnImport("AnimationRange")},e._NodeConstructors={},Object(n.__decorate)([Object(o.serialize)()],e.prototype,"name",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"id",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"uniqueId",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"state",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"metadata",void 0),e}()},"./scene.ts":
- /*!******************!*\
- !*** ./scene.ts ***!
- \******************/
- /*! exports provided: Scene */function(e,t,r){"use strict";r.r(t),r.d(t,"Scene",(function(){return N}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./Misc/tools */"./Misc/tools.ts"),o=r(/*! ./Misc/precisionDate */"./Misc/precisionDate.ts"),s=r(/*! ./Misc/observable */"./Misc/observable.ts"),a=r(/*! ./Misc/smartArray */"./Misc/smartArray.ts"),l=r(/*! ./Misc/stringDictionary */"./Misc/stringDictionary.ts"),c=r(/*! ./Misc/tags */"./Misc/tags.ts"),u=r(/*! ./Maths/math.vector */"./Maths/math.vector.ts"),d=r(/*! ./Meshes/transformNode */"./Meshes/transformNode.ts"),h=r(/*! ./Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),f=r(/*! ./Cameras/camera */"./Cameras/camera.ts"),p=r(/*! ./abstractScene */"./abstractScene.ts"),m=r(/*! ./Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),g=r(/*! ./Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),_=r(/*! ./Lights/light */"./Lights/light.ts"),v=r(/*! ./Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),y=r(/*! ./Actions/actionEvent */"./Actions/actionEvent.ts"),b=r(/*! ./PostProcesses/postProcessManager */"./PostProcesses/postProcessManager.ts"),A=r(/*! ./Rendering/renderingManager */"./Rendering/renderingManager.ts"),T=r(/*! ./sceneComponent */"./sceneComponent.ts"),M=r(/*! ./Engines/constants */"./Engines/constants.ts"),P=r(/*! ./Misc/domManagement */"./Misc/domManagement.ts"),S=r(/*! ./Misc/logger */"./Misc/logger.ts"),E=r(/*! ./Engines/engineStore */"./Engines/engineStore.ts"),C=r(/*! ./Misc/devTools */"./Misc/devTools.ts"),x=r(/*! ./Inputs/scene.inputManager */"./Inputs/scene.inputManager.ts"),R=r(/*! ./Misc/perfCounter */"./Misc/perfCounter.ts"),O=r(/*! ./Maths/math.color */"./Maths/math.color.ts"),I=r(/*! ./Maths/math.frustum */"./Maths/math.frustum.ts"),D=r(/*! ./Misc/uniqueIdGenerator */"./Misc/uniqueIdGenerator.ts"),B=r(/*! ./Misc/fileTools */"./Misc/fileTools.ts"),N=function(e){function t(r,i){var o=e.call(this)||this;o._inputManager=new x.InputManager(o),o.cameraToUseForPointers=null,o._isScene=!0,o._blockEntityCollection=!1,o.autoClear=!0,o.autoClearDepthAndStencil=!0,o.clearColor=new O.Color4(.2,.2,.3,1),o.ambientColor=new O.Color3(0,0,0),o._environmentIntensity=1,o._forceWireframe=!1,o._skipFrustumClipping=!1,o._forcePointsCloud=!1,o.animationsEnabled=!0,o._animationPropertiesOverride=null,o.useConstantAnimationDeltaTime=!1,o.constantlyUpdateMeshUnderPointer=!1,o.hoverCursor="pointer",o.defaultCursor="",o.doNotHandleCursors=!1,o.preventDefaultOnPointerDown=!0,o.preventDefaultOnPointerUp=!0,o.metadata=null,o.reservedDataStore=null,o.disableOfflineSupportExceptionRules=new Array,o.onDisposeObservable=new s.Observable,o._onDisposeObserver=null,o.onBeforeRenderObservable=new s.Observable,o._onBeforeRenderObserver=null,o.onAfterRenderObservable=new s.Observable,o.onAfterRenderCameraObservable=new s.Observable,o._onAfterRenderObserver=null,o.onBeforeAnimationsObservable=new s.Observable,o.onAfterAnimationsObservable=new s.Observable,o.onBeforeDrawPhaseObservable=new s.Observable,o.onAfterDrawPhaseObservable=new s.Observable,o.onReadyObservable=new s.Observable,o.onBeforeCameraRenderObservable=new s.Observable,o._onBeforeCameraRenderObserver=null,o.onAfterCameraRenderObservable=new s.Observable,o._onAfterCameraRenderObserver=null,o.onBeforeActiveMeshesEvaluationObservable=new s.Observable,o.onAfterActiveMeshesEvaluationObservable=new s.Observable,o.onBeforeParticlesRenderingObservable=new s.Observable,o.onAfterParticlesRenderingObservable=new s.Observable,o.onDataLoadedObservable=new s.Observable,o.onNewCameraAddedObservable=new s.Observable,o.onCameraRemovedObservable=new s.Observable,o.onNewLightAddedObservable=new s.Observable,o.onLightRemovedObservable=new s.Observable,o.onNewGeometryAddedObservable=new s.Observable,o.onGeometryRemovedObservable=new s.Observable,o.onNewTransformNodeAddedObservable=new s.Observable,o.onTransformNodeRemovedObservable=new s.Observable,o.onNewMeshAddedObservable=new s.Observable,o.onMeshRemovedObservable=new s.Observable,o.onNewSkeletonAddedObservable=new s.Observable,o.onSkeletonRemovedObservable=new s.Observable,o.onNewMaterialAddedObservable=new s.Observable,o.onMaterialRemovedObservable=new s.Observable,o.onNewTextureAddedObservable=new s.Observable,o.onTextureRemovedObservable=new s.Observable,o.onBeforeRenderTargetsRenderObservable=new s.Observable,o.onAfterRenderTargetsRenderObservable=new s.Observable,o.onBeforeStepObservable=new s.Observable,o.onAfterStepObservable=new s.Observable,o.onActiveCameraChanged=new s.Observable,o.onBeforeRenderingGroupObservable=new s.Observable,o.onAfterRenderingGroupObservable=new s.Observable,o.onMeshImportedObservable=new s.Observable,o.onAnimationFileImportedObservable=new s.Observable,o._registeredForLateAnimationBindings=new a.SmartArrayNoDuplicate(256),o.onPrePointerObservable=new s.Observable,o.onPointerObservable=new s.Observable,o.onPreKeyboardObservable=new s.Observable,o.onKeyboardObservable=new s.Observable,o._useRightHandedSystem=!1,o._timeAccumulator=0,o._currentStepId=0,o._currentInternalStep=0,o._fogEnabled=!0,o._fogMode=t.FOGMODE_NONE,o.fogColor=new O.Color3(.2,.2,.3),o.fogDensity=.1,o.fogStart=0,o.fogEnd=1e3,o.prePass=!1,o._shadowsEnabled=!0,o._lightsEnabled=!0,o.activeCameras=new Array,o._texturesEnabled=!0,o.physicsEnabled=!0,o.particlesEnabled=!0,o.spritesEnabled=!0,o._skeletonsEnabled=!0,o.lensFlaresEnabled=!0,o.collisionsEnabled=!0,o.gravity=new u.Vector3(0,-9.807,0),o.postProcessesEnabled=!0,o.postProcesses=new Array,o.renderTargetsEnabled=!0,o.dumpNextRenderTargets=!1,o.customRenderTargets=new Array,o.importedMeshesFiles=new Array,o.probesEnabled=!0,o._meshesForIntersections=new a.SmartArrayNoDuplicate(256),o.proceduralTexturesEnabled=!0,o._totalVertices=new R.PerfCounter,o._activeIndices=new R.PerfCounter,o._activeParticles=new R.PerfCounter,o._activeBones=new R.PerfCounter,o._animationTime=0,o.animationTimeScale=1,o._renderId=0,o._frameId=0,o._executeWhenReadyTimeoutId=-1,o._intermediateRendering=!1,o._viewUpdateFlag=-1,o._projectionUpdateFlag=-1,o._toBeDisposed=new Array(256),o._activeRequests=new Array,o._pendingData=new Array,o._isDisposed=!1,o.dispatchAllSubMeshesOfActiveMeshes=!1,o._activeMeshes=new a.SmartArray(256),o._processedMaterials=new a.SmartArray(256),o._renderTargets=new a.SmartArrayNoDuplicate(256),o._activeParticleSystems=new a.SmartArray(256),o._activeSkeletons=new a.SmartArrayNoDuplicate(32),o._softwareSkinnedMeshes=new a.SmartArrayNoDuplicate(32),o._activeAnimatables=new Array,o._transformMatrix=u.Matrix.Zero(),o.requireLightSorting=!1,o._components=[],o._serializableComponents=[],o._transientComponents=[],o._beforeCameraUpdateStage=T.Stage.Create(),o._beforeClearStage=T.Stage.Create(),o._gatherRenderTargetsStage=T.Stage.Create(),o._gatherActiveCameraRenderTargetsStage=T.Stage.Create(),o._isReadyForMeshStage=T.Stage.Create(),o._beforeEvaluateActiveMeshStage=T.Stage.Create(),o._evaluateSubMeshStage=T.Stage.Create(),o._activeMeshStage=T.Stage.Create(),o._cameraDrawRenderTargetStage=T.Stage.Create(),o._beforeCameraDrawStage=T.Stage.Create(),o._beforeRenderTargetDrawStage=T.Stage.Create(),o._beforeRenderingGroupDrawStage=T.Stage.Create(),o._beforeRenderingMeshStage=T.Stage.Create(),o._afterRenderingMeshStage=T.Stage.Create(),o._afterRenderingGroupDrawStage=T.Stage.Create(),o._afterCameraDrawStage=T.Stage.Create(),o._afterRenderTargetDrawStage=T.Stage.Create(),o._afterRenderStage=T.Stage.Create(),o._pointerMoveStage=T.Stage.Create(),o._pointerDownStage=T.Stage.Create(),o._pointerUpStage=T.Stage.Create(),o.geometriesByUniqueId=null,o._defaultMeshCandidates={data:[],length:0},o._defaultSubMeshCandidates={data:[],length:0},o._preventFreeActiveMeshesAndRenderingGroups=!1,o._activeMeshesFrozen=!1,o._skipEvaluateActiveMeshesCompletely=!1,o._allowPostProcessClearColor=!0,o.getDeterministicFrameTime=function(){return o._engine.getTimeStep()},o._blockMaterialDirtyMechanism=!1;var l=Object(n.__assign)({useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1},i);return o._engine=r||E.EngineStore.LastCreatedEngine,l.virtual||(E.EngineStore._LastCreatedScene=o,o._engine.scenes.push(o)),o._uid=null,o._renderingManager=new A.RenderingManager(o),b.PostProcessManager&&(o.postProcessManager=new b.PostProcessManager(o)),P.DomManagement.IsWindowObjectExist()&&o.attachControl(),o._createUbo(),m.ImageProcessingConfiguration&&(o._imageProcessingConfiguration=new m.ImageProcessingConfiguration),o.setDefaultCandidateProviders(),l.useGeometryUniqueIdsMap&&(o.geometriesByUniqueId={}),o.useMaterialMeshMap=l.useMaterialMeshMap,o.useClonedMeshMap=l.useClonedMeshMap,i&&i.virtual||o._engine.onNewSceneAddedObservable.notifyObservers(o),o}return Object(n.__extends)(t,e),t.DefaultMaterialFactory=function(e){throw C._DevTools.WarnImport("StandardMaterial")},t.CollisionCoordinatorFactory=function(){throw C._DevTools.WarnImport("DefaultCollisionCoordinator")},Object.defineProperty(t.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"environmentIntensity",{get:function(){return this._environmentIntensity},set:function(e){this._environmentIntensity!==e&&(this._environmentIntensity=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forceWireframe",{get:function(){return this._forceWireframe},set:function(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipFrustumClipping",{get:function(){return this._skipFrustumClipping},set:function(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forcePointsCloud",{get:function(){return this._forcePointsCloud},set:function(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"afterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforeCameraRender",{set:function(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"afterCameraRender",{set:function(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unTranslatedPointer",{get:function(){return this._inputManager.unTranslatedPointer},enumerable:!1,configurable:!0}),Object.defineProperty(t,"DragMovementThreshold",{get:function(){return x.InputManager.DragMovementThreshold},set:function(e){x.InputManager.DragMovementThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"LongPressDelay",{get:function(){return x.InputManager.LongPressDelay},set:function(e){x.InputManager.LongPressDelay=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"DoubleClickDelay",{get:function(){return x.InputManager.DoubleClickDelay},set:function(e){x.InputManager.DoubleClickDelay=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ExclusiveDoubleClickMode",{get:function(){return x.InputManager.ExclusiveDoubleClickMode},set:function(e){x.InputManager.ExclusiveDoubleClickMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useRightHandedSystem",{get:function(){return this._useRightHandedSystem},set:function(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),t.prototype.setStepId=function(e){this._currentStepId=e},t.prototype.getStepId=function(){return this._currentStepId},t.prototype.getInternalStep=function(){return this._currentInternalStep},Object.defineProperty(t.prototype,"fogEnabled",{get:function(){return this._fogEnabled},set:function(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fogMode",{get:function(){return this._fogMode},set:function(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowsEnabled",{get:function(){return this._shadowsEnabled},set:function(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_LightDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightsEnabled",{get:function(){return this._lightsEnabled},set:function(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_LightDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeCamera",{get:function(){return this._activeCamera},set:function(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultMaterial",{get:function(){return this._defaultMaterial||(this._defaultMaterial=t.DefaultMaterialFactory(this)),this._defaultMaterial},set:function(e){this._defaultMaterial=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texturesEnabled",{get:function(){return this._texturesEnabled},set:function(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skeletonsEnabled",{get:function(){return this._skeletonsEnabled},set:function(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(M.Constants.MATERIAL_AttributesDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"collisionCoordinator",{get:function(){return this._collisionCoordinator||(this._collisionCoordinator=t.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frustumPlanes",{get:function(){return this._frustumPlanes},enumerable:!1,configurable:!0}),t.prototype._registerTransientComponents=function(){if(this._transientComponents.length>0){for(var e=0,t=this._transientComponents;e<t.length;e++)t[e].register();this._transientComponents=[]}},t.prototype._addComponent=function(e){this._components.push(e),this._transientComponents.push(e);var t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)},t.prototype._getComponent=function(e){for(var t=0,r=this._components;t<r.length;t++){var n=r[t];if(n.name===e)return n}return null},t.prototype.getClassName=function(){return"Scene"},t.prototype._getDefaultMeshCandidates=function(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates},t.prototype._getDefaultSubMeshCandidates=function(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates},t.prototype.setDefaultCandidateProviders=function(){this.getActiveMeshCandidates=this._getDefaultMeshCandidates.bind(this),this.getActiveSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this),this.getIntersectingSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this),this.getCollidingSubMeshCandidates=this._getDefaultSubMeshCandidates.bind(this)},Object.defineProperty(t.prototype,"meshUnderPointer",{get:function(){return this._inputManager.meshUnderPointer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerX",{get:function(){return this._inputManager.pointerX},set:function(e){this._inputManager.pointerX=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerY",{get:function(){return this._inputManager.pointerY},set:function(e){this._inputManager.pointerY=e},enumerable:!1,configurable:!0}),t.prototype.getCachedMaterial=function(){return this._cachedMaterial},t.prototype.getCachedEffect=function(){return this._cachedEffect},t.prototype.getCachedVisibility=function(){return this._cachedVisibility},t.prototype.isCachedMaterialInvalid=function(e,t,r){return void 0===r&&(r=1),this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==r},t.prototype.getEngine=function(){return this._engine},t.prototype.getTotalVertices=function(){return this._totalVertices.current},Object.defineProperty(t.prototype,"totalVerticesPerfCounter",{get:function(){return this._totalVertices},enumerable:!1,configurable:!0}),t.prototype.getActiveIndices=function(){return this._activeIndices.current},Object.defineProperty(t.prototype,"totalActiveIndicesPerfCounter",{get:function(){return this._activeIndices},enumerable:!1,configurable:!0}),t.prototype.getActiveParticles=function(){return this._activeParticles.current},Object.defineProperty(t.prototype,"activeParticlesPerfCounter",{get:function(){return this._activeParticles},enumerable:!1,configurable:!0}),t.prototype.getActiveBones=function(){return this._activeBones.current},Object.defineProperty(t.prototype,"activeBonesPerfCounter",{get:function(){return this._activeBones},enumerable:!1,configurable:!0}),t.prototype.getActiveMeshes=function(){return this._activeMeshes},t.prototype.getAnimationRatio=function(){return void 0!==this._animationRatio?this._animationRatio:1},t.prototype.getRenderId=function(){return this._renderId},t.prototype.getFrameId=function(){return this._frameId},t.prototype.incrementRenderId=function(){this._renderId++},t.prototype._createUbo=function(){this._sceneUbo=new g.UniformBuffer(this._engine,void 0,!0),this._sceneUbo.addUniform("viewProjection",16),this._sceneUbo.addUniform("view",16)},t.prototype.simulatePointerMove=function(e,t){return this._inputManager.simulatePointerMove(e,t),this},t.prototype.simulatePointerDown=function(e,t){return this._inputManager.simulatePointerDown(e,t),this},t.prototype.simulatePointerUp=function(e,t,r){return this._inputManager.simulatePointerUp(e,t,r),this},t.prototype.isPointerCaptured=function(e){return void 0===e&&(e=0),this._inputManager.isPointerCaptured(e)},t.prototype.attachControl=function(e,t,r){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===r&&(r=!0),this._inputManager.attachControl(e,t,r)},t.prototype.detachControl=function(){this._inputManager.detachControl()},t.prototype.isReady=function(){if(this._isDisposed)return!1;var e,t=this.getEngine();if(!t.areAllEffectsReady())return!1;if(this._pendingData.length>0)return!1;for(e=0;e<this.meshes.length;e++){var r=this.meshes[e];if(r.isEnabled()&&r.subMeshes&&0!==r.subMeshes.length){if(!r.isReady(!0))return!1;for(var n=r.hasThinInstances||"InstancedMesh"===r.getClassName()||"InstancedLinesMesh"===r.getClassName()||t.getCaps().instancedArrays&&r.instances.length>0,i=0,o=this._isReadyForMeshStage;i<o.length;i++)if(!o[i].action(r,n))return!1}}for(e=0;e<this.geometries.length;e++)if(this.geometries[e].delayLoadState===M.Constants.DELAYLOADSTATE_LOADING)return!1;if(this.activeCameras&&this.activeCameras.length>0){for(var s=0,a=this.activeCameras;s<a.length;s++)if(!a[s].isReady(!0))return!1}else if(this.activeCamera&&!this.activeCamera.isReady(!0))return!1;for(var l=0,c=this.particleSystems;l<c.length;l++)if(!c[l].isReady())return!1;return!0},t.prototype.resetCachedMaterial=function(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null},t.prototype.registerBeforeRender=function(e){this.onBeforeRenderObservable.add(e)},t.prototype.unregisterBeforeRender=function(e){this.onBeforeRenderObservable.removeCallback(e)},t.prototype.registerAfterRender=function(e){this.onAfterRenderObservable.add(e)},t.prototype.unregisterAfterRender=function(e){this.onAfterRenderObservable.removeCallback(e)},t.prototype._executeOnceBeforeRender=function(e){var t=this,r=function(){e(),setTimeout((function(){t.unregisterBeforeRender(r)}))};this.registerBeforeRender(r)},t.prototype.executeOnceBeforeRender=function(e,t){var r=this;void 0!==t?setTimeout((function(){r._executeOnceBeforeRender(e)}),t):this._executeOnceBeforeRender(e)},t.prototype._addPendingData=function(e){this._pendingData.push(e)},t.prototype._removePendingData=function(e){var t=this.isLoading,r=this._pendingData.indexOf(e);-1!==r&&this._pendingData.splice(r,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)},t.prototype.getWaitingItemsCount=function(){return this._pendingData.length},Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._pendingData.length>0},enumerable:!1,configurable:!0}),t.prototype.executeWhenReady=function(e){var t=this;this.onReadyObservable.add(e),-1===this._executeWhenReadyTimeoutId&&(this._executeWhenReadyTimeoutId=setTimeout((function(){t._checkIsReady()}),150))},t.prototype.whenReadyAsync=function(){var e=this;return new Promise((function(t){e.executeWhenReady((function(){t()}))}))},t.prototype._checkIsReady=function(){var e=this;return this._registerTransientComponents(),this.isReady()?(this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1)):this._isDisposed?(this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1)):void(this._executeWhenReadyTimeoutId=setTimeout((function(){e._checkIsReady()}),150))},Object.defineProperty(t.prototype,"animatables",{get:function(){return this._activeAnimatables},enumerable:!1,configurable:!0}),t.prototype.resetLastAnimationTimeFrame=function(){this._animationTimeLast=o.PrecisionDate.Now},t.prototype.getViewMatrix=function(){return this._viewMatrix},t.prototype.getProjectionMatrix=function(){return this._projectionMatrix},t.prototype.getTransformMatrix=function(){return this._transformMatrix},t.prototype.setTransformMatrix=function(e,t,r,n){this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag||(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?I.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=I.Frustum.GetPlanes(this._transformMatrix),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(r,n):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.update()))},t.prototype.getSceneUniformBuffer=function(){return this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo},t.prototype.getUniqueId=function(){return D.UniqueIdGenerator.UniqueId},t.prototype.addMesh=function(e,t){var r=this;void 0===t&&(t=!1),this._blockEntityCollection||(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),this.onNewMeshAddedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach((function(e){r.addMesh(e)})))},t.prototype.removeMesh=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.meshes.indexOf(e);return-1!==n&&(this.meshes[n]=this.meshes[this.meshes.length-1],this.meshes.pop(),e.parent||e._removeFromSceneRootNodes()),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach((function(e){r.removeMesh(e)})),n},t.prototype.addTransformNode=function(e){this._blockEntityCollection||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))},t.prototype.removeTransformNode=function(e){var t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){var r=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=r,r._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t},t.prototype.removeSkeleton=function(e){var t=this.skeletons.indexOf(e);return-1!==t&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e)),t},t.prototype.removeMorphTargetManager=function(e){var t=this.morphTargetManagers.indexOf(e);return-1!==t&&this.morphTargetManagers.splice(t,1),t},t.prototype.removeLight=function(e){var t=this.lights.indexOf(e);if(-1!==t){for(var r=0,n=this.meshes;r<n.length;r++)n[r]._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes()}return this.onLightRemovedObservable.notifyObservers(e),t},t.prototype.removeCamera=function(e){var t=this.cameras.indexOf(e);-1!==t&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes());var r=this.activeCameras.indexOf(e);return-1!==r&&this.activeCameras.splice(r,1),this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t},t.prototype.removeParticleSystem=function(e){var t=this.particleSystems.indexOf(e);return-1!==t&&this.particleSystems.splice(t,1),t},t.prototype.removeAnimation=function(e){var t=this.animations.indexOf(e);return-1!==t&&this.animations.splice(t,1),t},t.prototype.stopAnimation=function(e,t,r){},t.prototype.removeAnimationGroup=function(e){var t=this.animationGroups.indexOf(e);return-1!==t&&this.animationGroups.splice(t,1),t},t.prototype.removeMultiMaterial=function(e){var t=this.multiMaterials.indexOf(e);return-1!==t&&this.multiMaterials.splice(t,1),t},t.prototype.removeMaterial=function(e){var t=e._indexInSceneMaterialArray;if(-1!==t&&t<this.materials.length){if(t!==this.materials.length-1){var r=this.materials[this.materials.length-1];this.materials[t]=r,r._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t},t.prototype.removeActionManager=function(e){var t=this.actionManagers.indexOf(e);return-1!==t&&this.actionManagers.splice(t,1),t},t.prototype.removeTexture=function(e){var t=this.textures.indexOf(e);return-1!==t&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t},t.prototype.addLight=function(e){if(!this._blockEntityCollection){this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes();for(var t=0,r=this.meshes;t<r.length;t++){var n=r[t];-1===n.lightSources.indexOf(e)&&(n.lightSources.push(e),n._resyncLightSources())}this.onNewLightAddedObservable.notifyObservers(e)}},t.prototype.sortLightsByPriority=function(){this.requireLightSorting&&this.lights.sort(_.Light.CompareLightsPriority)},t.prototype.addCamera=function(e){this._blockEntityCollection||(this.cameras.push(e),this.onNewCameraAddedObservable.notifyObservers(e),e.parent||e._addToSceneRootNodes())},t.prototype.addSkeleton=function(e){this._blockEntityCollection||(this.skeletons.push(e),this.onNewSkeletonAddedObservable.notifyObservers(e))},t.prototype.addParticleSystem=function(e){this._blockEntityCollection||this.particleSystems.push(e)},t.prototype.addAnimation=function(e){this._blockEntityCollection||this.animations.push(e)},t.prototype.addAnimationGroup=function(e){this._blockEntityCollection||this.animationGroups.push(e)},t.prototype.addMultiMaterial=function(e){this._blockEntityCollection||this.multiMaterials.push(e)},t.prototype.addMaterial=function(e){this._blockEntityCollection||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),this.onNewMaterialAddedObservable.notifyObservers(e))},t.prototype.addMorphTargetManager=function(e){this._blockEntityCollection||this.morphTargetManagers.push(e)},t.prototype.addGeometry=function(e){this._blockEntityCollection||(this.geometriesByUniqueId&&(this.geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))},t.prototype.addActionManager=function(e){this.actionManagers.push(e)},t.prototype.addTexture=function(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))},t.prototype.switchActiveCamera=function(e,t){void 0===t&&(t=!0);var r=this._engine.getInputElement();r&&(this.activeCamera&&this.activeCamera.detachControl(r),this.activeCamera=e,t&&e.attachControl(r))},t.prototype.setActiveCameraByID=function(e){var t=this.getCameraByID(e);return t?(this.activeCamera=t,t):null},t.prototype.setActiveCameraByName=function(e){var t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null},t.prototype.getAnimationGroupByName=function(e){for(var t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null},t.prototype.getMaterialByUniqueID=function(e){for(var t=0;t<this.materials.length;t++)if(this.materials[t].uniqueId===e)return this.materials[t];return null},t.prototype.getMaterialByID=function(e){for(var t=0;t<this.materials.length;t++)if(this.materials[t].id===e)return this.materials[t];return null},t.prototype.getLastMaterialByID=function(e){for(var t=this.materials.length-1;t>=0;t--)if(this.materials[t].id===e)return this.materials[t];return null},t.prototype.getMaterialByName=function(e){for(var t=0;t<this.materials.length;t++)if(this.materials[t].name===e)return this.materials[t];return null},t.prototype.getTextureByUniqueID=function(e){for(var t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null},t.prototype.getCameraByID=function(e){for(var t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null},t.prototype.getCameraByUniqueID=function(e){for(var t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null},t.prototype.getCameraByName=function(e){for(var t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null},t.prototype.getBoneByID=function(e){for(var t=0;t<this.skeletons.length;t++)for(var r=this.skeletons[t],n=0;n<r.bones.length;n++)if(r.bones[n].id===e)return r.bones[n];return null},t.prototype.getBoneByName=function(e){for(var t=0;t<this.skeletons.length;t++)for(var r=this.skeletons[t],n=0;n<r.bones.length;n++)if(r.bones[n].name===e)return r.bones[n];return null},t.prototype.getLightByName=function(e){for(var t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null},t.prototype.getLightByID=function(e){for(var t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null},t.prototype.getLightByUniqueID=function(e){for(var t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null},t.prototype.getParticleSystemByID=function(e){for(var t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null},t.prototype.getGeometryByID=function(e){for(var t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null},t.prototype._getGeometryByUniqueID=function(e){if(this.geometriesByUniqueId){var t=this.geometriesByUniqueId[e];if(void 0!==t)return this.geometries[t]}else for(var r=0;r<this.geometries.length;r++)if(this.geometries[r].uniqueId===e)return this.geometries[r];return null},t.prototype.pushGeometry=function(e,t){return!(!t&&this._getGeometryByUniqueID(e.uniqueId)||(this.addGeometry(e),this.onNewGeometryAddedObservable.notifyObservers(e),0))},t.prototype.removeGeometry=function(e){var t;if(this.geometriesByUniqueId){if(void 0===(t=this.geometriesByUniqueId[e.uniqueId]))return!1}else if((t=this.geometries.indexOf(e))<0)return!1;if(t!==this.geometries.length-1){var r=this.geometries[this.geometries.length-1];this.geometries[t]=r,this.geometriesByUniqueId&&(this.geometriesByUniqueId[r.uniqueId]=t,this.geometriesByUniqueId[e.uniqueId]=void 0)}return this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0},t.prototype.getGeometries=function(){return this.geometries},t.prototype.getMeshByID=function(e){for(var t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null},t.prototype.getMeshesByID=function(e){return this.meshes.filter((function(t){return t.id===e}))},t.prototype.getTransformNodeByID=function(e){for(var t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null},t.prototype.getTransformNodeByUniqueID=function(e){for(var t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null},t.prototype.getTransformNodesByID=function(e){return this.transformNodes.filter((function(t){return t.id===e}))},t.prototype.getMeshByUniqueID=function(e){for(var t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null},t.prototype.getLastMeshByID=function(e){for(var t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null},t.prototype.getLastEntryByID=function(e){var t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];return null},t.prototype.getNodeByID=function(e){var t=this.getMeshByID(e);if(t)return t;var r=this.getTransformNodeByID(e);if(r)return r;var n=this.getLightByID(e);if(n)return n;var i=this.getCameraByID(e);if(i)return i;var o=this.getBoneByID(e);return o||null},t.prototype.getNodeByName=function(e){var t=this.getMeshByName(e);if(t)return t;var r=this.getTransformNodeByName(e);if(r)return r;var n=this.getLightByName(e);if(n)return n;var i=this.getCameraByName(e);if(i)return i;var o=this.getBoneByName(e);return o||null},t.prototype.getMeshByName=function(e){for(var t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null},t.prototype.getTransformNodeByName=function(e){for(var t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null},t.prototype.getLastSkeletonByID=function(e){for(var t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null},t.prototype.getSkeletonByUniqueId=function(e){for(var t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null},t.prototype.getSkeletonById=function(e){for(var t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null},t.prototype.getSkeletonByName=function(e){for(var t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null},t.prototype.getMorphTargetManagerById=function(e){for(var t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null},t.prototype.getMorphTargetById=function(e){for(var t=0;t<this.morphTargetManagers.length;++t)for(var r=this.morphTargetManagers[t],n=0;n<r.numTargets;++n){var i=r.getTarget(n);if(i.id===e)return i}return null},t.prototype.getMorphTargetByName=function(e){for(var t=0;t<this.morphTargetManagers.length;++t)for(var r=this.morphTargetManagers[t],n=0;n<r.numTargets;++n){var i=r.getTarget(n);if(i.name===e)return i}return null},t.prototype.isActiveMesh=function(e){return-1!==this._activeMeshes.indexOf(e)},Object.defineProperty(t.prototype,"uid",{get:function(){return this._uid||(this._uid=i.Tools.RandomId()),this._uid},enumerable:!1,configurable:!0}),t.prototype.addExternalData=function(e,t){return this._externalData||(this._externalData=new l.StringDictionary),this._externalData.add(e,t)},t.prototype.getExternalData=function(e){return this._externalData?this._externalData.get(e):null},t.prototype.getOrAddExternalDataWithFactory=function(e,t){return this._externalData||(this._externalData=new l.StringDictionary),this._externalData.getOrAddWithFactory(e,t)},t.prototype.removeExternalData=function(e){return this._externalData.remove(e)},t.prototype._evaluateSubMesh=function(e,t,r){if(r.hasInstances||r.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh||1===t.subMeshes.length||e.isInFrustum(this._frustumPlanes)){for(var n=0,i=this._evaluateSubMeshStage;n<i.length;n++)i[n].action(t,e);var o=e.getMaterial();null!=o&&(o.hasRenderTargetTextures&&null!=o.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(o)&&(this._processedMaterials.push(o),this._renderTargets.concatWithNoDuplicate(o.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,o))}},t.prototype.freeProcessedMaterials=function(){this._processedMaterials.dispose()},Object.defineProperty(t.prototype,"blockfreeActiveMeshesAndRenderingGroups",{get:function(){return this._preventFreeActiveMeshesAndRenderingGroups},set:function(e){this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)},enumerable:!1,configurable:!0}),t.prototype.freeActiveMeshes=function(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(var e=0;e<this.activeCameras.length;e++){var t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}},t.prototype.freeRenderingGroups=function(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(var e=0;e<this.textures.length;e++){var t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}},t.prototype._isInIntermediateRendering=function(){return this._intermediateRendering},t.prototype.freezeActiveMeshes=function(e){var t=this;return void 0===e&&(e=!1),this.executeWhenReady((function(){if(t.activeCamera){t._frustumPlanes||t.setTransformMatrix(t.activeCamera.getViewMatrix(),t.activeCamera.getProjectionMatrix()),t._evaluateActiveMeshes(),t._activeMeshesFrozen=!0,t._skipEvaluateActiveMeshesCompletely=e;for(var r=0;r<t._activeMeshes.length;r++)t._activeMeshes.data[r]._freeze()}})),this},t.prototype.unfreezeActiveMeshes=function(){for(var e=0;e<this.meshes.length;e++){var t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}for(e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this},t.prototype._evaluateActiveMeshes=function(){if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely)for(var e=this._activeMeshes.length,t=0;t<e;t++)(a=this._activeMeshes.data[t]).computeWorldMatrix();if(this._activeParticleSystems){var r=this._activeParticleSystems.length;for(t=0;t<r;t++)this._activeParticleSystems.data[t].animate()}}else if(this.activeCamera){this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(var n=0,i=this._beforeEvaluateActiveMeshStage;n<i.length;n++)i[n].action();var o=this.getActiveMeshCandidates(),s=o.length;for(t=0;t<s;t++){var a;if(!(a=o.data[t]).isBlocked&&(this._totalVertices.addCount(a.getTotalVertices(),!1),a.isReady()&&a.isEnabled()&&0!==a.scaling.lengthSquared())){a.computeWorldMatrix(),a.actionManager&&a.actionManager.hasSpecificTriggers2(M.Constants.ACTION_OnIntersectionEnterTrigger,M.Constants.ACTION_OnIntersectionExitTrigger)&&this._meshesForIntersections.pushNoDuplicate(a);var l=this.customLODSelector?this.customLODSelector(a,this.activeCamera):a.getLOD(this.activeCamera);null!=l&&(l!==a&&l.billboardMode!==d.TransformNode.BILLBOARDMODE_NONE&&l.computeWorldMatrix(),a._preActivate(),a.isVisible&&a.visibility>0&&0!=(a.layerMask&this.activeCamera.layerMask)&&(this._skipFrustumClipping||a.alwaysSelectAsActiveMesh||a.isInFrustum(this._frustumPlanes))&&(this._activeMeshes.push(a),this.activeCamera._activeMeshes.push(a),l!==a&&l._activate(this._renderId,!1),a._activate(this._renderId,!1)&&(a.isAnInstance?a._internalAbstractMeshDataInfo._actAsRegularMesh&&(l=a):l._internalAbstractMeshDataInfo._onlyForInstances=!1,l._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(a,l)),a._postActivate()))}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(var c=0;c<this.particleSystems.length;c++){var u=this.particleSystems[c];if(u.isStarted()&&u.emitter){var h=u.emitter;h.position&&!h.isEnabled()||(this._activeParticleSystems.push(u),u.animate(),this._renderingManager.dispatchParticles(u))}}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}},t.prototype._activeMesh=function(e,t){this._skeletonsEnabled&&null!==t.skeleton&&void 0!==t.skeleton&&(this._activeSkeletons.pushNoDuplicate(t.skeleton)&&t.skeleton.prepare(),t.computeBonesUsingShaders||this._softwareSkinnedMeshes.pushNoDuplicate(t));for(var r=0,n=this._activeMeshStage;r<n.length;r++)n[r].action(e,t);if(null!=t&&void 0!==t.subMeshes&&null!==t.subMeshes&&t.subMeshes.length>0)for(var i=this.getActiveSubMeshCandidates(t),o=i.length,s=0;s<o;s++){var a=i.data[s];this._evaluateSubMesh(a,t,e)}},t.prototype.updateTransformMatrix=function(e){this.activeCamera&&this.setTransformMatrix(this.activeCamera.getViewMatrix(),this.activeCamera.getProjectionMatrix(e))},t.prototype._bindFrameBuffer=function(){if(this.activeCamera&&this.activeCamera._multiviewTexture)this.activeCamera._multiviewTexture._bindFrameBuffer();else if(this.activeCamera&&this.activeCamera.outputRenderTarget)if(this.getEngine().getCaps().multiview&&this.activeCamera.outputRenderTarget&&this.activeCamera.outputRenderTarget.getViewCount()>1)this.activeCamera.outputRenderTarget._bindFrameBuffer();else{var e=this.activeCamera.outputRenderTarget.getInternalTexture();e?this.getEngine().bindFramebuffer(e):S.Logger.Error("Camera contains invalid customDefaultRenderTarget")}else this.getEngine().restoreDefaultFramebuffer()},t.prototype._renderForCamera=function(e,t){if(!e||!e._skipRendering){var r=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");r.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,this.getEngine().getCaps().multiview&&e.outputRenderTarget&&e.outputRenderTarget.getViewCount()>1?this.setTransformMatrix(e._rigCameras[0].getViewMatrix(),e._rigCameras[0].getProjectionMatrix(),e._rigCameras[1].getViewMatrix(),e._rigCameras[1].getProjectionMatrix()):this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._evaluateActiveMeshes();for(var n=0;n<this._softwareSkinnedMeshes.length;n++){var o=this._softwareSkinnedMeshes.data[n];o.applySkeleton(o.skeleton)}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets);for(var s=0,a=this._gatherActiveCameraRenderTargetsStage;s<a.length;s++)a[s].action(this._renderTargets);var l=!1;if(this.renderTargetsEnabled){if(this._intermediateRendering=!0,this._renderTargets.length>0){i.Tools.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(var c=0;c<this._renderTargets.length;c++){var u=this._renderTargets.data[c];if(u._shouldRender()){this._renderId++;var d=u.activeCamera&&u.activeCamera!==this.activeCamera;u.render(d,this.dumpNextRenderTargets),l=!0}}i.Tools.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}for(var h=0,f=this._cameraDrawRenderTargetStage;h<f.length;h++)l=f[h].action(this.activeCamera)||l;this._intermediateRendering=!1,this.activeCamera&&this.activeCamera.outputRenderTarget&&(l=!0)}l&&!this.prePass&&this._bindFrameBuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),!this.postProcessManager||e._multiviewTexture||this.prePass||this.postProcessManager._prepareFrame();for(var p=0,m=this._beforeCameraDrawStage;p<m.length;p++)m[p].action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this),this._renderingManager.render(null,null,!0,!0),this.onAfterDrawPhaseObservable.notifyObservers(this);for(var g=0,_=this._afterCameraDrawStage;g<_.length;g++)_[g].action(this.activeCamera);this.postProcessManager&&!e._multiviewTexture&&this.postProcessManager._finalizeFrame(e.isIntermediate),this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}},t.prototype._processSubCameras=function(e){if(e.cameraRigMode===f.Camera.RIG_MODE_NONE||e.outputRenderTarget&&e.outputRenderTarget.getViewCount()>1&&this.getEngine().getCaps().multiview)return this._renderForCamera(e),void this.onAfterRenderCameraObservable.notifyObservers(e);if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else for(var t=0;t<e._rigCameras.length;t++)this._renderForCamera(e._rigCameras[t],e);this._activeCamera=e,this.setTransformMatrix(this._activeCamera.getViewMatrix(),this._activeCamera.getProjectionMatrix()),this.onAfterRenderCameraObservable.notifyObservers(e)},t.prototype._checkIntersections=function(){for(var e=0;e<this._meshesForIntersections.length;e++){var t=this._meshesForIntersections.data[e];if(t.actionManager)for(var r=0;t.actionManager&&r<t.actionManager.actions.length;r++){var n=t.actionManager.actions[r];if(n.trigger===M.Constants.ACTION_OnIntersectionEnterTrigger||n.trigger===M.Constants.ACTION_OnIntersectionExitTrigger){var i=n.getTriggerParameter(),o=i instanceof h.AbstractMesh?i:i.mesh,s=o.intersectsMesh(t,i.usePreciseIntersection),a=t._intersectionsInProgress.indexOf(o);s&&-1===a?n.trigger===M.Constants.ACTION_OnIntersectionEnterTrigger?(n._executeCurrent(y.ActionEvent.CreateNew(t,void 0,o)),t._intersectionsInProgress.push(o)):n.trigger===M.Constants.ACTION_OnIntersectionExitTrigger&&t._intersectionsInProgress.push(o):!s&&a>-1&&(n.trigger===M.Constants.ACTION_OnIntersectionExitTrigger&&n._executeCurrent(y.ActionEvent.CreateNew(t,void 0,o)),t.actionManager.hasSpecificTrigger(M.Constants.ACTION_OnIntersectionExitTrigger,(function(e){var t=e instanceof h.AbstractMesh?e:e.mesh;return o===t}))&&n.trigger!==M.Constants.ACTION_OnIntersectionExitTrigger||t._intersectionsInProgress.splice(a,1))}}}},t.prototype._advancePhysicsEngineStep=function(e){},t.prototype._animate=function(){},t.prototype.animate=function(){if(this._engine.isDeterministicLockStep()){var e=Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime))+this._timeAccumulator,r=this._engine.getTimeStep(),n=1e3/r/1e3,i=0,o=this._engine.getLockstepMaxSteps(),s=Math.floor(e/r);for(s=Math.min(s,o);e>0&&i<s;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=r*n,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(r),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,i++,e-=r;this._timeAccumulator=e<0?0:e}else e=this.useConstantAnimationDeltaTime?16:Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime)),this._animationRatio=.06*e,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)},t.prototype.render=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!1),!this.isDisposed){this.onReadyObservable.hasObservers()&&-1===this._executeWhenReadyTimeoutId&&this._checkIsReady(),this._frameId++,this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(M.Constants.ACTION_OnEveryFrameTrigger),t||this.animate();for(var r=0,n=this._beforeCameraUpdateStage;r<n.length;r++)n[r].action();if(e)if(this.activeCameras.length>0)for(var o=0;o<this.activeCameras.length;o++){var s=this.activeCameras[o];if(s.update(),s.cameraRigMode!==f.Camera.RIG_MODE_NONE)for(var a=0;a<s._rigCameras.length;a++)s._rigCameras[a].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==f.Camera.RIG_MODE_NONE))for(a=0;a<this.activeCamera._rigCameras.length;a++)this.activeCamera._rigCameras[a].update();this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);var l=this.getEngine(),c=this.activeCamera;if(this.renderTargetsEnabled){i.Tools.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._intermediateRendering=!0;for(var u=0;u<this.customRenderTargets.length;u++){var d=this.customRenderTargets[u];if(d._shouldRender()){if(this._renderId++,this.activeCamera=d.activeCamera||this.activeCamera,!this.activeCamera)throw new Error("Active camera not set");l.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),d.render(c!==this.activeCamera,this.dumpNextRenderTargets)}}i.Tools.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._intermediateRendering=!1,this._renderId++}this.activeCamera=c,this._activeCamera&&this._activeCamera.cameraRigMode!==f.Camera.RIG_MODE_CUSTOM&&!this.prePass&&this._bindFrameBuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(var h=0,p=this._beforeClearStage;h<p.length;h++)p[h].action();!this.autoClearDepthAndStencil&&!this.autoClear||this.prePass||this._engine.clear(this.clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil);for(var m=0,g=this._gatherRenderTargetsStage;m<g.length;m++)g[m].action(this._renderTargets);if(this.activeCameras.length>0)for(o=0;o<this.activeCameras.length;o++)o>0&&this._engine.clear(null,!1,!0,!0),this._processSubCameras(this.activeCameras[o]);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera)}this._checkIntersections();for(var _=0,v=this._afterRenderStage;_<v.length;_++)v[_].action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(a=0;a<this._toBeDisposed.length;a++){var y=this._toBeDisposed[a];y&&y.dispose()}this._toBeDisposed=[]}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0)}},t.prototype.freezeMaterials=function(){for(var e=0;e<this.materials.length;e++)this.materials[e].freeze()},t.prototype.unfreezeMaterials=function(){for(var e=0;e<this.materials.length;e++)this.materials[e].unfreeze()},t.prototype.dispose=function(){this.beforeRender=null,this.afterRender=null,E.EngineStore._LastCreatedScene===this&&(E.EngineStore._LastCreatedScene=null),this.skeletons=[],this.morphTargetManagers=[],this._transientComponents=[],this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._activeMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear();for(var e=0,t=this._components;e<t.length;e++)t[e].dispose();this.importedMeshesFiles=new Array,this.stopAllAnimations&&this.stopAllAnimations(),this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed=[];for(var r=0,n=this._activeRequests;r<n.length;r++)n[r].abort();this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.detachControl();var i,o=this._engine.getInputElement();if(o)for(i=0;i<this.cameras.length;i++)this.cameras[i].detachControl(o);for(;this.animationGroups.length;)this.animationGroups[0].dispose();for(;this.lights.length;)this.lights[0].dispose();for(;this.meshes.length;)this.meshes[0].dispose(!0);for(;this.transformNodes.length;)this.transformNodes[0].dispose(!0);for(;this.cameras.length;)this.cameras[0].dispose();for(this._defaultMaterial&&this._defaultMaterial.dispose();this.multiMaterials.length;)this.multiMaterials[0].dispose();for(;this.materials.length;)this.materials[0].dispose();for(;this.particleSystems.length;)this.particleSystems[0].dispose();for(;this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.textures.length;)this.textures[0].dispose();this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),(i=this._engine.scenes.indexOf(this))>-1&&this._engine.scenes.splice(i,1),this._engine.wipeCaches(!0),this._isDisposed=!0},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),t.prototype.clearCachedVertexData=function(){for(var e=0;e<this.meshes.length;e++){var t=this.meshes[e].geometry;if(t)for(var r in t._indices=[],t._vertexBuffers)t._vertexBuffers.hasOwnProperty(r)&&(t._vertexBuffers[r]._buffer._data=null)}},t.prototype.cleanCachedTextureBuffer=function(){for(var e=0,t=this.textures;e<t.length;e++){var r=t[e];r._buffer&&(r._buffer=null)}},t.prototype.getWorldExtends=function(e){var t=new u.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new u.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return e=e||function(){return!0},this.meshes.filter(e).forEach((function(e){if(e.computeWorldMatrix(!0),e.subMeshes&&0!==e.subMeshes.length&&!e.infiniteDistance){var n=e.getBoundingInfo(),i=n.boundingBox.minimumWorld,o=n.boundingBox.maximumWorld;u.Vector3.CheckExtends(i,t,r),u.Vector3.CheckExtends(o,t,r)}})),{min:t,max:r}},t.prototype.createPickingRay=function(e,t,r,n,i){throw void 0===i&&(i=!1),C._DevTools.WarnImport("Ray")},t.prototype.createPickingRayToRef=function(e,t,r,n,i,o){throw void 0===o&&(o=!1),C._DevTools.WarnImport("Ray")},t.prototype.createPickingRayInCameraSpace=function(e,t,r){throw C._DevTools.WarnImport("Ray")},t.prototype.createPickingRayInCameraSpaceToRef=function(e,t,r,n){throw C._DevTools.WarnImport("Ray")},t.prototype.pick=function(e,t,r,n,i,o){var s=new v.PickingInfo;return s._pickingUnavailable=!0,s},t.prototype.pickWithBoundingInfo=function(e,t,r,n,i){var o=new v.PickingInfo;return o._pickingUnavailable=!0,o},t.prototype.pickWithRay=function(e,t,r,n){throw C._DevTools.WarnImport("Ray")},t.prototype.multiPick=function(e,t,r,n,i){throw C._DevTools.WarnImport("Ray")},t.prototype.multiPickWithRay=function(e,t,r){throw C._DevTools.WarnImport("Ray")},t.prototype.setPointerOverMesh=function(e){this._inputManager.setPointerOverMesh(e)},t.prototype.getPointerOverMesh=function(){return this._inputManager.getPointerOverMesh()},t.prototype._rebuildGeometries=function(){for(var e=0,t=this.geometries;e<t.length;e++)t[e]._rebuild();for(var r=0,n=this.meshes;r<n.length;r++)n[r]._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(var i=0,o=this._components;i<o.length;i++)o[i].rebuild();for(var s=0,a=this.particleSystems;s<a.length;s++)a[s].rebuild()},t.prototype._rebuildTextures=function(){for(var e=0,t=this.textures;e<t.length;e++)t[e]._rebuild();this.markAllMaterialsAsDirty(M.Constants.MATERIAL_TextureDirtyFlag)},t.prototype._getByTags=function(e,t,r){if(void 0===t)return e;var n=[];for(var i in r=r||function(e){},e){var o=e[i];c.Tags&&c.Tags.MatchesQuery(o,t)&&(n.push(o),r(o))}return n},t.prototype.getMeshesByTags=function(e,t){return this._getByTags(this.meshes,e,t)},t.prototype.getCamerasByTags=function(e,t){return this._getByTags(this.cameras,e,t)},t.prototype.getLightsByTags=function(e,t){return this._getByTags(this.lights,e,t)},t.prototype.getMaterialByTags=function(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))},t.prototype.setRenderingOrder=function(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._renderingManager.setRenderingOrder(e,t,r,n)},t.prototype.setRenderingAutoClearDepthStencil=function(e,t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0),this._renderingManager.setRenderingAutoClearDepthStencil(e,t,r,n)},t.prototype.getAutoClearDepthStencilSetup=function(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)},Object.defineProperty(t.prototype,"blockMaterialDirtyMechanism",{get:function(){return this._blockMaterialDirtyMechanism},set:function(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(M.Constants.MATERIAL_AllDirtyFlag))},enumerable:!1,configurable:!0}),t.prototype.markAllMaterialsAsDirty=function(e,t){if(!this._blockMaterialDirtyMechanism)for(var r=0,n=this.materials;r<n.length;r++){var i=n[r];t&&!t(i)||i.markAsDirty(e)}},t.prototype._loadFile=function(e,t,r,n,i,o){var s=this,a=B.FileTools.LoadFile(e,t,r,n?this.offlineProvider:void 0,i,o);return this._activeRequests.push(a),a.onCompleteObservable.add((function(e){s._activeRequests.splice(s._activeRequests.indexOf(e),1)})),a},t.prototype._loadFileAsync=function(e,t,r,n){var i=this;return new Promise((function(o,s){i._loadFile(e,(function(e){o(e)}),t,r,n,(function(e,t){s(t)}))}))},t.prototype._requestFile=function(e,t,r,n,i,o,s){var a=this,l=B.FileTools.RequestFile(e,t,r,n?this.offlineProvider:void 0,i,o,s);return this._activeRequests.push(l),l.onCompleteObservable.add((function(e){a._activeRequests.splice(a._activeRequests.indexOf(e),1)})),l},t.prototype._requestFileAsync=function(e,t,r,n,i){var o=this;return new Promise((function(s,a){o._requestFile(e,(function(e){s(e)}),t,r,n,(function(e){a(e)}),i)}))},t.prototype._readFile=function(e,t,r,n,i){var o=this,s=B.FileTools.ReadFile(e,t,r,n,i);return this._activeRequests.push(s),s.onCompleteObservable.add((function(e){o._activeRequests.splice(o._activeRequests.indexOf(e),1)})),s},t.prototype._readFileAsync=function(e,t,r){var n=this;return new Promise((function(i,o){n._readFile(e,(function(e){i(e)}),t,r,(function(e){o(e)}))}))},t.FOGMODE_NONE=0,t.FOGMODE_EXP=1,t.FOGMODE_EXP2=2,t.FOGMODE_LINEAR=3,t.MinDeltaTime=1,t.MaxDeltaTime=1e3,t}(p.AbstractScene)},"./sceneComponent.ts":
- /*!***************************!*\
- !*** ./sceneComponent.ts ***!
- \***************************/
- /*! exports provided: SceneComponentConstants, Stage */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneComponentConstants",(function(){return i})),r.d(t,"Stage",(function(){return o}));var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(){function e(){}return e.NAME_EFFECTLAYER="EffectLayer",e.NAME_LAYER="Layer",e.NAME_LENSFLARESYSTEM="LensFlareSystem",e.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer",e.NAME_PARTICLESYSTEM="ParticleSystem",e.NAME_GAMEPAD="Gamepad",e.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue",e.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer",e.NAME_PREPASSRENDERER="PrePassRenderer",e.NAME_DEPTHRENDERER="DepthRenderer",e.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager",e.NAME_SPRITE="Sprite",e.NAME_OUTLINERENDERER="Outline",e.NAME_PROCEDURALTEXTURE="ProceduralTexture",e.NAME_SHADOWGENERATOR="ShadowGenerator",e.NAME_OCTREE="Octree",e.NAME_PHYSICSENGINE="PhysicsEngine",e.NAME_AUDIO="Audio",e.STEP_ISREADYFORMESH_EFFECTLAYER=0,e.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0,e.STEP_ACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1,e.STEP_BEFORECAMERADRAW_EFFECTLAYER=0,e.STEP_BEFORECAMERADRAW_LAYER=1,e.STEP_BEFORECAMERADRAW_PREPASS=2,e.STEP_BEFORERENDERTARGETDRAW_LAYER=0,e.STEP_BEFORERENDERINGMESH_OUTLINE=0,e.STEP_AFTERRENDERINGMESH_OUTLINE=0,e.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0,e.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1,e.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0,e.STEP_BEFORECAMERAUPDATE_GAMEPAD=1,e.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0,e.STEP_AFTERRENDERTARGETDRAW_LAYER=0,e.STEP_AFTERCAMERADRAW_EFFECTLAYER=0,e.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=1,e.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=2,e.STEP_AFTERCAMERADRAW_LAYER=3,e.STEP_AFTERCAMERADRAW_PREPASS=4,e.STEP_AFTERRENDER_AUDIO=0,e.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0,e.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2,e.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,e.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0,e.STEP_BEFORECLEARSTAGE_PREPASS=0,e.STEP_POINTERMOVE_SPRITE=0,e.STEP_POINTERDOWN_SPRITE=0,e.STEP_POINTERUP_SPRITE=0,e}(),o=function(e){function t(t){return e.apply(this,t)||this}return Object(n.__extends)(t,e),t.Create=function(){return Object.create(t.prototype)},t.prototype.registerStep=function(e,t,r){var n=0;for(Number.MAX_VALUE;n<this.length&&!(e<this[n].index);n++);this.splice(n,0,{index:e,component:t,action:r.bind(t)})},t.prototype.clear=function(){this.length=0},t}(Array)},"./types.ts":
- /*!******************!*\
- !*** ./types.ts ***!
- \******************/
- /*! no static exports found */function(e,t){}})},e.exports=r()}).call(this,r(10))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendClassWithConfig=t.camelToKebab=t.kebabToCamel=t.isUrl=t.deepmerge=void 0;var n=r(26).default;t.deepmerge=n,t.isUrl=function(e){return 0===e.indexOf("http")||0===e.indexOf("/")||0===e.indexOf("./")||0===e.indexOf("../")},t.kebabToCamel=function(e){return e.replace(/(\-\w)/g,(function(e){return e[1].toUpperCase()}))},t.camelToKebab=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-"+e[0].toLowerCase()})):null},t.extendClassWithConfig=function e(t,r){r&&"object"==typeof r&&Object.keys(r).forEach((function(n){n in t&&"function"!=typeof t[n]&&("object"!=typeof t[n]||null===t[n]&&"object"!=typeof r[n]?void 0!==r[n]&&(t[n]=r[n]):e(t[n],r[n]))}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapperManager=t.MapperManager=void 0;var n=r(0),i=r(1),o=function(){function e(){}return e.prototype.map=function(e){for(var t={},r=function(r){var n=e.attributes.item(r);if(!n)return"continue";var o=n.nodeName.split(".");o.reduce((function(e,t,r){var s=i.kebabToCamel(t);if(r===o.length-1){var a=n.nodeValue;if("true"===a)a=!0;else if("false"===a)a=!1;else if("undefined"===a)a=void 0;else if("null"===a)a=null;else{if(!isNaN(parseFloat(a))&&isFinite(a)){var l=parseFloat(a);isNaN(l)||(a=l)}}e[s]=a}else e[s]=e[s]||{};return e[s]}),t)},n=0;n<e.attributes.length;++n)r(n);return t},e}(),s=function(){function e(){}return e.prototype.map=function(e){return JSON.parse(e)},e}(),a=function(){function e(){}return e.prototype.map=function(e){var t=new o,r=t.map(e),n=function(e,r){var o=e.children;if(o.length)for(var s=0;s<o.length;++s){var a=o.item(s),l=t.map(a),c=i.kebabToCamel(a.nodeName.toLowerCase());if(a.attributes.getNamedItem("array")&&"true"===a.attributes.getNamedItem("array").nodeValue)r[c]=[];else if(e.attributes.getNamedItem("array")&&"true"===e.attributes.getNamedItem("array").nodeValue)r.push(l);else if(r[c]){e.setAttribute("array","true"),r=[r[c],l]}else r[c]=l;n(a,r[c]||l)}return r};return n(e,r),r},e}(),l=function(){function e(){this._mappers={html:new o,json:new s,dom:new a}}return e.prototype.getMapper=function(e){return this._mappers[e]||n.Tools.Error("No mapper defined for "+e),this._mappers[e]},e.prototype.registerMapper=function(e,t){this._mappers[e]=t},e.prototype.dispose=function(){this._mappers={}},e.DefaultMapper="json",e}();t.MapperManager=l,t.mapperManager=new l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.viewerGlobals=t.ViewerGlobals=void 0;var n=r(0),i=function(){function e(){this.disableInit=!1,this.disableWebGL2Support=!1}return Object.defineProperty(e.prototype,"version",{get:function(){return n.Engine.Version},enumerable:!1,configurable:!0}),e}();t.ViewerGlobals=i,t.viewerGlobals=new i},function(e,t,r){(function(t){var n;"undefined"!=typeof self&&self,n=function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./legacy/legacy.ts")}({"../../node_modules/tslib/tslib.es6.js":
- /*!*****************************************************************!*\
- !*** C:/Dev/Babylon/Babylon.js/node_modules/tslib/tslib.es6.js ***!
- \*****************************************************************/
- /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */function(e,t,r){"use strict";r.r(t),r.d(t,"__extends",(function(){return i})),r.d(t,"__assign",(function(){return o})),r.d(t,"__rest",(function(){return s})),r.d(t,"__decorate",(function(){return a})),r.d(t,"__param",(function(){return l})),r.d(t,"__metadata",(function(){return c})),r.d(t,"__awaiter",(function(){return u})),r.d(t,"__generator",(function(){return d})),r.d(t,"__createBinding",(function(){return h})),r.d(t,"__exportStar",(function(){return f})),r.d(t,"__values",(function(){return p})),r.d(t,"__read",(function(){return m})),r.d(t,"__spread",(function(){return g})),r.d(t,"__spreadArrays",(function(){return _})),r.d(t,"__await",(function(){return v})),r.d(t,"__asyncGenerator",(function(){return y})),r.d(t,"__asyncDelegator",(function(){return b})),r.d(t,"__asyncValues",(function(){return A})),r.d(t,"__makeTemplateObject",(function(){return T})),r.d(t,"__importStar",(function(){return P})),r.d(t,"__importDefault",(function(){return S})),r.d(t,"__classPrivateFieldGet",(function(){return E})),r.d(t,"__classPrivateFieldSet",(function(){return C}));
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function l(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var h=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function f(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||h(t,e,r)}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function _(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function y(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof v?Promise.resolve(r.value.v).then(l,c):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function b(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function A(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&h(t,e,r);return M(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},"../../node_modules/webpack/buildin/global.js":
- /*!***********************************!*\
- !*** (webpack)/buildin/global.js ***!
- \***********************************/
- /*! no static exports found */function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},"./OBJ/index.ts":
- /*!**********************!*\
- !*** ./OBJ/index.ts ***!
- \**********************/
- /*! exports provided: MTLFileLoader, OBJFileLoader */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./mtlFileLoader */"./OBJ/mtlFileLoader.ts");r.d(t,"MTLFileLoader",(function(){return n.MTLFileLoader}));var i=r(/*! ./objFileLoader */"./OBJ/objFileLoader.ts");r.d(t,"OBJFileLoader",(function(){return i.OBJFileLoader}))},"./OBJ/mtlFileLoader.ts":
- /*!******************************!*\
- !*** ./OBJ/mtlFileLoader.ts ***!
- \******************************/
- /*! exports provided: MTLFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"MTLFileLoader",(function(){return i}));var n=r(/*! babylonjs/Maths/math.color */"babylonjs/Misc/observable"),i=function(){function e(){this.materials=[]}return e.prototype.parseMTL=function(t,r,i,o){if(!(r instanceof ArrayBuffer)){for(var s,a=r.split("\n"),l=/\s+/,c=null,u=0;u<a.length;u++){var d=a[u].trim();if(0!==d.length&&"#"!==d.charAt(0)){var h=d.indexOf(" "),f=h>=0?d.substring(0,h):d;f=f.toLowerCase();var p=h>=0?d.substring(h+1).trim():"";"newmtl"===f?(c&&this.materials.push(c),t._blockEntityCollection=o,c=new n.StandardMaterial(p,t),t._blockEntityCollection=!1):"kd"===f&&c?(s=p.split(l,3).map(parseFloat),c.diffuseColor=n.Color3.FromArray(s)):"ka"===f&&c?(s=p.split(l,3).map(parseFloat),c.ambientColor=n.Color3.FromArray(s)):"ks"===f&&c?(s=p.split(l,3).map(parseFloat),c.specularColor=n.Color3.FromArray(s)):"ke"===f&&c?(s=p.split(l,3).map(parseFloat),c.emissiveColor=n.Color3.FromArray(s)):"ns"===f&&c?c.specularPower=parseFloat(p):"d"===f&&c?c.alpha=parseFloat(p):"map_ka"===f&&c?c.ambientTexture=e._getTexture(i,p,t):"map_kd"===f&&c?c.diffuseTexture=e._getTexture(i,p,t):"map_ks"===f&&c?c.specularTexture=e._getTexture(i,p,t):"map_ns"===f||("map_bump"===f&&c?c.bumpTexture=e._getTexture(i,p,t):"map_d"===f&&c&&(c.opacityTexture=e._getTexture(i,p,t)))}}c&&this.materials.push(c)}},e._getTexture=function(t,r,i){if(!r)return null;var o=t;if("file:"===t){var s=r.lastIndexOf("\\");-1===s&&(s=r.lastIndexOf("/")),o+=s>-1?r.substr(s+1):r}else o+=r;return new n.Texture(o,i,!1,e.INVERT_TEXTURE_Y)},e.INVERT_TEXTURE_Y=!0,e}()},"./OBJ/objFileLoader.ts":
- /*!******************************!*\
- !*** ./OBJ/objFileLoader.ts ***!
- \******************************/
- /*! exports provided: OBJFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"OBJFileLoader",(function(){return o}));var n=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),i=r(/*! ./mtlFileLoader */"./OBJ/mtlFileLoader.ts"),o=function(){function e(t){this.name="obj",this.extensions=".obj",this.obj=/^o/,this.group=/^g/,this.mtllib=/^mtllib /,this.usemtl=/^usemtl /,this.smooth=/^s /,this.vertexPattern=/v( +[\d|\.|\+|\-|e|E]+){3,7}/,this.normalPattern=/vn( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,this.uvPattern=/vt( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,this.facePattern1=/f\s+(([\d]{1,}[\s]?){3,})+/,this.facePattern2=/f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,this.facePattern3=/f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,this.facePattern4=/f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/,this.facePattern5=/f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/,this._forAssetContainer=!1,this._meshLoadOptions=t||e.currentMeshLoadOptions}return Object.defineProperty(e,"INVERT_TEXTURE_Y",{get:function(){return i.MTLFileLoader.INVERT_TEXTURE_Y},set:function(e){i.MTLFileLoader.INVERT_TEXTURE_Y=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"currentMeshLoadOptions",{get:function(){return{ComputeNormals:e.COMPUTE_NORMALS,ImportVertexColors:e.IMPORT_VERTEX_COLORS,InvertY:e.INVERT_Y,InvertTextureY:e.INVERT_TEXTURE_Y,UVScaling:e.UV_SCALING,MaterialLoadingFailsSilently:e.MATERIAL_LOADING_FAILS_SILENTLY,OptimizeWithUV:e.OPTIMIZE_WITH_UV,SkipMaterials:e.SKIP_MATERIALS}},enumerable:!1,configurable:!0}),e.prototype._loadMTL=function(e,t,r,i){var o=n.Tools.BaseUrl+t+e;n.Tools.LoadFile(o,r,void 0,void 0,!1,(function(e,t){i(o,t)}))},e.prototype.createPlugin=function(){return new e(e.currentMeshLoadOptions)},e.prototype.canDirectLoad=function(e){return!1},e.prototype.importMeshAsync=function(e,t,r,n,i,o){return this._parseSolid(e,t,r,n).then((function(e){return{meshes:e,particleSystems:[],skeletons:[],animationGroups:[]}}))},e.prototype.loadAsync=function(e,t,r,n,i){return this.importMeshAsync(null,e,t,r,n).then((function(){}))},e.prototype.loadAssetContainerAsync=function(e,t,r,i,o){var s=this;return this._forAssetContainer=!0,this.importMeshAsync(null,e,t,r).then((function(t){var r=new n.AssetContainer(e);return t.meshes.forEach((function(e){return r.meshes.push(e)})),t.meshes.forEach((function(e){var t=e.material;t&&-1==r.materials.indexOf(t)&&(r.materials.push(t),t.getActiveTextures().forEach((function(e){-1==r.textures.indexOf(e)&&r.textures.push(e)})))})),s._forAssetContainer=!1,r})).catch((function(e){throw s._forAssetContainer=!1,e}))},e.prototype._parseSolid=function(t,r,o,s){for(var a,l=this,c=[],u=[],d=[],h=[],f=[],p=[],m=[],g=[],_=[],v=[],y=[],b=0,A=!1,T=[],M=[],P=[],S=[],E=[],C="",x="",R=new i.MTLFileLoader,O=1,I=!0,D=new n.Color4(.5,.5,.5,1),B=function(e,t,r,n,i,o,s){var a;-1===(a=l._meshLoadOptions.OptimizeWithUV?function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});var r=e[t[0]].normals.indexOf(t[1]);return 1!=r&&t[2]===e[t[0]].uv[r]?e[t[0]].idx[r]:-1}(y,[e,r,t]):function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[]});var r=e[t[0]].normals.indexOf(t[1]);return-1===r?-1:e[t[0]].idx[r]}(y,[e,r]))?(p.push(m.length),m.push(n),g.push(i),v.push(o),void 0!==s&&_.push(s),y[e].normals.push(r),y[e].idx.push(b++),l._meshLoadOptions.OptimizeWithUV&&y[e].uv.push(t)):p.push(a)},N=function(){for(var e=0;e<m.length;e++)T.push(m[e].x,m[e].y,m[e].z),P.push(v[e].x,v[e].y,v[e].z),S.push(g[e].x,g[e].y),!0===l._meshLoadOptions.ImportVertexColors&&M.push(_[e].r,_[e].g,_[e].b,_[e].a);m=[],v=[],g=[],_=[],y=[],b=0},L=function(e,t){for(var r=t;r<e.length-1;r++)E.push(e[0],e[r],e[r+1])},w=function(e,t){L(e,t);for(var r=0;r<E.length;r++){var i=parseInt(E[r])-1;B(i,0,0,c[i],n.Vector2.Zero(),n.Vector3.Up(),!0===l._meshLoadOptions.ImportVertexColors?h[i]:void 0)}E=[]},F=function(e,t){L(e,t);for(var r=0;r<E.length;r++){var i=E[r].split("/"),o=parseInt(i[0])-1,s=parseInt(i[1])-1;B(o,s,0,c[o],d[s],n.Vector3.Up(),!0===l._meshLoadOptions.ImportVertexColors?h[o]:void 0)}E=[]},V=function(e,t){L(e,t);for(var r=0;r<E.length;r++){var n=E[r].split("/"),i=parseInt(n[0])-1,o=parseInt(n[1])-1,s=parseInt(n[2])-1;B(i,o,s,c[i],d[o],u[s])}E=[]},k=function(e,t){L(e,t);for(var r=0;r<E.length;r++){var i=E[r].split("//"),o=parseInt(i[0])-1,s=parseInt(i[1])-1;B(o,1,s,c[o],n.Vector2.Zero(),u[s],!0===l._meshLoadOptions.ImportVertexColors?h[o]:void 0)}E=[]},U=function(e,t){L(e,t);for(var r=0;r<E.length;r++){var n=E[r].split("/"),i=c.length+parseInt(n[0]),o=d.length+parseInt(n[1]),s=u.length+parseInt(n[2]);B(i,o,s,c[i],d[o],u[s],!0===l._meshLoadOptions.ImportVertexColors?h[i]:void 0)}E=[]},z=function(){f.length>0&&(a=f[f.length-1],N(),p.reverse(),a.indices=p.slice(),a.positions=T.slice(),a.normals=P.slice(),a.uvs=S.slice(),!0===l._meshLoadOptions.ImportVertexColors&&(a.colors=M.slice()),p=[],T=[],M=[],P=[],S=[])},G=o.split("\n"),j=0;j<G.length;j++){var H,W=G[j].trim().replace(/\s\s/g," ");if(0!==W.length&&"#"!==W.charAt(0))if(this.vertexPattern.test(W))H=W.match(/[^ ]+/g),c.push(new n.Vector3(parseFloat(H[1]),parseFloat(H[2]),parseFloat(H[3]))),!0===this._meshLoadOptions.ImportVertexColors&&(H.length>=7?h.push(new n.Color4(parseFloat(H[4]),parseFloat(H[5]),parseFloat(H[6]),7===H.length||void 0===H[7]?1:parseFloat(H[7]))):h.push(D));else if(null!==(H=this.normalPattern.exec(W)))u.push(new n.Vector3(parseFloat(H[1]),parseFloat(H[2]),parseFloat(H[3])));else if(null!==(H=this.uvPattern.exec(W)))d.push(new n.Vector2(parseFloat(H[1])*e.UV_SCALING.x,parseFloat(H[2])*e.UV_SCALING.y));else if(null!==(H=this.facePattern3.exec(W)))V(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern4.exec(W)))k(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern5.exec(W)))U(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern2.exec(W)))F(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern1.exec(W)))w(H[1].trim().split(" "),1);else if(this.group.test(W)||this.obj.test(W)){var X={name:W.substring(2).trim(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:""};z(),f.push(X),A=!0,I=!0,O=1}else this.usemtl.test(W)?(C=W.substring(7).trim(),I&&A||(z(),X={name:"mesh_mm"+O.toString(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:C},O++,f.push(X),A=!0),A&&I&&(f[f.length-1].materialName=C,I=!1)):this.mtllib.test(W)?x=W.substring(7).trim():this.smooth.test(W)||console.log("Unhandled expression at line : "+W)}A&&(a=f[f.length-1],p.reverse(),N(),a.indices=p,a.positions=T,a.normals=P,a.uvs=S,!0===this._meshLoadOptions.ImportVertexColors&&(a.colors=M)),A||(p.reverse(),N(),f.push({name:n.Geometry.RandomId(),indices:p,positions:T,colors:M,normals:P,uvs:S,materialName:C}));for(var Y=[],Q=new Array,K=0;K<f.length;K++){if(t&&f[K].name)if(t instanceof Array){if(-1===t.indexOf(f[K].name))continue}else if(f[K].name!==t)continue;a=f[K],r._blockEntityCollection=this._forAssetContainer;var q=new n.Mesh(f[K].name,r);r._blockEntityCollection=!1,Q.push(f[K].materialName);var Z=new n.VertexData;if(Z.uvs=a.uvs,Z.indices=a.indices,Z.positions=a.positions,!0===this._meshLoadOptions.ComputeNormals){var J=new Array;n.VertexData.ComputeNormals(a.positions,a.indices,J),Z.normals=J}else Z.normals=a.normals;!0===this._meshLoadOptions.ImportVertexColors&&(Z.colors=a.colors),Z.applyToMesh(q),this._meshLoadOptions.InvertY&&(q.scaling.y*=-1),Y.push(q)}var $=[];return""!==x&&!1===this._meshLoadOptions.SkipMaterials&&$.push(new Promise((function(e,t){l._loadMTL(x,s,(function(i){try{R.parseMTL(r,i,s,l._forAssetContainer);for(var o=0;o<R.materials.length;o++){for(var a,c=0,u=[];(a=Q.indexOf(R.materials[o].name,c))>-1;)u.push(a),c=a+1;if(-1===a&&0===u.length)R.materials[o].dispose();else for(var d=0;d<u.length;d++)Y[u[d]].material=R.materials[o]}e()}catch(r){n.Tools.Warn("Error processing MTL file: '"+x+"'"),l._meshLoadOptions.MaterialLoadingFailsSilently?e():t(r)}}),(function(r,i){n.Tools.Warn("Error downloading MTL file: '"+x+"'"),l._meshLoadOptions.MaterialLoadingFailsSilently?e():t(i)}))}))),Promise.all($).then((function(){return Y}))},e.OPTIMIZE_WITH_UV=!0,e.INVERT_Y=!1,e.IMPORT_VERTEX_COLORS=!1,e.COMPUTE_NORMALS=!1,e.UV_SCALING=new n.Vector2(1,1),e.SKIP_MATERIALS=!1,e.MATERIAL_LOADING_FAILS_SILENTLY=!0,e}();n.SceneLoader&&n.SceneLoader.RegisterPlugin(new o)},"./STL/index.ts":
- /*!**********************!*\
- !*** ./STL/index.ts ***!
- \**********************/
- /*! exports provided: STLFileLoader */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./stlFileLoader */"./STL/stlFileLoader.ts");r.d(t,"STLFileLoader",(function(){return n.STLFileLoader}))},"./STL/stlFileLoader.ts":
- /*!******************************!*\
- !*** ./STL/stlFileLoader.ts ***!
- \******************************/
- /*! exports provided: STLFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"STLFileLoader",(function(){return i}));var n=r(/*! babylonjs/Misc/tools */"babylonjs/Misc/observable"),i=function(){function e(){this.solidPattern=/solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g,this.facetsPattern=/facet([\s\S]*?)endfacet/g,this.normalPattern=/normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g,this.vertexPattern=/vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g,this.name="stl",this.extensions={".stl":{isBinary:!0}}}return e.prototype.importMesh=function(e,t,r,i,o,s,a){var l;if("string"!=typeof r){if(this._isBinary(r)){var c=new n.Mesh("stlmesh",t);return this._parseBinary(c,r),o&&o.push(c),!0}for(var u=new Uint8Array(r),d="",h=0;h<r.byteLength;h++)d+=String.fromCharCode(u[h]);r=d}for(;l=this.solidPattern.exec(r);){var f=l[1];if(f!=l[3])return n.Tools.Error("Error in STL, solid name != endsolid name"),!1;if(e&&f)if(e instanceof Array){if(!e.indexOf(f))continue}else if(f!==e)continue;f=f||"stlmesh",c=new n.Mesh(f,t),this._parseASCII(c,l[2]),o&&o.push(c)}return!0},e.prototype.load=function(e,t,r){return this.importMesh(null,e,t,r,null,null,null)},e.prototype.loadAssetContainer=function(e,t,r,i){var o=new n.AssetContainer(e);return e._blockEntityCollection=!0,this.importMesh(null,e,t,r,o.meshes,null,null),e._blockEntityCollection=!1,o},e.prototype._isBinary=function(e){var t;if(84+50*(t=new DataView(e)).getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,n=0;n<r;n++)if(t.getUint8(n)>127)return!0;return!1},e.prototype._parseBinary=function(e,t){for(var r=new DataView(t),i=r.getUint32(80,!0),o=0,s=new Float32Array(3*i*3),a=new Float32Array(3*i*3),l=new Uint32Array(3*i),c=0,u=0;u<i;u++){for(var d=84+50*u,h=r.getFloat32(d,!0),f=r.getFloat32(d+4,!0),p=r.getFloat32(d+8,!0),m=1;m<=3;m++){var g=d+12*m;s[o]=r.getFloat32(g,!0),s[o+2]=r.getFloat32(g+4,!0),s[o+1]=r.getFloat32(g+8,!0),a[o]=h,a[o+2]=f,a[o+1]=p,o+=3}l[c]=c++,l[c]=c++,l[c]=c++}e.setVerticesData(n.VertexBuffer.PositionKind,s),e.setVerticesData(n.VertexBuffer.NormalKind,a),e.setIndices(l),e.computeWorldMatrix(!0)},e.prototype._parseASCII=function(e,t){for(var r,i=[],o=[],s=[],a=0;r=this.facetsPattern.exec(t);){var l=r[1],c=this.normalPattern.exec(l);if(this.normalPattern.lastIndex=0,c){for(var u,d=[Number(c[1]),Number(c[5]),Number(c[3])];u=this.vertexPattern.exec(l);)i.push(Number(u[1]),Number(u[5]),Number(u[3])),o.push(d[0],d[1],d[2]);s.push(a++,a++,a++),this.vertexPattern.lastIndex=0}}this.facetsPattern.lastIndex=0,e.setVerticesData(n.VertexBuffer.PositionKind,i),e.setVerticesData(n.VertexBuffer.NormalKind,o),e.setIndices(s),e.computeWorldMatrix(!0)},e}();n.SceneLoader&&n.SceneLoader.RegisterPlugin(new i)},"./glTF/1.0/glTFBinaryExtension.ts":
- /*!*****************************************!*\
- !*** ./glTF/1.0/glTFBinaryExtension.ts ***!
- \*****************************************/
- /*! exports provided: GLTFBinaryExtension */function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFBinaryExtension",(function(){return a}));var n=r(/*! tslib */"../../node_modules/tslib/tslib.es6.js"),i=r(/*! ./glTFLoader */"./glTF/1.0/glTFLoader.ts"),o=r(/*! ./glTFLoaderUtils */"./glTF/1.0/glTFLoaderUtils.ts"),s=r(/*! ./glTFLoaderInterfaces */"./glTF/1.0/glTFLoaderInterfaces.ts"),a=function(e){function t(){return e.call(this,"KHR_binary_glTF")||this}return Object(n.__extends)(t,e),t.prototype.loadRuntimeAsync=function(e,t,r,n,o){var s=t.json.extensionsUsed;return!(!s||-1===s.indexOf(this.name)||!t.bin||(this._bin=t.bin,n(i.GLTFLoaderBase.CreateRuntime(t.json,e,r)),0))},t.prototype.loadBufferAsync=function(e,t,r,n){return-1!==e.extensionsUsed.indexOf(this.name)&&"binary_glTF"===t&&(this._bin.readAsync(0,this._bin.byteLength).then(r,(function(e){return n(e.message)})),!0)},t.prototype.loadTextureBufferAsync=function(e,t,r,n){var i=e.textures[t],a=e.images[i.source];if(!a.extensions||!(this.name in a.extensions))return!1;var l=a.extensions[this.name],c=e.bufferViews[l.bufferView];return r(o.GLTFUtils.GetBufferFromBufferView(e,c,0,c.byteLength,s.EComponentType.UNSIGNED_BYTE)),!0},t.prototype.loadShaderStringAsync=function(e,t,r,n){var i=e.shaders[t];if(!i.extensions||!(this.name in i.extensions))return!1;var a=i.extensions[this.name],l=e.bufferViews[a.bufferView],c=o.GLTFUtils.GetBufferFromBufferView(e,l,0,l.byteLength,s.EComponentType.UNSIGNED_BYTE);return setTimeout((function(){var e=o.GLTFUtils.DecodeBufferToText(c);r(e)})),!0},t}(i.GLTFLoaderExtension);i.GLTFLoader.RegisterExtension(new a)},"./glTF/1.0/glTFLoader.ts":
- /*!********************************!*\
- !*** ./glTF/1.0/glTFLoader.ts ***!
- \********************************/
- /*! exports provided: GLTFLoaderBase, GLTFLoader, GLTFLoaderExtension */function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFLoaderBase",(function(){return O})),r.d(t,"GLTFLoader",(function(){return I})),r.d(t,"GLTFLoaderExtension",(function(){return D}));var n,i=r(/*! ./glTFLoaderInterfaces */"./glTF/1.0/glTFLoaderInterfaces.ts"),o=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),s=r(/*! ./glTFLoaderUtils */"./glTF/1.0/glTFLoaderUtils.ts"),a=r(/*! ../glTFFileLoader */"./glTF/glTFFileLoader.ts");!function(e){e[e.IDENTIFIER=1]="IDENTIFIER",e[e.UNKNOWN=2]="UNKNOWN",e[e.END_OF_INPUT=3]="END_OF_INPUT"}(n||(n={}));var l=function(){function e(e){this._pos=0,this.currentToken=n.UNKNOWN,this.currentIdentifier="",this.currentString="",this.isLetterOrDigitPattern=/^[a-zA-Z0-9]+$/,this._toParse=e,this._maxPos=e.length}return e.prototype.getNextToken=function(){if(this.isEnd())return n.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=n.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=n.IDENTIFIER,this.currentIdentifier=this.currentString;!this.isEnd()&&(this.isLetterOrDigitPattern.test(this.currentString=this.peek())||"_"===this.currentString);)this.currentIdentifier+=this.currentString,this.forward();return this.currentToken},e.prototype.peek=function(){return this._toParse[this._pos]},e.prototype.read=function(){return this._toParse[this._pos++]},e.prototype.forward=function(){this._pos++},e.prototype.isEnd=function(){return this._pos>=this._maxPos},e}(),c=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],u=["world","view","projection","worldView","worldViewProjection","mBones"],d=["translation","rotation","scale"],h=["position","rotationQuaternion","scaling"],f=function(e,t,r){for(var n in e){var i=e[n];r[t][n]=i}},p=function(e){if(e)for(var t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},m=function(e){if("NORMAL"===e.semantic)return"normal";if("POSITION"===e.semantic)return"position";if("JOINT"===e.semantic)return"matricesIndices";if("WEIGHT"===e.semantic)return"matricesWeights";if("COLOR"===e.semantic)return"color";if(e.semantic&&-1!==e.semantic.indexOf("TEXCOORD_")){var t=Number(e.semantic.split("_")[1]);return"uv"+(0===t?"":t+1)}return null},g=function(e){var t=null;if(e.translation||e.rotation||e.scale){var r=o.Vector3.FromArray(e.scale||[1,1,1]),n=o.Quaternion.FromArray(e.rotation||[0,0,0,1]),i=o.Vector3.FromArray(e.translation||[0,0,0]);t=o.Matrix.Compose(r,n,i)}else t=o.Matrix.FromArray(e.matrix);return t},_=function(e,t,r,n){for(var i=0;i<n.bones.length;i++)if(n.bones[i].name===r)return n.bones[i];var s=e.nodes;for(var a in s){var l=s[a];if(l.jointName){var c=l.children;for(i=0;i<c.length;i++){var u=e.nodes[c[i]];if(u.jointName&&u.jointName===r){var d=g(l),h=new o.Bone(l.name||"",n,_(e,t,l.jointName,n),d);return h.id=a,h}}}}return null},v=function(e,t){for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.node.children.length;i++)if(n.node.children[i]===t)return n.bone;return null},y=function(e,t){var r=e.nodes,n=r[t];if(n)return{node:n,id:t};for(var i in r)if((n=r[i]).jointName===t)return{node:n,id:i};return null},b=function(e,t){for(var r=0;r<e.jointNames.length;r++)if(e.jointNames[r]===t)return!0;return!1},A=function(e,t,r,n,i){if(n||(n=new o.Skeleton(t.name||"","",e.scene)),!t.babylonSkeleton)return n;var s=[],a=[];!function(e,t,r,n){for(var i in e.nodes){var s=e.nodes[i],a=i;if(s.jointName&&!b(r,s.jointName)){var l=g(s),c=new o.Bone(s.name||"",t,null,l);c.id=a,n.push({bone:c,node:s,id:a})}}for(var u=0;u<n.length;u++)for(var d=n[u],h=d.node.children,f=0;f<h.length;f++){for(var p=null,m=0;m<n.length;m++)if(n[m].id===h[f]){p=n[m];break}p&&(p.bone._parent=d.bone,d.bone.children.push(p.bone))}}(e,n,t,s),n.bones=[];for(var l=0;l<t.jointNames.length;l++)if(S=y(e,t.jointNames[l])){var c=S.node;if(c){i=S.id;var u=e.scene.getBoneByID(i);if(u)n.bones.push(u);else{for(var d=!1,h=null,f=0;f<l;f++){var p=y(e,t.jointNames[f]);if(p){var m=p.node;if(m){var A=m.children;if(A){d=!1;for(var T=0;T<A.length;T++)if(A[T]===i){h=_(e,t,t.jointNames[f],n),d=!0;break}if(d)break}}else o.Tools.Warn("Joint named "+t.jointNames[f]+" does not exist when looking for parent")}}var M=g(c);!h&&s.length>0&&(h=v(s,i))&&-1===a.indexOf(h)&&a.push(h),new o.Bone(c.jointName||"",n,h,M).id=i}}else o.Tools.Warn("Joint named "+t.jointNames[l]+" does not exist")}var P=n.bones;for(n.bones=[],l=0;l<t.jointNames.length;l++){var S;if(S=y(e,t.jointNames[l]))for(f=0;f<P.length;f++)if(P[f].id===S.id){n.bones.push(P[f]);break}}for(n.prepare(),l=0;l<a.length;l++)n.bones.push(a[l]);return n},T=function(e,t,r,n,i){if(i||(e.scene._blockEntityCollection=e.forAssetContainer,i=new o.Mesh(t.name||"",e.scene),e.scene._blockEntityCollection=!1,i.id=n),!t.babylonNode)return i;for(var l,c=[],u=null,d=new Array,h=new Array,f=new Array,m=new Array,g=0;g<r.length;g++){var _=r[g];if(D=e.meshes[_])for(var v=0;v<D.primitives.length;v++){var y=new o.VertexData,b=D.primitives[v];b.mode;var A=b.attributes,T=null,M=null;for(var P in A)if(T=e.accessors[A[P]],M=s.GLTFUtils.GetBufferFromAccessor(e,T),"NORMAL"===P)y.normals=new Float32Array(M.length),y.normals.set(M);else if("POSITION"===P){if(a.GLTFFileLoader.HomogeneousCoordinates){y.positions=new Float32Array(M.length-M.length/4);for(var S=0;S<M.length;S+=4)y.positions[S]=M[S],y.positions[S+1]=M[S+1],y.positions[S+2]=M[S+2]}else y.positions=new Float32Array(M.length),y.positions.set(M);h.push(y.positions.length)}else if(-1!==P.indexOf("TEXCOORD_")){var E=Number(P.split("_")[1]),C=o.VertexBuffer.UVKind+(0===E?"":E+1),x=new Float32Array(M.length);x.set(M),p(x),y.set(x,C)}else"JOINT"===P?(y.matricesIndices=new Float32Array(M.length),y.matricesIndices.set(M)):"WEIGHT"===P?(y.matricesWeights=new Float32Array(M.length),y.matricesWeights.set(M)):"COLOR"===P&&(y.colors=new Float32Array(M.length),y.colors.set(M));if(T=e.accessors[b.indices])M=s.GLTFUtils.GetBufferFromAccessor(e,T),y.indices=new Int32Array(M.length),y.indices.set(M),m.push(y.indices.length);else{var R=[];for(S=0;S<y.positions.length/3;S++)R.push(S);y.indices=new Int32Array(R),m.push(y.indices.length)}u?u.merge(y):u=y;var O=e.scene.getMaterialByID(b.material);c.push(null===O?s.GLTFUtils.GetDefaultMaterial(e.scene):O),d.push(0===d.length?0:d[d.length-1]+h[h.length-2]),f.push(0===f.length?0:f[f.length-1]+m[m.length-2])}}e.scene._blockEntityCollection=e.forAssetContainer,c.length>1?(l=new o.MultiMaterial("multimat"+n,e.scene)).subMaterials=c:l=new o.StandardMaterial("multimat"+n,e.scene),1===c.length&&(l=c[0]),i.material||(i.material=l),new o.Geometry(n,e.scene,u,!1,i),i.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,i.subMeshes=[];var I=0;for(g=0;g<r.length;g++){var D;if(_=r[g],D=e.meshes[_])for(v=0;v<D.primitives.length;v++)D.primitives[v].mode,o.SubMesh.AddToMesh(I,d[I],h[I],f[I],m[I],i,i,!0),I++}return i},M=function(e,t,r,n){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=r),e.scaling&&(e.scaling=n)},P=function(e,t,r,n){var i=null;if(e.importOnlyMeshes&&(t.skin||t.meshes)&&e.importMeshesNames&&e.importMeshesNames.length>0&&-1===e.importMeshesNames.indexOf(t.name||""))return null;if(t.skin){if(t.meshes){var s=e.skins[t.skin];(a=T(e,t,t.meshes,r,t.babylonNode)).skeleton=e.scene.getLastSkeletonByID(t.skin),null===a.skeleton&&(a.skeleton=A(e,s,0,s.babylonSkeleton,t.skin),s.babylonSkeleton||(s.babylonSkeleton=a.skeleton)),i=a}}else if(t.meshes){var a;i=a=T(e,t,t.mesh?[t.mesh]:t.meshes,r,t.babylonNode)}else if(!t.light||t.babylonNode||e.importOnlyMeshes){if(t.camera&&!t.babylonNode&&!e.importOnlyMeshes){var l=e.cameras[t.camera];if(l){if(e.scene._blockEntityCollection=e.forAssetContainer,"orthographic"===l.type){var c=new o.FreeCamera(t.camera,o.Vector3.Zero(),e.scene,!1);c.name=t.name||"",c.mode=o.Camera.ORTHOGRAPHIC_CAMERA,c.attachControl(e.scene.getEngine().getInputElement()),i=c}else if("perspective"===l.type){var u=l[l.type],d=new o.FreeCamera(t.camera,o.Vector3.Zero(),e.scene,!1);d.name=t.name||"",d.attachControl(e.scene.getEngine().getInputElement()),u.aspectRatio||(u.aspectRatio=e.scene.getEngine().getRenderWidth()/e.scene.getEngine().getRenderHeight()),u.znear&&u.zfar&&(d.maxZ=u.zfar,d.minZ=u.znear),i=d}e.scene._blockEntityCollection=!1}}}else{var h=e.lights[t.light];if(h)if("ambient"===h.type){var f=h[h.type],p=new o.HemisphericLight(t.light,o.Vector3.Zero(),e.scene);p.name=t.name||"",f.color&&(p.diffuse=o.Color3.FromArray(f.color)),i=p}else if("directional"===h.type){var m=h[h.type],g=new o.DirectionalLight(t.light,o.Vector3.Zero(),e.scene);g.name=t.name||"",m.color&&(g.diffuse=o.Color3.FromArray(m.color)),i=g}else if("point"===h.type){var _=h[h.type],v=new o.PointLight(t.light,o.Vector3.Zero(),e.scene);v.name=t.name||"",_.color&&(v.diffuse=o.Color3.FromArray(_.color)),i=v}else if("spot"===h.type){var y=h[h.type],b=new o.SpotLight(t.light,o.Vector3.Zero(),o.Vector3.Zero(),0,0,e.scene);b.name=t.name||"",y.color&&(b.diffuse=o.Color3.FromArray(y.color)),y.fallOfAngle&&(b.angle=y.fallOfAngle),y.fallOffExponent&&(b.exponent=y.fallOffExponent),i=b}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===i){e.scene._blockEntityCollection=e.forAssetContainer;var P=new o.Mesh(t.name||"",e.scene);e.scene._blockEntityCollection=!1,t.babylonNode=P,i=P}}if(null!==i){if(t.matrix&&i instanceof o.Mesh)!function(e,t,r){if(t.matrix){var n=new o.Vector3(0,0,0),i=new o.Quaternion,s=new o.Vector3(0,0,0);o.Matrix.FromArray(t.matrix).decompose(s,i,n),M(e,n,i,s)}else t.translation&&t.rotation&&t.scale&&M(e,o.Vector3.FromArray(t.translation),o.Quaternion.FromArray(t.rotation),o.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(i,t);else{var S=t.translation||[0,0,0],E=t.rotation||[0,0,0,1],C=t.scale||[1,1,1];M(i,o.Vector3.FromArray(S),o.Quaternion.FromArray(E),o.Vector3.FromArray(C))}i.updateCache(!0),t.babylonNode=i}return i},S=function(e,t,r,n){void 0===n&&(n=!1);var i=e.nodes[t],o=null;if(n=!(e.importOnlyMeshes&&!n&&e.importMeshesNames)||-1!==e.importMeshesNames.indexOf(i.name||"")||0===e.importMeshesNames.length,!i.jointName&&n&&null!==(o=P(e,i,t))&&(o.id=t,o.parent=r),i.children)for(var s=0;s<i.children.length;s++)S(e,i.children[s],o,n)},E=function(e){var t=e.currentScene;if(t)for(var r=0;r<t.nodes.length;r++)S(e,t.nodes[r],null);else for(var n in e.scenes)for(t=e.scenes[n],r=0;r<t.nodes.length;r++)S(e,t.nodes[r],null);for(function(e){for(var t in e.animations){var r=e.animations[t];if(r.channels&&r.samplers)for(var n=null,i=0;i<r.channels.length;i++){var a=r.channels[i],l=r.samplers[a.sampler];if(l){var c=null,u=null;r.parameters?(c=r.parameters[l.input],u=r.parameters[l.output]):(c=l.input,u=l.output);var f=s.GLTFUtils.GetBufferFromAccessor(e,e.accessors[c]),p=s.GLTFUtils.GetBufferFromAccessor(e,e.accessors[u]),m=a.target.id,g=e.scene.getNodeByID(m);if(null===g&&(g=e.scene.getNodeByName(m)),null!==g){var _=g instanceof o.Bone,v=a.target.path,y=d.indexOf(v);-1!==y&&(v=h[y]);var b=o.Animation.ANIMATIONTYPE_MATRIX;_||("rotationQuaternion"===v?(b=o.Animation.ANIMATIONTYPE_QUATERNION,g.rotationQuaternion=new o.Quaternion):b=o.Animation.ANIMATIONTYPE_VECTOR3);var A=null,T=[],M=0,P=!1;_&&n&&n.getKeys().length===f.length&&(A=n,P=!0),P||(e.scene._blockEntityCollection=e.forAssetContainer,A=new o.Animation(t,_?"_matrix":v,1,b,o.Animation.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(var S=0;S<f.length;S++){var E=null;if("rotationQuaternion"===v?(E=o.Quaternion.FromArray([p[M],p[M+1],p[M+2],p[M+3]]),M+=4):(E=o.Vector3.FromArray([p[M],p[M+1],p[M+2]]),M+=3),_){var C=g,x=o.Vector3.Zero(),R=new o.Quaternion,O=o.Vector3.Zero(),I=C.getBaseMatrix();P&&n&&(I=n.getKeys()[S].value),I.decompose(O,R,x),"position"===v?x=E:"rotationQuaternion"===v?R=E:O=E,E=o.Matrix.Compose(O,R,x)}P?n&&(n.getKeys()[S].value=E):T.push({frame:f[S],value:E})}!P&&A&&(A.setKeys(T),g.animations.push(A)),n=A,e.scene.stopAnimation(g),e.scene.beginAnimation(g,0,f[f.length-1],!0,1)}else o.Tools.Warn("Creating animation named "+t+". But cannot find node named "+m+" to attach to")}}}}(e),r=0;r<e.scene.skeletons.length;r++){var i=e.scene.skeletons[r];e.scene.beginAnimation(i,0,Number.MAX_VALUE,!0,1)}},C=function(e,t,r,n,o,a){return function(l){!function(e,t,r,n,o){var a=n.values||r.parameters,l=r.uniforms;for(var c in o){var u=o[c],d=u.type,h=a[l[c]];if(void 0===h&&(h=u.value),h){var f=function(e){return function(r){u.value&&e&&(t.setTexture(e,r),delete o[e])}};d===i.EParameterType.SAMPLER_2D?D.LoadTextureAsync(e,n.values?h:u.value,f(c),(function(){return f(null)})):u.value&&s.GLTFUtils.SetUniform(t,c,n.values?h:u.value,d)&&delete o[c]}}}(e,t,r,n,o),t.onBind=function(l){!function(e,t,r,n,o,a,l){var c=a.values||o.parameters;for(var u in r){var d=r[u],h=d.type;if(h===i.EParameterType.FLOAT_MAT2||h===i.EParameterType.FLOAT_MAT3||h===i.EParameterType.FLOAT_MAT4)if(!d.semantic||d.source||d.node){if(d.semantic&&(d.source||d.node)){var f=t.scene.getNodeByName(d.source||d.node||"");if(null===f&&(f=t.scene.getNodeByID(d.source||d.node||"")),null===f)continue;s.GLTFUtils.SetMatrix(t.scene,f,d,u,n.getEffect())}}else s.GLTFUtils.SetMatrix(t.scene,e,d,u,n.getEffect());else{var p=c[o.uniforms[u]];if(!p)continue;if(h===i.EParameterType.SAMPLER_2D){var m=t.textures[a.values?p:d.value].babylonTexture;if(null==m)continue;n.getEffect().setTexture(u,m)}else s.GLTFUtils.SetUniform(n.getEffect(),u,p,h)}}l(n)}(l,e,o,t,r,n,a)}}},x=function(e,t,r){for(var n in t.uniforms){var i=t.uniforms[n],o=t.parameters[i];if(e.currentIdentifier===n&&o.semantic&&!o.source&&!o.node){var s=c.indexOf(o.semantic);if(-1!==s)return delete r[n],u[s]}}return e.currentIdentifier},R=function(e){for(var t in e.materials)D.LoadMaterialAsync(e,t,(function(e){}),(function(){}))},O=function(){function e(){}return e.CreateRuntime=function(e,t,r){var n={extensions:{},accessors:{},buffers:{},bufferViews:{},meshes:{},lights:{},cameras:{},nodes:{},images:{},textures:{},shaders:{},programs:{},samplers:{},techniques:{},materials:{},animations:{},skins:{},extensionsUsed:[],scenes:{},buffersCount:0,shaderscount:0,scene:t,rootUrl:r,loadedBufferCount:0,loadedBufferViews:{},loadedShaderCount:0,importOnlyMeshes:!1,dummyNodes:[],forAssetContainer:!1};return e.extensions&&f(e.extensions,"extensions",n),e.extensionsUsed&&f(e.extensionsUsed,"extensionsUsed",n),e.buffers&&function(e,t){for(var r in e){var n=e[r];t.buffers[r]=n,t.buffersCount++}}(e.buffers,n),e.bufferViews&&f(e.bufferViews,"bufferViews",n),e.accessors&&f(e.accessors,"accessors",n),e.meshes&&f(e.meshes,"meshes",n),e.lights&&f(e.lights,"lights",n),e.cameras&&f(e.cameras,"cameras",n),e.nodes&&f(e.nodes,"nodes",n),e.images&&f(e.images,"images",n),e.textures&&f(e.textures,"textures",n),e.shaders&&function(e,t){for(var r in e){var n=e[r];t.shaders[r]=n,t.shaderscount++}}(e.shaders,n),e.programs&&f(e.programs,"programs",n),e.samplers&&f(e.samplers,"samplers",n),e.techniques&&f(e.techniques,"techniques",n),e.materials&&f(e.materials,"materials",n),e.animations&&f(e.animations,"animations",n),e.skins&&f(e.skins,"skins",n),e.scenes&&(n.scenes=e.scenes),e.scene&&e.scenes&&(n.currentScene=e.scenes[e.scene]),n},e.LoadBufferAsync=function(e,t,r,n,i){var s=e.buffers[t];o.Tools.IsBase64(s.uri)?setTimeout((function(){return r(new Uint8Array(o.Tools.DecodeBase64(s.uri)))})):o.Tools.LoadFile(e.rootUrl+s.uri,(function(e){return r(new Uint8Array(e))}),i,void 0,!0,(function(e){e&&n(e.status+" "+e.statusText)}))},e.LoadTextureBufferAsync=function(e,t,r,n){var i=e.textures[t];if(i&&i.source)if(i.babylonTexture)r(null);else{var s=e.images[i.source];o.Tools.IsBase64(s.uri)?setTimeout((function(){return r(new Uint8Array(o.Tools.DecodeBase64(s.uri)))})):o.Tools.LoadFile(e.rootUrl+s.uri,(function(e){return r(new Uint8Array(e))}),void 0,void 0,!0,(function(e){e&&n(e.status+" "+e.statusText)}))}else n("")},e.CreateTextureAsync=function(e,t,r,n,a){var l=e.textures[t];if(l.babylonTexture)n(l.babylonTexture);else{var c=e.samplers[l.sampler],u=c.minFilter===i.ETextureFilterType.NEAREST_MIPMAP_NEAREST||c.minFilter===i.ETextureFilterType.NEAREST_MIPMAP_LINEAR||c.minFilter===i.ETextureFilterType.LINEAR_MIPMAP_NEAREST||c.minFilter===i.ETextureFilterType.LINEAR_MIPMAP_LINEAR,d=o.Texture.BILINEAR_SAMPLINGMODE,h=null==r?new Blob:new Blob([r]),f=URL.createObjectURL(h),p=function(){return URL.revokeObjectURL(f)},m=new o.Texture(f,e.scene,!u,!0,d,p,p);void 0!==c.wrapS&&(m.wrapU=s.GLTFUtils.GetWrapMode(c.wrapS)),void 0!==c.wrapT&&(m.wrapV=s.GLTFUtils.GetWrapMode(c.wrapT)),m.name=t,l.babylonTexture=m,n(m)}},e.LoadShaderStringAsync=function(e,t,r,n){var i=e.shaders[t];if(o.Tools.IsBase64(i.uri)){var s=atob(i.uri.split(",")[1]);r&&r(s)}else o.Tools.LoadFile(e.rootUrl+i.uri,r,void 0,void 0,!1,(function(e){e&&n&&n(e.status+" "+e.statusText)}))},e.LoadMaterialAsync=function(e,t,r,s){var a=e.materials[t];if(a.technique){var d=e.techniques[a.technique];if(!d){e.scene._blockEntityCollection=e.forAssetContainer;var h=new o.StandardMaterial(t,e.scene);return e.scene._blockEntityCollection=!1,h.diffuseColor=new o.Color3(.5,.5,.5),h.sideOrientation=o.Material.CounterClockWiseSideOrientation,void r(h)}var f=e.programs[d.program],p=d.states,g=o.Effect.ShadersStore[f.vertexShader+"VertexShader"],_=o.Effect.ShadersStore[f.fragmentShader+"PixelShader"],v="",y="",b=new l(g),A=new l(_),T={},M=[],P=[],S=[];for(var E in d.uniforms){var R=d.uniforms[E],O=d.parameters[R];if(T[E]=O,!O.semantic||O.node||O.source)O.type===i.EParameterType.SAMPLER_2D?S.push(E):M.push(E);else{var I=c.indexOf(O.semantic);-1!==I?(M.push(u[I]),delete T[E]):M.push(E)}}for(var D in d.attributes){var B=d.attributes[D];if((w=d.parameters[B]).semantic){var N=m(w);N&&P.push(N)}}for(;!b.isEnd()&&b.getNextToken();)if(b.currentToken===n.IDENTIFIER){var L=!1;for(var D in d.attributes){B=d.attributes[D];var w=d.parameters[B];if(b.currentIdentifier===D&&w.semantic){v+=m(w),L=!0;break}}L||(v+=x(b,d,T))}else v+=b.currentString;for(;!A.isEnd()&&A.getNextToken();)A.currentToken===n.IDENTIFIER?y+=x(A,d,T):y+=A.currentString;var F={vertex:f.vertexShader+t,fragment:f.fragmentShader+t},V={attributes:P,uniforms:M,samplers:S,needAlphaBlending:p&&p.enable&&-1!==p.enable.indexOf(3042)};o.Effect.ShadersStore[f.vertexShader+t+"VertexShader"]=v,o.Effect.ShadersStore[f.fragmentShader+t+"PixelShader"]=y;var k=new o.ShaderMaterial(t,e.scene,F,V);if(k.onError=function(e,t,r){return function(n,i){t.dispose(!0),r("Cannot compile program named "+e.name+". Error: "+i+". Default material will be applied")}}(f,k,s),k.onCompiled=C(e,k,d,a,T,r),k.sideOrientation=o.Material.CounterClockWiseSideOrientation,p&&p.functions){var U=p.functions;U.cullFace&&U.cullFace[0]!==i.ECullingType.BACK&&(k.backFaceCulling=!1);var z=U.blendFuncSeparate;z&&(z[0]===i.EBlendingFunction.SRC_ALPHA&&z[1]===i.EBlendingFunction.ONE_MINUS_SRC_ALPHA&&z[2]===i.EBlendingFunction.ONE&&z[3]===i.EBlendingFunction.ONE?k.alphaMode=o.Constants.ALPHA_COMBINE:z[0]===i.EBlendingFunction.ONE&&z[1]===i.EBlendingFunction.ONE&&z[2]===i.EBlendingFunction.ZERO&&z[3]===i.EBlendingFunction.ONE?k.alphaMode=o.Constants.ALPHA_ONEONE:z[0]===i.EBlendingFunction.SRC_ALPHA&&z[1]===i.EBlendingFunction.ONE&&z[2]===i.EBlendingFunction.ZERO&&z[3]===i.EBlendingFunction.ONE?k.alphaMode=o.Constants.ALPHA_ADD:z[0]===i.EBlendingFunction.ZERO&&z[1]===i.EBlendingFunction.ONE_MINUS_SRC_COLOR&&z[2]===i.EBlendingFunction.ONE&&z[3]===i.EBlendingFunction.ONE?k.alphaMode=o.Constants.ALPHA_SUBTRACT:z[0]===i.EBlendingFunction.DST_COLOR&&z[1]===i.EBlendingFunction.ZERO&&z[2]===i.EBlendingFunction.ONE&&z[3]===i.EBlendingFunction.ONE?k.alphaMode=o.Constants.ALPHA_MULTIPLY:z[0]===i.EBlendingFunction.SRC_ALPHA&&z[1]===i.EBlendingFunction.ONE_MINUS_SRC_COLOR&&z[2]===i.EBlendingFunction.ONE&&z[3]===i.EBlendingFunction.ONE&&(k.alphaMode=o.Constants.ALPHA_MAXIMIZED))}}else s&&s("No technique found.")},e}(),I=function(){function e(){this.state=null}return e.RegisterExtension=function(t){e.Extensions[t.name]?o.Tools.Error('Tool with the same name "'+t.name+'" already exists'):e.Extensions[t.name]=t},e.prototype.dispose=function(){},e.prototype._importMeshAsync=function(e,t,r,n,i,s,l,c){var u=this;return t.useRightHandedSystem=!0,D.LoadRuntimeAsync(t,r,n,(function(t){t.forAssetContainer=i,t.importOnlyMeshes=!0,""===e?t.importMeshesNames=[]:"string"==typeof e?t.importMeshesNames=[e]:!e||e instanceof Array?(t.importMeshesNames=[],o.Tools.Warn("Argument meshesNames must be of type string or string[]")):t.importMeshesNames=[e],u._createNodes(t);var r=new Array,n=new Array;for(var c in t.nodes){var d=t.nodes[c];d.babylonNode instanceof o.AbstractMesh&&r.push(d.babylonNode)}for(var h in t.skins){var f=t.skins[h];f.babylonSkeleton instanceof o.Skeleton&&n.push(f.babylonSkeleton)}u._loadBuffersAsync(t,(function(){u._loadShadersAsync(t,(function(){R(t),E(t),!a.GLTFFileLoader.IncrementalLoading&&s&&s(r,n)}))}),l),a.GLTFFileLoader.IncrementalLoading&&s&&s(r,n)}),c),!0},e.prototype.importMeshAsync=function(e,t,r,n,i,o){var s=this;return new Promise((function(a,l){s._importMeshAsync(e,t,n,i,r,(function(e,t){a({meshes:e,particleSystems:[],skeletons:t,animationGroups:[],lights:[],transformNodes:[]})}),o,(function(e){l(new Error(e))}))}))},e.prototype._loadAsync=function(e,t,r,n,i,o,s){var l=this;e.useRightHandedSystem=!0,D.LoadRuntimeAsync(e,t,r,(function(e){D.LoadRuntimeExtensionsAsync(e,(function(){l._createNodes(e),l._loadBuffersAsync(e,(function(){l._loadShadersAsync(e,(function(){R(e),E(e),a.GLTFFileLoader.IncrementalLoading||i()}))})),a.GLTFFileLoader.IncrementalLoading&&i()}),s)}),s)},e.prototype.loadAsync=function(e,t,r,n){var i=this;return new Promise((function(o,s){i._loadAsync(e,t,r,!1,(function(){o()}),n,(function(e){s(new Error(e))}))}))},e.prototype._loadShadersAsync=function(e,t){var r=!1,n=function(r,n){D.LoadShaderStringAsync(e,r,(function(s){s instanceof ArrayBuffer||(e.loadedShaderCount++,s&&(o.Effect.ShadersStore[r+(n.type===i.EShaderType.VERTEX?"VertexShader":"PixelShader")]=s),e.loadedShaderCount===e.shaderscount&&t())}),(function(){o.Tools.Error("Error when loading shader program named "+r+" located at "+n.uri)}))};for(var s in e.shaders){r=!0;var a=e.shaders[s];a?n.bind(this,s,a)():o.Tools.Error("No shader named: "+s)}r||t()},e.prototype._loadBuffersAsync=function(e,t,r){var n=!1,i=function(r,n){D.LoadBufferAsync(e,r,(function(i){e.loadedBufferCount++,i&&(i.byteLength!=e.buffers[r].byteLength&&o.Tools.Error("Buffer named "+r+" is length "+i.byteLength+". Expected: "+n.byteLength),e.loadedBufferViews[r]=i),e.loadedBufferCount===e.buffersCount&&t()}),(function(){o.Tools.Error("Error when loading buffer named "+r+" located at "+n.uri)}))};for(var s in e.buffers){n=!0;var a=e.buffers[s];a?i.bind(this,s,a)():o.Tools.Error("No buffer named: "+s)}n||t()},e.prototype._createNodes=function(e){var t=e.currentScene;if(t)for(var r=0;r<t.nodes.length;r++)S(e,t.nodes[r],null);else for(var n in e.scenes)for(t=e.scenes[n],r=0;r<t.nodes.length;r++)S(e,t.nodes[r],null)},e.Extensions={},e}(),D=function(){function e(e){this._name=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e.prototype.loadRuntimeAsync=function(e,t,r,n,i){return!1},e.prototype.loadRuntimeExtensionsAsync=function(e,t,r){return!1},e.prototype.loadBufferAsync=function(e,t,r,n,i){return!1},e.prototype.loadTextureBufferAsync=function(e,t,r,n){return!1},e.prototype.createTextureAsync=function(e,t,r,n,i){return!1},e.prototype.loadShaderStringAsync=function(e,t,r,n){return!1},e.prototype.loadMaterialAsync=function(e,t,r,n){return!1},e.LoadRuntimeAsync=function(t,r,n,i,o){e.ApplyExtensions((function(e){return e.loadRuntimeAsync(t,r,n,i,o)}),(function(){setTimeout((function(){i&&i(O.CreateRuntime(r.json,t,n))}))}))},e.LoadRuntimeExtensionsAsync=function(t,r,n){e.ApplyExtensions((function(e){return e.loadRuntimeExtensionsAsync(t,r,n)}),(function(){setTimeout((function(){r()}))}))},e.LoadBufferAsync=function(t,r,n,i,o){e.ApplyExtensions((function(e){return e.loadBufferAsync(t,r,n,i,o)}),(function(){O.LoadBufferAsync(t,r,n,i,o)}))},e.LoadTextureAsync=function(t,r,n,i){e.LoadTextureBufferAsync(t,r,(function(o){o&&e.CreateTextureAsync(t,r,o,n,i)}),i)},e.LoadShaderStringAsync=function(t,r,n,i){e.ApplyExtensions((function(e){return e.loadShaderStringAsync(t,r,n,i)}),(function(){O.LoadShaderStringAsync(t,r,n,i)}))},e.LoadMaterialAsync=function(t,r,n,i){e.ApplyExtensions((function(e){return e.loadMaterialAsync(t,r,n,i)}),(function(){O.LoadMaterialAsync(t,r,n,i)}))},e.LoadTextureBufferAsync=function(t,r,n,i){e.ApplyExtensions((function(e){return e.loadTextureBufferAsync(t,r,n,i)}),(function(){O.LoadTextureBufferAsync(t,r,n,i)}))},e.CreateTextureAsync=function(t,r,n,i,o){e.ApplyExtensions((function(e){return e.createTextureAsync(t,r,n,i,o)}),(function(){O.CreateTextureAsync(t,r,n,i,o)}))},e.ApplyExtensions=function(e,t){for(var r in I.Extensions)if(e(I.Extensions[r]))return;t()},e}();a.GLTFFileLoader._CreateGLTF1Loader=function(){return new I}},"./glTF/1.0/glTFLoaderInterfaces.ts":
- /*!******************************************!*\
- !*** ./glTF/1.0/glTFLoaderInterfaces.ts ***!
- \******************************************/
- /*! exports provided: EComponentType, EShaderType, EParameterType, ETextureWrapMode, ETextureFilterType, ETextureFormat, ECullingType, EBlendingFunction */function(e,t,r){"use strict";var n,i,o,s,a,l,c,u;r.r(t),r.d(t,"EComponentType",(function(){return n})),r.d(t,"EShaderType",(function(){return i})),r.d(t,"EParameterType",(function(){return o})),r.d(t,"ETextureWrapMode",(function(){return s})),r.d(t,"ETextureFilterType",(function(){return a})),r.d(t,"ETextureFormat",(function(){return l})),r.d(t,"ECullingType",(function(){return c})),r.d(t,"EBlendingFunction",(function(){return u})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.FLOAT=5126]="FLOAT"}(n||(n={})),function(e){e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(i||(i={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D"}(o||(o={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(s||(s={})),function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9728]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(a||(a={})),function(e){e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA"}(l||(l={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(c||(c={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(u||(u={}))},"./glTF/1.0/glTFLoaderUtils.ts":
- /*!*************************************!*\
- !*** ./glTF/1.0/glTFLoaderUtils.ts ***!
- \*************************************/
- /*! exports provided: GLTFUtils */function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFUtils",(function(){return o}));var n=r(/*! ./glTFLoaderInterfaces */"./glTF/1.0/glTFLoaderInterfaces.ts"),i=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),o=function(){function e(){}return e.SetMatrix=function(e,t,r,o,s){var a=null;if("MODEL"===r.semantic?a=t.getWorldMatrix():"PROJECTION"===r.semantic?a=e.getProjectionMatrix():"VIEW"===r.semantic?a=e.getViewMatrix():"MODELVIEWINVERSETRANSPOSE"===r.semantic?a=i.Matrix.Transpose(t.getWorldMatrix().multiply(e.getViewMatrix()).invert()):"MODELVIEW"===r.semantic?a=t.getWorldMatrix().multiply(e.getViewMatrix()):"MODELVIEWPROJECTION"===r.semantic?a=t.getWorldMatrix().multiply(e.getTransformMatrix()):"MODELINVERSE"===r.semantic?a=t.getWorldMatrix().invert():"VIEWINVERSE"===r.semantic?a=e.getViewMatrix().invert():"PROJECTIONINVERSE"===r.semantic?a=e.getProjectionMatrix().invert():"MODELVIEWINVERSE"===r.semantic?a=t.getWorldMatrix().multiply(e.getViewMatrix()).invert():"MODELVIEWPROJECTIONINVERSE"===r.semantic?a=t.getWorldMatrix().multiply(e.getTransformMatrix()).invert():"MODELINVERSETRANSPOSE"===r.semantic&&(a=i.Matrix.Transpose(t.getWorldMatrix().invert())),a)switch(r.type){case n.EParameterType.FLOAT_MAT2:s.setMatrix2x2(o,i.Matrix.GetAsMatrix2x2(a));break;case n.EParameterType.FLOAT_MAT3:s.setMatrix3x3(o,i.Matrix.GetAsMatrix3x3(a));break;case n.EParameterType.FLOAT_MAT4:s.setMatrix(o,a)}},e.SetUniform=function(e,t,r,o){switch(o){case n.EParameterType.FLOAT:return e.setFloat(t,r),!0;case n.EParameterType.FLOAT_VEC2:return e.setVector2(t,i.Vector2.FromArray(r)),!0;case n.EParameterType.FLOAT_VEC3:return e.setVector3(t,i.Vector3.FromArray(r)),!0;case n.EParameterType.FLOAT_VEC4:return e.setVector4(t,i.Vector4.FromArray(r)),!0;default:return!1}},e.GetWrapMode=function(e){switch(e){case n.ETextureWrapMode.CLAMP_TO_EDGE:return i.Texture.CLAMP_ADDRESSMODE;case n.ETextureWrapMode.MIRRORED_REPEAT:return i.Texture.MIRROR_ADDRESSMODE;case n.ETextureWrapMode.REPEAT:default:return i.Texture.WRAP_ADDRESSMODE}},e.GetByteStrideFromType=function(e){switch(e.type){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}},e.GetTextureFilterMode=function(e){switch(e){case n.ETextureFilterType.LINEAR:case n.ETextureFilterType.LINEAR_MIPMAP_NEAREST:case n.ETextureFilterType.LINEAR_MIPMAP_LINEAR:return i.Texture.TRILINEAR_SAMPLINGMODE;case n.ETextureFilterType.NEAREST:case n.ETextureFilterType.NEAREST_MIPMAP_NEAREST:return i.Texture.NEAREST_SAMPLINGMODE;default:return i.Texture.BILINEAR_SAMPLINGMODE}},e.GetBufferFromBufferView=function(e,t,r,i,o){r=t.byteOffset+r;var s=e.loadedBufferViews[t.buffer];if(r+i>s.byteLength)throw new Error("Buffer access is out of range");var a=s.buffer;switch(r+=s.byteOffset,o){case n.EComponentType.BYTE:return new Int8Array(a,r,i);case n.EComponentType.UNSIGNED_BYTE:return new Uint8Array(a,r,i);case n.EComponentType.SHORT:return new Int16Array(a,r,i);case n.EComponentType.UNSIGNED_SHORT:return new Uint16Array(a,r,i);default:return new Float32Array(a,r,i)}},e.GetBufferFromAccessor=function(t,r){var n=t.bufferViews[r.bufferView],i=r.count*e.GetByteStrideFromType(r);return e.GetBufferFromBufferView(t,n,r.byteOffset,i,r.componentType)},e.DecodeBufferToText=function(e){for(var t="",r=e.byteLength,n=0;n<r;++n)t+=String.fromCharCode(e[n]);return t},e.GetDefaultMaterial=function(t){if(!e._DefaultMaterial){i.Effect.ShadersStore.GLTFDefaultMaterialVertexShader=["precision highp float;","","uniform mat4 worldView;","uniform mat4 projection;","","attribute vec3 position;","","void main(void)","{"," gl_Position = projection * worldView * vec4(position, 1.0);","}"].join("\n"),i.Effect.ShadersStore.GLTFDefaultMaterialPixelShader=["precision highp float;","","uniform vec4 u_emission;","","void main(void)","{"," gl_FragColor = u_emission;","}"].join("\n");var r={attributes:["position"],uniforms:["worldView","projection","u_emission"],samplers:new Array,needAlphaBlending:!1};e._DefaultMaterial=new i.ShaderMaterial("GLTFDefaultMaterial",t,{vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},r),e._DefaultMaterial.setColor4("u_emission",new i.Color4(.5,.5,.5,1))}return e._DefaultMaterial},e._DefaultMaterial=null,e}()},"./glTF/1.0/glTFMaterialsCommonExtension.ts":
- /*!**************************************************!*\
- !*** ./glTF/1.0/glTFMaterialsCommonExtension.ts ***!
- \**************************************************/
- /*! exports provided: GLTFMaterialsCommonExtension */function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFMaterialsCommonExtension",(function(){return s}));var n=r(/*! tslib */"../../node_modules/tslib/tslib.es6.js"),i=r(/*! ./glTFLoader */"./glTF/1.0/glTFLoader.ts"),o=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),s=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return Object(n.__extends)(t,e),t.prototype.loadRuntimeExtensionsAsync=function(e,t,r){if(!e.extensions)return!1;var n=e.extensions[this.name];if(!n)return!1;var i=n.lights;if(i)for(var s in i){var a=i[s];switch(a.type){case"ambient":var l=new o.HemisphericLight(a.name,new o.Vector3(0,1,0),e.scene),c=a.ambient;c&&(l.diffuse=o.Color3.FromArray(c.color||[1,1,1]));break;case"point":var u=new o.PointLight(a.name,new o.Vector3(10,10,10),e.scene),d=a.point;d&&(u.diffuse=o.Color3.FromArray(d.color||[1,1,1]));break;case"directional":var h=new o.DirectionalLight(a.name,new o.Vector3(0,-1,0),e.scene),f=a.directional;f&&(h.diffuse=o.Color3.FromArray(f.color||[1,1,1]));break;case"spot":var p=a.spot;p&&(new o.SpotLight(a.name,new o.Vector3(0,10,0),new o.Vector3(0,-1,0),p.fallOffAngle||Math.PI,p.fallOffExponent||0,e.scene).diffuse=o.Color3.FromArray(p.color||[1,1,1]));break;default:o.Tools.Warn('GLTF Material Common extension: light type "'+a.type+"” not supported")}}return!1},t.prototype.loadMaterialAsync=function(e,t,r,n){var i=e.materials[t];if(!i||!i.extensions)return!1;var s=i.extensions[this.name];if(!s)return!1;var a=new o.StandardMaterial(t,e.scene);return a.sideOrientation=o.Material.CounterClockWiseSideOrientation,"CONSTANT"===s.technique&&(a.disableLighting=!0),a.backFaceCulling=void 0!==s.doubleSided&&!s.doubleSided,a.alpha=void 0===s.values.transparency?1:s.values.transparency,a.specularPower=void 0===s.values.shininess?0:s.values.shininess,"string"==typeof s.values.ambient?this._loadTexture(e,s.values.ambient,a,"ambientTexture",n):a.ambientColor=o.Color3.FromArray(s.values.ambient||[0,0,0]),"string"==typeof s.values.diffuse?this._loadTexture(e,s.values.diffuse,a,"diffuseTexture",n):a.diffuseColor=o.Color3.FromArray(s.values.diffuse||[0,0,0]),"string"==typeof s.values.emission?this._loadTexture(e,s.values.emission,a,"emissiveTexture",n):a.emissiveColor=o.Color3.FromArray(s.values.emission||[0,0,0]),"string"==typeof s.values.specular?this._loadTexture(e,s.values.specular,a,"specularTexture",n):a.specularColor=o.Color3.FromArray(s.values.specular||[0,0,0]),!0},t.prototype._loadTexture=function(e,t,r,n,o){i.GLTFLoaderBase.LoadTextureBufferAsync(e,t,(function(s){i.GLTFLoaderBase.CreateTextureAsync(e,t,s,(function(e){return r[n]=e}),o)}),o)},t}(i.GLTFLoaderExtension);i.GLTFLoader.RegisterExtension(new s)},"./glTF/1.0/index.ts":
- /*!***************************!*\
- !*** ./glTF/1.0/index.ts ***!
- \***************************/
- /*! exports provided: GLTFBinaryExtension, GLTFLoaderBase, GLTFLoader, GLTFLoaderExtension, EComponentType, EShaderType, EParameterType, ETextureWrapMode, ETextureFilterType, ETextureFormat, ECullingType, EBlendingFunction, GLTFUtils, GLTFMaterialsCommonExtension */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./glTFBinaryExtension */"./glTF/1.0/glTFBinaryExtension.ts");r.d(t,"GLTFBinaryExtension",(function(){return n.GLTFBinaryExtension}));var i=r(/*! ./glTFLoader */"./glTF/1.0/glTFLoader.ts");r.d(t,"GLTFLoaderBase",(function(){return i.GLTFLoaderBase})),r.d(t,"GLTFLoader",(function(){return i.GLTFLoader})),r.d(t,"GLTFLoaderExtension",(function(){return i.GLTFLoaderExtension}));var o=r(/*! ./glTFLoaderInterfaces */"./glTF/1.0/glTFLoaderInterfaces.ts");r.d(t,"EComponentType",(function(){return o.EComponentType})),r.d(t,"EShaderType",(function(){return o.EShaderType})),r.d(t,"EParameterType",(function(){return o.EParameterType})),r.d(t,"ETextureWrapMode",(function(){return o.ETextureWrapMode})),r.d(t,"ETextureFilterType",(function(){return o.ETextureFilterType})),r.d(t,"ETextureFormat",(function(){return o.ETextureFormat})),r.d(t,"ECullingType",(function(){return o.ECullingType})),r.d(t,"EBlendingFunction",(function(){return o.EBlendingFunction}));var s=r(/*! ./glTFLoaderUtils */"./glTF/1.0/glTFLoaderUtils.ts");r.d(t,"GLTFUtils",(function(){return s.GLTFUtils}));var a=r(/*! ./glTFMaterialsCommonExtension */"./glTF/1.0/glTFMaterialsCommonExtension.ts");r.d(t,"GLTFMaterialsCommonExtension",(function(){return a.GLTFMaterialsCommonExtension}))},"./glTF/2.0/Extensions/EXT_lights_image_based.ts":
- /*!*******************************************************!*\
- !*** ./glTF/2.0/Extensions/EXT_lights_image_based.ts ***!
- \*******************************************************/
- /*! exports provided: EXT_lights_image_based */function(e,t,r){"use strict";r.r(t),r.d(t,"EXT_lights_image_based",(function(){return s}));var n=r(/*! babylonjs/Maths/math.scalar */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="EXT_lights_image_based",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights}},e.prototype.loadSceneAsync=function(e,t){var r=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var s=new Array;s.push(r._loader.loadSceneAsync(e,t)),r._loader.logOpen(""+n);var a=i.ArrayItem.Get(n+"/light",r._lights,o.light);return s.push(r._loadLightAsync("/extensions/"+r.name+"/lights/"+o.light,a).then((function(e){r._loader.babylonScene.environmentTexture=e}))),r._loader.logClose(),Promise.all(s).then((function(){}))}))},e.prototype._loadLightAsync=function(e,t){var r=this;if(!t._loaded){var o=new Array;this._loader.logOpen(""+e);for(var s=new Array(t.specularImages.length),a=function(r){var n=t.specularImages[r];s[r]=new Array(n.length);for(var a=function(t){var a=e+"/specularImages/"+r+"/"+t;l._loader.logOpen(""+a);var c=n[t],u=i.ArrayItem.Get(a,l._loader.gltf.images,c);o.push(l._loader.loadImageAsync("/images/"+c,u).then((function(e){s[r][t]=e}))),l._loader.logClose()},c=0;c<n.length;c++)a(c)},l=this,c=0;c<t.specularImages.length;c++)a(c);this._loader.logClose(),t._loaded=Promise.all(o).then((function(){var e=new n.RawCubeTexture(r._loader.babylonScene,null,t.specularImageSize);if(e.name=t.name||"environment",t._babylonTexture=e,null!=t.intensity&&(e.level=t.intensity),t.rotation){var i=n.Quaternion.FromArray(t.rotation);r._loader.babylonScene.useRightHandedSystem||(i=n.Quaternion.Inverse(i)),n.Matrix.FromQuaternionToRef(i,e.getReflectionTextureMatrix())}var o=n.SphericalHarmonics.FromArray(t.irradianceCoefficients);o.scaleInPlace(t.intensity),o.convertIrradianceToLambertianRadiance();var a=n.SphericalPolynomial.FromHarmonics(o),l=(s.length-1)/n.Scalar.Log2(t.specularImageSize);return e.updateRGBDAsync(s,a,l)}))}return t._loaded.then((function(){return t._babylonTexture}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts":
- /*!********************************************************!*\
- !*** ./glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts ***!
- \********************************************************/
- /*! exports provided: EXT_mesh_gpu_instancing */function(e,t,r){"use strict";r.r(t),r.d(t,"EXT_mesh_gpu_instancing",(function(){return s}));var n=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="EXT_mesh_gpu_instancing",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadNodeAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,s){o._loader._disableInstancedMesh++;var a=o._loader.loadNodeAsync("/nodes/"+t.index,t,r);if(o._loader._disableInstancedMesh--,!t._primitiveBabylonMeshes)return a;var l=new Array,c=0,u=function(t){if(null!=s.attributes[t]){var r=i.ArrayItem.Get(e+"/attributes/"+t,o._loader.gltf.accessors,s.attributes[t]);if(l.push(o._loader._loadFloatAccessorAsync("/accessors/"+r.bufferView,r)),0===c)c=r.count;else if(c!==r.count)throw new Error(e+"/attributes: Instance buffer accessors do not have the same count.")}else l.push(Promise.resolve(null))};return u("TRANSLATION"),u("ROTATION"),u("SCALE"),a.then((function(e){return Promise.all(l).then((function(r){var i=r[0],o=r[1],s=r[2],a=new Float32Array(16*c);n.TmpVectors.Vector3[0].copyFromFloats(0,0,0),n.TmpVectors.Quaternion[0].copyFromFloats(0,0,0,1),n.TmpVectors.Vector3[1].copyFromFloats(1,1,1);for(var l=0;l<c;++l)i&&n.Vector3.FromArrayToRef(i,3*l,n.TmpVectors.Vector3[0]),o&&n.Quaternion.FromArrayToRef(o,4*l,n.TmpVectors.Quaternion[0]),s&&n.Vector3.FromArrayToRef(s,3*l,n.TmpVectors.Vector3[1]),n.Matrix.ComposeToRef(n.TmpVectors.Vector3[1],n.TmpVectors.Quaternion[0],n.TmpVectors.Vector3[0],n.TmpVectors.Matrix[0]),n.TmpVectors.Matrix[0].copyToArray(a,16*l);for(var u=0,d=t._primitiveBabylonMeshes;u<d.length;u++)d[u].thinInstanceSetBuffer("matrix",a,16,!0);return e}))}))}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/ExtrasAsMetadata.ts":
- /*!*************************************************!*\
- !*** ./glTF/2.0/Extensions/ExtrasAsMetadata.ts ***!
- \*************************************************/
- /*! exports provided: ExtrasAsMetadata */function(e,t,r){"use strict";r.r(t),r.d(t,"ExtrasAsMetadata",(function(){return o}));var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i="ExtrasAsMetadata",o=function(){function e(e){this.name=i,this.enabled=!0,this._loader=e}return e.prototype._assignExtras=function(e,t){if(t.extras&&Object.keys(t.extras).length>0){var r=e.metadata=e.metadata||{};(r.gltf=r.gltf||{}).extras=t.extras}},e.prototype.dispose=function(){delete this._loader},e.prototype.loadNodeAsync=function(e,t,r){var n=this;return this._loader.loadNodeAsync(e,t,(function(e){n._assignExtras(e,t),r(e)}))},e.prototype.loadCameraAsync=function(e,t,r){var n=this;return this._loader.loadCameraAsync(e,t,(function(e){n._assignExtras(e,t),r(e)}))},e.prototype.createMaterial=function(e,t,r){var n=this._loader.createMaterial(e,t,r);return this._assignExtras(n,t),n},e}();n.GLTFLoader.RegisterExtension(i,(function(e){return new o(e)}))},"./glTF/2.0/Extensions/KHR_draco_mesh_compression.ts":
- /*!***********************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_draco_mesh_compression.ts ***!
- \***********************************************************/
- /*! exports provided: KHR_draco_mesh_compression */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_draco_mesh_compression",(function(){return s}));var n=r(/*! babylonjs/Meshes/Compression/dracoCompression */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_draco_mesh_compression",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=n.DracoCompression.DecoderAvailable&&this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this.dracoCompression,delete this._loader},e.prototype._loadVertexDataAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,a){if(null!=t.mode){if(5!==t.mode&&4!==t.mode)throw new Error(e+": Unsupported mode "+t.mode);if(5===t.mode)throw new Error(e+": Mode "+t.mode+" is not currently supported")}var l={},c=function(e,t){var n=a.attributes[e];null!=n&&(r._delayInfo=r._delayInfo||[],-1===r._delayInfo.indexOf(t)&&r._delayInfo.push(t),l[t]=n)};c("POSITION",n.VertexBuffer.PositionKind),c("NORMAL",n.VertexBuffer.NormalKind),c("TANGENT",n.VertexBuffer.TangentKind),c("TEXCOORD_0",n.VertexBuffer.UVKind),c("TEXCOORD_1",n.VertexBuffer.UV2Kind),c("JOINTS_0",n.VertexBuffer.MatricesIndicesKind),c("WEIGHTS_0",n.VertexBuffer.MatricesWeightsKind),c("COLOR_0",n.VertexBuffer.ColorKind);var u=i.ArrayItem.Get(s,o._loader.gltf.bufferViews,a.bufferView);return u._dracoBabylonGeometry||(u._dracoBabylonGeometry=o._loader.loadBufferViewAsync("/bufferViews/"+u.index,u).then((function(t){return(o.dracoCompression||n.DracoCompression.Default).decodeMeshAsync(t,l).then((function(e){var t=new n.Geometry(r.name,o._loader.babylonScene);return e.applyToGeometry(t),t})).catch((function(t){throw new Error(e+": "+t.message)}))}))),u._dracoBabylonGeometry}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_lights_punctual.ts":
- /*!****************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_lights_punctual.ts ***!
- \****************************************************/
- /*! exports provided: KHR_lights */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_lights",(function(){return s}));var n=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_lights_punctual",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights}},e.prototype.loadNodeAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,a){return o._loader.loadNodeAsync(e,t,(function(e){var t,l=i.ArrayItem.Get(s,o._lights,a.light),c=l.name||e.name;switch(o._loader.babylonScene._blockEntityCollection=o._loader._forAssetContainer,l.type){case"directional":t=new n.DirectionalLight(c,n.Vector3.Backward(),o._loader.babylonScene);break;case"point":t=new n.PointLight(c,n.Vector3.Zero(),o._loader.babylonScene);break;case"spot":var u=new n.SpotLight(c,n.Vector3.Zero(),n.Vector3.Backward(),0,1,o._loader.babylonScene);u.angle=2*(l.spot&&l.spot.outerConeAngle||Math.PI/4),u.innerAngle=2*(l.spot&&l.spot.innerConeAngle||0),t=u;break;default:throw o._loader.babylonScene._blockEntityCollection=!1,new Error(s+": Invalid light type ("+l.type+")")}o._loader.babylonScene._blockEntityCollection=!1,t.falloffType=n.Light.FALLOFF_GLTF,t.diffuse=l.color?n.Color3.FromArray(l.color):n.Color3.White(),t.intensity=null==l.intensity?1:l.intensity,t.range=null==l.range?Number.MAX_VALUE:l.range,t.parent=e,o._loader._babylonLights.push(t),i.GLTFLoader.AddPointerMetadata(t,s),r(e)}))}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_clearcoat.ts":
- /*!********************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_clearcoat.ts ***!
- \********************************************************/
- /*! exports provided: KHR_materials_clearcoat */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_clearcoat",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_clearcoat",s=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadClearCoatPropertiesAsync(i,o,r)),Promise.all(s).then((function(){}))}))},e.prototype._loadClearCoatPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return r.clearCoat.isEnabled=!0,null!=t.clearcoatFactor?r.clearCoat.intensity=t.clearcoatFactor:r.clearCoat.intensity=0,t.clearcoatTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/clearcoatTexture",t.clearcoatTexture,(function(e){e.name=r.name+" (ClearCoat Intensity)",r.clearCoat.texture=e}))),null!=t.clearcoatRoughnessFactor?r.clearCoat.roughness=t.clearcoatRoughnessFactor:r.clearCoat.roughness=0,t.clearcoatRoughnessTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/clearcoatRoughnessTexture",t.clearcoatRoughnessTexture,(function(e){e.name=r.name+" (ClearCoat Roughness)",r.clearCoat.texture=e}))),t.clearcoatNormalTexture&&(i.push(this._loader.loadTextureInfoAsync(e+"/clearcoatNormalTexture",t.clearcoatNormalTexture,(function(e){e.name=r.name+" (ClearCoat Normal)",r.clearCoat.bumpTexture=e}))),r.invertNormalMapX=!r.getScene().useRightHandedSystem,r.invertNormalMapY=r.getScene().useRightHandedSystem,null!=t.clearcoatNormalTexture.scale&&(r.clearCoat.bumpTexture.level=t.clearcoatNormalTexture.scale)),Promise.all(i).then((function(){}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_ior.ts":
- /*!**************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_ior.ts ***!
- \**************************************************/
- /*! exports provided: KHR_materials_ior */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_ior",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_ior",s=function(){function e(e){this.name=o,this.order=180,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadIorPropertiesAsync(i,o,r)),Promise.all(s).then((function(){}))}))},e.prototype._loadIorPropertiesAsync=function(t,r,i){if(!(i instanceof n.PBRMaterial))throw new Error(t+": Material type not supported");return void 0!==r.ior?i.indexOfRefraction=r.ior:i.indexOfRefraction=e._DEFAULT_IOR,Promise.resolve()},e._DEFAULT_IOR=1.5,e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts":
- /*!********************************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts ***!
- \********************************************************************/
- /*! exports provided: KHR_materials_pbrSpecularGlossiness */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_pbrSpecularGlossiness",(function(){return s}));var n=r(/*! babylonjs/Maths/math.color */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_pbrSpecularGlossiness",s=function(){function e(e){this.name=o,this.order=200,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,o){var s=new Array;return s.push(n._loader.loadMaterialBasePropertiesAsync(e,t,r)),s.push(n._loadSpecularGlossinessPropertiesAsync(i,t,o,r)),n._loader.loadMaterialAlphaProperties(e,t,r),Promise.all(s).then((function(){}))}))},e.prototype._loadSpecularGlossinessPropertiesAsync=function(e,t,r,i){if(!(i instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var o=new Array;return i.metallic=null,i.roughness=null,r.diffuseFactor?(i.albedoColor=n.Color3.FromArray(r.diffuseFactor),i.alpha=r.diffuseFactor[3]):i.albedoColor=n.Color3.White(),i.reflectivityColor=r.specularFactor?n.Color3.FromArray(r.specularFactor):n.Color3.White(),i.microSurface=null==r.glossinessFactor?1:r.glossinessFactor,r.diffuseTexture&&o.push(this._loader.loadTextureInfoAsync(e+"/diffuseTexture",r.diffuseTexture,(function(e){e.name=i.name+" (Diffuse)",i.albedoTexture=e}))),r.specularGlossinessTexture&&(o.push(this._loader.loadTextureInfoAsync(e+"/specularGlossinessTexture",r.specularGlossinessTexture,(function(e){e.name=i.name+" (Specular Glossiness)",i.reflectivityTexture=e}))),i.reflectivityTexture.hasAlpha=!0,i.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(o).then((function(){}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_sheen.ts":
- /*!****************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_sheen.ts ***!
- \****************************************************/
- /*! exports provided: KHR_materials_sheen */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_sheen",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_sheen",s=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadSheenPropertiesAsync(i,o,r)),Promise.all(s).then((function(){}))}))},e.prototype._loadSheenPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return r.sheen.isEnabled=!0,r.sheen.intensity=1,null!=t.sheenColorFactor?r.sheen.color=n.Color3.FromArray(t.sheenColorFactor):r.sheen.color=n.Color3.Black(),t.sheenTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/sheenTexture",t.sheenTexture,(function(e){e.name=r.name+" (Sheen Color)",r.sheen.texture=e}))),void 0!==t.sheenRoughnessFactor?r.sheen.roughness=t.sheenRoughnessFactor:r.sheen.roughness=0,r.sheen.albedoScaling=!0,Promise.all(i).then((function(){}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_specular.ts":
- /*!*******************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_specular.ts ***!
- \*******************************************************/
- /*! exports provided: KHR_materials_specular */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_specular",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_specular",s=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadSpecularPropertiesAsync(i,o,r)),Promise.all(s).then((function(){}))}))},e.prototype._loadSpecularPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return void 0!==t.specularFactor&&(r.metallicF0Factor=t.specularFactor),void 0!==t.specularColorFactor&&(r.metallicReflectanceColor=n.Color3.FromArray(t.specularColorFactor)),t.specularTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/specularTexture",t.specularTexture,(function(e){e.name=r.name+" (Specular F0 Color)",r.metallicReflectanceTexture=e}))),Promise.all(i).then((function(){}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_transmission.ts":
- /*!***********************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_transmission.ts ***!
- \***********************************************************/
- /*! exports provided: KHR_materials_transmission */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_transmission",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_transmission",s=function(){function e(e){this.name=o,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(o),this.enabled&&(e._parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,o){var s=new Array;return s.push(n._loader.loadMaterialBasePropertiesAsync(e,t,r)),s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadTransparentPropertiesAsync(i,t,r,o)),Promise.all(s).then((function(){}))}))},e.prototype._loadTransparentPropertiesAsync=function(e,t,r,i){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var o=r;return o.subSurface.isRefractionEnabled=!0,o.subSurface.volumeIndexOfRefraction=1,o.subSurface.useAlbedoToTintRefraction=!0,void 0===i.transmissionFactor?(o.subSurface.refractionIntensity=0,o.subSurface.isRefractionEnabled=!1,Promise.resolve()):(o.subSurface.refractionIntensity=i.transmissionFactor,i.transmissionTexture?this._loader.loadTextureInfoAsync(e+"/transmissionTexture",i.transmissionTexture).then((function(e){o.subSurface.thicknessTexture=e,o.subSurface.useMaskFromThicknessTexture=!0})):Promise.resolve())},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_unlit.ts":
- /*!****************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_unlit.ts ***!
- \****************************************************/
- /*! exports provided: KHR_materials_unlit */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_unlit",(function(){return s}));var n=r(/*! babylonjs/Maths/math.color */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_unlit",s=function(){function e(e){this.name=o,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(){return n._loadUnlitPropertiesAsync(e,t,r)}))},e.prototype._loadUnlitPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;r.unlit=!0;var o=t.pbrMetallicRoughness;return o&&(o.baseColorFactor?(r.albedoColor=n.Color3.FromArray(o.baseColorFactor),r.alpha=o.baseColorFactor[3]):r.albedoColor=n.Color3.White(),o.baseColorTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/baseColorTexture",o.baseColorTexture,(function(e){e.name=r.name+" (Base Color)",r.albedoTexture=e})))),t.doubleSided&&(r.backFaceCulling=!1,r.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,t,r),Promise.all(i).then((function(){}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_materials_variants.ts":
- /*!*******************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_materials_variants.ts ***!
- \*******************************************************/
- /*! exports provided: KHR_materials_variants */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_variants",(function(){return s}));var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i=r(/*! babylonjs/Meshes/mesh */"babylonjs/Misc/observable"),o="KHR_materials_variants",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.GetAvailableVariants=function(e){var t=this._GetExtensionMetadata(e);return t?Object.keys(t.variants):[]},e.prototype.getAvailableVariants=function(t){return e.GetAvailableVariants(t)},e.SelectVariant=function(e,t){var r=this._GetExtensionMetadata(e);if(!r)throw new Error("Cannot select variant on a glTF mesh that does not have the "+o+" extension");var n=function(e){var t=r.variants[e];if(t)for(var n=0,i=t;n<i.length;n++){var o=i[n];o.mesh.material=o.material}};if(t instanceof Array)for(var i=0,s=t;i<s.length;i++)n(s[i]);else n(t);r.lastSelected=t},e.prototype.selectVariant=function(t,r){return e.SelectVariant(t,r)},e.Reset=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot reset on a glTF mesh that does not have the "+o+" extension");for(var r=0,n=t.original;r<n.length;r++){var i=n[r];i.mesh.material=i.material}t.lastSelected=null},e.prototype.reset=function(t){return e.Reset(t)},e.GetLastSelectedVariant=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot get the last selected variant on a glTF mesh that does not have the "+o+" extension");return t.lastSelected},e.prototype.getLastSelectedVariant=function(t){return e.GetLastSelectedVariant(t)},e._GetExtensionMetadata=function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.gltf)||void 0===r?void 0:r[o])||null},e.prototype._loadMeshPrimitiveAsync=function(e,t,r,s,a,l){var c=this;return n.GLTFLoader.LoadExtensionAsync(e,a,this.name,(function(u,d){var h=new Array;return h.push(c._loader._loadMeshPrimitiveAsync(e,t,r,s,a,(function(t){if(l(t),t instanceof i.Mesh){var r=n.GLTFLoader._GetDrawMode(e,a.mode),s=c._loader.rootBabylonMesh,u=s.metadata=s.metadata||{},f=u.gltf=u.gltf||{},p=f[o]=f[o]||{lastSelected:null,original:[],variants:{}};p.original.push({mesh:t,material:t.material});for(var m=p.variants,g=0,_=d.mapping;g<_.length;g++)for(var v=_[g],y=function(e){var i=n.ArrayItem.Get("#/materials/",c._loader.gltf.materials,v.material);h.push(c._loader._loadMaterialAsync("#/materials/"+v.material,i,t,r,(function(r){m[e]=m[e]||[],m[e].push({mesh:t,material:r})})))},b=0,A=v.variants;b<A.length;b++)y(A[b])}}))),Promise.all(h).then((function(e){return e[0]}))}))},e}();n.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_mesh_quantization.ts":
- /*!******************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_mesh_quantization.ts ***!
- \******************************************************/
- /*! exports provided: KHR_mesh_quantization */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_mesh_quantization",(function(){return o}));var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i="KHR_mesh_quantization",o=function(){function e(e){this.name=i,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){},e}();n.GLTFLoader.RegisterExtension(i,(function(e){return new o(e)}))},"./glTF/2.0/Extensions/KHR_texture_basisu.ts":
- /*!***************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_texture_basisu.ts ***!
- \***************************************************/
- /*! exports provided: KHR_texture_basisu */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_texture_basisu",(function(){return o}));var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i="KHR_texture_basisu",o=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){delete this._loader},e.prototype._loadTextureAsync=function(e,t,r){var i=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,s){var a=null==t.sampler?n.GLTFLoader.DefaultSampler:n.ArrayItem.Get(e+"/sampler",i._loader.gltf.samplers,t.sampler),l=n.ArrayItem.Get(o+"/source",i._loader.gltf.images,s.source);return i._loader._createTextureAsync(e,a,l,(function(e){e.gammaSpace=!1,r(e)}))}))},e}();n.GLTFLoader.RegisterExtension(i,(function(e){return new o(e)}))},"./glTF/2.0/Extensions/KHR_texture_transform.ts":
- /*!******************************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_texture_transform.ts ***!
- \******************************************************/
- /*! exports provided: KHR_texture_transform */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_texture_transform",(function(){return s}));var n=r(/*! babylonjs/Materials/Textures/texture */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_texture_transform",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadTextureInfoAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return o._loader.loadTextureInfoAsync(e,t,(function(e){if(!(e instanceof n.Texture))throw new Error(i+": Texture type not supported");s.offset&&(e.uOffset=s.offset[0],e.vOffset=s.offset[1]),e.uRotationCenter=0,e.vRotationCenter=0,s.rotation&&(e.wAng=-s.rotation),s.scale&&(e.uScale=s.scale[0],e.vScale=s.scale[1]),null!=s.texCoord&&(e.coordinatesIndex=s.texCoord),r(e)}))}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/KHR_xmp.ts":
- /*!****************************************!*\
- !*** ./glTF/2.0/Extensions/KHR_xmp.ts ***!
- \****************************************/
- /*! exports provided: KHR_xmp */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_xmp",(function(){return i}));var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i=function(){function e(e){this.name="KHR_xmp",this.order=100,this._loader=e,this.enabled=this._loader.isExtensionUsed("KHR_xmp")}return e.prototype.dispose=function(){delete this._loader},e.prototype.onLoading=function(){var e,t,r,n=null===(e=this._loader.gltf.extensions)||void 0===e?void 0:e.KHR_xmp,i=null===(r=null===(t=this._loader.gltf.asset)||void 0===t?void 0:t.extensions)||void 0===r?void 0:r.KHR_xmp;if(n&&i){var o=+i.packet;n.packets&&o<n.packets.length&&(this._loader.rootBabylonMesh.metadata=this._loader.rootBabylonMesh.metadata||{},this._loader.rootBabylonMesh.metadata.xmp=n.packets[o])}},e}();n.GLTFLoader.RegisterExtension("KHR_xmp",(function(e){return new i(e)}))},"./glTF/2.0/Extensions/MSFT_audio_emitter.ts":
- /*!***************************************************!*\
- !*** ./glTF/2.0/Extensions/MSFT_audio_emitter.ts ***!
- \***************************************************/
- /*! exports provided: MSFT_audio_emitter */function(e,t,r){"use strict";r.r(t),r.d(t,"MSFT_audio_emitter",(function(){return s}));var n=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="MSFT_audio_emitter",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader,delete this._clips,delete this._emitters},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._clips=t.clips,this._emitters=t.emitters,i.ArrayItem.Assign(this._clips),i.ArrayItem.Assign(this._emitters)}},e.prototype.loadSceneAsync=function(e,t){var r=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){var s=new Array;s.push(r._loader.loadSceneAsync(e,t));for(var a=0,l=o.emitters;a<l.length;a++){var c=l[a],u=i.ArrayItem.Get(n+"/emitters",r._emitters,c);if(null!=u.refDistance||null!=u.maxDistance||null!=u.rolloffFactor||null!=u.distanceModel||null!=u.innerAngle||null!=u.outerAngle)throw new Error(n+": Direction or Distance properties are not allowed on emitters attached to a scene");s.push(r._loadEmitterAsync(n+"/emitters/"+u.index,u))}return Promise.all(s).then((function(){}))}))},e.prototype.loadNodeAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,s){var a=new Array;return o._loader.loadNodeAsync(e,t,(function(t){for(var l=function(r){var s=i.ArrayItem.Get(e+"/emitters",o._emitters,r);a.push(o._loadEmitterAsync(e+"/emitters/"+s.index,s).then((function(){for(var e=0,r=s._babylonSounds;e<r.length;e++){var i=r[e];i.attachToMesh(t),null==s.innerAngle&&null==s.outerAngle||(i.setLocalDirectionToMesh(n.Vector3.Forward()),i.setDirectionalCone(2*n.Tools.ToDegrees(null==s.innerAngle?Math.PI:s.innerAngle),2*n.Tools.ToDegrees(null==s.outerAngle?Math.PI:s.outerAngle),0))}})))},c=0,u=s.emitters;c<u.length;c++)l(u[c]);r(t)})).then((function(e){return Promise.all(a).then((function(){return e}))}))}))},e.prototype.loadAnimationAsync=function(e,t){var r=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(n,o){return r._loader.loadAnimationAsync(e,t).then((function(s){var a=new Array;i.ArrayItem.Assign(o.events);for(var l=0,c=o.events;l<c.length;l++){var u=c[l];a.push(r._loadAnimationEventAsync(n+"/events/"+u.index,e,t,u,s))}return Promise.all(a).then((function(){return s}))}))}))},e.prototype._loadClipAsync=function(e,t){if(t._objectURL)return t._objectURL;var r;if(t.uri)r=this._loader.loadUriAsync(e,t,t.uri);else{var n=i.ArrayItem.Get(e+"/bufferView",this._loader.gltf.bufferViews,t.bufferView);r=this._loader.loadBufferViewAsync("/bufferViews/"+n.index,n)}return t._objectURL=r.then((function(e){return URL.createObjectURL(new Blob([e],{type:t.mimeType}))})),t._objectURL},e.prototype._loadEmitterAsync=function(e,t){var r=this;if(t._babylonSounds=t._babylonSounds||[],!t._babylonData){for(var o=new Array,s=t.name||"emitter"+t.index,a={loop:!1,autoplay:!1,volume:null==t.volume?1:t.volume},l=function(e){var l="/extensions/"+c.name+"/clips",u=i.ArrayItem.Get(l,c._clips,t.clips[e].clip);o.push(c._loadClipAsync(l+"/"+t.clips[e].clip,u).then((function(i){var o=t._babylonSounds[e]=new n.Sound(s,i,r._loader.babylonScene,null,a);o.refDistance=t.refDistance||1,o.maxDistance=t.maxDistance||256,o.rolloffFactor=t.rolloffFactor||1,o.distanceModel=t.distanceModel||"exponential",o._positionInEmitterSpace=!0})))},c=this,u=0;u<t.clips.length;u++)l(u);var d=Promise.all(o).then((function(){var e=t.clips.map((function(e){return e.weight||1})),r=new n.WeightedSound(t.loop||!1,t._babylonSounds,e);t.innerAngle&&(r.directionalConeInnerAngle=2*n.Tools.ToDegrees(t.innerAngle)),t.outerAngle&&(r.directionalConeOuterAngle=2*n.Tools.ToDegrees(t.outerAngle)),t.volume&&(r.volume=t.volume),t._babylonData.sound=r}));t._babylonData={loaded:d}}return t._babylonData.loaded},e.prototype._getEventAction=function(e,t,r,n,i){switch(r){case"play":return function(e){var r=(i||0)+(e-n);t.play(r)};case"stop":return function(e){t.stop()};case"pause":return function(e){t.pause()};default:throw new Error(e+": Unsupported action "+r)}},e.prototype._loadAnimationEventAsync=function(e,t,r,o,s){var a=this;if(0==s.targetedAnimations.length)return Promise.resolve();var l=s.targetedAnimations[0],c=o.emitter,u=i.ArrayItem.Get("/extensions/"+this.name+"/emitters",this._emitters,c);return this._loadEmitterAsync(e,u).then((function(){var t=u._babylonData.sound;if(t){var r=new n.AnimationEvent(o.time,a._getEventAction(e,t,o.action,o.time,o.startOffset));l.animation.addEvent(r),s.onAnimationGroupEndObservable.add((function(){t.stop()})),s.onAnimationGroupPauseObservable.add((function(){t.pause()}))}}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/MSFT_lod.ts":
- /*!*****************************************!*\
- !*** ./glTF/2.0/Extensions/MSFT_lod.ts ***!
- \*****************************************/
- /*! exports provided: MSFT_lod */function(e,t,r){"use strict";r.r(t),r.d(t,"MSFT_lod",(function(){return s}));var n=r(/*! babylonjs/Misc/observable */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="MSFT_lod",s=function(){function e(e){this.name=o,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new n.Observable,this.onMaterialLODsLoadedObservable=new n.Observable,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()},e.prototype.onReady=function(){for(var e=this,t=function(t){var n=Promise.all(r._nodePromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Node LOD "+t),e._loader.log("Loaded node LOD "+t)),e.onNodeLODsLoadedObservable.notifyObservers(t),t!==e._nodePromiseLODs.length-1&&(e._loader.startPerformanceCounter("Node LOD "+(t+1)),e._loadBufferLOD(e._nodeBufferLODs,t+1),e._nodeSignalLODs[t]&&e._nodeSignalLODs[t].resolve())}));r._loader._completePromises.push(n)},r=this,n=0;n<this._nodePromiseLODs.length;n++)t(n);var i=function(t){var r=Promise.all(o._materialPromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Material LOD "+t),e._loader.log("Loaded material LOD "+t)),e.onMaterialLODsLoadedObservable.notifyObservers(t),t!==e._materialPromiseLODs.length-1&&(e._loader.startPerformanceCounter("Material LOD "+(t+1)),e._loadBufferLOD(e._materialBufferLODs,t+1),e._materialSignalLODs[t]&&e._materialSignalLODs[t].resolve())}));o._loader._completePromises.push(r)},o=this;for(n=0;n<this._materialPromiseLODs.length;n++)i(n)},e.prototype.loadSceneAsync=function(e,t){var r=this._loader.loadSceneAsync(e,t);return this._loadBufferLOD(this._bufferLODs,0),r},e.prototype.loadNodeAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,r){var i,s=o._getLODs(e,t,o._loader.gltf.nodes,r.ids);o._loader.logOpen(""+e);for(var a=function(e){var t=s[e];0!==e&&(o._nodeIndexLOD=e,o._nodeSignalLODs[e]=o._nodeSignalLODs[e]||new n.Deferred);var r=o._loader.loadNodeAsync("/nodes/"+t.index,t,(function(e){e.setEnabled(!1)})).then((function(t){if(0!==e){var r=s[e-1];r._babylonTransformNode&&(o._disposeTransformNode(r._babylonTransformNode),delete r._babylonTransformNode)}return t.setEnabled(!0),t}));o._nodePromiseLODs[e]=o._nodePromiseLODs[e]||[],0===e?i=r:(o._nodeIndexLOD=null,o._nodePromiseLODs[e].push(r))},l=0;l<s.length;l++)a(l);return o._loader.logClose(),i}))},e.prototype._loadMaterialAsync=function(e,t,r,n,o){var s=this;return this._nodeIndexLOD?null:i.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,i){var a,l=s._getLODs(e,t,s._loader.gltf.materials,i.ids);s._loader.logOpen(""+e);for(var c=function(e){var t=l[e];0!==e&&(s._materialIndexLOD=e);var i=s._loader._loadMaterialAsync("/materials/"+t.index,t,r,n,(function(t){0===e&&o(t)})).then((function(t){if(0!==e){o(t);var r=l[e-1]._data;r[n]&&(s._disposeMaterials([r[n].babylonMaterial]),delete r[n])}return t}));s._materialPromiseLODs[e]=s._materialPromiseLODs[e]||[],0===e?a=i:(s._materialIndexLOD=null,s._materialPromiseLODs[e].push(i))},u=0;u<l.length;u++)c(u);return s._loader.logClose(),a}))},e.prototype._loadUriAsync=function(e,t,r){var i=this;if(null!==this._nodeIndexLOD){this._loader.log("deferred");var o=this._nodeIndexLOD-1;return this._nodeSignalLODs[o]=this._nodeSignalLODs[o]||new n.Deferred,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then((function(){return i._loader.loadUriAsync(e,t,r)}))}return null!==this._materialIndexLOD?(this._loader.log("deferred"),o=this._materialIndexLOD-1,this._materialSignalLODs[o]=this._materialSignalLODs[o]||new n.Deferred,this._materialSignalLODs[o].promise.then((function(){return i._loader.loadUriAsync(e,t,r)}))):null},e.prototype.loadBufferAsync=function(e,t,r,i){if(this._loader.parent.useRangeRequests&&!t.uri){if(!this._loader.bin)throw new Error(e+": Uri is missing or the binary glTF is missing its binary chunk");var o=function(e,t){var o=r,s=o+i-1,a=e[t];return a?(a.start=Math.min(a.start,o),a.end=Math.max(a.end,s)):(a={start:o,end:s,loaded:new n.Deferred},e[t]=a),a.loaded.promise.then((function(e){return new Uint8Array(e.buffer,e.byteOffset+r-a.start,i)}))};return this._loader.log("deferred"),null!==this._nodeIndexLOD?o(this._nodeBufferLODs,this._nodeIndexLOD):null!==this._materialIndexLOD?o(this._materialBufferLODs,this._materialIndexLOD):o(this._bufferLODs,0)}return null},e.prototype._loadBufferLOD=function(e,t){var r=e[t];r&&(this._loader.log("Loading buffer range ["+r.start+"-"+r.end+"]"),this._loader.bin.readAsync(r.start,r.end-r.start+1).then((function(e){r.loaded.resolve(e)}),(function(e){r.loaded.reject(e)})))},e.prototype._getLODs=function(e,t,r,n){if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");for(var o=new Array,s=n.length-1;s>=0;s--)if(o.push(i.ArrayItem.Get(e+"/ids/"+n[s],r,n[s])),o.length===this.maxLODsToLoad)return o;return o.push(t),o},e.prototype._disposeTransformNode=function(e){var t=this,r=new Array,n=e.material;n&&r.push(n);for(var i=0,o=e.getChildMeshes();i<o.length;i++){var s=o[i];s.material&&r.push(s.material)}e.dispose();var a=r.filter((function(e){return t._loader.babylonScene.meshes.every((function(t){return t.material!=e}))}));this._disposeMaterials(a)},e.prototype._disposeMaterials=function(e){for(var t={},r=0,n=e;r<n.length;r++){for(var i=0,o=(u=n[r]).getActiveTextures();i<o.length;i++){var s=o[i];t[s.uniqueId]=s}u.dispose()}for(var a in t)for(var l=0,c=this._loader.babylonScene.materials;l<c.length;l++){var u;(u=c[l]).hasTexture(t[a])&&delete t[a]}for(var a in t)t[a].dispose()},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/MSFT_minecraftMesh.ts":
- /*!***************************************************!*\
- !*** ./glTF/2.0/Extensions/MSFT_minecraftMesh.ts ***!
- \***************************************************/
- /*! exports provided: MSFT_minecraftMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"MSFT_minecraftMesh",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="MSFT_minecraftMesh",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(i,s){if(s){if(!(r instanceof n.PBRMaterial))throw new Error(i+": Material type not supported");var a=o._loader.loadMaterialPropertiesAsync(e,t,r);return r.needAlphaBlending()&&(r.forceDepthWrite=!0,r.separateCullingPass=!0),r.backFaceCulling=r.forceDepthWrite,r.twoSidedLighting=!0,a}return null}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/MSFT_sRGBFactors.ts":
- /*!*************************************************!*\
- !*** ./glTF/2.0/Extensions/MSFT_sRGBFactors.ts ***!
- \*************************************************/
- /*! exports provided: MSFT_sRGBFactors */function(e,t,r){"use strict";r.r(t),r.d(t,"MSFT_sRGBFactors",(function(){return s}));var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="MSFT_sRGBFactors",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(i,s){if(s){if(!(r instanceof n.PBRMaterial))throw new Error(i+": Material type not supported");var a=o._loader.loadMaterialPropertiesAsync(e,t,r);return r.albedoTexture||r.albedoColor.toLinearSpaceToRef(r.albedoColor),r.reflectivityTexture||r.reflectivityColor.toLinearSpaceToRef(r.reflectivityColor),a}return null}))},e}();i.GLTFLoader.RegisterExtension(o,(function(e){return new s(e)}))},"./glTF/2.0/Extensions/index.ts":
- /*!**************************************!*\
- !*** ./glTF/2.0/Extensions/index.ts ***!
- \**************************************/
- /*! exports provided: EXT_lights_image_based, EXT_mesh_gpu_instancing, KHR_draco_mesh_compression, KHR_lights, KHR_materials_pbrSpecularGlossiness, KHR_materials_unlit, KHR_materials_clearcoat, KHR_materials_sheen, KHR_materials_specular, KHR_materials_ior, KHR_materials_variants, KHR_materials_transmission, KHR_mesh_quantization, KHR_texture_basisu, KHR_texture_transform, KHR_xmp, MSFT_audio_emitter, MSFT_lod, MSFT_minecraftMesh, MSFT_sRGBFactors, ExtrasAsMetadata */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./EXT_lights_image_based */"./glTF/2.0/Extensions/EXT_lights_image_based.ts");r.d(t,"EXT_lights_image_based",(function(){return n.EXT_lights_image_based}));var i=r(/*! ./EXT_mesh_gpu_instancing */"./glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts");r.d(t,"EXT_mesh_gpu_instancing",(function(){return i.EXT_mesh_gpu_instancing}));var o=r(/*! ./KHR_draco_mesh_compression */"./glTF/2.0/Extensions/KHR_draco_mesh_compression.ts");r.d(t,"KHR_draco_mesh_compression",(function(){return o.KHR_draco_mesh_compression}));var s=r(/*! ./KHR_lights_punctual */"./glTF/2.0/Extensions/KHR_lights_punctual.ts");r.d(t,"KHR_lights",(function(){return s.KHR_lights}));var a=r(/*! ./KHR_materials_pbrSpecularGlossiness */"./glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts");r.d(t,"KHR_materials_pbrSpecularGlossiness",(function(){return a.KHR_materials_pbrSpecularGlossiness}));var l=r(/*! ./KHR_materials_unlit */"./glTF/2.0/Extensions/KHR_materials_unlit.ts");r.d(t,"KHR_materials_unlit",(function(){return l.KHR_materials_unlit}));var c=r(/*! ./KHR_materials_clearcoat */"./glTF/2.0/Extensions/KHR_materials_clearcoat.ts");r.d(t,"KHR_materials_clearcoat",(function(){return c.KHR_materials_clearcoat}));var u=r(/*! ./KHR_materials_sheen */"./glTF/2.0/Extensions/KHR_materials_sheen.ts");r.d(t,"KHR_materials_sheen",(function(){return u.KHR_materials_sheen}));var d=r(/*! ./KHR_materials_specular */"./glTF/2.0/Extensions/KHR_materials_specular.ts");r.d(t,"KHR_materials_specular",(function(){return d.KHR_materials_specular}));var h=r(/*! ./KHR_materials_ior */"./glTF/2.0/Extensions/KHR_materials_ior.ts");r.d(t,"KHR_materials_ior",(function(){return h.KHR_materials_ior}));var f=r(/*! ./KHR_materials_variants */"./glTF/2.0/Extensions/KHR_materials_variants.ts");r.d(t,"KHR_materials_variants",(function(){return f.KHR_materials_variants}));var p=r(/*! ./KHR_materials_transmission */"./glTF/2.0/Extensions/KHR_materials_transmission.ts");r.d(t,"KHR_materials_transmission",(function(){return p.KHR_materials_transmission}));var m=r(/*! ./KHR_mesh_quantization */"./glTF/2.0/Extensions/KHR_mesh_quantization.ts");r.d(t,"KHR_mesh_quantization",(function(){return m.KHR_mesh_quantization}));var g=r(/*! ./KHR_texture_basisu */"./glTF/2.0/Extensions/KHR_texture_basisu.ts");r.d(t,"KHR_texture_basisu",(function(){return g.KHR_texture_basisu}));var _=r(/*! ./KHR_texture_transform */"./glTF/2.0/Extensions/KHR_texture_transform.ts");r.d(t,"KHR_texture_transform",(function(){return _.KHR_texture_transform}));var v=r(/*! ./KHR_xmp */"./glTF/2.0/Extensions/KHR_xmp.ts");r.d(t,"KHR_xmp",(function(){return v.KHR_xmp}));var y=r(/*! ./MSFT_audio_emitter */"./glTF/2.0/Extensions/MSFT_audio_emitter.ts");r.d(t,"MSFT_audio_emitter",(function(){return y.MSFT_audio_emitter}));var b=r(/*! ./MSFT_lod */"./glTF/2.0/Extensions/MSFT_lod.ts");r.d(t,"MSFT_lod",(function(){return b.MSFT_lod}));var A=r(/*! ./MSFT_minecraftMesh */"./glTF/2.0/Extensions/MSFT_minecraftMesh.ts");r.d(t,"MSFT_minecraftMesh",(function(){return A.MSFT_minecraftMesh}));var T=r(/*! ./MSFT_sRGBFactors */"./glTF/2.0/Extensions/MSFT_sRGBFactors.ts");r.d(t,"MSFT_sRGBFactors",(function(){return T.MSFT_sRGBFactors}));var M=r(/*! ./ExtrasAsMetadata */"./glTF/2.0/Extensions/ExtrasAsMetadata.ts");r.d(t,"ExtrasAsMetadata",(function(){return M.ExtrasAsMetadata}))},"./glTF/2.0/glTFLoader.ts":
- /*!********************************!*\
- !*** ./glTF/2.0/glTFLoader.ts ***!
- \********************************/
- /*! exports provided: ArrayItem, GLTFLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"ArrayItem",(function(){return o})),r.d(t,"GLTFLoader",(function(){return s}));var n=r(/*! babylonjs/Misc/deferred */"babylonjs/Misc/observable"),i=r(/*! ../glTFFileLoader */"./glTF/glTFFileLoader.ts"),o=function(){function e(){}return e.Get=function(e,t,r){if(!t||null==r||!t[r])throw new Error(e+": Failed to find index ("+r+")");return t[r]},e.Assign=function(e){if(e)for(var t=0;t<e.length;t++)e[t].index=t},e}(),s=function(){function e(e){this._completePromises=new Array,this._forAssetContainer=!1,this._babylonLights=[],this._disableInstancedMesh=0,this._disposed=!1,this._state=null,this._extensions=new Array,this._defaultBabylonMaterialData={},this._parent=e}return e.RegisterExtension=function(t,r){e.UnregisterExtension(t)&&n.Logger.Warn("Extension with the name '"+t+"' already exists"),e._RegisteredExtensions[t]={factory:r}},e.UnregisterExtension=function(t){return!!e._RegisteredExtensions[t]&&(delete e._RegisteredExtensions[t],!0)},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gltf",{get:function(){return this._gltf},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bin",{get:function(){return this._bin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"babylonScene",{get:function(){return this._babylonScene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootBabylonMesh",{get:function(){return this._rootBabylonMesh},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(!this._disposed){for(var e in this._disposed=!0,this._completePromises.length=0,this._extensions){var t=this._extensions[e];t.dispose&&t.dispose(),delete this._extensions[e]}delete this._gltf,delete this._babylonScene,delete this._rootBabylonMesh,this._parent.dispose()}},e.prototype.importMeshAsync=function(e,t,r,n,i,o,s){var a=this;return Promise.resolve().then((function(){a._babylonScene=t,a._rootUrl=i,a._fileName=s||"scene",a._forAssetContainer=r,a._loadData(n);var o=null;if(e){var l={};if(a._gltf.nodes)for(var c=0,u=a._gltf.nodes;c<u.length;c++){var d=u[c];d.name&&(l[d.name]=d.index)}o=(e instanceof Array?e:[e]).map((function(e){var t=l[e];if(void 0===t)throw new Error("Failed to find node '"+e+"'");return t}))}return a._loadAsync(o,(function(){return{meshes:a._getMeshes(),particleSystems:[],skeletons:a._getSkeletons(),animationGroups:a._getAnimationGroups(),lights:a._babylonLights,transformNodes:a._getTransformNodes()}}))}))},e.prototype.loadAsync=function(e,t,r,n,i){var o=this;return Promise.resolve().then((function(){return o._babylonScene=e,o._rootUrl=r,o._fileName=i||"scene",o._loadData(t),o._loadAsync(null,(function(){}))}))},e.prototype._loadAsync=function(e,t){var r=this;return Promise.resolve().then((function(){r._uniqueRootUrl=-1===r._rootUrl.indexOf("file:")&&r._fileName?r._rootUrl:""+r._rootUrl+Date.now()+"/",r._loadExtensions(),r._checkExtensions();var s=i.GLTFLoaderState[i.GLTFLoaderState.LOADING]+" => "+i.GLTFLoaderState[i.GLTFLoaderState.READY],a=i.GLTFLoaderState[i.GLTFLoaderState.LOADING]+" => "+i.GLTFLoaderState[i.GLTFLoaderState.COMPLETE];r._parent._startPerformanceCounter(s),r._parent._startPerformanceCounter(a),r._setState(i.GLTFLoaderState.LOADING),r._extensionsOnLoading();var l=new Array,c=r._babylonScene.blockMaterialDirtyMechanism;if(r._babylonScene.blockMaterialDirtyMechanism=!0,e)l.push(r.loadSceneAsync("/nodes",{nodes:e,index:-1}));else if(null!=r._gltf.scene||r._gltf.scenes&&r._gltf.scenes[0]){var u=o.Get("/scene",r._gltf.scenes,r._gltf.scene||0);l.push(r.loadSceneAsync("/scenes/"+u.index,u))}r._babylonScene.blockMaterialDirtyMechanism=c,r._parent.compileMaterials&&l.push(r._compileMaterialsAsync()),r._parent.compileShadowGenerators&&l.push(r._compileShadowGeneratorsAsync());var d=Promise.all(l).then((function(){return r._rootBabylonMesh&&r._rootBabylonMesh.setEnabled(!0),r._extensionsOnReady(),r._setState(i.GLTFLoaderState.READY),r._startAnimations(),t()}));return d.then((function(){r._parent._endPerformanceCounter(s),n.Tools.SetImmediate((function(){r._disposed||Promise.all(r._completePromises).then((function(){r._parent._endPerformanceCounter(a),r._setState(i.GLTFLoaderState.COMPLETE),r._parent.onCompleteObservable.notifyObservers(void 0),r._parent.onCompleteObservable.clear(),r.dispose()}),(function(e){r._parent.onErrorObservable.notifyObservers(e),r._parent.onErrorObservable.clear(),r.dispose()}))}))})),d})).catch((function(e){throw r._disposed||(r._parent.onErrorObservable.notifyObservers(e),r._parent.onErrorObservable.clear(),r.dispose()),e}))},e.prototype._loadData=function(e){if(this._gltf=e.json,this._setupData(),e.bin){var t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){var r=t[0];(r.byteLength<e.bin.byteLength-3||r.byteLength>e.bin.byteLength)&&n.Logger.Warn("Binary buffer length ("+r.byteLength+") from JSON does not match chunk length ("+e.bin.byteLength+")"),this._bin=e.bin}else n.Logger.Warn("Unexpected BIN chunk")}},e.prototype._setupData=function(){if(o.Assign(this._gltf.accessors),o.Assign(this._gltf.animations),o.Assign(this._gltf.buffers),o.Assign(this._gltf.bufferViews),o.Assign(this._gltf.cameras),o.Assign(this._gltf.images),o.Assign(this._gltf.materials),o.Assign(this._gltf.meshes),o.Assign(this._gltf.nodes),o.Assign(this._gltf.samplers),o.Assign(this._gltf.scenes),o.Assign(this._gltf.skins),o.Assign(this._gltf.textures),this._gltf.nodes){for(var e={},t=0,r=this._gltf.nodes;t<r.length;t++)if((c=r[t]).children)for(var n=0,i=c.children;n<i.length;n++)e[i[n]]=c.index;for(var s=this._createRootNode(),a=0,l=this._gltf.nodes;a<l.length;a++){var c,u=e[(c=l[a]).index];c.parent=void 0===u?s:this._gltf.nodes[u]}}},e.prototype._loadExtensions=function(){for(var t in e._RegisteredExtensions){var r=e._RegisteredExtensions[t].factory(this);r.name!==t&&n.Logger.Warn("The name of the glTF loader extension instance does not match the registered name: "+r.name+" !== "+t),this._extensions.push(r),this._parent.onExtensionLoadedObservable.notifyObservers(r)}this._extensions.sort((function(e,t){return(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE)})),this._parent.onExtensionLoadedObservable.clear()},e.prototype._checkExtensions=function(){if(this._gltf.extensionsRequired)for(var e=function(e){if(!t._extensions.some((function(t){return t.name===e&&t.enabled})))throw new Error("Require extension "+e+" is not available")},t=this,r=0,n=this._gltf.extensionsRequired;r<n.length;r++)e(n[r])},e.prototype._setState=function(e){this._state=e,this.log(i.GLTFLoaderState[this._state])},e.prototype._createRootNode=function(){this._babylonScene._blockEntityCollection=this._forAssetContainer,this._rootBabylonMesh=new n.Mesh("__root__",this._babylonScene),this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);var t={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case i.GLTFLoaderCoordinateSystemMode.AUTO:this._babylonScene.useRightHandedSystem||(t.rotation=[0,1,0,0],t.scale=[1,1,-1],e._LoadTransform(t,this._rootBabylonMesh));break;case i.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error("Invalid coordinate system mode ("+this._parent.coordinateSystemMode+")")}return this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh),t},e.prototype.loadSceneAsync=function(e,t){var r=this,n=this._extensionsLoadSceneAsync(e,t);if(n)return n;var i=new Array;if(this.logOpen(e+" "+(t.name||"")),t.nodes)for(var s=0,a=t.nodes;s<a.length;s++){var l=a[s],c=o.Get(e+"/nodes/"+l,this._gltf.nodes,l);i.push(this.loadNodeAsync("/nodes/"+c.index,c,(function(e){e.parent=r._rootBabylonMesh})))}if(this._gltf.nodes)for(var u=0,d=this._gltf.nodes;u<d.length;u++)if((c=d[u])._babylonTransformNode&&c._babylonBones)for(var h=0,f=c._babylonBones;h<f.length;h++)f[h].linkTransformNode(c._babylonTransformNode);return i.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(i).then((function(){}))},e.prototype._forEachPrimitive=function(e,t){if(e._primitiveBabylonMeshes)for(var r=0,n=e._primitiveBabylonMeshes;r<n.length;r++)t(n[r])},e.prototype._getMeshes=function(){var e=new Array;e.push(this._rootBabylonMesh);var t=this._gltf.nodes;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];this._forEachPrimitive(i,(function(t){e.push(t)}))}return e},e.prototype._getTransformNodes=function(){var e=new Array,t=this._gltf.nodes;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];i._babylonTransformNode&&"TransformNode"===i._babylonTransformNode.getClassName()&&e.push(i._babylonTransformNode)}return e},e.prototype._getSkeletons=function(){var e=new Array,t=this._gltf.skins;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];i._data&&e.push(i._data.babylonSkeleton)}return e},e.prototype._getAnimationGroups=function(){var e=new Array,t=this._gltf.animations;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];i._babylonAnimationGroup&&e.push(i._babylonAnimationGroup)}return e},e.prototype._startAnimations=function(){switch(this._parent.animationStartMode){case i.GLTFLoaderAnimationStartMode.NONE:break;case i.GLTFLoaderAnimationStartMode.FIRST:0!==(e=this._getAnimationGroups()).length&&e[0].start(!0);break;case i.GLTFLoaderAnimationStartMode.ALL:for(var e,t=0,r=e=this._getAnimationGroups();t<r.length;t++)r[t].start(!0);break;default:return void n.Logger.Error("Invalid animation start mode ("+this._parent.animationStartMode+")")}},e.prototype.loadNodeAsync=function(t,r,i){var s=this;void 0===i&&(i=function(){});var a=this._extensionsLoadNodeAsync(t,r,i);if(a)return a;if(r._babylonTransformNode)throw new Error(t+": Invalid recursive node hierarchy");var l=new Array;this.logOpen(t+" "+(r.name||""));var c=function(n){if(e.AddPointerMetadata(n,t),e._LoadTransform(r,n),null!=r.camera){var a=o.Get(t+"/camera",s._gltf.cameras,r.camera);l.push(s.loadCameraAsync("/cameras/"+a.index,a,(function(e){e.parent=n})))}if(r.children)for(var c=0,u=r.children;c<u.length;c++){var d=u[c],h=o.Get(t+"/children/"+d,s._gltf.nodes,d);l.push(s.loadNodeAsync("/nodes/"+h.index,h,(function(e){e.parent=n})))}i(n)};if(null==r.mesh){var u=r.name||"node"+r.index;this._babylonScene._blockEntityCollection=this._forAssetContainer,r._babylonTransformNode=new n.TransformNode(u,this._babylonScene),this._babylonScene._blockEntityCollection=!1,c(r._babylonTransformNode)}else{var d=o.Get(t+"/mesh",this._gltf.meshes,r.mesh);l.push(this._loadMeshAsync("/meshes/"+d.index,r,d,c))}return this.logClose(),Promise.all(l).then((function(){return s._forEachPrimitive(r,(function(e){e.geometry&&e.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0)})),r._babylonTransformNode}))},e.prototype._loadMeshAsync=function(e,t,r,i){var s=r.primitives;if(!s||!s.length)throw new Error(e+": Primitives are missing");null==s[0].index&&o.Assign(s);var a=new Array;this.logOpen(e+" "+(r.name||""));var l=t.name||"node"+t.index;if(1===s.length){var c=r.primitives[0];a.push(this._loadMeshPrimitiveAsync(e+"/primitives/"+c.index,l,t,r,c,(function(e){t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=this._forAssetContainer,t._babylonTransformNode=new n.TransformNode(l,this._babylonScene),this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(var u=0,d=s;u<d.length;u++)c=d[u],a.push(this._loadMeshPrimitiveAsync(e+"/primitives/"+c.index,l+"_primitive"+c.index,t,r,c,(function(e){e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}if(null!=t.skin){var h=o.Get(e+"/skin",this._gltf.skins,t.skin);a.push(this._loadSkinAsync("/skins/"+h.index,t,h))}return i(t._babylonTransformNode),this.logClose(),Promise.all(a).then((function(){return t._babylonTransformNode}))},e.prototype._loadMeshPrimitiveAsync=function(t,r,i,s,a,l){var c=this,u=this._extensionsLoadMeshPrimitiveAsync(t,r,i,s,a,l);if(u)return u;this.logOpen(""+t);var d,h,f=0===this._disableInstancedMesh&&this._parent.createInstances&&null==i.skin&&!s.primitives[0].targets;if(f&&a._instanceData)d=a._instanceData.babylonSourceMesh.createInstance(r),h=a._instanceData.promise;else{var p=new Array;this._babylonScene._blockEntityCollection=this._forAssetContainer;var m=new n.Mesh(r,this._babylonScene);this._babylonScene._blockEntityCollection=!1,m.overrideMaterialSideOrientation=this._babylonScene.useRightHandedSystem?n.Material.CounterClockWiseSideOrientation:n.Material.ClockWiseSideOrientation,this._createMorphTargets(t,i,s,a,m),p.push(this._loadVertexDataAsync(t,a,m).then((function(e){return c._loadMorphTargetsAsync(t,a,m,e).then((function(){e.applyToMesh(m)}))})));var g=e._GetDrawMode(t,a.mode);if(null==a.material){var _=this._defaultBabylonMaterialData[g];_||(_=this._createDefaultMaterial("__GLTFLoader._default",g),this._parent.onMaterialLoadedObservable.notifyObservers(_),this._defaultBabylonMaterialData[g]=_),m.material=_}else{var v=o.Get(t+"/material",this._gltf.materials,a.material);p.push(this._loadMaterialAsync("/materials/"+v.index,v,m,g,(function(e){m.material=e})))}h=Promise.all(p),f&&(a._instanceData={babylonSourceMesh:m,promise:h}),d=m}return e.AddPointerMetadata(d,t),this._parent.onMeshLoadedObservable.notifyObservers(d),l(d),this.logClose(),h.then((function(){return d}))},e.prototype._loadVertexDataAsync=function(e,t,r){var i=this,s=this._extensionsLoadVertexDataAsync(e,t,r);if(s)return s;var a=t.attributes;if(!a)throw new Error(e+": Attributes are missing");var l=new Array,c=new n.Geometry(r.name,this._babylonScene);if(null==t.indices)r.isUnIndexed=!0;else{var u=o.Get(e+"/indices",this._gltf.accessors,t.indices);l.push(this._loadIndicesAccessorAsync("/accessors/"+u.index,u).then((function(e){c.setIndices(e)})))}var d=function(t,s,u){if(null!=a[t]){r._delayInfo=r._delayInfo||[],-1===r._delayInfo.indexOf(s)&&r._delayInfo.push(s);var d=o.Get(e+"/attributes/"+t,i._gltf.accessors,a[t]);l.push(i._loadVertexAccessorAsync("/accessors/"+d.index,d,s).then((function(e){if(e.getKind()===n.VertexBuffer.PositionKind&&!i.parent.alwaysComputeBoundingBox&&!r.skeleton){var t=d.min,o=d.max;if(void 0!==t&&void 0!==o){var s=n.TmpVectors.Vector3[0],a=n.TmpVectors.Vector3[1];s.copyFromFloats.apply(s,t),a.copyFromFloats.apply(a,o),c._boundingInfo=new n.BoundingInfo(s,a),c.useBoundingInfoFromGeometry=!0}}c.setVerticesBuffer(e,d.count)}))),s==n.VertexBuffer.MatricesIndicesExtraKind&&(r.numBoneInfluencers=8),u&&u(d)}};return d("POSITION",n.VertexBuffer.PositionKind),d("NORMAL",n.VertexBuffer.NormalKind),d("TANGENT",n.VertexBuffer.TangentKind),d("TEXCOORD_0",n.VertexBuffer.UVKind),d("TEXCOORD_1",n.VertexBuffer.UV2Kind),d("JOINTS_0",n.VertexBuffer.MatricesIndicesKind),d("WEIGHTS_0",n.VertexBuffer.MatricesWeightsKind),d("JOINTS_1",n.VertexBuffer.MatricesIndicesExtraKind),d("WEIGHTS_1",n.VertexBuffer.MatricesWeightsExtraKind),d("COLOR_0",n.VertexBuffer.ColorKind,(function(e){"VEC4"===e.type&&(r.hasVertexAlpha=!0)})),Promise.all(l).then((function(){return c}))},e.prototype._createMorphTargets=function(e,t,r,i,o){if(i.targets){if(null==t._numMorphTargets)t._numMorphTargets=i.targets.length;else if(i.targets.length!==t._numMorphTargets)throw new Error(e+": Primitives do not have the same number of targets");var s=r.extras?r.extras.targetNames:null;o.morphTargetManager=new n.MorphTargetManager(o.getScene());for(var a=0;a<i.targets.length;a++){var l=t.weights?t.weights[a]:r.weights?r.weights[a]:0,c=s?s[a]:"morphTarget"+a;o.morphTargetManager.addTarget(new n.MorphTarget(c,l,o.getScene()))}}},e.prototype._loadMorphTargetsAsync=function(e,t,r,n){if(!t.targets)return Promise.resolve();for(var i=new Array,o=r.morphTargetManager,s=0;s<o.numTargets;s++){var a=o.getTarget(s);i.push(this._loadMorphTargetVertexDataAsync(e+"/targets/"+s,n,t.targets[s],a))}return Promise.all(i).then((function(){}))},e.prototype._loadMorphTargetVertexDataAsync=function(e,t,r,i){var s=this,a=new Array,l=function(n,i,l){if(null!=r[n]){var c=t.getVertexBuffer(i);if(c){var u=o.Get(e+"/"+n,s._gltf.accessors,r[n]);a.push(s._loadFloatAccessorAsync("/accessors/"+u.index,u).then((function(e){l(c,e)})))}}};return l("POSITION",n.VertexBuffer.PositionKind,(function(e,t){var r=new Float32Array(t.length);e.forEach(t.length,(function(e,n){r[n]=t[n]+e})),i.setPositions(r)})),l("NORMAL",n.VertexBuffer.NormalKind,(function(e,t){var r=new Float32Array(t.length);e.forEach(r.length,(function(e,n){r[n]=t[n]+e})),i.setNormals(r)})),l("TANGENT",n.VertexBuffer.TangentKind,(function(e,t){var r=new Float32Array(t.length/3*4),n=0;e.forEach(t.length/3*4,(function(e,i){(i+1)%4!=0&&(r[n]=t[n]+e,n++)})),i.setTangents(r)})),Promise.all(a).then((function(){}))},e._LoadTransform=function(e,t){if(null==e.skin){var r=n.Vector3.Zero(),i=n.Quaternion.Identity(),o=n.Vector3.One();e.matrix?n.Matrix.FromArray(e.matrix).decompose(o,i,r):(e.translation&&(r=n.Vector3.FromArray(e.translation)),e.rotation&&(i=n.Quaternion.FromArray(e.rotation)),e.scale&&(o=n.Vector3.FromArray(e.scale))),t.position=r,t.rotationQuaternion=i,t.scaling=o}},e.prototype._loadSkinAsync=function(e,t,r){var i=this,o=this._extensionsLoadSkinAsync(e,t,r);if(o)return o;var s=function(e){i._forEachPrimitive(t,(function(t){t.skeleton=e}))};if(r._data)return s(r._data.babylonSkeleton),r._data.promise;var a="skeleton"+r.index;this._babylonScene._blockEntityCollection=this._forAssetContainer;var l=new n.Skeleton(r.name||a,a,this._babylonScene);this._babylonScene._blockEntityCollection=!1,l.overrideMesh=this._rootBabylonMesh,this._loadBones(e,r,l),s(l);var c=this._loadSkinInverseBindMatricesDataAsync(e,r).then((function(e){i._updateBoneMatrices(l,e)}));return r._data={babylonSkeleton:l,promise:c},c},e.prototype._loadBones=function(e,t,r){for(var n={},i=0,s=t.joints;i<s.length;i++){var a=s[i],l=o.Get(e+"/joints/"+a,this._gltf.nodes,a);this._loadBone(l,t,r,n)}},e.prototype._loadBone=function(e,t,r,i){var o=i[e.index];if(o)return o;var s=null;e.parent&&e.parent._babylonTransformNode!==this._rootBabylonMesh&&(s=this._loadBone(e.parent,t,r,i));var a=t.joints.indexOf(e.index);return o=new n.Bone(e.name||"joint"+e.index,r,s,this._getNodeMatrix(e),null,null,a),i[e.index]=o,e._babylonBones=e._babylonBones||[],e._babylonBones.push(o),o},e.prototype._loadSkinInverseBindMatricesDataAsync=function(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);var r=o.Get(e+"/inverseBindMatrices",this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync("/accessors/"+r.index,r)},e.prototype._updateBoneMatrices=function(e,t){for(var r=0,i=e.bones;r<i.length;r++){var o=i[r],s=n.Matrix.Identity(),a=o._index;t&&-1!==a&&(n.Matrix.FromArrayToRef(t,16*a,s),s.invertToRef(s));var l=o.getParent();l&&s.multiplyToRef(l.getInvertedAbsoluteTransform(),s),o.setRestPose(s),o.updateMatrix(s,!1,!1),o._updateDifferenceMatrix(void 0,!1)}},e.prototype._getNodeMatrix=function(e){return e.matrix?n.Matrix.FromArray(e.matrix):n.Matrix.Compose(e.scale?n.Vector3.FromArray(e.scale):n.Vector3.One(),e.rotation?n.Quaternion.FromArray(e.rotation):n.Quaternion.Identity(),e.translation?n.Vector3.FromArray(e.translation):n.Vector3.Zero())},e.prototype.loadCameraAsync=function(t,r,i){void 0===i&&(i=function(){});var o=this._extensionsLoadCameraAsync(t,r,i);if(o)return o;var s=new Array;this.logOpen(t+" "+(r.name||"")),this._babylonScene._blockEntityCollection=this._forAssetContainer;var a=new n.FreeCamera(r.name||"camera"+r.index,n.Vector3.Zero(),this._babylonScene,!1);switch(this._babylonScene._blockEntityCollection=!1,a.ignoreParentScaling=!0,a.rotation=new n.Vector3(0,Math.PI,0),r.type){case"perspective":var l=r.perspective;if(!l)throw new Error(t+": Camera perspective properties are missing");a.fov=l.yfov,a.minZ=l.znear,a.maxZ=l.zfar||Number.MAX_VALUE;break;case"orthographic":if(!r.orthographic)throw new Error(t+": Camera orthographic properties are missing");a.mode=n.Camera.ORTHOGRAPHIC_CAMERA,a.orthoLeft=-r.orthographic.xmag,a.orthoRight=r.orthographic.xmag,a.orthoBottom=-r.orthographic.ymag,a.orthoTop=r.orthographic.ymag,a.minZ=r.orthographic.znear,a.maxZ=r.orthographic.zfar;break;default:throw new Error(t+": Invalid camera type ("+r.type+")")}return e.AddPointerMetadata(a,t),this._parent.onCameraLoadedObservable.notifyObservers(a),i(a),this.logClose(),Promise.all(s).then((function(){return a}))},e.prototype._loadAnimationsAsync=function(){var e=this._gltf.animations;if(!e)return Promise.resolve();for(var t=new Array,r=0;r<e.length;r++){var n=e[r];t.push(this.loadAnimationAsync("/animations/"+n.index,n))}return Promise.all(t).then((function(){}))},e.prototype.loadAnimationAsync=function(e,t){var r=this._extensionsLoadAnimationAsync(e,t);if(r)return r;this._babylonScene._blockEntityCollection=this._forAssetContainer;var i=new n.AnimationGroup(t.name||"animation"+t.index,this._babylonScene);this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=i;var s=new Array;o.Assign(t.channels),o.Assign(t.samplers);for(var a=0,l=t.channels;a<l.length;a++){var c=l[a];s.push(this._loadAnimationChannelAsync(e+"/channels/"+c.index,e,t,c,i))}return Promise.all(s).then((function(){return i.normalize(0),i}))},e.prototype._loadAnimationChannelAsync=function(e,t,r,i,s,a){var l=this;if(void 0===a&&(a=null),null==i.target.node)return Promise.resolve();var c=o.Get(e+"/target/node",this._gltf.nodes,i.target.node);if("weights"===i.target.path&&!c._numMorphTargets||"weights"!==i.target.path&&!c._babylonTransformNode)return Promise.resolve();var u=o.Get(e+"/sampler",r.samplers,i.sampler);return this._loadAnimationSamplerAsync(t+"/samplers/"+i.sampler,u).then((function(t){var r,o;switch(i.target.path){case"translation":r="position",o=n.Animation.ANIMATIONTYPE_VECTOR3;break;case"rotation":r="rotationQuaternion",o=n.Animation.ANIMATIONTYPE_QUATERNION;break;case"scale":r="scaling",o=n.Animation.ANIMATIONTYPE_VECTOR3;break;case"weights":r="influence",o=n.Animation.ANIMATIONTYPE_FLOAT;break;default:throw new Error(e+"/target/path: Invalid value ("+i.target.path+")")}var u,d,h=0;switch(r){case"position":u=function(){var e=n.Vector3.FromArray(t.output,h);return h+=3,e};break;case"rotationQuaternion":u=function(){var e=n.Quaternion.FromArray(t.output,h);return h+=4,e};break;case"scaling":u=function(){var e=n.Vector3.FromArray(t.output,h);return h+=3,e};break;case"influence":u=function(){for(var e=new Array(c._numMorphTargets),r=0;r<c._numMorphTargets;r++)e[r]=t.output[h++];return e}}switch(t.interpolation){case"STEP":d=function(e){return{frame:t.input[e],value:u(),interpolation:n.AnimationKeyInterpolation.STEP}};break;case"LINEAR":d=function(e){return{frame:t.input[e],value:u()}};break;case"CUBICSPLINE":d=function(e){return{frame:t.input[e],inTangent:u(),value:u(),outTangent:u()}}}for(var f=new Array(t.input.length),p=0;p<t.input.length;p++)f[p]=d(p);if("influence"===r)for(var m=function(e){var t=s.name+"_channel"+s.targetedAnimations.length,i=new n.Animation(t,r,1,o);i.setKeys(f.map((function(t){return{frame:t.frame,inTangent:t.inTangent?t.inTangent[e]:void 0,value:t.value[e],outTangent:t.outTangent?t.outTangent[e]:void 0}}))),l._forEachPrimitive(c,(function(t){var r=t.morphTargetManager.getTarget(e),n=i.clone();r.animations.push(n),s.addTargetedAnimation(n,r)}))},g=0;g<c._numMorphTargets;g++)m(g);else{var _=s.name+"_channel"+s.targetedAnimations.length,v=new n.Animation(_,r,1,o);v.setKeys(f),null!=a&&null!=a.animations?(a.animations.push(v),s.addTargetedAnimation(v,a)):(c._babylonTransformNode.animations.push(v),s.addTargetedAnimation(v,c._babylonTransformNode))}}))},e.prototype._loadAnimationSamplerAsync=function(e,t){if(t._data)return t._data;var r=t.interpolation||"LINEAR";switch(r){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error(e+"/interpolation: Invalid value ("+t.interpolation+")")}var n=o.Get(e+"/input",this._gltf.accessors,t.input),i=o.Get(e+"/output",this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync("/accessors/"+n.index,n),this._loadFloatAccessorAsync("/accessors/"+i.index,i)]).then((function(e){var t=e[0],n=e[1];return{input:t,interpolation:r,output:n}})),t._data},e.prototype._loadBufferAsync=function(e,t,r,n){var i=this._extensionsLoadBufferAsync(e,t,r,n);if(i)return i;if(!t._data)if(t.uri)t._data=this.loadUriAsync(e+"/uri",t,t.uri);else{if(!this._bin)throw new Error(e+": Uri is missing or the binary glTF is missing its binary chunk");t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((function(t){try{return new Uint8Array(t.buffer,t.byteOffset+r,n)}catch(t){throw new Error(e+": "+t.message)}}))},e.prototype.loadBufferViewAsync=function(e,t){var r=this._extensionsLoadBufferViewAsync(e,t);if(r)return r;if(t._data)return t._data;var n=o.Get(e+"/buffer",this._gltf.buffers,t.buffer);return t._data=this._loadBufferAsync("/buffers/"+n.index,n,t.byteOffset||0,t.byteLength),t._data},e.prototype._loadAccessorAsync=function(t,r,i){var s=this;if(r._data)return r._data;var a=e._GetNumComponents(t,r.type),l=a*n.VertexBuffer.GetTypeByteLength(r.componentType),c=a*r.count;if(null==r.bufferView)r._data=Promise.resolve(new i(c));else{var u=o.Get(t+"/bufferView",this._gltf.bufferViews,r.bufferView);r._data=this.loadBufferViewAsync("/bufferViews/"+u.index,u).then((function(o){if(5126!==r.componentType||r.normalized){var s=new i(c);return n.VertexBuffer.ForEach(o,r.byteOffset||0,u.byteStride||l,a,r.componentType,s.length,r.normalized||!1,(function(e,t){s[t]=e})),s}return e._GetTypedArray(t,r.componentType,o,r.byteOffset,c)}))}if(r.sparse){var d=r.sparse;r._data=r._data.then((function(c){var u=c,h=o.Get(t+"/sparse/indices/bufferView",s._gltf.bufferViews,d.indices.bufferView),f=o.Get(t+"/sparse/values/bufferView",s._gltf.bufferViews,d.values.bufferView);return Promise.all([s.loadBufferViewAsync("/bufferViews/"+h.index,h),s.loadBufferViewAsync("/bufferViews/"+f.index,f)]).then((function(o){var s,c=o[0],h=o[1],f=e._GetTypedArray(t+"/sparse/indices",d.indices.componentType,c,d.indices.byteOffset,d.count),p=a*d.count;if(5126!==r.componentType||r.normalized){var m=e._GetTypedArray(t+"/sparse/values",r.componentType,h,d.values.byteOffset,p);s=new i(p),n.VertexBuffer.ForEach(m,0,l,a,r.componentType,s.length,r.normalized||!1,(function(e,t){s[t]=e}))}else s=e._GetTypedArray(t+"/sparse/values",r.componentType,h,d.values.byteOffset,p);for(var g=0,_=0;_<f.length;_++)for(var v=f[_]*a,y=0;y<a;y++)u[v++]=s[g++];return u}))}))}return r._data},e.prototype._loadFloatAccessorAsync=function(e,t){return this._loadAccessorAsync(e,t,Float32Array)},e.prototype._loadIndicesAccessorAsync=function(t,r){if("SCALAR"!==r.type)throw new Error(t+"/type: Invalid value "+r.type);if(5121!==r.componentType&&5123!==r.componentType&&5125!==r.componentType)throw new Error(t+"/componentType: Invalid value "+r.componentType);if(r._data)return r._data;if(r.sparse){var n=e._GetTypedArrayConstructor(t+"/componentType",r.componentType);r._data=this._loadAccessorAsync(t,r,n)}else{var i=o.Get(t+"/bufferView",this._gltf.bufferViews,r.bufferView);r._data=this.loadBufferViewAsync("/bufferViews/"+i.index,i).then((function(n){return e._GetTypedArray(t,r.componentType,n,r.byteOffset,r.count)}))}return r._data},e.prototype._loadVertexBufferViewAsync=function(e,t){var r=this;return e._babylonBuffer||(e._babylonBuffer=this.loadBufferViewAsync("/bufferViews/"+e.index,e).then((function(e){return new n.Buffer(r._babylonScene.getEngine(),e,!1)}))),e._babylonBuffer},e.prototype._loadVertexAccessorAsync=function(t,r,i){var s=this;if(r._babylonVertexBuffer)return r._babylonVertexBuffer;if(r.sparse)r._babylonVertexBuffer=this._loadFloatAccessorAsync("/accessors/"+r.index,r).then((function(e){return new n.VertexBuffer(s._babylonScene.getEngine(),e,i,!1)}));else if(r.byteOffset&&r.byteOffset%n.VertexBuffer.GetTypeByteLength(r.componentType)!=0)n.Logger.Warn("Accessor byte offset is not a multiple of component type byte length"),r._babylonVertexBuffer=this._loadFloatAccessorAsync("/accessors/"+r.index,r).then((function(e){return new n.VertexBuffer(s._babylonScene.getEngine(),e,i,!1)}));else if(i===n.VertexBuffer.MatricesIndicesKind||i===n.VertexBuffer.MatricesIndicesExtraKind)r._babylonVertexBuffer=this._loadFloatAccessorAsync("/accessors/"+r.index,r).then((function(e){return new n.VertexBuffer(s._babylonScene.getEngine(),e,i,!1)}));else{var a=o.Get(t+"/bufferView",this._gltf.bufferViews,r.bufferView);r._babylonVertexBuffer=this._loadVertexBufferViewAsync(a,i).then((function(o){var l=e._GetNumComponents(t,r.type);return new n.VertexBuffer(s._babylonScene.getEngine(),o,i,!1,!1,a.byteStride,!1,r.byteOffset,l,r.componentType,r.normalized,!0)}))}return r._babylonVertexBuffer},e.prototype._loadMaterialMetallicRoughnessPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return t&&(t.baseColorFactor?(r.albedoColor=n.Color3.FromArray(t.baseColorFactor),r.alpha=t.baseColorFactor[3]):r.albedoColor=n.Color3.White(),r.metallic=null==t.metallicFactor?1:t.metallicFactor,r.roughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&i.push(this.loadTextureInfoAsync(e+"/baseColorTexture",t.baseColorTexture,(function(e){e.name=r.name+" (Base Color)",r.albedoTexture=e}))),t.metallicRoughnessTexture&&(i.push(this.loadTextureInfoAsync(e+"/metallicRoughnessTexture",t.metallicRoughnessTexture,(function(e){e.name=r.name+" (Metallic Roughness)",r.metallicTexture=e}))),r.useMetallnessFromMetallicTextureBlue=!0,r.useRoughnessFromMetallicTextureGreen=!0,r.useRoughnessFromMetallicTextureAlpha=!1)),Promise.all(i).then((function(){}))},e.prototype._loadMaterialAsync=function(t,r,n,i,o){void 0===o&&(o=function(){});var s=this._extensionsLoadMaterialAsync(t,r,n,i,o);if(s)return s;r._data=r._data||{};var a=r._data[i];if(!a){this.logOpen(t+" "+(r.name||""));var l=this.createMaterial(t,r,i);a={babylonMaterial:l,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(t,r,l)},r._data[i]=a,e.AddPointerMetadata(l,t),this._parent.onMaterialLoadedObservable.notifyObservers(l),this.logClose()}return a.babylonMeshes.push(n),n.onDisposeObservable.addOnce((function(){var e=a.babylonMeshes.indexOf(n);-1!==e&&a.babylonMeshes.splice(e,1)})),o(a.babylonMaterial),a.promise.then((function(){return a.babylonMaterial}))},e.prototype._createDefaultMaterial=function(e,t){this._babylonScene._blockEntityCollection=this._forAssetContainer;var r=new n.PBRMaterial(e,this._babylonScene);return this._babylonScene._blockEntityCollection=!1,r.fillMode=t,r.enableSpecularAntiAliasing=!0,r.useRadianceOverAlpha=!this._parent.transparencyAsCoverage,r.useSpecularOverAlpha=!this._parent.transparencyAsCoverage,r.transparencyMode=n.PBRMaterial.PBRMATERIAL_OPAQUE,r.metallic=1,r.roughness=1,r},e.prototype.createMaterial=function(e,t,r){var n=this._extensionsCreateMaterial(e,t,r);if(n)return n;var i=t.name||"material"+t.index;return this._createDefaultMaterial(i,r)},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this._extensionsLoadMaterialPropertiesAsync(e,t,r);if(n)return n;var i=new Array;return i.push(this.loadMaterialBasePropertiesAsync(e,t,r)),t.pbrMetallicRoughness&&i.push(this._loadMaterialMetallicRoughnessPropertiesAsync(e+"/pbrMetallicRoughness",t.pbrMetallicRoughness,r)),this.loadMaterialAlphaProperties(e,t,r),Promise.all(i).then((function(){}))},e.prototype.loadMaterialBasePropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return r.emissiveColor=t.emissiveFactor?n.Color3.FromArray(t.emissiveFactor):new n.Color3(0,0,0),t.doubleSided&&(r.backFaceCulling=!1,r.twoSidedLighting=!0),t.normalTexture&&(i.push(this.loadTextureInfoAsync(e+"/normalTexture",t.normalTexture,(function(e){e.name=r.name+" (Normal)",r.bumpTexture=e}))),r.invertNormalMapX=!this._babylonScene.useRightHandedSystem,r.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=t.normalTexture.scale&&(r.bumpTexture.level=t.normalTexture.scale),r.forceIrradianceInFragment=!0),t.occlusionTexture&&(i.push(this.loadTextureInfoAsync(e+"/occlusionTexture",t.occlusionTexture,(function(e){e.name=r.name+" (Occlusion)",r.ambientTexture=e}))),r.useAmbientInGrayScale=!0,null!=t.occlusionTexture.strength&&(r.ambientTextureStrength=t.occlusionTexture.strength)),t.emissiveTexture&&i.push(this.loadTextureInfoAsync(e+"/emissiveTexture",t.emissiveTexture,(function(e){e.name=r.name+" (Emissive)",r.emissiveTexture=e}))),Promise.all(i).then((function(){}))},e.prototype.loadMaterialAlphaProperties=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");switch(t.alphaMode||"OPAQUE"){case"OPAQUE":r.transparencyMode=n.PBRMaterial.PBRMATERIAL_OPAQUE;break;case"MASK":r.transparencyMode=n.PBRMaterial.PBRMATERIAL_ALPHATEST,r.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,r.albedoTexture&&(r.albedoTexture.hasAlpha=!0);break;case"BLEND":r.transparencyMode=n.PBRMaterial.PBRMATERIAL_ALPHABLEND,r.albedoTexture&&(r.albedoTexture.hasAlpha=!0,r.useAlphaFromAlbedoTexture=!0);break;default:throw new Error(e+"/alphaMode: Invalid value ("+t.alphaMode+")")}},e.prototype.loadTextureInfoAsync=function(t,r,n){var i=this;void 0===n&&(n=function(){});var s=this._extensionsLoadTextureInfoAsync(t,r,n);if(s)return s;if(this.logOpen(""+t),r.texCoord>=2)throw new Error(t+"/texCoord: Invalid value ("+r.texCoord+")");var a=o.Get(t+"/index",this._gltf.textures,r.index),l=this._loadTextureAsync("/textures/"+r.index,a,(function(o){o.coordinatesIndex=r.texCoord||0,e.AddPointerMetadata(o,t),i._parent.onTextureLoadedObservable.notifyObservers(o),n(o)}));return this.logClose(),l},e.prototype._loadTextureAsync=function(t,r,n){void 0===n&&(n=function(){});var i=this._extensionsLoadTextureAsync(t,r,n);if(i)return i;this.logOpen(t+" "+(r.name||""));var s=null==r.sampler?e.DefaultSampler:o.Get(t+"/sampler",this._gltf.samplers,r.sampler),a=o.Get(t+"/source",this._gltf.images,r.source),l=this._createTextureAsync(t,s,a,n);return this.logClose(),l},e.prototype._createTextureAsync=function(e,t,r,i){var o=this;void 0===i&&(i=function(){});var s=this._loadSampler("/samplers/"+t.index,t),a=new Array,l=new n.Deferred;this._babylonScene._blockEntityCollection=this._forAssetContainer;var c=new n.Texture(null,this._babylonScene,s.noMipMaps,!1,s.samplingMode,(function(){o._disposed||l.resolve()}),(function(t,r){o._disposed||l.reject(new Error(e+": "+(r&&r.message?r.message:t||"Failed to load texture")))}),void 0,void 0,void 0,r.mimeType);return this._babylonScene._blockEntityCollection=!1,a.push(l.promise),a.push(this.loadImageAsync("/images/"+r.index,r).then((function(e){var t=r.uri||o._fileName+"#image"+r.index,n="data:"+o._uniqueRootUrl+t;c.updateURL(n,e)}))),c.wrapU=s.wrapU,c.wrapV=s.wrapV,i(c),Promise.all(a).then((function(){return c}))},e.prototype._loadSampler=function(t,r){return r._data||(r._data={noMipMaps:9728===r.minFilter||9729===r.minFilter,samplingMode:e._GetTextureSamplingMode(t,r),wrapU:e._GetTextureWrapMode(t+"/wrapS",r.wrapS),wrapV:e._GetTextureWrapMode(t+"/wrapT",r.wrapT)}),r._data},e.prototype.loadImageAsync=function(e,t){if(!t._data){if(this.logOpen(e+" "+(t.name||"")),t.uri)t._data=this.loadUriAsync(e+"/uri",t,t.uri);else{var r=o.Get(e+"/bufferView",this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync("/bufferViews/"+r.index,r)}this.logClose()}return t._data},e.prototype.loadUriAsync=function(t,r,i){var o=this,s=this._extensionsLoadUriAsync(t,r,i);if(s)return s;if(!e._ValidateUri(i))throw new Error(t+": '"+i+"' is invalid");if(n.Tools.IsBase64(i)){var a=new Uint8Array(n.Tools.DecodeBase64(i));return this.log("Decoded "+i.substr(0,64)+"... ("+a.length+" bytes)"),Promise.resolve(a)}return this.log("Loading "+i),this._parent.preprocessUrlAsync(this._rootUrl+i).then((function(e){return new Promise((function(r,s){o._parent._loadFile(e,o._babylonScene,(function(e){o._disposed||(o.log("Loaded "+i+" ("+e.byteLength+" bytes)"),r(new Uint8Array(e)))}),!0,(function(e){s(new n.LoadFileError(t+": Failed to load '"+i+"'"+(e?": "+e.status+" "+e.statusText:""),e))}))}))}))},e.AddPointerMetadata=function(e,t){var r=e.metadata=e.metadata||{},n=r.gltf=r.gltf||{};(n.pointers=n.pointers||[]).push(t)},e._GetTextureWrapMode=function(e,t){switch(t=null==t?10497:t){case 33071:return n.Texture.CLAMP_ADDRESSMODE;case 33648:return n.Texture.MIRROR_ADDRESSMODE;case 10497:return n.Texture.WRAP_ADDRESSMODE;default:return n.Logger.Warn(e+": Invalid value ("+t+")"),n.Texture.WRAP_ADDRESSMODE}},e._GetTextureSamplingMode=function(e,t){var r=null==t.magFilter?9729:t.magFilter,i=null==t.minFilter?9987:t.minFilter;if(9729===r)switch(i){case 9728:return n.Texture.LINEAR_NEAREST;case 9729:return n.Texture.LINEAR_LINEAR;case 9984:return n.Texture.LINEAR_NEAREST_MIPNEAREST;case 9985:return n.Texture.LINEAR_LINEAR_MIPNEAREST;case 9986:return n.Texture.LINEAR_NEAREST_MIPLINEAR;case 9987:return n.Texture.LINEAR_LINEAR_MIPLINEAR;default:return n.Logger.Warn(e+"/minFilter: Invalid value ("+i+")"),n.Texture.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==r&&n.Logger.Warn(e+"/magFilter: Invalid value ("+r+")"),i){case 9728:return n.Texture.NEAREST_NEAREST;case 9729:return n.Texture.NEAREST_LINEAR;case 9984:return n.Texture.NEAREST_NEAREST_MIPNEAREST;case 9985:return n.Texture.NEAREST_LINEAR_MIPNEAREST;case 9986:return n.Texture.NEAREST_NEAREST_MIPLINEAR;case 9987:return n.Texture.NEAREST_LINEAR_MIPLINEAR;default:return n.Logger.Warn(e+"/minFilter: Invalid value ("+i+")"),n.Texture.NEAREST_NEAREST_MIPNEAREST}},e._GetTypedArrayConstructor=function(e,t){switch(t){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(e+": Invalid component type "+t)}},e._GetTypedArray=function(t,r,n,i,o){var s=n.buffer;i=n.byteOffset+(i||0);var a=e._GetTypedArrayConstructor(t+"/componentType",r);try{return new a(s,i,o)}catch(e){throw new Error(t+": "+e)}},e._GetNumComponents=function(e,t){switch(t){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}throw new Error(e+": Invalid type ("+t+")")},e._ValidateUri=function(e){return n.Tools.IsBase64(e)||-1===e.indexOf("..")},e._GetDrawMode=function(e,t){switch(null==t&&(t=4),t){case 0:return n.Material.PointListDrawMode;case 1:return n.Material.LineListDrawMode;case 2:return n.Material.LineLoopDrawMode;case 3:return n.Material.LineStripDrawMode;case 4:return n.Material.TriangleFillMode;case 5:return n.Material.TriangleStripDrawMode;case 6:return n.Material.TriangleFanDrawMode}throw new Error(e+": Invalid mesh primitive mode ("+t+")")},e.prototype._compileMaterialsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile materials");var t=new Array;if(this._gltf.materials)for(var r=0,n=this._gltf.materials;r<n.length;r++){var i=n[r];if(i._data)for(var o in i._data)for(var s=i._data[o],a=0,l=s.babylonMeshes;a<l.length;a++){var c=l[a];c.computeWorldMatrix(!0);var u=s.babylonMaterial;t.push(u.forceCompilationAsync(c)),t.push(u.forceCompilationAsync(c,{useInstances:!0})),this._parent.useClipPlane&&(t.push(u.forceCompilationAsync(c,{clipPlane:!0})),t.push(u.forceCompilationAsync(c,{clipPlane:!0,useInstances:!0})))}}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile materials")}))},e.prototype._compileShadowGeneratorsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile shadow generators");for(var t=new Array,r=0,n=this._babylonScene.lights;r<n.length;r++){var i=n[r].getShadowGenerator();i&&t.push(i.forceCompilationAsync())}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile shadow generators")}))},e.prototype._forEachExtensions=function(e){for(var t=0,r=this._extensions;t<r.length;t++){var n=r[t];n.enabled&&e(n)}},e.prototype._applyExtensions=function(e,t,r){for(var n=0,i=this._extensions;n<i.length;n++){var o=i[n];if(o.enabled){var s=o.name+"."+t,a=e;a._activeLoaderExtensionFunctions=a._activeLoaderExtensionFunctions||{};var l=a._activeLoaderExtensionFunctions;if(!l[s]){l[s]=!0;try{var c=r(o);if(c)return c}finally{delete l[s]}}}}return null},e.prototype._extensionsOnLoading=function(){this._forEachExtensions((function(e){return e.onLoading&&e.onLoading()}))},e.prototype._extensionsOnReady=function(){this._forEachExtensions((function(e){return e.onReady&&e.onReady()}))},e.prototype._extensionsLoadSceneAsync=function(e,t){return this._applyExtensions(t,"loadScene",(function(r){return r.loadSceneAsync&&r.loadSceneAsync(e,t)}))},e.prototype._extensionsLoadNodeAsync=function(e,t,r){return this._applyExtensions(t,"loadNode",(function(n){return n.loadNodeAsync&&n.loadNodeAsync(e,t,r)}))},e.prototype._extensionsLoadCameraAsync=function(e,t,r){return this._applyExtensions(t,"loadCamera",(function(n){return n.loadCameraAsync&&n.loadCameraAsync(e,t,r)}))},e.prototype._extensionsLoadVertexDataAsync=function(e,t,r){return this._applyExtensions(t,"loadVertexData",(function(n){return n._loadVertexDataAsync&&n._loadVertexDataAsync(e,t,r)}))},e.prototype._extensionsLoadMeshPrimitiveAsync=function(e,t,r,n,i,o){return this._applyExtensions(i,"loadMeshPrimitive",(function(s){return s._loadMeshPrimitiveAsync&&s._loadMeshPrimitiveAsync(e,t,r,n,i,o)}))},e.prototype._extensionsLoadMaterialAsync=function(e,t,r,n,i){return this._applyExtensions(t,"loadMaterial",(function(o){return o._loadMaterialAsync&&o._loadMaterialAsync(e,t,r,n,i)}))},e.prototype._extensionsCreateMaterial=function(e,t,r){return this._applyExtensions(t,"createMaterial",(function(n){return n.createMaterial&&n.createMaterial(e,t,r)}))},e.prototype._extensionsLoadMaterialPropertiesAsync=function(e,t,r){return this._applyExtensions(t,"loadMaterialProperties",(function(n){return n.loadMaterialPropertiesAsync&&n.loadMaterialPropertiesAsync(e,t,r)}))},e.prototype._extensionsLoadTextureInfoAsync=function(e,t,r){return this._applyExtensions(t,"loadTextureInfo",(function(n){return n.loadTextureInfoAsync&&n.loadTextureInfoAsync(e,t,r)}))},e.prototype._extensionsLoadTextureAsync=function(e,t,r){return this._applyExtensions(t,"loadTexture",(function(n){return n._loadTextureAsync&&n._loadTextureAsync(e,t,r)}))},e.prototype._extensionsLoadAnimationAsync=function(e,t){return this._applyExtensions(t,"loadAnimation",(function(r){return r.loadAnimationAsync&&r.loadAnimationAsync(e,t)}))},e.prototype._extensionsLoadSkinAsync=function(e,t,r){return this._applyExtensions(r,"loadSkin",(function(n){return n._loadSkinAsync&&n._loadSkinAsync(e,t,r)}))},e.prototype._extensionsLoadUriAsync=function(e,t,r){return this._applyExtensions(t,"loadUri",(function(n){return n._loadUriAsync&&n._loadUriAsync(e,t,r)}))},e.prototype._extensionsLoadBufferViewAsync=function(e,t){return this._applyExtensions(t,"loadBufferView",(function(r){return r.loadBufferViewAsync&&r.loadBufferViewAsync(e,t)}))},e.prototype._extensionsLoadBufferAsync=function(e,t,r,n){return this._applyExtensions(t,"loadBuffer",(function(i){return i.loadBufferAsync&&i.loadBufferAsync(e,t,r,n)}))},e.LoadExtensionAsync=function(e,t,r,n){if(!t.extensions)return null;var i=t.extensions[r];return i?n(e+"/extensions/"+r,i):null},e.LoadExtraAsync=function(e,t,r,n){if(!t.extras)return null;var i=t.extras[r];return i?n(e+"/extras/"+r,i):null},e.prototype.isExtensionUsed=function(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)},e.prototype.logOpen=function(e){this._parent._logOpen(e)},e.prototype.logClose=function(){this._parent._logClose()},e.prototype.log=function(e){this._parent._log(e)},e.prototype.startPerformanceCounter=function(e){this._parent._startPerformanceCounter(e)},e.prototype.endPerformanceCounter=function(e){this._parent._endPerformanceCounter(e)},e._RegisteredExtensions={},e.DefaultSampler={index:-1},e}();i.GLTFFileLoader._CreateGLTF2Loader=function(e){return new s(e)}},"./glTF/2.0/glTFLoaderExtension.ts":
- /*!*****************************************!*\
- !*** ./glTF/2.0/glTFLoaderExtension.ts ***!
- \*****************************************/
- /*! no static exports found */function(e,t){},"./glTF/2.0/glTFLoaderInterfaces.ts":
- /*!******************************************!*\
- !*** ./glTF/2.0/glTFLoaderInterfaces.ts ***!
- \******************************************/
- /*! no static exports found */function(e,t){},"./glTF/2.0/index.ts":
- /*!***************************!*\
- !*** ./glTF/2.0/index.ts ***!
- \***************************/
- /*! no static exports found */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./glTFLoader */"./glTF/2.0/glTFLoader.ts");r.d(t,"ArrayItem",(function(){return n.ArrayItem})),r.d(t,"GLTFLoader",(function(){return n.GLTFLoader}));var i=r(/*! ./glTFLoaderExtension */"./glTF/2.0/glTFLoaderExtension.ts");for(var o in i)["ArrayItem","GLTFLoader","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(o);var s=r(/*! ./glTFLoaderInterfaces */"./glTF/2.0/glTFLoaderInterfaces.ts");for(var o in s)["ArrayItem","GLTFLoader","default"].indexOf(o)<0&&function(e){r.d(t,e,(function(){return s[e]}))}(o);var a=r(/*! ./Extensions */"./glTF/2.0/Extensions/index.ts");r.d(t,"EXT_lights_image_based",(function(){return a.EXT_lights_image_based})),r.d(t,"EXT_mesh_gpu_instancing",(function(){return a.EXT_mesh_gpu_instancing})),r.d(t,"KHR_draco_mesh_compression",(function(){return a.KHR_draco_mesh_compression})),r.d(t,"KHR_lights",(function(){return a.KHR_lights})),r.d(t,"KHR_materials_pbrSpecularGlossiness",(function(){return a.KHR_materials_pbrSpecularGlossiness})),r.d(t,"KHR_materials_unlit",(function(){return a.KHR_materials_unlit})),r.d(t,"KHR_materials_clearcoat",(function(){return a.KHR_materials_clearcoat})),r.d(t,"KHR_materials_sheen",(function(){return a.KHR_materials_sheen})),r.d(t,"KHR_materials_specular",(function(){return a.KHR_materials_specular})),r.d(t,"KHR_materials_ior",(function(){return a.KHR_materials_ior})),r.d(t,"KHR_materials_variants",(function(){return a.KHR_materials_variants})),r.d(t,"KHR_materials_transmission",(function(){return a.KHR_materials_transmission})),r.d(t,"KHR_mesh_quantization",(function(){return a.KHR_mesh_quantization})),r.d(t,"KHR_texture_basisu",(function(){return a.KHR_texture_basisu})),r.d(t,"KHR_texture_transform",(function(){return a.KHR_texture_transform})),r.d(t,"KHR_xmp",(function(){return a.KHR_xmp})),r.d(t,"MSFT_audio_emitter",(function(){return a.MSFT_audio_emitter})),r.d(t,"MSFT_lod",(function(){return a.MSFT_lod})),r.d(t,"MSFT_minecraftMesh",(function(){return a.MSFT_minecraftMesh})),r.d(t,"MSFT_sRGBFactors",(function(){return a.MSFT_sRGBFactors})),r.d(t,"ExtrasAsMetadata",(function(){return a.ExtrasAsMetadata}))},"./glTF/glTFFileLoader.ts":
- /*!********************************!*\
- !*** ./glTF/glTFFileLoader.ts ***!
- \********************************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFLoaderCoordinateSystemMode",(function(){return n})),r.d(t,"GLTFLoaderAnimationStartMode",(function(){return i})),r.d(t,"GLTFLoaderState",(function(){return o})),r.d(t,"GLTFFileLoader",(function(){return l}));var n,i,o,s=r(/*! babylonjs/Misc/observable */"babylonjs/Misc/observable"),a=r(/*! ./glTFValidation */"./glTF/glTFValidation.ts");!function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(n||(n={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(i||(i={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(o||(o={}));var l=function(){function e(){this.onParsedObservable=new s.Observable,this.coordinateSystemMode=n.AUTO,this.animationStartMode=i.FIRST,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable=new s.Observable,this.onTextureLoadedObservable=new s.Observable,this.onMaterialLoadedObservable=new s.Observable,this.onCameraLoadedObservable=new s.Observable,this.onCompleteObservable=new s.Observable,this.onErrorObservable=new s.Observable,this.onDisposeObservable=new s.Observable,this.onExtensionLoadedObservable=new s.Observable,this.validate=!1,this.onValidatedObservable=new s.Observable,this._loader=null,this._requests=new Array,this.name="gltf",this.extensions={".gltf":{isBinary:!1},".glb":{isBinary:!0}},this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled}return Object.defineProperty(e.prototype,"onParsed",{set:function(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),this._onParsedObserver=this.onParsedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMeshLoaded",{set:function(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTextureLoaded",{set:function(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMaterialLoaded",{set:function(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCameraLoaded",{set:function(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{set:function(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{set:function(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onExtensionLoaded",{set:function(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loggingEnabled",{get:function(){return this._loggingEnabled},set:function(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capturePerformanceCounters",{get:function(){return this._capturePerformanceCounters},set:function(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onValidated",{set:function(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._loader&&(this._loader.dispose(),this._loader=null);for(var e=0,t=this._requests;e<t.length;e++)t[e].abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()},e.prototype.requestFile=function(e,t,r,n,i,o){var a=this;if(this._progressCallback=n,i){if(this.useRangeRequests){this.validate&&s.Logger.Warn("glTF validation is not supported when range requests are enabled");var l={abort:function(){},onCompleteObservable:new s.Observable},c={readAsync:function(r,n){return new Promise((function(i,o){a._requestFile(t,e,(function(e){i(new Uint8Array(e))}),!0,(function(e){o(e)}),(function(e){e.setRequestHeader("Range","bytes="+r+"-"+(r+n-1))}))}))},byteLength:0};return this._unpackBinaryAsync(new s.DataReader(c)).then((function(e){l.onCompleteObservable.notifyObservers(l),r(e)}),o),l}return this._requestFile(t,e,(function(e,t){var n=e;a._unpackBinaryAsync(new s.DataReader({readAsync:function(e,t){return Promise.resolve(new Uint8Array(n,e,t))},byteLength:n.byteLength})).then((function(e){r(e,t)}),o)}),!0,o)}return this._requestFile(t,e,(function(n,i){a._validate(e,n,s.Tools.GetFolderPath(t),s.Tools.GetFilename(t)),r({json:a._parseJson(n)},i)}),i,o)},e.prototype.readFile=function(e,t,r,n,i,o){var a=this;return e._readFile(t,(function(n){if(a._validate(e,n,"file:",t.name),i){var l=n;a._unpackBinaryAsync(new s.DataReader({readAsync:function(e,t){return Promise.resolve(new Uint8Array(l,e,t))},byteLength:l.byteLength})).then(r,o)}else r({json:a._parseJson(n)})}),n,i,o)},e.prototype.importMeshAsync=function(e,t,r,n,i,o){var s=this;return Promise.resolve().then((function(){return s.onParsedObservable.notifyObservers(r),s.onParsedObservable.clear(),s._log("Loading "+(o||"")),s._loader=s._getLoader(r),s._loader.importMeshAsync(e,t,!1,r,n,i,o)}))},e.prototype.loadAsync=function(e,t,r,n,i){var o=this;return Promise.resolve().then((function(){return o.onParsedObservable.notifyObservers(t),o.onParsedObservable.clear(),o._log("Loading "+(i||"")),o._loader=o._getLoader(t),o._loader.loadAsync(e,t,r,n,i)}))},e.prototype.loadAssetContainerAsync=function(e,t,r,n,i){var o=this;return Promise.resolve().then((function(){o.onParsedObservable.notifyObservers(t),o.onParsedObservable.clear(),o._log("Loading "+(i||"")),o._loader=o._getLoader(t);var a=new s.AssetContainer(e),l=[];o.onMaterialLoadedObservable.add((function(e){l.push(e),e.onDisposeObservable.addOnce((function(){var t=a.materials.indexOf(e);t>-1&&a.materials.splice(t,1),(t=l.indexOf(e))>-1&&l.splice(t,1)}))}));var c=[];o.onTextureLoadedObservable.add((function(e){c.push(e),e.onDisposeObservable.addOnce((function(){var t=a.textures.indexOf(e);t>-1&&a.textures.splice(t,1),(t=c.indexOf(e))>-1&&c.splice(t,1)}))}));var u=[];return o.onCameraLoadedObservable.add((function(e){u.push(e)})),o._loader.importMeshAsync(null,e,!0,t,r,n,i).then((function(e){return Array.prototype.push.apply(a.meshes,e.meshes),Array.prototype.push.apply(a.particleSystems,e.particleSystems),Array.prototype.push.apply(a.skeletons,e.skeletons),Array.prototype.push.apply(a.animationGroups,e.animationGroups),Array.prototype.push.apply(a.materials,l),Array.prototype.push.apply(a.textures,c),Array.prototype.push.apply(a.lights,e.lights),Array.prototype.push.apply(a.transformNodes,e.transformNodes),Array.prototype.push.apply(a.cameras,u),a}))}))},e.prototype.canDirectLoad=function(t){return-1!==t.indexOf("asset")&&-1!==t.indexOf("version")||s.StringTools.StartsWith(t,"data:base64,"+e.magicBase64Encoded)||s.StringTools.StartsWith(t,"data:application/octet-stream;base64,"+e.magicBase64Encoded)||s.StringTools.StartsWith(t,"data:model/gltf-binary;base64,"+e.magicBase64Encoded)},e.prototype.directLoad=function(t,r){if(s.StringTools.StartsWith(r,"base64,"+e.magicBase64Encoded)||s.StringTools.StartsWith(r,"application/octet-stream;base64,"+e.magicBase64Encoded)||s.StringTools.StartsWith(r,"model/gltf-binary;base64,"+e.magicBase64Encoded)){var n=s.Tools.DecodeBase64(r);return this._validate(t,n),this._unpackBinaryAsync(new s.DataReader({readAsync:function(e,t){return Promise.resolve(new Uint8Array(n,e,t))},byteLength:n.byteLength}))}return this._validate(t,r),Promise.resolve({json:this._parseJson(r)})},e.prototype.createPlugin=function(){return new e},Object.defineProperty(e.prototype,"loaderState",{get:function(){return this._loader?this._loader.state:null},enumerable:!1,configurable:!0}),e.prototype.whenCompleteAsync=function(){var e=this;return new Promise((function(t,r){e.onCompleteObservable.addOnce((function(){t()})),e.onErrorObservable.addOnce((function(e){r(e)}))}))},e.prototype._loadFile=function(e,t,r,n,i){var o=this,s=t._loadFile(e,r,(function(e){o._onProgress(e,s)}),void 0,n,i);return s.onCompleteObservable.add((function(e){o._requests.splice(o._requests.indexOf(e),1)})),this._requests.push(s),s},e.prototype._requestFile=function(e,t,r,n,i,o){var s=this,a=t._requestFile(e,r,(function(e){s._onProgress(e,a)}),void 0,n,i,o);return a.onCompleteObservable.add((function(e){s._requests.splice(s._requests.indexOf(e),1)})),this._requests.push(a),a},e.prototype._onProgress=function(e,t){if(this._progressCallback){t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;for(var r=!0,n=0,i=0,o=0,s=this._requests;o<s.length;o++){var a=s[o];if(void 0===a._lengthComputable||void 0===a._loaded||void 0===a._total)return;r=r&&a._lengthComputable,n+=a._loaded,i+=a._total}this._progressCallback({lengthComputable:r,loaded:n,total:r?i:0})}},e.prototype._validate=function(e,t,r,n){var i=this;void 0===r&&(r=""),void 0===n&&(n=""),this.validate&&(this._startPerformanceCounter("Validate JSON"),a.GLTFValidation.ValidateAsync(t,r,n,(function(t){return i.preprocessUrlAsync(r+t).then((function(t){return e._loadFileAsync(t,void 0,!0,!0)}))})).then((function(e){i._endPerformanceCounter("Validate JSON"),i.onValidatedObservable.notifyObservers(e),i.onValidatedObservable.clear()}),(function(e){i._endPerformanceCounter("Validate JSON"),s.Tools.Warn("Failed to validate: "+e.message),i.onValidatedObservable.clear()})))},e.prototype._getLoader=function(t){var r=t.json.asset||{};this._log("Asset version: "+r.version),r.minVersion&&this._log("Asset minimum version: "+r.minVersion),r.generator&&this._log("Asset generator: "+r.generator);var n=e._parseVersion(r.version);if(!n)throw new Error("Invalid version: "+r.version);if(void 0!==r.minVersion){var i=e._parseVersion(r.minVersion);if(!i)throw new Error("Invalid minimum version: "+r.minVersion);if(e._compareVersion(i,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+r.minVersion)}var o={1:e._CreateGLTF1Loader,2:e._CreateGLTF2Loader}[n.major];if(!o)throw new Error("Unsupported version: "+r.version);return o(this)},e.prototype._parseJson=function(e){this._startPerformanceCounter("Parse JSON"),this._log("JSON length: "+e.length);var t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t},e.prototype._unpackBinaryAsync=function(e){var t=this;return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((function(){var r=e.readUint32();if(1179937895!==r)throw new Error("Unexpected magic: "+r);var n=e.readUint32();t.loggingEnabled&&t._log("Binary version: "+n);var i,o=e.readUint32();if(0!==e.buffer.byteLength&&o!==e.buffer.byteLength)throw new Error("Length in header does not match actual data length: "+o+" != "+e.buffer.byteLength);switch(n){case 1:i=t._unpackBinaryV1Async(e,o);break;case 2:i=t._unpackBinaryV2Async(e,o);break;default:throw new Error("Unsupported version: "+n)}return t._endPerformanceCounter("Unpack Binary"),i}))},e.prototype._unpackBinaryV1Async=function(e,t){var r=e.readUint32(),n=e.readUint32();if(0!==n)throw new Error("Unexpected content format: "+n);var i=t-e.byteOffset,o={json:this._parseJson(e.readString(r)),bin:null};if(0!==i){var s=e.byteOffset;o.bin={readAsync:function(t,r){return e.buffer.readAsync(s+t,r)},byteLength:i}}return Promise.resolve(o)},e.prototype._unpackBinaryV2Async=function(e,t){var r=this,n=1313821514,i=5130562,o=e.readUint32();if(e.readUint32()!==n)throw new Error("First chunk format is not JSON");return e.byteOffset+o===t?e.loadAsync(o).then((function(){return{json:r._parseJson(e.readString(o)),bin:null}})):e.loadAsync(o+8).then((function(){var s={json:r._parseJson(e.readString(o)),bin:null},a=function(){var r=e.readUint32();switch(e.readUint32()){case n:throw new Error("Unexpected JSON chunk");case i:var o=e.byteOffset;s.bin={readAsync:function(t,r){return e.buffer.readAsync(o+t,r)},byteLength:r},e.skipBytes(r);break;default:e.skipBytes(r)}return e.byteOffset!==t?e.loadAsync(8).then(a):Promise.resolve(s)};return a()}))},e._parseVersion=function(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};var t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},e._compareVersion=function(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0},e.prototype._logOpen=function(e){this._log(e),this._logIndentLevel++},e.prototype._logClose=function(){--this._logIndentLevel},e.prototype._logEnabled=function(t){var r=e._logSpaces.substr(0,2*this._logIndentLevel);s.Logger.Log(""+r+t)},e.prototype._logDisabled=function(e){},e.prototype._startPerformanceCounterEnabled=function(e){s.Tools.StartPerformanceCounter(e)},e.prototype._startPerformanceCounterDisabled=function(e){},e.prototype._endPerformanceCounterEnabled=function(e){s.Tools.EndPerformanceCounter(e)},e.prototype._endPerformanceCounterDisabled=function(e){},e.IncrementalLoading=!0,e.HomogeneousCoordinates=!1,e.magicBase64Encoded="Z2xURg",e._logSpaces=" ",e}();s.SceneLoader&&s.SceneLoader.RegisterPlugin(new l)},"./glTF/glTFValidation.ts":
- /*!********************************!*\
- !*** ./glTF/glTFValidation.ts ***!
- \********************************/
- /*! exports provided: GLTFValidation */function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFValidation",(function(){return s}));var n=r(/*! babylonjs/Misc/tools */"babylonjs/Misc/observable");function i(e,t,r,n){var i={externalResourceFunction:function(e){return n(e).then((function(e){return new Uint8Array(e)}))}};return r&&(i.uri="file:"===t?r:t+r),e instanceof ArrayBuffer?GLTFValidator.validateBytes(new Uint8Array(e),i):GLTFValidator.validateString(e,i)}function o(){var e=[];onmessage=function(t){var r=t.data;switch(r.id){case"init":importScripts(r.url);break;case"validate":i(r.data,r.rootUrl,r.fileName,(function(t){return new Promise((function(r,n){var i=e.length;e.push({resolve:r,reject:n}),postMessage({id:"getExternalResource",index:i,uri:t})}))})).then((function(e){postMessage({id:"validate.resolve",value:e})}),(function(e){postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[r.index].resolve(r.value);break;case"getExternalResource.reject":e[r.index].reject(r.reason)}}}var s=function(){function e(){}return e.ValidateAsync=function(e,t,r,s){var a=this;return"function"==typeof Worker?new Promise((function(l,c){var u=i+"("+o+")()",d=URL.createObjectURL(new Blob([u],{type:"application/javascript"})),h=new Worker(d),f=function(e){h.removeEventListener("error",f),h.removeEventListener("message",p),c(e)},p=function(e){var t=e.data;switch(t.id){case"getExternalResource":s(t.uri).then((function(e){h.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e])}),(function(e){h.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":h.removeEventListener("error",f),h.removeEventListener("message",p),l(t.value);break;case"validate.reject":h.removeEventListener("error",f),h.removeEventListener("message",p),c(t.reason)}};h.addEventListener("error",f),h.addEventListener("message",p),h.postMessage({id:"init",url:n.Tools.GetAbsoluteUrl(a.Configuration.url)}),h.postMessage({id:"validate",data:e,rootUrl:t,fileName:r})})):(this._LoadScriptPromise||(this._LoadScriptPromise=n.Tools.LoadScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return i(e,t,r,s)})))},e.Configuration={url:"https://preview.babylonjs.com/gltf_validator.js"},e}()},"./glTF/index.ts":
- /*!***********************!*\
- !*** ./glTF/index.ts ***!
- \***********************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, GLTFValidation, GLTF1, GLTF2 */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./glTFFileLoader */"./glTF/glTFFileLoader.ts");r.d(t,"GLTFLoaderCoordinateSystemMode",(function(){return n.GLTFLoaderCoordinateSystemMode})),r.d(t,"GLTFLoaderAnimationStartMode",(function(){return n.GLTFLoaderAnimationStartMode})),r.d(t,"GLTFLoaderState",(function(){return n.GLTFLoaderState})),r.d(t,"GLTFFileLoader",(function(){return n.GLTFFileLoader}));var i=r(/*! ./glTFValidation */"./glTF/glTFValidation.ts");r.d(t,"GLTFValidation",(function(){return i.GLTFValidation}));var o=r(/*! ./1.0 */"./glTF/1.0/index.ts");r.d(t,"GLTF1",(function(){return o}));var s=r(/*! ./2.0 */"./glTF/2.0/index.ts");r.d(t,"GLTF2",(function(){return s}))},"./index.ts":
- /*!******************!*\
- !*** ./index.ts ***!
- \******************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, GLTFValidation, GLTF1, GLTF2, MTLFileLoader, OBJFileLoader, STLFileLoader */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./glTF */"./glTF/index.ts");r.d(t,"GLTFLoaderCoordinateSystemMode",(function(){return n.GLTFLoaderCoordinateSystemMode})),r.d(t,"GLTFLoaderAnimationStartMode",(function(){return n.GLTFLoaderAnimationStartMode})),r.d(t,"GLTFLoaderState",(function(){return n.GLTFLoaderState})),r.d(t,"GLTFFileLoader",(function(){return n.GLTFFileLoader})),r.d(t,"GLTFValidation",(function(){return n.GLTFValidation})),r.d(t,"GLTF1",(function(){return n.GLTF1})),r.d(t,"GLTF2",(function(){return n.GLTF2}));var i=r(/*! ./OBJ */"./OBJ/index.ts");r.d(t,"MTLFileLoader",(function(){return i.MTLFileLoader})),r.d(t,"OBJFileLoader",(function(){return i.OBJFileLoader}));var o=r(/*! ./STL */"./STL/index.ts");r.d(t,"STLFileLoader",(function(){return o.STLFileLoader}))},"./legacy/legacy-glTF.ts":
- /*!*******************************!*\
- !*** ./legacy/legacy-glTF.ts ***!
- \*******************************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, GLTFValidation */function(e,t,r){"use strict";r.r(t),function(e){var n=r(/*! ../glTF/glTFFileLoader */"./glTF/glTFFileLoader.ts"),i=r(/*! ../glTF/glTFValidation */"./glTF/glTFValidation.ts");r.d(t,"GLTFLoaderCoordinateSystemMode",(function(){return n.GLTFLoaderCoordinateSystemMode})),r.d(t,"GLTFLoaderAnimationStartMode",(function(){return n.GLTFLoaderAnimationStartMode})),r.d(t,"GLTFLoaderState",(function(){return n.GLTFLoaderState})),r.d(t,"GLTFFileLoader",(function(){return n.GLTFFileLoader})),r.d(t,"GLTFValidation",(function(){return i.GLTFValidation}));var o=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==o){for(var s in o.BABYLON=o.BABYLON||{},n)o.BABYLON[s]=n[s];for(var s in i)o.BABYLON[s]=i[s]}}.call(this,r(/*! ./../../../node_modules/webpack/buildin/global.js */"../../node_modules/webpack/buildin/global.js"))},"./legacy/legacy-glTF1.ts":
- /*!********************************!*\
- !*** ./legacy/legacy-glTF1.ts ***!
- \********************************/
- /*! exports provided: GLTF1 */function(e,t,r){"use strict";r.r(t),function(e){var n=r(/*! ../glTF/1.0 */"./glTF/1.0/index.ts");r.d(t,"GLTF1",(function(){return n}));var i=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==i)for(var o in i.BABYLON=i.BABYLON||{},i.BABYLON.GLTF1=i.BABYLON.GLTF1||{},n)i.BABYLON.GLTF1[o]=n[o]}.call(this,r(/*! ./../../../node_modules/webpack/buildin/global.js */"../../node_modules/webpack/buildin/global.js"))},"./legacy/legacy-glTF2.ts":
- /*!********************************!*\
- !*** ./legacy/legacy-glTF2.ts ***!
- \********************************/
- /*! exports provided: GLTF2 */function(e,t,r){"use strict";r.r(t),function(e){var n=r(/*! ../glTF/2.0/Extensions */"./glTF/2.0/Extensions/index.ts"),i=r(/*! ../glTF/2.0/glTFLoaderInterfaces */"./glTF/2.0/glTFLoaderInterfaces.ts"),o=r(/*! ../glTF/2.0 */"./glTF/2.0/index.ts");r.d(t,"GLTF2",(function(){return o}));var s=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==s){s.BABYLON=s.BABYLON||{};var a=s.BABYLON;a.GLTF2=a.GLTF2||{},a.GLTF2.Loader=a.GLTF2.Loader||{},a.GLTF2.Loader.Extensions=a.GLTF2.Loader.Extensions||{};var l=[];for(var c in n)a.GLTF2.Loader.Extensions[c]=n[c],l.push(c);for(var c in i)a.GLTF2.Loader[c]=i[c],l.push(c);for(var c in o)l.indexOf(c)>-1||(a.GLTF2[c]=o[c])}}.call(this,r(/*! ./../../../node_modules/webpack/buildin/global.js */"../../node_modules/webpack/buildin/global.js"))},"./legacy/legacy-objFileLoader.ts":
- /*!****************************************!*\
- !*** ./legacy/legacy-objFileLoader.ts ***!
- \****************************************/
- /*! exports provided: MTLFileLoader, OBJFileLoader */function(e,t,r){"use strict";r.r(t),function(e){var n=r(/*! ../OBJ */"./OBJ/index.ts");r.d(t,"MTLFileLoader",(function(){return n.MTLFileLoader})),r.d(t,"OBJFileLoader",(function(){return n.OBJFileLoader}));var i=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==i)for(var o in n)i.BABYLON[o]=n[o]}.call(this,r(/*! ./../../../node_modules/webpack/buildin/global.js */"../../node_modules/webpack/buildin/global.js"))},"./legacy/legacy-stlFileLoader.ts":
- /*!****************************************!*\
- !*** ./legacy/legacy-stlFileLoader.ts ***!
- \****************************************/
- /*! exports provided: STLFileLoader */function(e,t,r){"use strict";r.r(t),function(e){var n=r(/*! ../STL */"./STL/index.ts");r.d(t,"STLFileLoader",(function(){return n.STLFileLoader}));var i=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==i)for(var o in n)i.BABYLON[o]=n[o]}.call(this,r(/*! ./../../../node_modules/webpack/buildin/global.js */"../../node_modules/webpack/buildin/global.js"))},"./legacy/legacy.ts":
- /*!**************************!*\
- !*** ./legacy/legacy.ts ***!
- \**************************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, GLTFValidation, GLTF1, GLTF2, MTLFileLoader, OBJFileLoader, STLFileLoader */function(e,t,r){"use strict";r.r(t),r(/*! ../index */"./index.ts");var n=r(/*! ./legacy-glTF */"./legacy/legacy-glTF.ts");r.d(t,"GLTFLoaderCoordinateSystemMode",(function(){return n.GLTFLoaderCoordinateSystemMode})),r.d(t,"GLTFLoaderAnimationStartMode",(function(){return n.GLTFLoaderAnimationStartMode})),r.d(t,"GLTFLoaderState",(function(){return n.GLTFLoaderState})),r.d(t,"GLTFFileLoader",(function(){return n.GLTFFileLoader})),r.d(t,"GLTFValidation",(function(){return n.GLTFValidation}));var i=r(/*! ./legacy-glTF1 */"./legacy/legacy-glTF1.ts");r.d(t,"GLTF1",(function(){return i.GLTF1}));var o=r(/*! ./legacy-glTF2 */"./legacy/legacy-glTF2.ts");r.d(t,"GLTF2",(function(){return o.GLTF2}));var s=r(/*! ./legacy-objFileLoader */"./legacy/legacy-objFileLoader.ts");r.d(t,"MTLFileLoader",(function(){return s.MTLFileLoader})),r.d(t,"OBJFileLoader",(function(){return s.OBJFileLoader}));var a=r(/*! ./legacy-stlFileLoader */"./legacy/legacy-stlFileLoader.ts");r.d(t,"STLFileLoader",(function(){return a.STLFileLoader}))},"babylonjs/Misc/observable":
- /*!****************************************************************************************************!*\
- !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
- \****************************************************************************************************/
- /*! no static exports found */function(t,r){t.exports=e}})},e.exports=n(r(0))}).call(this,r(10))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewerModel=t.ModelState=void 0;var n,i=r(0),o=r(0),s=r(0),a=r(0),l=r(0),c=r(0),u=r(0),d=r(0),h=r(0),f=r(6),p=r(1);!function(e){e[e.INIT=0]="INIT",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e[e.ENTRY=3]="ENTRY",e[e.ENTRYDONE=4]="ENTRYDONE",e[e.COMPLETE=5]="COMPLETE",e[e.CANCELED=6]="CANCELED",e[e.ERROR=7]="ERROR"}(n=t.ModelState||(t.ModelState={}));var m=function(){function e(e,t,r){var s=this;this._observablesManager=e,this._configurationContainer=r,this._meshes=[],this.particleSystems=[],this.skeletons=[],this._loaderDone=!1,this._animatables=[],this._frameRate=60,this._shadowsRenderedAfterLoad=!1,this.onLoadedObservable=new o.Observable,this.onLoadErrorObservable=new o.Observable,this.onLoadProgressObservable=new o.Observable,this.onCompleteObservable=new o.Observable,this.onAfterConfigure=new o.Observable,this.state=n.INIT;var l=this._configurationContainer&&this._configurationContainer.scene;this.rootMesh=new i.AbstractMesh("modelRootMesh",l),this._pivotMesh=new i.AbstractMesh("pivotMesh",l),this._pivotMesh.parent=this.rootMesh,this._pivotMesh.rotation.y+=Math.PI,this._scaleTransition=new a.Animation("scaleAnimation","scaling",this._frameRate,a.Animation.ANIMATIONTYPE_VECTOR3,a.Animation.ANIMATIONLOOPMODE_CONSTANT),this._animations=[],this._modelConfiguration=p.deepmerge(this._configurationContainer&&this._configurationContainer.configuration.model||{},t),this._observablesManager&&this._observablesManager.onModelAddedObservable.notifyObservers(this),this._modelConfiguration.entryAnimation&&this.rootMesh.setEnabled(!1),this.onLoadedObservable.add((function(){s.updateConfiguration(s._modelConfiguration),s._observablesManager&&s._observablesManager.onModelLoadedObservable.notifyObservers(s),s._initAnimations()})),this.onCompleteObservable.add((function(){s.state=n.COMPLETE}))}return Object.defineProperty(e.prototype,"shadowsRenderedAfterLoad",{get:function(){return this._shadowsRenderedAfterLoad},set:function(e){if(!e)throw new Error("can only be enabled");this._shadowsRenderedAfterLoad=e},enumerable:!1,configurable:!0}),e.prototype.getViewerId=function(){return this._configurationContainer&&this._configurationContainer.viewerId},Object.defineProperty(e.prototype,"enabled",{get:function(){return this.rootMesh.isEnabled()},set:function(e){this.rootMesh.setEnabled(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderDone",{set:function(e){this._loaderDone=e,this._checkCompleteState()},enumerable:!1,configurable:!0}),e.prototype._checkCompleteState=function(){this._loaderDone&&this.state===n.ENTRYDONE&&this._modelComplete()},e.prototype.addMesh=function(e,t){if(e.parent||(e.parent=this._pivotMesh),"InstancedMesh"!==e.getClassName()&&(e.receiveShadows=!!this.configuration.receiveShadows),this._meshes.push(e),t)return this.onLoadedObservable.notifyObserversWithPromise(this)},Object.defineProperty(e.prototype,"meshes",{get:function(){return this._meshes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._modelConfiguration},set:function(e){this._modelConfiguration=e,this._configureModel()},enumerable:!1,configurable:!0}),e.prototype.updateConfiguration=function(e){this._modelConfiguration=p.deepmerge(this._modelConfiguration,e),this._configureModel()},e.prototype._initAnimations=function(){var e=this;this.skeletons.length&&this.skeletons.forEach((function(t,r){var n=new s.AnimationGroup("animation-"+r,e._configurationContainer&&e._configurationContainer.scene),i=!1;t.getAnimatables().forEach((function(e){e.animations&&e.animations[0]&&(n.addTargetedAnimation(e.animations[0],e),i=!0)})),i&&e.addAnimationGroup(n)}));var t=function(){};if(this._modelConfiguration.animation&&(this._modelConfiguration.animation.playOnce&&this._animations.forEach((function(e){e.playMode=f.AnimationPlayMode.ONCE})),this._modelConfiguration.animation.autoStart&&this._animations.length)){var r=!0===this._modelConfiguration.animation.autoStart?this._animations[0].name:this._modelConfiguration.animation.autoStart;t=function(){e.playAnimation(r)}}this._enterScene(t)},e.prototype._enterScene=function(e){var t=this,r=this.rootMesh.getScene(),i=r.animationPropertiesOverride.enableBlending,o=function(){t.state=n.ENTRYDONE,r.animationPropertiesOverride.enableBlending=i,t._checkCompleteState(),e&&e()};this._entryAnimation?(this.rootMesh.setEnabled(!0),r.animationPropertiesOverride.enableBlending=!1,this._applyAnimation(this._entryAnimation,!0,o)):o()},e.prototype._exitScene=function(e){this._exitAnimation?this._applyAnimation(this._exitAnimation,!1,e):e()},e.prototype._modelComplete=function(){var e=this;this._pivotMesh.getChildMeshes(!1).filter((function(e){return e.material})).forEach((function(t){e._applyModelMaterialConfiguration(t.material)})),this.state=n.COMPLETE,this.onCompleteObservable.notifyObservers(this)},e.prototype.addAnimationGroup=function(e){this._animations.push(new f.GroupModelAnimation(e))},e.prototype.getAnimations=function(){return this._animations},e.prototype.getAnimationNames=function(){return this._animations.map((function(e){return e.name}))},e.prototype._getAnimationByName=function(e){var t=this._animations.filter((function(t){return t.name===e.trim()}));return 1===t.length?t[0]:null},e.prototype.playAnimation=function(e){var t=this.setCurrentAnimationByName(e);return t&&t.start(),t},e.prototype.setCurrentAnimationByName=function(e){var t=this._getAnimationByName(e.trim());if(t)return this.currentAnimation&&this.currentAnimation.state!==f.AnimationState.STOPPED&&this.currentAnimation.stop(),this.currentAnimation=t,t;throw new Error("animation not found - "+e)},e.prototype._configureModel=function(){var e=this,t=[this.rootMesh],r=function(e,r,n){t.forEach((function(t){n?t[e][n]=r:t[e]=r}))},n=function(e,t){void 0!==t.x&&r(e,t.x,"x"),void 0!==t.y&&r(e,t.y,"y"),void 0!==t.z&&r(e,t.z,"z"),void 0!==t.w&&r(e,t.w,"w")};if(this._modelConfiguration.normalize){var i=!1,o=!1,s=void 0;!0===this._modelConfiguration.normalize?(i=!0,o=!0):(i=!!this._modelConfiguration.normalize.center,o=!!this._modelConfiguration.normalize.unitSize,s=this._modelConfiguration.normalize.parentIndex);var a=[];void 0!==s?a.push(this._meshes[s]):a=1===this._pivotMesh.getChildMeshes(!0).length?[this._pivotMesh]:t,o&&a.forEach((function(e){e.normalizeToUnitCube(!0),e.computeWorldMatrix(!0)})),i&&a.forEach((function(e){var t=e.getHierarchyBoundingVectors(!0),r=t.max.subtract(t.min).scale(.5),n=t.min.add(r);e.position=n.scale(-1),e.position.y+=r.y,e.computeWorldMatrix(!0)}))}if(this._modelConfiguration.position&&n("position",this._modelConfiguration.position),this._modelConfiguration.rotation&&(this._modelConfiguration.rotation.w?(t.forEach((function(e){e.rotationQuaternion||(e.rotationQuaternion=new l.Quaternion)})),n("rotationQuaternion",this._modelConfiguration.rotation)):n("rotation",this._modelConfiguration.rotation)),this._modelConfiguration.rotationOffsetAxis){var u=new l.Vector3(this._modelConfiguration.rotationOffsetAxis.x,this._modelConfiguration.rotationOffsetAxis.y,this._modelConfiguration.rotationOffsetAxis.z);t.forEach((function(t){e._modelConfiguration.rotationOffsetAngle&&t.rotate(u,e._modelConfiguration.rotationOffsetAngle)}))}this._modelConfiguration.scaling&&n("scaling",this._modelConfiguration.scaling),this._modelConfiguration.castShadow&&this._meshes.forEach((function(e){c.Tags.AddTagsTo(e,"castShadow")})),this._pivotMesh.getChildMeshes(!1).filter((function(e){return e.material})).forEach((function(t){e._applyModelMaterialConfiguration(t.material)})),this._modelConfiguration.entryAnimation&&(this._entryAnimation=this._modelAnimationConfigurationToObject(this._modelConfiguration.entryAnimation)),this._modelConfiguration.exitAnimation&&(this._exitAnimation=this._modelAnimationConfigurationToObject(this._modelConfiguration.exitAnimation)),this.onAfterConfigure.notifyObservers(this)},e.prototype._modelAnimationConfigurationToObject=function(e){var t={time:.5};return e.scaling&&(t.scaling=l.Vector3.Zero()),void 0!==e.easingFunction&&(t.easingFunction=e.easingFunction),void 0!==e.easingMode&&(t.easingMode=e.easingMode),p.extendClassWithConfig(t,e),t},e.prototype._applyModelMaterialConfiguration=function(e){if(this._modelConfiguration.material)if(p.extendClassWithConfig(e,this._modelConfiguration.material),e instanceof u.PBRMaterial)void 0!==this._modelConfiguration.material.directIntensity&&(e.directIntensity=this._modelConfiguration.material.directIntensity),void 0!==this._modelConfiguration.material.emissiveIntensity&&(e.emissiveIntensity=this._modelConfiguration.material.emissiveIntensity),void 0!==this._modelConfiguration.material.environmentIntensity&&(e.environmentIntensity=this._modelConfiguration.material.environmentIntensity),void 0!==this._modelConfiguration.material.directEnabled&&(e.disableLighting=!this._modelConfiguration.material.directEnabled),this._configurationContainer&&this._configurationContainer.reflectionColor&&(e.reflectionColor=this._configurationContainer.reflectionColor.clone());else if(e instanceof d.MultiMaterial)for(var t=0;t<e.subMaterials.length;t++){var r=e.subMaterials[t];r&&this._applyModelMaterialConfiguration(r)}},e.prototype._applyAnimation=function(e,t,r){var n=[];if(e.scaling){var i=t?e.scaling:new l.Vector3(1,1,1),o=t?new l.Vector3(1,1,1):e.scaling;i.equals(o)||(this.rootMesh.scaling=i,this._setLinearKeys(this._scaleTransition,this.rootMesh.scaling,o,e.time),n.push(this._scaleTransition))}this.transitionTo(n,e.time,this._createEasingFunction(e.easingFunction),e.easingMode,(function(){r&&r()}))},e.prototype.transitionTo=function(e,t,r,n,i){if(void 0===n&&(n=2),r)for(var o=0,s=e;o<s.length;o++){var a=s[o];r.setEasingMode(n),a.setEasingFunction(r)}if(this.stopAllAnimations(),this.rootMesh.animations=e,void 0!==this.rootMesh.getScene().beginAnimation){var l=this.rootMesh.getScene().beginAnimation(this.rootMesh,0,this._frameRate*t,!1,1,(function(){i&&i()}));this._animatables.push(l)}},e.prototype._setLinearKeys=function(e,t,r,n){e.setKeys([{frame:0,value:t},{frame:this._frameRate*n,value:r}])},e.prototype._createEasingFunction=function(e){var t;switch(e){case f.EasingFunction.CircleEase:t=new a.CircleEase;break;case f.EasingFunction.BackEase:t=new a.BackEase(.3);break;case f.EasingFunction.BounceEase:t=new a.BounceEase;break;case f.EasingFunction.CubicEase:t=new a.CubicEase;break;case f.EasingFunction.ElasticEase:t=new a.ElasticEase;break;case f.EasingFunction.ExponentialEase:t=new a.ExponentialEase;break;case f.EasingFunction.PowerEase:t=new a.PowerEase;break;case f.EasingFunction.QuadraticEase:t=new a.QuadraticEase;break;case f.EasingFunction.QuarticEase:t=new a.QuarticEase;break;case f.EasingFunction.QuinticEase:t=new a.QuinticEase;break;case f.EasingFunction.SineEase:t=new a.SineEase;break;default:h.Tools.Log("No ease function found")}return t},e.prototype.stopAllAnimations=function(){for(this.rootMesh&&(this.rootMesh.animations=[]),this.currentAnimation&&this.currentAnimation.stop();this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()},e.prototype.remove=function(){this.stopAllAnimations(),this.rootMesh.isVisible=!1,this._observablesManager&&this._observablesManager.onModelRemovedObservable.notifyObservers(this)},e.prototype.dispose=function(){this.remove(),this.onAfterConfigure.clear(),this.onLoadedObservable.clear(),this.onLoadErrorObservable.clear(),this.onLoadProgressObservable.clear(),this.loader&&"gltf"===this.loader.name&&this.loader.dispose(),this.particleSystems.forEach((function(e){return e.dispose()})),this.particleSystems.length=0,this.skeletons.forEach((function(e){return e.dispose()})),this.skeletons.length=0,this._animations.forEach((function(e){return e.dispose()})),this._animations.length=0,this.rootMesh.dispose(!1,!0)},e}();t.ViewerModel=m},function(e,t,r){"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.GroupModelAnimation=t.EasingFunction=t.AnimationState=t.AnimationPlayMode=void 0,function(e){e[e.ONCE=0]="ONCE",e[e.LOOP=1]="LOOP"}(n=t.AnimationPlayMode||(t.AnimationPlayMode={})),function(e){e[e.INIT=0]="INIT",e[e.PLAYING=1]="PLAYING",e[e.PAUSED=2]="PAUSED",e[e.STOPPED=3]="STOPPED",e[e.ENDED=4]="ENDED"}(i=t.AnimationState||(t.AnimationState={})),function(e){e[e.Linear=0]="Linear",e[e.CircleEase=1]="CircleEase",e[e.BackEase=2]="BackEase",e[e.BounceEase=3]="BounceEase",e[e.CubicEase=4]="CubicEase",e[e.ElasticEase=5]="ElasticEase",e[e.ExponentialEase=6]="ExponentialEase",e[e.PowerEase=7]="PowerEase",e[e.QuadraticEase=8]="QuadraticEase",e[e.QuarticEase=9]="QuarticEase",e[e.QuinticEase=10]="QuinticEase",e[e.SineEase=11]="SineEase"}(t.EasingFunction||(t.EasingFunction={}));var o=function(){function e(e){var t=this;this._animationGroup=e,this._state=i.INIT,this._playMode=n.LOOP,this._animationGroup.onAnimationEndObservable.add((function(){t.stop(),t._state=i.ENDED}))}return Object.defineProperty(e.prototype,"name",{get:function(){return this._animationGroup.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._animationGroup.speedRatio},set:function(e){this._animationGroup.speedRatio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frames",{get:function(){return this._animationGroup.to-this._animationGroup.from},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._animationGroup.targetedAnimations[0]&&this._animationGroup.targetedAnimations[0].animation.runtimeAnimations[0]?this._animationGroup.targetedAnimations[0].animation.runtimeAnimations[0].currentFrame-this._animationGroup.from:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fps",{get:function(){for(var e=0;e<this._animationGroup.animatables.length;++e){var t=this._animationGroup.animatables[e].getAnimations();if(t&&t.length)for(var r=0;r<t.length;++r)if(t[r].animation&&t[r].animation.framePerSecond)return t[r].animation.framePerSecond}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playMode",{get:function(){return this._playMode},set:function(e){e!==this._playMode&&(this._playMode=e,this.state===i.PLAYING?this._animationGroup.play(this._playMode===n.LOOP):(this._animationGroup.reset(),this._state=i.INIT))},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._animationGroup.reset()},e.prototype.restart=function(){this.state===i.PAUSED?this._animationGroup.restart():this.start()},e.prototype.goToFrame=function(e){this._animationGroup.goToFrame(e+this._animationGroup.from)},e.prototype.start=function(){this._animationGroup.start(this.playMode===n.LOOP,this.speedRatio),this._animationGroup.isStarted&&(this._state=i.PLAYING)},e.prototype.pause=function(){this._animationGroup.pause(),this._state=i.PAUSED},e.prototype.stop=function(){this._animationGroup.stop(),this._animationGroup.isStarted||(this._state=i.STOPPED)},e.prototype.dispose=function(){this._animationGroup.dispose()},e}();t.GroupModelAnimation=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryManager=t.TelemetryManager=void 0;var n=r(0),i=function(){function e(){this.onEventBroadcastedObservable=new n.Observable,this._event=this._eventEnabled}return Object.defineProperty(e.prototype,"broadcast",{get:function(){return this._event},enumerable:!1,configurable:!0}),e.prototype.flushWebGLErrors=function(e,t){if(e)for(var r=!0;r;){var n=e.getError();0===n?r=!1:this.broadcast("WebGL Error",t,{error:n})}},Object.defineProperty(e.prototype,"enable",{set:function(e){this._event=e?this._eventEnabled:this._eventDisabled},enumerable:!1,configurable:!0}),e.prototype._eventDisabled=function(){},e.prototype._eventEnabled=function(e,t,r){var n={viewerId:t,event:e,session:this.session,date:new Date,now:window.performance?window.performance.now():Date.now(),detail:null};if("object"==typeof r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);else r&&(n.detail=r);this.onEventBroadcastedObservable.notifyObservers(n)},Object.defineProperty(e.prototype,"session",{get:function(){return this._currentSessionId||(this._currentSessionId="SESSION_"+Date.now()+Math.floor(65536*Math.random())),this._currentSessionId},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.onEventBroadcastedObservable.clear(),delete this.onEventBroadcastedObservable},e}();t.TelemetryManager=i,t.telemetryManager=new i},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(60),t),i(r(62),t),i(r(69),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractViewerNavbarButton=void 0;var n=r(13),i=function(){function e(e,t,r){this.templateName="navBar",this.eventsToAttach=["pointerdown"],this._prepend=!0,this._buttonName=e,this._buttonClass=t||e+"-button",this._htmlTemplate=r||'\n<button class="'+this._buttonClass+'">\n <span class="icon '+this._buttonName+'-icon"></span>\n</button>\n'}return e.prototype.interactionPredicate=function(e){if(0!==e.event.button)return!1;var t=e.event.target;if(!t)return!1;for(var r=t.classList,n=0;n<r.length;++n){if(-1!==r[n].indexOf(this._buttonClass))return!0}return!1},e.prototype.addHTMLTemplate=function(e){var t=this._generateHTMLElement(e),r=e.parent.querySelector("div.default-control");r&&(this._prepend?r.insertBefore(t,r.firstChild):r.appendChild(t))},e.prototype._generateHTMLElement=function(e){var t,r=n.compile(this._htmlTemplate,{noEscape:e.configuration.params&&!!e.configuration.params.noEscape})(e.configuration.params||{});try{t=document.createRange().createContextualFragment(r)}catch(e){var i=document.createElement(this._buttonClass);i.innerHTML=r,t=i}return t},e}();t.AbstractViewerNavbarButton=i},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.viewerManager=t.ViewerManager=void 0;var n=r(0),i=function(){function e(){this._viewers={},this.onViewerAddedObservable=new n.Observable,this.onViewerRemovedObservable=new n.Observable}return e.prototype.addViewer=function(e){this._viewers[e.getBaseId()]=e,this._onViewerAdded(e)},e.prototype.removeViewer=function(e){var t=e.getBaseId();delete this._viewers[t],this.onViewerRemovedObservable.notifyObservers(t)},e.prototype.getViewerById=function(e){return this._viewers[e]},e.prototype.getViewerByHTMLElement=function(e){for(var t in this._viewers)if(this._viewers[t].containerElement===e)return this.getViewerById(t)},e.prototype.getViewerPromiseById=function(e){var t=this;return new Promise((function(r,n){var i=t.getViewerById(e);if(i)return r(i);var o=function(n){n.getBaseId()===e&&(r(n),t.onViewerAddedObservable.removeCallback(o))};t.onViewerAddedObservable.add(o)}))},e.prototype._onViewerAdded=function(e){this.onViewerAdded&&this.onViewerAdded(e),this.onViewerAddedObservable.notifyObservers(e)},e.prototype.dispose=function(){for(var e in delete this._onViewerAdded,this._viewers)this._viewers[e].dispose();this.onViewerAddedObservable.clear(),this.onViewerRemovedObservable.clear()},e}();t.ViewerManager=i,t.viewerManager=new i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultViewer=void 0;var o=r(0),s=r(0),a=r(0),l=r(27),c=r(29),u=r(0),d=r(0),h=r(1),f=r(6),p=r(82),m=r(83),g=function(e){function t(t,r){void 0===r&&(r={extends:"default"});var n=e.call(this,t,r)||this;return n.containerElement=t,n._registeredPlugins=[],n._handlePointerClick=function(e){if(0===e.event.button){var t=e.event.target;if(t){for(var r=t.parentElement.classList,i=t.classList,o="",s=0;s<i.length;++s){var a=i[s];if(-1!==a.indexOf("-button")||-1!==a.indexOf("-wrapper")){o=a;break}}switch(o){case"speed-button":case"types-button":r.contains("open")?r.remove("open"):r.add("open");break;case"play-pause-button":n._togglePlayPause();break;case"label-option-button":var l=t.dataset.value,c=t.querySelector("span.animation-label");c&&l&&n._updateAnimationType({value:l.trim(),label:c.innerHTML});break;case"speed-option-button":if(!n._currentAnimation)return;var u=t.dataset.value;u&&n._updateAnimationSpeed(u);break;case"progress-wrapper":n._resumePlay=!n._isAnimationPaused,n._resumePlay&&n._togglePlayPause(!0);break;case"fullscreen-button":n.toggleFullscreen();break;case"vr-button":n.toggleVR();break;default:return}}}},n._togglePlayPause=function(e){if(n._currentAnimation&&(n._isAnimationPaused?n._currentAnimation.restart():n._currentAnimation.pause(),n._isAnimationPaused=!n._isAnimationPaused,!e)){var t=n.templateManager.getTemplate("navBar");t&&t.updateParams({paused:n._isAnimationPaused})}},n._updateProgressBar=function(){var e=n.templateManager.getTemplate("navBar");if(e){var t=e.parent.querySelector("input.progress-wrapper");if(t&&n._currentAnimation){var r=n._currentAnimation.currentFrame/n._currentAnimation.frames*100,i=t.valueAsNumber;Math.abs(i-r)>.5&&(t.value=""+r),n._currentAnimation.state===f.AnimationState.PLAYING?n.sceneManager.camera.autoRotationBehavior&&!n._oldIdleRotationValue&&(n._oldIdleRotationValue=n.sceneManager.camera.autoRotationBehavior.idleRotationSpeed,n.sceneManager.camera.autoRotationBehavior.idleRotationSpeed=0):n.sceneManager.camera.autoRotationBehavior&&n._oldIdleRotationValue&&(n.sceneManager.camera.autoRotationBehavior.idleRotationSpeed=n._oldIdleRotationValue,n._oldIdleRotationValue=0)}}},n._updateAnimationSpeed=function(e,t){var r=n.templateManager.getTemplate("navBar");r&&e&&n._currentAnimation&&(n._currentAnimation.speedRatio=parseFloat(e),n._isAnimationPaused||n._currentAnimation.restart(),t?t.selectedSpeed=e+"x":r.updateParams({selectedSpeed:e+"x"}))},n._updateAnimationType=function(e,t){var r=n.templateManager.getTemplate("navBar");r&&(e&&(n._currentAnimation=n.sceneManager.models[0].setCurrentAnimationByName(e.value)),t?(t.selectedAnimation=n._animationList.indexOf(e.value)+1,t.selectedAnimationName=e.label):r.updateParams({selectedAnimation:n._animationList.indexOf(e.value)+1,selectedAnimationName:e.label}),n._updateAnimationSpeed("1.0",t))},n.toggleFullscreen=function(){var e=n.templateManager.getTemplate("viewer"),t=e&&e.parent,r=n.fullscreenElement||t;r&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement?((document.exitFullscreen||document.webkitExitFullscreen||document.msExitFullscreen||document.mozCancelFullScreen).call(document),t&&t.classList.remove("in-fullscreen")):((r.requestFullscreen||r.webkitRequestFullscreen||r.msRequestFullscreen||r.mozRequestFullScreen).call(r),t&&t.classList.add("in-fullscreen")))},n._onModelLoaded=function(e){n._configureTemplate(e);var t=20;n.configuration.lab&&void 0!==n.configuration.lab.hideLoadingDelay&&(t=n.configuration.lab.hideLoadingDelay),setTimeout((function(){n.sceneManager.scene.executeWhenReady((function(){n.hideLoadingScreen()}))}),t)},n.onModelLoadedObservable.add(n._onModelLoaded),n.onModelRemovedObservable.add((function(){n._configureTemplate()})),n.onEngineInitObservable.add((function(){n.sceneManager.onLightsConfiguredObservable.add((function(e){n._configureLights()}))})),n.onInitDoneObservable.add((function(){n.sceneManager.setDefaultMaterial=function(e){var t=e.defaultMaterial;t&&(("standard"===t.materialType&&"StandardMaterial"!==this.scene.defaultMaterial.getClassName()||"pbr"===t.materialType&&"PBRMaterial"!==this.scene.defaultMaterial.getClassName())&&(this.scene.defaultMaterial.dispose(),"standard"===t.materialType?this.scene.defaultMaterial=new u.StandardMaterial("defaultMaterial",this.scene):this.scene.defaultMaterial=new d.PBRMaterial("defaultMaterial",this.scene)),h.extendClassWithConfig(this.scene.defaultMaterial,t))},n.sceneManager.models.length||n.hideLoadingScreen()})),n}return i(t,e),t.prototype.registerTemplatePlugin=function(e){var t=this;if(!e.templateName)throw new Error("No template name provided");this._registeredPlugins.push(e);var r=this.templateManager.getTemplate(e.templateName);if(!r)throw new Error("Template "+e.templateName+" not found");e.addHTMLTemplate&&(r.onHTMLRendered.add((function(t){e.addHTMLTemplate(t)})),r.redraw()),e.eventsToAttach&&e.eventsToAttach.forEach((function(r){e.onEvent&&t.templateManager.eventManager.registerCallback(e.templateName,(function(t){e.onEvent&&e.interactionPredicate(t)&&e.onEvent(t)}),r)}))},t.prototype._onTemplatesLoaded=function(){var t=this;this.showLoadingScreen(),this._initNavbar();var r=this.templateManager.getTemplate("overlay");if(r){var n=r.parent.querySelector(".close-button");n&&n.addEventListener("pointerdown",(function(){t.hideOverlayScreen()}))}return this.configuration.templates&&this.configuration.templates.viewer&&this.configuration.templates.viewer.params&&this.configuration.templates.viewer.params.enableDragAndDrop&&this.onSceneInitObservable.addOnce((function(){new o.FilesInput(t.engine,t.sceneManager.scene,(function(){}),(function(){}),(function(){}),(function(){}),(function(){}),(function(e){t.loadModel(e)}),(function(){})).monitorElementForDragNDrop(t.templateManager.getCanvas())})),e.prototype._onTemplatesLoaded.call(this)},t.prototype._initNavbar=function(){var e=this,t=this.templateManager.getTemplate("navBar");t&&(this.onFrameRenderedObservable.add(this._updateProgressBar),this.templateManager.eventManager.registerCallback("navBar",this._handlePointerClick,"click"),this.templateManager.eventManager.registerCallback("navBar",(function(){}),"pointerdown",".help-button"),this.templateManager.eventManager.registerCallback("navBar",(function(t){var r=t.event.target;if(e._currentAnimation){var n=+r.value/100*e._currentAnimation.frames;isNaN(n)||e._currentAnimation.goToFrame(n)}}),"input"),this.templateManager.eventManager.registerCallback("navBar",(function(){e._resumePlay&&e._togglePlayPause(!0),e._resumePlay=!1}),"pointerup",".progress-wrapper"),1===window.devicePixelRatio&&t.configuration.params&&!t.configuration.params.hideHdButton&&t.updateParams({hideHdButton:!0}),this.registerTemplatePlugin(new p.HDButtonPlugin(this)),this.registerTemplatePlugin(new m.PrintButtonPlugin(this)))},t.prototype._initVR=function(){var t=this;this.engine.onVRDisplayChangedObservable.add((function(){var e=t.templateManager.getTemplate("viewer"),r=e&&e.parent;r&&(t.sceneManager.vrHelper.isInVRMode?r.classList.add("in-vr"):r.classList.remove("in-vr"))})),this.sceneManager.vrHelper&&this.sceneManager.vrHelper.onExitingVR.add((function(){var e=t.templateManager.getTemplate("viewer"),r=e&&e.parent;r&&r.classList.remove("in-vr")})),e.prototype._initVR.call(this)},t.prototype._prepareContainerElement=function(){var e=this.containerElement;e.style&&(e.style.position="relative",e.style.height="100%",e.style.display="flex")},t.prototype._configureTemplate=function(e){var t=this.templateManager.getTemplate("navBar");if(t){var r=t.configuration.params||{};if(e){var n=e.getAnimationNames();if(r.animations=n.map((function(e){return{label:e,value:e}})),n.length){this._isAnimationPaused=e.configuration.animation&&!e.configuration.animation.autoStart||!e.configuration.animation,this._animationList=n,r.paused=this._isAnimationPaused;var i=0;e.configuration.animation&&"string"==typeof e.configuration.animation.autoStart&&-1===(i=n.indexOf(e.configuration.animation.autoStart))&&(i=0),this._updateAnimationType(r.animations[i],r)}else r.animations=null;e.configuration.thumbnail&&(r.logoImage=e.configuration.thumbnail)}else r.animations=null;t.updateParams(r,!1)}},t.prototype.loadModel=function(t){var r=this;return t||(t=this.configuration.model),this.showLoadingScreen(),e.prototype.loadModel.call(this,t,!0).catch((function(e){return console.log(e),r.hideLoadingScreen(),r.showOverlayScreen("error"),Promise.reject(e)}))},t.prototype.showOverlayScreen=function(e){var t=this,r=this.templateManager.getTemplate("overlay");return r?r.show((function(r){var n=t.containerElement.getBoundingClientRect();r.parent.style.display="flex",r.parent.style.width=n.width+"px",r.parent.style.height=n.height+"px",r.parent.style.opacity="1";var i=t.templateManager.getTemplate(e);return i?i.show((function(e){return e.parent.style.display="flex",Promise.resolve(e)})):Promise.reject(e+" template not found")})):Promise.resolve("Overlay template not found")},t.prototype.hideOverlayScreen=function(){var e=this.templateManager.getTemplate("overlay");return e?e.hide((function(e){e.parent.style.opacity="0";var t=function(){e.parent.removeEventListener("transitionend",t),e.parent.style.display="none"};e.parent.addEventListener("transitionend",t);var r=e.parent.querySelectorAll(".overlay");if(r)for(var n=0;n<r.length;++n){r.item(n).style.display="none"}return Promise.resolve(e)})):Promise.resolve("Overlay template not found")},t.prototype.show=function(e){var t=this.templateManager.getTemplate("main");return t?t.show(e):Promise.reject("Main template not found")},t.prototype.hide=function(e){var t=this.templateManager.getTemplate("main");return t?t.hide(e):Promise.reject("Main template not found")},t.prototype.showLoadingScreen=function(){var e=this,t=this.templateManager.getTemplate("loadingScreen");return t?t.show((function(t){var r=e.containerElement.getBoundingClientRect();t.parent.style.display="flex",t.parent.style.width=r.width+"px",t.parent.style.height=r.height+"px",t.parent.style.opacity="1";var n="black";return e.configuration.templates&&e.configuration.templates.loadingScreen&&(n=e.configuration.templates.loadingScreen.params&&e.configuration.templates.loadingScreen.params.backgroundColor||n),t.parent.style.backgroundColor=n,Promise.resolve(t)})):Promise.resolve("Loading Screen template not found")},t.prototype.hideLoadingScreen=function(){var e=this.templateManager.getTemplate("loadingScreen");return e?e.hide((function(e){e.parent.style.opacity="0";var t=function(){e.parent.removeEventListener("transitionend",t),e.parent.style.display="none"};return e.parent.addEventListener("transitionend",t),Promise.resolve(e)})):Promise.resolve("Loading Screen template not found")},t.prototype.dispose=function(){this.templateManager.dispose(),e.prototype.dispose.call(this)},t.prototype._onConfigurationLoaded=function(t){var r=this;e.prototype._onConfigurationLoaded.call(this,t),this.templateManager=new l.TemplateManager(this.containerElement);var n=this.configuration.templates||{};this.templateManager.initTemplate(n),this.templateManager.onAllLoaded.add((function(){var e=r.templateManager.getCanvas();e&&(r._canvas=e),r._onTemplateLoaded()}))},t.prototype._configureLights=function(){var e=this;if(this.configuration.lab&&this.configuration.lab.flashlight){var t,r=.5,n=Math.PI/2;"object"==typeof this.configuration.lab.flashlight&&(n=this.configuration.lab.flashlight.exponent||n,r=this.configuration.lab.flashlight.angle||r);var i=new s.SpotLight("flashlight",a.Vector3.Zero(),a.Vector3.Zero(),n,r,this.sceneManager.scene);"object"==typeof this.configuration.lab.flashlight&&(i.intensity=this.configuration.lab.flashlight.intensity||i.intensity,this.configuration.lab.flashlight.diffuse&&(i.diffuse.r=this.configuration.lab.flashlight.diffuse.r,i.diffuse.g=this.configuration.lab.flashlight.diffuse.g,i.diffuse.b=this.configuration.lab.flashlight.diffuse.b),this.configuration.lab.flashlight.specular&&(i.specular.r=this.configuration.lab.flashlight.specular.r,i.specular.g=this.configuration.lab.flashlight.specular.g,i.specular.b=this.configuration.lab.flashlight.specular.b)),this.sceneManager.scene.constantlyUpdateMeshUnderPointer=!0,this.sceneManager.scene.onPointerObservable.add((function(e){t=4===e.type&&e.pickInfo?e.pickInfo.pickedPoint:void 0}));var o=function(){e.sceneManager.camera&&i&&(i.position.copyFrom(e.sceneManager.camera.position),t&&t.subtractToRef(i.position,i.direction))};this.sceneManager.scene.registerBeforeRender(o),this._registeredOnBeforeRenderFunctions.push(o)}},t}(c.AbstractViewerWithTemplate);t.DefaultViewer=g},function(e,t,r){
- /**!
- @license
- handlebars v4.5.1
- Copyright (C) 2011-2017 by Yehuda Katz
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- */
- var n;n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=n(r(2)),o=n(r(35)),s=r(36),a=r(41),l=n(r(42)),c=n(r(39)),u=n(r(34)),d=i.default.create;function h(){var e=d();return e.compile=function(t,r){return a.compile(t,r,e)},e.precompile=function(t,r){return a.precompile(t,r,e)},e.AST=o.default,e.Compiler=a.Compiler,e.JavaScriptCompiler=l.default,e.Parser=s.parser,e.parse=s.parse,e.parseWithoutProcessing=s.parseWithoutProcessing,e}var f=h();f.create=h,u.default(f),f.Visitor=c.default,f.default=f,t.default=f,e.exports=t.default},function(e,t){"use strict";t.default=function(e){return e&&e.__esModule?e:{default:e}},t.__esModule=!0},function(e,t,r){"use strict";var n=r(3).default,i=r(1).default;t.__esModule=!0;var o=n(r(4)),s=i(r(21)),a=i(r(6)),l=n(r(5)),c=n(r(22)),u=i(r(34));function d(){var e=new o.HandlebarsEnvironment;return l.extend(e,o),e.SafeString=s.default,e.Exception=a.default,e.Utils=l,e.escapeExpression=l.escapeExpression,e.VM=c,e.template=function(t){return c.template(t,e)},e}var h=d();h.create=d,u.default(h),h.default=h,t.default=h,e.exports=t.default},function(e,t){"use strict";t.default=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},t.__esModule=!0},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0,t.HandlebarsEnvironment=c;var i=r(5),o=n(r(6)),s=r(10),a=r(18),l=n(r(20));function c(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},s.registerDefaultHelpers(this),a.registerDefaultDecorators(this)}t.VERSION="4.5.1",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"},c.prototype={constructor:c,logger:l.default,log:l.default.log,registerHelper:function(e,t){if("[object Object]"===i.toString.call(e)){if(t)throw new o.default("Arg not supported with multiple helpers");i.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===i.toString.call(e))i.extend(this.partials,e);else{if(void 0===t)throw new o.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===i.toString.call(e)){if(t)throw new o.default("Arg not supported with multiple decorators");i.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var u=l.default.log;t.log=u,t.createFrame=i.createFrame,t.logger=l.default},function(e,t){"use strict";t.__esModule=!0,t.extend=s,t.indexOf=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}return i.test(e)?e.replace(n,o):e},t.isEmpty=function(e){return!e&&0!==e||!(!c(e)||0!==e.length)},t.createFrame=function(e){var t=s({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var r={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},n=/[&<>"'`=]/g,i=/[&<>"'`=]/;function o(e){return r[e]}function s(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}var a=Object.prototype.toString;t.toString=a;var l=function(e){return"function"==typeof e};l(/x/)&&(t.isFunction=l=function(e){return"function"==typeof e&&"[object Function]"===a.call(e)}),t.isFunction=l;var c=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===a.call(e)};t.isArray=c},function(e,t,r){"use strict";var n=r(7).default;t.__esModule=!0;var i=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function o(e,t){var r=t&&t.loc,s=void 0,a=void 0,l=void 0,c=void 0;r&&(s=r.start.line,a=r.end.line,l=r.start.column,c=r.end.column,e+=" - "+s+":"+l);for(var u=Error.prototype.constructor.call(this,e),d=0;d<i.length;d++)this[i[d]]=u[i[d]];Error.captureStackTrace&&Error.captureStackTrace(this,o);try{r&&(this.lineNumber=s,this.endLineNumber=a,n?(Object.defineProperty(this,"column",{value:l,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=l,this.endColumn=c))}catch(e){}}o.prototype=new Error,t.default=o,e.exports=t.default},function(e,t,r){e.exports={default:r(8),__esModule:!0}},function(e,t,r){var n=r(9);e.exports=function(e,t,r){return n.setDesc(e,t,r)}},function(e,t){var r=Object;e.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0,t.registerDefaultHelpers=function(e){i.default(e),o.default(e),s.default(e),a.default(e),l.default(e),c.default(e),u.default(e)},t.moveHelperToHooks=function(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])};var i=n(r(11)),o=n(r(12)),s=n(r(13)),a=n(r(14)),l=n(r(15)),c=n(r(16)),u=n(r(17))},function(e,t,r){"use strict";t.__esModule=!0;var n=r(5);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,r){var i=r.inverse,o=r.fn;if(!0===t)return o(this);if(!1===t||null==t)return i(this);if(n.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):i(this);if(r.data&&r.ids){var s=n.createFrame(r.data);s.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:s}}return o(t,r)}))},e.exports=t.default},function(e,t,r){(function(n){"use strict";var i=r(1).default;t.__esModule=!0;var o=r(5),s=i(r(6));t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new s.default("Must pass iterator to #each");var r=t.fn,i=t.inverse,a=0,l="",c=void 0,u=void 0;function d(t,n,i){c&&(c.key=t,c.index=n,c.first=0===n,c.last=!!i,u&&(c.contextPath=u+t)),l+=r(e[t],{data:c,blockParams:o.blockParams([e[t],t],[u+t,null])})}if(t.data&&t.ids&&(u=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(c=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var h=e.length;a<h;a++)a in e&&d(a,a,a===e.length-1);else if(n.Symbol&&e[n.Symbol.iterator]){for(var f=[],p=e[n.Symbol.iterator](),m=p.next();!m.done;m=p.next())f.push(m.value);for(h=(e=f).length;a<h;a++)d(a,a,a===e.length-1)}else{var g=void 0;for(var _ in e)e.hasOwnProperty(_)&&(void 0!==g&&d(g,a-1),g=_,a++);void 0!==g&&d(g,a-1,!0)}return 0===a&&(l=i(this)),l}))},e.exports=t.default}).call(t,function(){return this}())},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=n(r(6));t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=r(5),o=n(r(6));t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new o.default("#if requires exactly one argument");return i.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||i.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,r){if(2!=arguments.length)throw new o.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})}))},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var i=1;null!=r.hash.level?i=r.hash.level:r.data&&null!=r.data.level&&(i=r.data.level),t[0]=i,e.log.apply(e,t)}))},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t){return e?"constructor"!==t||e.propertyIsEnumerable(t)?e[t]:void 0:e}))},e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=r(5),o=n(r(6));t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new o.default("#with requires exactly one argument");i.isFunction(e)&&(e=e.call(this));var r=t.fn;if(i.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=i.createFrame(t.data)).contextPath=i.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:i.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0,t.registerDefaultDecorators=function(e){i.default(e)};var i=n(r(19))},function(e,t,r){"use strict";t.__esModule=!0;var n=r(5);t.default=function(e){e.registerDecorator("inline",(function(e,t,r,i){var o=e;return t.partials||(t.partials={},o=function(i,o){var s=r.partials;r.partials=n.extend({},s,t.partials);var a=e(i,o);return r.partials=s,a}),t.partials[i.args[0]]=i.fn,o}))},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(5),i={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(i.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=i.lookupLevel(e),"undefined"!=typeof console&&i.lookupLevel(i.level)<=e){var t=i.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];console[t].apply(console,n)}}};t.default=i,e.exports=t.default},function(e,t){"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},function(e,t,r){"use strict";var n=r(23).default,i=r(3).default,o=r(1).default;t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,r=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t<l.LAST_COMPATIBLE_COMPILER_REVISION){var n=l.REVISION_CHANGES[r],i=l.REVISION_CHANGES[t];throw new a.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+i+").")}throw new a.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}},t.template=function(e,t){if(!t)throw new a.default("No environment passed to template");if(!e||!e.main)throw new a.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var r=e.compiler&&7===e.compiler[0],i={strict:function(e,t,r){if(!e||!(t in e))throw new a.default('"'+t+'" not defined in '+e,{loc:r});return e[t]},lookup:function(e,t){for(var r=e.length,n=0;n<r;n++)if(e[n]&&null!=e[n][t])return e[n][t]},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:s.escapeExpression,invokePartial:function(r,n,i){i.hash&&(n=s.extend({},n,i.hash),i.ids&&(i.ids[0]=!0)),r=t.VM.resolvePartial.call(this,r,n,i);var o=s.extend({},i,{hooks:this.hooks}),l=t.VM.invokePartial.call(this,r,n,o);if(null==l&&t.compile&&(i.partials[i.name]=t.compile(r,e.compilerOptions,t),l=i.partials[i.name](n,o)),null!=l){if(i.indent){for(var c=l.split("\n"),u=0,d=c.length;u<d&&(c[u]||u+1!==d);u++)c[u]=i.indent+c[u];l=c.join("\n")}return l}throw new a.default("The partial "+i.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var r=e[t];return r.decorator=e[t+"_d"],r},programs:[],program:function(e,t,r,n,i){var o=this.programs[e],s=this.fn(e);return t||i||n||r?o=u(this,e,s,t,r,n,i):o||(o=this.programs[e]=u(this,e,s)),o},data:function(e,t){for(;e&&t--;)e=e._parent;return e},nullContext:n({}),noop:t.VM.noop,compilerInfo:e.compiler};function o(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=r.data;o._setup(r),!r.partial&&e.useData&&(n=h(t,n));var s=void 0,a=e.useBlockParams?[]:void 0;function l(t){return""+e.main(i,t,i.helpers,i.partials,n,a,s)}return e.useDepths&&(s=r.depths?t!=r.depths[0]?[t].concat(r.depths):r.depths:[t]),(l=f(e.main,l,i,r.depths||[],n,a))(t,r)}return o.isTop=!0,o._setup=function(n){if(n.partial)i.helpers=n.helpers,i.partials=n.partials,i.decorators=n.decorators,i.hooks=n.hooks;else{i.helpers=s.extend({},t.helpers,n.helpers),e.usePartial&&(i.partials=s.extend({},t.partials,n.partials)),(e.usePartial||e.useDecorators)&&(i.decorators=s.extend({},t.decorators,n.decorators)),i.hooks={};var o=n.allowCallsToHelperMissing||r;c.moveHelperToHooks(i,"helperMissing",o),c.moveHelperToHooks(i,"blockHelperMissing",o)}},o._child=function(t,r,n,o){if(e.useBlockParams&&!n)throw new a.default("must pass block params");if(e.useDepths&&!o)throw new a.default("must pass parent depths");return u(i,t,e[t],r,0,n,o)},o},t.wrapProgram=u,t.resolvePartial=function(e,t,r){return e?e.call||r.name||(r.name=e,e=r.partials[e]):e="@partial-block"===r.name?r.data["partial-block"]:r.partials[r.name],e},t.invokePartial=function(e,t,r){var n=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var i=void 0;if(r.fn&&r.fn!==d&&function(){r.data=l.createFrame(r.data);var e=r.fn;i=r.data["partial-block"]=function(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return r.data=l.createFrame(r.data),r.data["partial-block"]=n,e(t,r)},e.partials&&(r.partials=s.extend({},r.partials,e.partials))}(),void 0===e&&i&&(e=i),void 0===e)throw new a.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)},t.noop=d;var s=i(r(5)),a=o(r(6)),l=r(4),c=r(10);function u(e,t,r,n,i,o,s){function a(t){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=s;return!s||t==s[0]||t===e.nullContext&&null===s[0]||(a=[t].concat(s)),r(e,t,e.helpers,e.partials,i.data||n,o&&[i.blockParams].concat(o),a)}return(a=f(r,a,e,s,n,o)).program=t,a.depth=s?s.length:0,a.blockParams=i||0,a}function d(){return""}function h(e,t){return t&&"root"in t||((t=t?l.createFrame(t):{}).root=e),t}function f(e,t,r,n,i,o){if(e.decorator){var a={};t=e.decorator(t,a,r,n&&n[0],i,o,n),s.extend(t,a)}return t}},function(e,t,r){e.exports={default:r(24),__esModule:!0}},function(e,t,r){r(25),e.exports=r(30).Object.seal},function(e,t,r){var n=r(26);r(27)("seal",(function(e){return function(t){return e&&n(t)?e(t):t}}))},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(28),i=r(30),o=r(33);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],s={};s[e]=t(r),n(n.S+n.F*o((function(){r(1)})),"Object",s)}},function(e,t,r){var n=r(29),i=r(30),o=r(31),s=function(e,t,r){var a,l,c,u=e&s.F,d=e&s.G,h=e&s.S,f=e&s.P,p=e&s.B,m=e&s.W,g=d?i:i[t]||(i[t]={}),_=d?n:h?n[t]:(n[t]||{}).prototype;for(a in d&&(r=t),r)(l=!u&&_&&a in _)&&a in g||(c=l?_[a]:r[a],g[a]=d&&"function"!=typeof _[a]?r[a]:p&&l?o(c,n):m&&_[a]==c?function(e){var t=function(t){return this instanceof e?new e(t):e(t)};return t.prototype=e.prototype,t}(c):f&&"function"==typeof c?o(Function.call,c):c,f&&((g.prototype||(g.prototype={}))[a]=c))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,e.exports=s},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){var r=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(32);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){(function(r){"use strict";t.__esModule=!0,t.default=function(e){var t=void 0!==r?r:window,n=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=n),e}},e.exports=t.default}).call(t,function(){return this}())},function(e,t){"use strict";t.__esModule=!0;var r={helpers:{helperExpression:function(e){return"SubExpression"===e.type||("MustacheStatement"===e.type||"BlockStatement"===e.type)&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return 1===e.parts.length&&!r.helpers.scopedId(e)&&!e.depth}}};t.default=r,e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default,i=r(3).default;t.__esModule=!0,t.parseWithoutProcessing=u,t.parse=function(e,t){var r=u(e,t);return new s.default(t).accept(r)};var o=n(r(37)),s=n(r(38)),a=i(r(40)),l=r(5);t.parser=o.default;var c={};function u(e,t){return"Program"===e.type?e:(o.default.yy=c,c.locInfo=function(e){return new c.SourceLocation(t&&t.srcName,e)},o.default.parse(e))}l.extend(c,a)},function(e,t){"use strict";t.__esModule=!0;var r=function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(e,t,r,n,i,o,s){var a=o.length-1;switch(i){case 1:return o[a-1];case 2:this.$=n.prepareProgram(o[a]);break;case 3:case 4:case 5:case 6:case 7:case 8:this.$=o[a];break;case 9:this.$={type:"CommentStatement",value:n.stripComment(o[a]),strip:n.stripFlags(o[a],o[a]),loc:n.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:o[a],value:o[a],loc:n.locInfo(this._$)};break;case 11:this.$=n.prepareRawBlock(o[a-2],o[a-1],o[a],this._$);break;case 12:this.$={path:o[a-3],params:o[a-2],hash:o[a-1]};break;case 13:this.$=n.prepareBlock(o[a-3],o[a-2],o[a-1],o[a],!1,this._$);break;case 14:this.$=n.prepareBlock(o[a-3],o[a-2],o[a-1],o[a],!0,this._$);break;case 15:this.$={open:o[a-5],path:o[a-4],params:o[a-3],hash:o[a-2],blockParams:o[a-1],strip:n.stripFlags(o[a-5],o[a])};break;case 16:case 17:this.$={path:o[a-4],params:o[a-3],hash:o[a-2],blockParams:o[a-1],strip:n.stripFlags(o[a-5],o[a])};break;case 18:this.$={strip:n.stripFlags(o[a-1],o[a-1]),program:o[a]};break;case 19:var l=n.prepareBlock(o[a-2],o[a-1],o[a],o[a],!1,this._$),c=n.prepareProgram([l],o[a-1].loc);c.chained=!0,this.$={strip:o[a-2].strip,program:c,chain:!0};break;case 20:this.$=o[a];break;case 21:this.$={path:o[a-1],strip:n.stripFlags(o[a-2],o[a])};break;case 22:case 23:this.$=n.prepareMustache(o[a-3],o[a-2],o[a-1],o[a-4],n.stripFlags(o[a-4],o[a]),this._$);break;case 24:this.$={type:"PartialStatement",name:o[a-3],params:o[a-2],hash:o[a-1],indent:"",strip:n.stripFlags(o[a-4],o[a]),loc:n.locInfo(this._$)};break;case 25:this.$=n.preparePartialBlock(o[a-2],o[a-1],o[a],this._$);break;case 26:this.$={path:o[a-3],params:o[a-2],hash:o[a-1],strip:n.stripFlags(o[a-4],o[a])};break;case 27:case 28:this.$=o[a];break;case 29:this.$={type:"SubExpression",path:o[a-3],params:o[a-2],hash:o[a-1],loc:n.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:o[a],loc:n.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:n.id(o[a-2]),value:o[a],loc:n.locInfo(this._$)};break;case 32:this.$=n.id(o[a-1]);break;case 33:case 34:this.$=o[a];break;case 35:this.$={type:"StringLiteral",value:o[a],original:o[a],loc:n.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(o[a]),original:Number(o[a]),loc:n.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===o[a],original:"true"===o[a],loc:n.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:n.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:n.locInfo(this._$)};break;case 40:case 41:this.$=o[a];break;case 42:this.$=n.preparePath(!0,o[a],this._$);break;case 43:this.$=n.preparePath(!1,o[a],this._$);break;case 44:o[a-2].push({part:n.id(o[a]),original:o[a],separator:o[a-1]}),this.$=o[a-2];break;case 45:this.$=[{part:n.id(o[a]),original:o[a]}];break;case 46:this.$=[];break;case 47:o[a-1].push(o[a]);break;case 48:this.$=[];break;case 49:o[a-1].push(o[a]);break;case 50:this.$=[];break;case 51:o[a-1].push(o[a]);break;case 58:this.$=[];break;case 59:o[a-1].push(o[a]);break;case 64:this.$=[];break;case 65:o[a-1].push(o[a]);break;case 70:this.$=[];break;case 71:o[a-1].push(o[a]);break;case 78:this.$=[];break;case 79:o[a-1].push(o[a]);break;case 82:this.$=[];break;case 83:o[a-1].push(o[a]);break;case 86:this.$=[];break;case 87:o[a-1].push(o[a]);break;case 90:this.$=[];break;case 91:o[a-1].push(o[a]);break;case 94:this.$=[];break;case 95:o[a-1].push(o[a]);break;case 98:this.$=[o[a]];break;case 99:o[a-1].push(o[a]);break;case 100:this.$=[o[a]];break;case 101:o[a-1].push(o[a])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,r=[0],n=[null],i=[],o=this.table,s="",a=0,l=0,c=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;i.push(u);var d=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var h,f,p,m,g,_,v,y,b,A,T={};;){if(p=r[r.length-1],this.defaultActions[p]?m=this.defaultActions[p]:(null==h&&(A=void 0,"number"!=typeof(A=t.lexer.lex()||1)&&(A=t.symbols_[A]||A),h=A),m=o[p]&&o[p][h]),void 0===m||!m.length||!m[0]){var M="";if(!c){for(_ in b=[],o[p])this.terminals_[_]&&_>2&&b.push("'"+this.terminals_[_]+"'");M=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[h]||h)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(M,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:u,expected:b})}}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+h);switch(m[0]){case 1:r.push(h),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),r.push(m[1]),h=null,f?(h=f,f=null):(l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,c>0&&c--);break;case 2:if(v=this.productions_[m[1]][1],T.$=n[n.length-v],T._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},d&&(T._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(g=this.performAction.call(T,s,l,a,this.yy,m[1],n,i)))return g;v&&(r=r.slice(0,-1*v*2),n=n.slice(0,-1*v),i=i.slice(0,-1*v)),r.push(this.productions_[m[1]][0]),n.push(T.$),i.push(T._$),y=o[r[r.length-2]][r[r.length-1]],r.push(y);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,r,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),s=0;s<o.length&&(!(r=this._input.match(this.rules[o[s]]))||t&&!(r[0].length>t[0].length)||(t=r,n=s,this.options.flex));s++);return t?((i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,r,n){function i(e,r){return t.yytext=t.yytext.substring(e,t.yyleng-r+e)}switch(r){case 0:if("\\\\"===t.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(t.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return t.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return t.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return t.yytext=t.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return e}();function r(){this.yy={}}return e.lexer=t,r.prototype=e,e.Parser=r,new r}();t.default=r,e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=n(r(39));function o(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=e}function s(e,t,r){void 0===t&&(t=e.length);var n=e[t-1],i=e[t-2];return n?"ContentStatement"===n.type?(i||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original):void 0:r}function a(e,t,r){void 0===t&&(t=-1);var n=e[t+1],i=e[t+2];return n?"ContentStatement"===n.type?(i||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original):void 0:r}function l(e,t,r){var n=e[null==t?0:t+1];if(n&&"ContentStatement"===n.type&&(r||!n.rightStripped)){var i=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==i}}function c(e,t,r){var n=e[null==t?e.length-1:t-1];if(n&&"ContentStatement"===n.type&&(r||!n.leftStripped)){var i=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==i,n.leftStripped}}o.prototype=new i.default,o.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,i=0,o=n.length;i<o;i++){var u=n[i],d=this.accept(u);if(d){var h=s(n,i,r),f=a(n,i,r),p=d.openStandalone&&h,m=d.closeStandalone&&f,g=d.inlineStandalone&&h&&f;d.close&&l(n,i,!0),d.open&&c(n,i,!0),t&&g&&(l(n,i),c(n,i)&&"PartialStatement"===u.type&&(u.indent=/([ \t]+$)/.exec(n[i-1].original)[1])),t&&p&&(l((u.program||u.inverse).body),c(n,i)),t&&m&&(l(n,i),c((u.inverse||u.program).body))}}return e},o.prototype.BlockStatement=o.prototype.DecoratorBlock=o.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,i=r;if(r&&r.chained)for(n=r.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var o={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:a(t.body),closeStandalone:s((n||t).body)};if(e.openStrip.close&&l(t.body,null,!0),r){var u=e.inverseStrip;u.open&&c(t.body,null,!0),u.close&&l(n.body,null,!0),e.closeStrip.open&&c(i.body,null,!0),!this.options.ignoreStandalone&&s(t.body)&&a(n.body)&&(c(t.body),l(n.body))}else e.closeStrip.open&&c(t.body,null,!0);return o},o.prototype.Decorator=o.prototype.MustacheStatement=function(e){return e.strip},o.prototype.PartialStatement=o.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}},t.default=o,e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=n(r(6));function o(){this.parents=[]}function s(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function a(e){s.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function l(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}o.prototype={constructor:o,mutating:!1,acceptKey:function(e,t){var r=this.accept(e[t]);if(this.mutating){if(r&&!o.prototype[r.type])throw new i.default('Unexpected node type "'+r.type+'" found when accepting '+t+" on "+e.type);e[t]=r}},acceptRequired:function(e,t){if(this.acceptKey(e,t),!e[t])throw new i.default(e.type+" requires "+t)},acceptArray:function(e){for(var t=0,r=e.length;t<r;t++)this.acceptKey(e,t),e[t]||(e.splice(t,1),t--,r--)},accept:function(e){if(e){if(!this[e.type])throw new i.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var t=this[e.type](e);return this.current=this.parents.shift(),!this.mutating||t?t:!1!==t?e:void 0}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:s,Decorator:s,BlockStatement:a,DecoratorBlock:a,PartialStatement:l,PartialBlockStatement:function(e){l.call(this,e),this.acceptKey(e,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:s,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,"value")}},t.default=o,e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0,t.SourceLocation=function(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}},t.id=function(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e},t.stripFlags=function(e,t){return{open:"~"===e.charAt(2),close:"~"===t.charAt(t.length-3)}},t.stripComment=function(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},t.preparePath=function(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",o=[],s=0,a=0,l=t.length;a<l;a++){var c=t[a].part,u=t[a].original!==c;if(n+=(t[a].separator||"")+c,u||".."!==c&&"."!==c&&"this"!==c)o.push(c);else{if(o.length>0)throw new i.default("Invalid path: "+n,{loc:r});".."===c&&s++}}return{type:"PathExpression",data:e,depth:s,parts:o,original:n,loc:r}},t.prepareMustache=function(e,t,r,n,i,o){var s=n.charAt(3)||n.charAt(2),a="{"!==s&&"&"!==s;return{type:/\*/.test(n)?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:a,strip:i,loc:this.locInfo(o)}},t.prepareRawBlock=function(e,t,r,n){o(e,r),n=this.locInfo(n);var i={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}},t.prepareBlock=function(e,t,r,n,s,a){n&&n.path&&o(e,n);var l=/\*/.test(e.open);t.blockParams=e.blockParams;var c=void 0,u=void 0;if(r){if(l)throw new i.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),u=r.strip,c=r.program}return s&&(s=c,c=t,t=s),{type:l?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:c,openStrip:e.strip,inverseStrip:u,closeStrip:n&&n.strip,loc:this.locInfo(a)}},t.prepareProgram=function(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}},t.preparePartialBlock=function(e,t,r,n){return o(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}};var i=n(r(6));function o(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new i.default(e.path.original+" doesn't match "+t,r)}}},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0,t.Compiler=l,t.precompile=function(e,t,r){if(null==e||"string"!=typeof e&&"Program"!==e.type)throw new i.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);"data"in(t=t||{})||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),o=(new r.Compiler).compile(n,t);return(new r.JavaScriptCompiler).compile(o,t)},t.compile=function(e,t,r){if(void 0===t&&(t={}),null==e||"string"!=typeof e&&"Program"!==e.type)throw new i.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);"data"in(t=o.extend({},t))||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function s(){var n=r.parse(e,t),i=(new r.Compiler).compile(n,t),o=(new r.JavaScriptCompiler).compile(i,t,void 0,!0);return r.template(o)}function a(e,t){return n||(n=s()),n.call(this,e,t)}return a._setup=function(e){return n||(n=s()),n._setup(e)},a._child=function(e,t,r,i){return n||(n=s()),n._child(e,t,r,i)},a};var i=n(r(6)),o=r(5),s=n(r(35)),a=[].slice;function l(){}function c(e,t){if(e===t)return!0;if(o.isArray(e)&&o.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!c(e[r],t[r]))return!1;return!0}}function u(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}l.prototype={compiler:l,equals:function(e){var t=this.opcodes.length;if(e.opcodes.length!==t)return!1;for(var r=0;r<t;r++){var n=this.opcodes[r],i=e.opcodes[r];if(n.opcode!==i.opcode||!c(n.args,i.args))return!1}for(t=this.children.length,r=0;r<t;r++)if(!this.children[r].equals(e.children[r]))return!1;return!0},guid:0,compile:function(e,t){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=t,this.stringParams=t.stringParams,this.trackIds=t.trackIds,t.blockParams=t.blockParams||[];var r=t.knownHelpers;if(t.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r)for(var n in r)this.options.knownHelpers[n]=r[n];return this.accept(e)},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),r=this.guid++;return this.usePartial=this.usePartial||t.usePartial,this.children[r]=t,this.useDepths=this.useDepths||t.useDepths,r},accept:function(e){if(!this[e.type])throw new i.default("Unknown type: "+e.type,e);this.sourceNode.unshift(e);var t=this[e.type](e);return this.sourceNode.shift(),t},Program:function(e){this.options.blockParams.unshift(e.blockParams);for(var t=e.body,r=t.length,n=0;n<r;n++)this.accept(t[n]);return this.options.blockParams.shift(),this.isSimple=1===r,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){u(e);var t=e.program,r=e.inverse;t=t&&this.compileProgram(t),r=r&&this.compileProgram(r);var n=this.classifySexpr(e);"helper"===n?this.helperSexpr(e,t,r):"simple"===n?(this.simpleSexpr(e),this.opcode("pushProgram",t),this.opcode("pushProgram",r),this.opcode("emptyHash"),this.opcode("blockValue",e.path.original)):(this.ambiguousSexpr(e,t,r),this.opcode("pushProgram",t),this.opcode("pushProgram",r),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(e){var t=e.program&&this.compileProgram(e.program),r=this.setupFullMustacheParams(e,t,void 0),n=e.path;this.useDecorators=!0,this.opcode("registerDecorator",r.length,n.original)},PartialStatement:function(e){this.usePartial=!0;var t=e.program;t&&(t=this.compileProgram(e.program));var r=e.params;if(r.length>1)throw new i.default("Unsupported number of partial arguments: "+r.length,e);r.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):r.push({type:"PathExpression",parts:[],depth:0}));var n=e.name.original,o="SubExpression"===e.name.type;o&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var s=e.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",o,n,s),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){u(e);var t=this.classifySexpr(e);"simple"===t?this.simpleSexpr(e):"helper"===t?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,r){var n=e.path,i=n.parts[0],o=null!=t||null!=r;this.opcode("getContext",n.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",r),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",i,o)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,t,r){var n=this.setupFullMustacheParams(e,t,r),o=e.path,a=o.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",n.length,a);else{if(this.options.knownHelpersOnly)throw new i.default("You specified knownHelpersOnly, but used the unknown helper "+a,e);o.strict=!0,o.falsy=!0,this.accept(o),this.opcode("invokeHelper",n.length,o.original,s.default.helpers.simpleId(o))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var t=e.parts[0],r=s.default.helpers.scopedId(e),n=!e.depth&&!r&&this.blockParamIndex(t);n?this.opcode("lookupBlockParam",n,e.parts):t?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,r):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var t=e.pairs,r=0,n=t.length;for(this.opcode("pushHash");r<n;r++)this.pushParam(t[r].value);for(;r--;)this.opcode("assignToHash",t[r].key);this.opcode("popHash")},opcode:function(e){this.opcodes.push({opcode:e,args:a.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){var t=s.default.helpers.simpleId(e.path),r=t&&!!this.blockParamIndex(e.path.parts[0]),n=!r&&s.default.helpers.helperExpression(e),i=!r&&(n||t);if(i&&!n){var o=e.path.parts[0],a=this.options;a.knownHelpers[o]?n=!0:a.knownHelpersOnly&&(i=!1)}return n?"helper":i?"ambiguous":"simple"},pushParams:function(e){for(var t=0,r=e.length;t<r;t++)this.pushParam(e[t])},pushParam:function(e){var t=null!=e.value?e.value:e.original||"";if(this.stringParams)t.replace&&(t=t.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),e.depth&&this.addDepth(e.depth),this.opcode("getContext",e.depth||0),this.opcode("pushStringParam",t,e.type),"SubExpression"===e.type&&this.accept(e);else{if(this.trackIds){var r=void 0;if(!e.parts||s.default.helpers.scopedId(e)||e.depth||(r=this.blockParamIndex(e.parts[0])),r){var n=e.parts.slice(1).join(".");this.opcode("pushId","BlockParam",r,n)}else(t=e.original||t).replace&&(t=t.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",e.type,t)}this.accept(e)}},setupFullMustacheParams:function(e,t,r,n){var i=e.params;return this.pushParams(i),this.opcode("pushProgram",t),this.opcode("pushProgram",r),e.hash?this.accept(e.hash):this.opcode("emptyHash",n),i},blockParamIndex:function(e){for(var t=0,r=this.options.blockParams.length;t<r;t++){var n=this.options.blockParams[t],i=n&&o.indexOf(n,e);if(n&&i>=0)return[t,i]}}}},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=r(4),o=n(r(6)),s=r(5),a=n(r(43));function l(e){this.value=e}function c(){}c.prototype={nameLookup:function(e,t){var r=[this.aliasable("container.propertyIsEnumerable"),".call(",e,',"constructor")'];return"constructor"===t?["(",r,"?",n()," : undefined)"]:n();function n(){return c.isValidJavaScriptVariableName(t)?[e,".",t]:[e,"[",JSON.stringify(t),"]"]}},depthedLookup:function(e){return[this.aliasable("container.lookup"),'(depths, "',e,'")']},compilerInfo:function(){var e=i.COMPILER_REVISION;return[e,i.REVISION_CHANGES[e]]},appendToBuffer:function(e,t,r){return s.isArray(e)||(e=[e]),e=this.source.wrap(e,t),this.environment.isSimple?["return ",e,";"]:r?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},compile:function(e,t,r,n){this.environment=e,this.options=t,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!n,this.name=this.environment.name,this.isChild=!!r,this.context=r||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,t),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var i=e.opcodes,s=void 0,a=void 0,l=void 0,c=void 0;for(l=0,c=i.length;l<c;l++)s=i[l],this.source.currentLocation=s.loc,a=a||s.loc,this[s.opcode].apply(this,s.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),n?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var u=this.createFunctionContext(n);if(this.isChild)return u;var d={compiler:this.compilerInfo(),main:u};this.decorators&&(d.main_d=this.decorators,d.useDecorators=!0);var h=this.context,f=h.programs,p=h.decorators;for(l=0,c=f.length;l<c;l++)f[l]&&(d[l]=f[l],p[l]&&(d[l+"_d"]=p[l],d.useDecorators=!0));return this.environment.usePartial&&(d.usePartial=!0),this.options.data&&(d.useData=!0),this.useDepths&&(d.useDepths=!0),this.useBlockParams&&(d.useBlockParams=!0),this.options.compat&&(d.compat=!0),n?d.compilerOptions=this.options:(d.compiler=JSON.stringify(d.compiler),this.source.currentLocation={start:{line:1,column:0}},d=this.objectLiteral(d),t.srcName?(d=d.toStringWithSourceMap({file:t.destName})).map=d.map&&d.map.toString():d=d.toString()),d},preamble:function(){this.lastContext=0,this.source=new a.default(this.options.srcName),this.decorators=new a.default(this.options.srcName)},createFunctionContext:function(e){var t="",r=this.stackVars.concat(this.registers.list);r.length>0&&(t+=", "+r.join(", "));var n=0;for(var i in this.aliases){var o=this.aliases[i];this.aliases.hasOwnProperty(i)&&o.children&&o.referenceCount>1&&(t+=", alias"+ ++n+"="+i,o.children[0]="alias"+n)}var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var a=this.mergeSource(t);return e?(s.push(a),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),") {\n ",a,"}"])},mergeSource:function(e){var t=this.environment.isSimple,r=!this.forceBuffer,n=void 0,i=void 0,o=void 0,s=void 0;return this.source.each((function(e){e.appendToBuffer?(o?e.prepend(" + "):o=e,s=e):(o&&(i?o.prepend("buffer += "):n=!0,s.add(";"),o=s=void 0),i=!0,t||(r=!1))})),r?o?(o.prepend("return "),s.add(";")):i||this.source.push('return "";'):(e+=", buffer = "+(n?"":this.initializeBuffer()),o?(o.prepend("return buffer + "),s.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(n?"":";\n")),this.source.merge()},blockValue:function(e){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs(e,0,r);var n=this.popStack();r.splice(1,0,n),this.push(this.source.functionCall(t,"call",r))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs("",0,t,!0),this.flushInline();var r=this.topStack();t.splice(1,0,r),this.pushSource(["if (!",this.lastHelper,") { ",r," = ",this.source.functionCall(e,"call",t),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack((function(e){return[" != null ? ",e,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,r,n){var i=0;n||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(e[i++])),this.resolvePath("context",e,i,t,r)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",t,1)},lookupData:function(e,t,r){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",t,0,!0,r)},resolvePath:function(e,t,r,n,i){var o=this;if(this.options.strict||this.options.assumeObjects)this.push(function(e,t,r,n){var i=t.popStack(),o=0,s=r.length;for(e&&s--;o<s;o++)i=t.nameLookup(i,r[o],n);return e?[t.aliasable("container.strict"),"(",i,", ",t.quotedString(r[o]),", ",JSON.stringify(t.source.currentLocation)," )"]:i}(this.options.strict&&i,this,t,e));else for(var s=t.length;r<s;r++)this.replaceStack((function(i){var s=o.nameLookup(i,t[r],e);return n?[" && ",s]:[" != null ? ",s," : ",i]}))},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,t){this.pushContext(),this.pushString(t),"SubExpression"!==t&&("string"==typeof e?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){null!=e?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,t){var r=this.nameLookup("decorators",t,"decorator"),n=this.setupHelperArgs(t,e);this.decorators.push(["fn = ",this.decorators.functionCall(r,"",["fn","props","container",n])," || fn;"])},invokeHelper:function(e,t,r){var n=this.popStack(),i=this.setupHelper(e,t),o=[];r&&o.push(i.name),o.push(n),this.options.strict||o.push(this.aliasable("container.hooks.helperMissing"));var s=["(",this.itemsSeparatedBy(o,"||"),")"],a=this.source.functionCall(s,"call",i.callParams);this.push(a)},itemsSeparatedBy:function(e,t){var r=[];r.push(e[0]);for(var n=1;n<e.length;n++)r.push(t,e[n]);return r},invokeKnownHelper:function(e,t){var r=this.setupHelper(e,t);this.push(this.source.functionCall(r.name,"call",r.callParams))},invokeAmbiguous:function(e,t){this.useRegister("helper");var r=this.popStack();this.emptyHash();var n=this.setupHelper(0,e,t),i=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",e,"helper")," || ",r,")"];this.options.strict||(i[0]="(helper = ",i.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",i,n.paramsInit?["),(",n.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",n.callParams)," : helper))"])},invokePartial:function(e,t,r){var n=[],i=this.setupParams(t,1,n);e&&(t=this.popStack(),delete i.name),r&&(i.indent=JSON.stringify(r)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",e?n.unshift(t):n.unshift(this.nameLookup("partials",t,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),n.push(i),this.push(this.source.functionCall("container.invokePartial","",n))},assignToHash:function(e){var t=this.popStack(),r=void 0,n=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(n=this.popStack(),r=this.popStack());var o=this.hash;r&&(o.contexts[e]=r),n&&(o.types[e]=n),i&&(o.ids[e]=i),o.values[e]=t},pushId:function(e,t,r){"BlockParam"===e?this.pushStackLiteral("blockParams["+t[0]+"].path["+t[1]+"]"+(r?" + "+JSON.stringify("."+r):"")):"PathExpression"===e?this.pushString(t):"SubExpression"===e?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(e,t){for(var r=e.children,n=void 0,i=void 0,o=0,s=r.length;o<s;o++){n=r[o],i=new this.compiler;var a=this.matchExistingProgram(n);if(null==a){this.context.programs.push("");var l=this.context.programs.length;n.index=l,n.name="program"+l,this.context.programs[l]=i.compile(n,t,this.context,!this.precompile),this.context.decorators[l]=i.decorators,this.context.environments[l]=n,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,n.useDepths=this.useDepths,n.useBlockParams=this.useBlockParams}else n.index=a.index,n.name="program"+a.index,this.useDepths=this.useDepths||a.useDepths,this.useBlockParams=this.useBlockParams||a.useBlockParams}},matchExistingProgram:function(e){for(var t=0,r=this.context.environments.length;t<r;t++){var n=this.context.environments[t];if(n&&n.equals(e))return n}},programExpression:function(e){var t=this.environment.children[e],r=[t.index,"data",t.blockParams];return(this.useBlockParams||this.useDepths)&&r.push("blockParams"),this.useDepths&&r.push("depths"),"container.program("+r.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof l||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new l(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var t=["("],r=void 0,n=void 0,i=void 0;if(!this.isInline())throw new o.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof l)t=["(",r=[s.value]],i=!0;else{n=!0;var a=this.incrStack();t=["((",this.push(a)," = ",s,")"],r=this.topStack()}var c=e.call(this,r);i||this.popStack(),n&&this.stackSlot--,this.push(t.concat(c,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,r=e.length;t<r;t++){var n=e[t];if(n instanceof l)this.compileStack.push(n);else{var i=this.incrStack();this.pushSource([i," = ",n,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var t=this.isInline(),r=(t?this.inlineStack:this.compileStack).pop();if(!e&&r instanceof l)return r.value;if(!t){if(!this.stackSlot)throw new o.default("Invalid stack pop");this.stackSlot--}return r},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,t=e[e.length-1];return t instanceof l?t.value:t},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var t=this.aliases[e];return t?(t.referenceCount++,t):((t=this.aliases[e]=this.source.wrap(e)).aliasable=!0,t.referenceCount=1,t)},setupHelper:function(e,t,r){var n=[];return{params:n,paramsInit:this.setupHelperArgs(t,e,n,r),name:this.nameLookup("helpers",t,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(n)}},setupParams:function(e,t,r){var n={},i=[],o=[],s=[],a=!r,l=void 0;a&&(r=[]),n.name=this.quotedString(e),n.hash=this.popStack(),this.trackIds&&(n.hashIds=this.popStack()),this.stringParams&&(n.hashTypes=this.popStack(),n.hashContexts=this.popStack());var c=this.popStack(),u=this.popStack();(u||c)&&(n.fn=u||"container.noop",n.inverse=c||"container.noop");for(var d=t;d--;)l=this.popStack(),r[d]=l,this.trackIds&&(s[d]=this.popStack()),this.stringParams&&(o[d]=this.popStack(),i[d]=this.popStack());return a&&(n.args=this.source.generateArray(r)),this.trackIds&&(n.ids=this.source.generateArray(s)),this.stringParams&&(n.types=this.source.generateArray(o),n.contexts=this.source.generateArray(i)),this.options.data&&(n.data="data"),this.useBlockParams&&(n.blockParams="blockParams"),n},setupHelperArgs:function(e,t,r,n){var i=this.setupParams(e,t,r);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),n?(this.useRegister("options"),r.push("options"),["options=",i]):r?(r.push(i),""):i}},function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=c.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0}(),c.isValidJavaScriptVariableName=function(e){return!c.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)},t.default=c,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(5),i=void 0;function o(e,t,r){if(n.isArray(e)){for(var i=[],o=0,s=e.length;o<s;o++)i.push(t.wrap(e[o],r));return i}return"boolean"==typeof e||"number"==typeof e?e+"":e}function s(e){this.srcFile=e,this.source=[]}i||((i=function(e,t,r,n){this.src="",n&&this.add(n)}).prototype={add:function(e){n.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){n.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),s.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,t){this.source.unshift(this.wrap(e,t))},push:function(e,t){this.source.push(this.wrap(e,t))},merge:function(){var e=this.empty();return this.each((function(t){e.add([" ",t,"\n"])})),e},each:function(e){for(var t=0,r=this.source.length;t<r;t++)e(this.source[t])},empty:function(){var e=this.currentLocation||{start:{}};return new i(e.start.line,e.start.column,this.srcFile)},wrap:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return e instanceof i?e:(e=o(e,this,t),new i(t.start.line,t.start.column,this.srcFile,e))},functionCall:function(e,t,r){return r=this.generateList(r),this.wrap([e,t?"."+t+"(":"(",r,")"])},quotedString:function(e){return'"'+(e+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(e){var t=[];for(var r in e)if(e.hasOwnProperty(r)){var n=o(e[r],this);"undefined"!==n&&t.push([this.quotedString(r),":",n])}var i=this.generateList(t);return i.prepend("{"),i.add("}"),i},generateList:function(e){for(var t=this.empty(),r=0,n=e.length;r<n;r++)r&&t.add(","),t.add(o(e[r],this));return t},generateArray:function(e){var t=this.generateList(e);return t.prepend("["),t.add("]"),t}},t.default=s,e.exports=t.default}])},e.exports=n()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractViewer=void 0;var n=r(0),i=r(0),o=r(0),s=r(0),a=r(15),l=r(30),c=r(3),u=r(17),d=r(1),h=r(20),f=r(36),p=r(37),m=r(7),g=r(11),_=function(){function e(e,t){var r=this;void 0===t&&(t={}),this.containerElement=e,this.runRenderLoop=!0,this._isDisposed=!1,this._hdToggled=!1,this._vrToggled=!1,this._vrModelRepositioning=0,this._vrScale=1,this._vrInit=!1,this._resize=function(){r.isCanvasInDOM()&&(r.canvas.clientWidth<=0||r.canvas.clientHeight<=0||r.configuration.engine&&r.configuration.engine.disableResize||r.engine.resize())},this._render=function(e){void 0===e&&(e=!1),(e||r.sceneManager.scene&&r.sceneManager.scene.activeCamera)&&(r.runRenderLoop||e?(r.engine.performanceMonitor.enable(),r.sceneManager.scene.render(),r.onFrameRenderedObservable.notifyObservers(r)):(r.engine.performanceMonitor.disable(),r.sceneManager.scene.activeCamera&&r.sceneManager.scene.activeCamera.update()))},e.id?this.baseId=e.id:this.baseId=e.id="bjs"+Math.random().toString(32).substr(2,8),this._registeredOnBeforeRenderFunctions=[],this._configurationContainer=new l.ConfigurationContainer,this.observablesManager=new f.ObservablesManager,this.modelLoader=new h.ModelLoader(this.observablesManager,this._configurationContainer),i.RenderingManager.AUTOCLEAR=!1,this._configurationLoader=this.getConfigurationLoader(),this._configurationLoader.loadConfiguration(t,(function(e){r._onConfigurationLoaded(e)})),this.onSceneInitObservable.add((function(){r.updateConfiguration()})),this.onInitDoneObservable.add((function(){r._isInit=!0,r.engine.runRenderLoop(r._render)})),this._prepareContainerElement(),g.viewerManager.addViewer(this)}return Object.defineProperty(e.prototype,"onSceneInitObservable",{get:function(){return this.observablesManager.onSceneInitObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onEngineInitObservable",{get:function(){return this.observablesManager.onEngineInitObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onModelAddedObservable",{get:function(){return this.observablesManager.onModelAddedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onModelLoadedObservable",{get:function(){return this.observablesManager.onModelLoadedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onModelLoadProgressObservable",{get:function(){return this.observablesManager.onModelLoadProgressObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onModelLoadErrorObservable",{get:function(){return this.observablesManager.onModelLoadErrorObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onModelRemovedObservable",{get:function(){return this.observablesManager.onModelRemovedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLoaderInitObservable",{get:function(){return this.observablesManager.onLoaderInitObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onInitDoneObservable",{get:function(){return this.observablesManager.onViewerInitDoneObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onFrameRenderedObservable",{get:function(){return this.observablesManager.onFrameRenderedObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onEnteringVRObservable",{get:function(){return this.observablesManager.onEnteringVRObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVRObservable",{get:function(){return this.observablesManager.onExitingVRObservable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvas",{get:function(){return this._canvas},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"configurationContainer",{get:function(){return this._configurationContainer},enumerable:!1,configurable:!0}),e.prototype.getConfigurationLoader=function(){return new u.RenderOnlyConfigurationLoader},e.prototype.getBaseId=function(){return this.baseId},e.prototype.isCanvasInDOM=function(){return!!this._canvas&&!!this._canvas.parentElement},Object.defineProperty(e.prototype,"renderInBackground",{get:function(){return this.engine&&this.engine.renderEvenInBackground},set:function(e){this.engine&&(this.engine.renderEvenInBackground=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configurationContainer.configuration},enumerable:!1,configurable:!0}),e.prototype.forceResize=function(){this._resize()},e.prototype.toggleHD=function(){this._hdToggled=!this._hdToggled;var e=this._hdToggled?Math.max(.5,1/(window.devicePixelRatio||2)):1;this.engine.setHardwareScalingLevel(e)},e.prototype.toggleVR=function(){if(this._vrInit||this._initVR(),this.sceneManager.vrHelper&&!this.sceneManager.vrHelper.isInVRMode)if(this.sceneManager.environmentHelper&&this.sceneManager.environmentHelper.ground&&this.sceneManager.vrHelper.addFloorMesh(this.sceneManager.environmentHelper.ground),this._vrToggled=!0,this.sceneManager.vrHelper.enterVR(),this.sceneManager.vrHelper.currentVRCamera&&this.sceneManager.vrHelper.currentVRCamera!==this.sceneManager.camera){if(this.configuration.vr&&void 0!==this.configuration.vr.cameraPosition?this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(this.configuration.vr.cameraPosition.x,this.configuration.vr.cameraPosition.y,this.configuration.vr.cameraPosition.z):this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(0,this.sceneManager.vrHelper.currentVRCamera.position.y,-1),this.sceneManager.vrHelper.currentVRCamera.rotationQuaternion&&this.sceneManager.vrHelper.currentVRCamera.rotationQuaternion.copyFromFloats(0,0,0,1),this.configuration.vr&&void 0!==this.configuration.vr.modelHeightCorrection&&("number"==typeof this.configuration.vr.modelHeightCorrection?this._vrModelRepositioning=this.configuration.vr.modelHeightCorrection:this.configuration.vr.modelHeightCorrection?this._vrModelRepositioning=this.sceneManager.vrHelper.currentVRCamera.position.y/2:this._vrModelRepositioning=0),this.sceneManager.models.length){var e=this.sceneManager.models[0].rootMesh.getHierarchyBoundingVectors(),t=e.max.subtract(e.min),r=Math.max(t.x,t.y,t.z);this._vrScale=1/r,this.configuration.vr&&this.configuration.vr.objectScaleFactor&&(this._vrScale*=this.configuration.vr.objectScaleFactor),this.sceneManager.models[0].rootMesh.scaling.scaleInPlace(this._vrScale),this.sceneManager.models[0].rootMesh.position.y+=this._vrModelRepositioning,this.sceneManager.models[0].rootMesh.rotationQuaternion=null}this.sceneManager.environmentHelper&&(this.sceneManager.environmentHelper.ground&&this.sceneManager.environmentHelper.ground.scaling.scaleInPlace(this._vrScale),this.sceneManager.environmentHelper.skybox&&this.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(this._vrScale)),this.sceneManager.defaultRenderingPipelineEnabled&&this.sceneManager.defaultRenderingPipeline&&(this.sceneManager.defaultRenderingPipeline.imageProcessingEnabled=!1,this.sceneManager.defaultRenderingPipeline.prepare())}else this._vrModelRepositioning=0;else this.sceneManager.vrHelper&&this.sceneManager.vrHelper.exitVR()},e.prototype._initVR=function(){var e=this;this.sceneManager.vrHelper&&this.observablesManager.onExitingVRObservable.add((function(){e._vrToggled&&(e._vrToggled=!1,e.sceneManager.models.length&&(e.sceneManager.models[0].rootMesh.scaling.scaleInPlace(1/e._vrScale),e.sceneManager.models[0].rootMesh.position.y-=e._vrModelRepositioning),e.sceneManager.environmentHelper&&(e.sceneManager.environmentHelper.ground&&e.sceneManager.environmentHelper.ground.scaling.scaleInPlace(1/e._vrScale),e.sceneManager.environmentHelper.skybox&&e.sceneManager.environmentHelper.skybox.scaling.scaleInPlace(1/e._vrScale)),e.sceneManager.defaultRenderingPipelineEnabled&&e.sceneManager.defaultRenderingPipeline&&(e.sceneManager.defaultRenderingPipeline.imageProcessingEnabled=!0,e.sceneManager.defaultRenderingPipeline.prepare()),e.canvas.removeAttribute("height"),e.canvas.removeAttribute("width"),e.engine.resize())})),this._vrInit=!0},e.prototype._onConfigurationLoaded=function(e){var t=this;this._configurationContainer.configuration=d.deepmerge(this.configuration||{},e),this.configuration.observers&&this._configureObservers(this.configuration.observers),this.configuration.loaderPlugins&&Object.keys(this.configuration.loaderPlugins).forEach((function(e){t.configuration.loaderPlugins&&t.configuration.loaderPlugins[e]&&t.modelLoader.addPlugin(e)})),this.observablesManager.onViewerInitStartedObservable.notifyObservers(this)},e.prototype.forceRender=function(){this._render(!0)},e.prototype.takeScreenshot=function(e,t,r){var n=this;return void 0===t&&(t=0),void 0===r&&(r=0),t=t||this.canvas.clientWidth,r=r||this.canvas.clientHeight,new Promise((function(i,s){try{o.Tools.CreateScreenshot(n.engine,n.sceneManager.camera,{width:t,height:r},(function(t){e&&e(t),i(t)}))}catch(e){s(e)}}))},e.prototype.updateConfiguration=function(e){var t=this;void 0===e&&(e=this.configuration),"string"==typeof e?o.Tools.LoadFile(e,(function(r){try{var n=JSON.parse(r.toString());return t.updateConfiguration(n)}catch(t){console.log("Error parsing file "+e)}}),void 0,void 0,void 0,(function(t){console.log("Error parsing file "+e,t)})):(a.processConfigurationCompatibility(e),this._configurationContainer.configuration=d.deepmerge(this.configuration||{},e),this.sceneManager.updateConfiguration(e),e.observers&&this._configureObservers(e.observers),e.loaderPlugins&&Object.keys(e.loaderPlugins).forEach((function(r){e.loaderPlugins&&e.loaderPlugins[r]&&t.modelLoader.addPlugin(r)})))},e.prototype._configureObservers=function(e){e.onEngineInit?this.onEngineInitObservable.add(window[e.onEngineInit]):""===e.onEngineInit&&this.configuration.observers&&this.configuration.observers.onEngineInit&&this.onEngineInitObservable.removeCallback(window[this.configuration.observers.onEngineInit]),e.onSceneInit?this.onSceneInitObservable.add(window[e.onSceneInit]):""===e.onSceneInit&&this.configuration.observers&&this.configuration.observers.onSceneInit&&this.onSceneInitObservable.removeCallback(window[this.configuration.observers.onSceneInit]),e.onModelLoaded?this.onModelLoadedObservable.add(window[e.onModelLoaded]):""===e.onModelLoaded&&this.configuration.observers&&this.configuration.observers.onModelLoaded&&this.onModelLoadedObservable.removeCallback(window[this.configuration.observers.onModelLoaded])},e.prototype.dispose=function(){this._isDisposed||(window.removeEventListener("resize",this._resize),this.sceneManager&&(this.sceneManager.scene&&this.sceneManager.scene.activeCamera&&this.sceneManager.scene.activeCamera.detachControl(this.canvas),this.sceneManager.dispose()),this._fpsTimeoutInterval&&clearInterval(this._fpsTimeoutInterval),this.observablesManager.dispose(),this.modelLoader.dispose(),this.engine&&this.engine.dispose(),g.viewerManager.removeViewer(this),this._isDisposed=!0)},e.prototype._onTemplatesLoaded=function(){return Promise.resolve(this)},e.prototype._onTemplateLoaded=function(){var e=this;return this._isDisposed?Promise.reject("viewer was disposed"):this._onTemplatesLoaded().then((function(){var t="string"==typeof e.configuration.model||e.configuration.model&&e.configuration.model.url;return e._initEngine().then((function(t){return e.onEngineInitObservable.notifyObserversWithPromise(t)})).then((function(){return e._initTelemetryEvents(),t?e.loadModel(e.configuration.model).catch((function(){})).then((function(){return e.sceneManager.scene})):e.sceneManager.scene||e.sceneManager.initScene(e.configuration.scene)})).then((function(){return e.onInitDoneObservable.notifyObserversWithPromise(e)})).catch((function(t){return o.Tools.Warn(t.toString()),e}))}))},e.prototype._initEngine=function(){if(this._injectCustomShaders(),!this.canvas)return Promise.reject("Canvas element not found!");var e=this.configuration.engine||{};if(c.viewerGlobals.disableWebGL2Support&&(e.engineOptions=e.engineOptions||{},e.engineOptions.disableWebGL2Support=!0),this.engine=new n.Engine(this.canvas,!!e.antialiasing,e.engineOptions),e.disableResize||window.addEventListener("resize",this._resize),this.configuration.engine){if(this.configuration.engine.adaptiveQuality){var t=Math.max(.5,1/(window.devicePixelRatio||2));this.engine.setHardwareScalingLevel(t)}this.configuration.engine.hdEnabled&&this.toggleHD()}return this.sceneManager=new p.SceneManager(this.engine,this._configurationContainer,this.observablesManager),Promise.resolve(this.engine)},e.prototype.initModel=function(e,t){var r,n=this;if(void 0===t&&(t=!0),!(r="string"==typeof e?{url:e}:e instanceof File?{file:e,root:"file:"}:e).url&&!r.file)throw new Error("no model provided");if(t&&this.sceneManager.clearScene(!0,!1),this.configuration.model&&"object"==typeof this.configuration.model){var i=d.deepmerge({},this.configuration.model);r=d.deepmerge(i,r),e instanceof File&&(r.file=e)}else this.configuration.model=r;this._isLoading=!0;var o=this.modelLoader.load(r);return this.lastUsedLoader=o.loader,o.onLoadErrorObservable.add((function(e){n.onModelLoadErrorObservable.notifyObserversWithPromise(e)})),o.onLoadProgressObservable.add((function(e){n.onModelLoadProgressObservable.notifyObserversWithPromise(e)})),this.onLoaderInitObservable.notifyObserversWithPromise(this.lastUsedLoader),o.onLoadedObservable.add((function(){n._isLoading=!1})),o},e.prototype.loadModel=function(e,t){var r=this;return void 0===t&&(t=!0),this._isLoading?Promise.reject("another model is curently being loaded."):Promise.resolve(this.sceneManager.scene).then((function(e){return e||r.sceneManager.initScene(r.configuration.scene,r.configuration.optimizer)})).then((function(){var n=r.initModel(e,t);return new Promise((function(e,t){n.onLoadedObservable.add((function(){e(n)})),n.onLoadErrorObservable.add((function(e){t(e)}))}))}))},e.prototype._initTelemetryEvents=function(){var e=this;m.telemetryManager.broadcast("Engine Capabilities",this.baseId,this.engine.getCaps()),m.telemetryManager.broadcast("Platform Details",this.baseId,{userAgent:navigator.userAgent,platform:navigator.platform}),m.telemetryManager.flushWebGLErrors(this.engine,this.baseId);var t=function(){m.telemetryManager.broadcast("Current FPS",e.baseId,{fps:e.engine.getFps()})};t(),this._fpsTimeoutInterval=window.setInterval(t,6e4)},e.prototype._injectCustomShaders=function(){var e=this.configuration.customShaders;e&&(e.shaders&&Object.keys(e.shaders).forEach((function(t){s.Effect.ShadersStore[t]=e.shaders[t]})),e.includes&&Object.keys(e.includes).forEach((function(t){s.Effect.IncludesShadersStore[t]=e.includes[t]})))},e}();t.AbstractViewer=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processConfigurationCompatibility=void 0;var n=r(16);function i(e,t,r,n){var i=t.split(".");if(0!==i.length){var o=i.pop();if(o){var s=e;i.forEach((function(e){s[e]=s[e]||{},s=s[e]})),(void 0===s[o]||n)&&(s[o]=r)}}}t.processConfigurationCompatibility=function(e){if(e.camera&&(void 0!==e.camera.contrast&&i(e,"scene.imageProcessingConfiguration.contrast",e.camera.contrast),void 0!==e.camera.exposure&&i(e,"scene.imageProcessingConfiguration.exposure",e.camera.exposure)),e.scene){if(e.scene.glow)i(e,"lab.defaultRenderingPipelines.glowLayerEnabled",!0),!1!==n.getConfigurationKey("scene.imageProcessingConfiguration.isEnabled",e)&&i(e,"scene.imageProcessingConfiguration.isEnabled",!0);e.scene.mainColor&&i(e,"environmentMap.mainColor",e.scene.mainColor,!0)}e.model&&"object"==typeof e.model&&void 0!==e.model.castShadows&&void 0===e.model.castShadow&&(e.model.castShadow=e.model.castShadows),e.lab&&(e.lab.assetsRootURL&&i(e,"scene.assetsRootURL",e.lab.assetsRootURL,!0),e.lab.environmentMap&&i(e,"environmentMap",e.lab.environmentMap,!0))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigurationKey=void 0,t.getConfigurationKey=function e(t,r){var n=t.split(".");if(0!==n.length&&r){if(1!==n.length){var i=n.shift();return e(n.join("."),r[i])}return void 0!==r[t]?r[t]:void 0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderOnlyConfigurationLoader=void 0;var n=r(2),i=r(15),o=r(1),s=r(0),a=r(18),l=r(19),c=function(){function e(e){void 0===e&&(e=!1),this._enableCache=e,this._configurationCache={},this._loadRequests=[]}return e.prototype._getConfigurationTypeExcludeTemplate=function(e){var t=this,r={};return e.split(",").forEach((function(e){switch(e.trim()){case"default":r=o.deepmerge(r,l.renderOnlyDefaultConfiguration);break;case"none":break;case"extended":default:r=o.deepmerge(r,a.extendedConfiguration)}r.extends&&(r=o.deepmerge(r,t._getConfigurationTypeExcludeTemplate(r.extends)))})),r},e.prototype.getExtendedConfig=function(e){return this._getConfigurationTypeExcludeTemplate(e||"extended")},e.prototype.loadConfiguration=function(e,t){var r=this;void 0===e&&(e={});var s=o.deepmerge({},e);this._processInitialConfiguration(s);var a=this.getExtendedConfig(s.extends);if(s.configuration){var l="json";return Promise.resolve().then((function(){if("string"==typeof s.configuration||s.configuration&&s.configuration.url){var e="";if("string"==typeof s.configuration&&(e=s.configuration),"object"==typeof s.configuration&&s.configuration.url){e=s.configuration.url;var t=s.configuration.mapper;t||(t=s.configuration.url.split(".").pop()),l=t||l}return r._loadFile(e)}return"object"==typeof s.configuration?(l=s.configuration.mapper||l,s.configuration.payload||{}):{}})).then((function(e){var r=n.mapperManager.getMapper(l),c=o.deepmerge(r.map(e),s),u=o.deepmerge(a,c);return i.processConfigurationCompatibility(u),t&&t(u),u}))}return s=o.deepmerge(a,s),i.processConfigurationCompatibility(s),t&&t(s),Promise.resolve(s)},e.prototype.dispose=function(){this._loadRequests.forEach((function(e){e.abort()})),this._loadRequests.length=0},e.prototype._processInitialConfiguration=function(e){e.model&&"string"==typeof e.model&&(e.model={url:e.model})},e.prototype._loadFile=function(e){var t=this,r=this._configurationCache;return this._enableCache&&r[e]?Promise.resolve(r[e]):new Promise((function(n,i){var o=s.Tools.LoadFile(e,(function(i){var s=t._loadRequests.indexOf(o);-1!==s&&t._loadRequests.splice(s,1),t._enableCache&&(r[e]=i),n(i)}),void 0,void 0,!1,(function(e,r){var n=t._loadRequests.indexOf(o);-1!==n&&t._loadRequests.splice(n,1),i(r)}));t._loadRequests.push(o)}))},e}();t.RenderOnlyConfigurationLoader=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendedConfiguration=void 0;var n=r(0);t.extendedConfiguration={version:"3.2.0",extends:"default",camera:{exposure:3.034578,fov:.7853981633974483,contrast:1.6,toneMappingEnabled:!0,upperBetaLimit:1.3962634015954636+Math.PI/2,lowerBetaLimit:Math.PI/2-1.4835298641951802,behaviors:{framing:{type:2,mode:0,positionScale:.5,defaultElevation:.2617993877991494,elevationReturnWaitTime:3e3,elevationReturnTime:2e3,framingTime:500,zoomStopsAnimation:!1,radiusScale:.866},autoRotate:{type:0,idleRotationWaitTime:4e3,idleRotationSpeed:.17453292519943295,idleRotationSpinupTime:2500,zoomStopsAnimation:!1},bouncing:{type:1,lowerRadiusTransitionRange:.05,upperRadiusTransitionRange:-.2}},upperRadiusLimit:5,lowerRadiusLimit:.5,frameOnModelLoad:!0,framingElevation:.2617993877991494,framingRotation:1.5707963267948966,radius:2,alpha:1.5708,beta:.5*Math.PI-.2618,wheelPrecision:300,minZ:.1,maxZ:50,fovMode:0,pinchPrecision:1500,panningSensibility:3e3},lights:{light0:{type:0,frustumEdgeFalloff:0,intensity:7,intensityMode:0,radius:.6,range:4.4,spotAngle:60,diffuse:{r:1,g:1,b:1},position:{x:-2,y:2.5,z:2},target:{x:0,y:0,z:0},enabled:!0,shadowEnabled:!0,shadowBufferSize:512,shadowMinZ:1,shadowMaxZ:10,shadowFieldOfView:60,shadowFrustumSize:2,shadowConfig:{useBlurCloseExponentialShadowMap:!0,useKernelBlur:!0,blurScale:1,bias:.001,depthScale:450,frustumEdgeFalloff:0}},light1:{type:0,frustumEdgeFalloff:0,intensity:7,intensityMode:0,radius:.4,range:5.8,spotAngle:57,diffuse:{r:1,g:1,b:1},position:{x:4,y:3,z:-.5},target:{x:0,y:0,z:0},enabled:!0,shadowEnabled:!1,shadowBufferSize:512,shadowMinZ:.2,shadowMaxZ:10,shadowFieldOfView:28,shadowFrustumSize:2},light2:{type:0,frustumEdgeFalloff:0,intensity:1,intensityMode:0,radius:.5,range:6,spotAngle:42.85,diffuse:{r:.8,g:.8,b:.8},position:{x:-1,y:3,z:-3},target:{x:0,y:0,z:0},enabled:!0,shadowEnabled:!1,shadowBufferSize:512,shadowMinZ:.2,shadowMaxZ:10,shadowFieldOfView:45,shadowFrustumSize:2}},ground:{shadowLevel:.9,texture:"Ground_2.0-1024.png",material:{primaryColorHighlightLevel:.035,primaryColorShadowLevel:0,enableNoise:!0,useRGBColor:!1,maxSimultaneousLights:1,diffuseTexture:{gammaSpace:!0}},opacity:1,mirror:!1,receiveShadows:!0,size:5},skybox:{scale:11,cubeTexture:{url:"Skybox_2.0-256.dds"},material:{primaryColorHighlightLevel:.03,primaryColorShadowLevel:.03,enableNoise:!0,useRGBColor:!1,reflectionTexture:{gammaSpace:!0}}},engine:{renderInBackground:!0},scene:{flags:{shadowsEnabled:!0,particlesEnabled:!1,collisionsEnabled:!1,lightsEnabled:!0,texturesEnabled:!0,lensFlaresEnabled:!1,proceduralTexturesEnabled:!1,renderTargetsEnabled:!0,spritesEnabled:!1,skeletonsEnabled:!0,audioEnabled:!1},defaultMaterial:{materialType:"pbr",reflectivityColor:{r:.1,g:.1,b:.1},microSurface:.6},clearColor:{r:.9,g:.9,b:.9,a:1},imageProcessingConfiguration:{vignetteCentreX:0,vignetteCentreY:0,vignetteColor:{r:.086,g:.184,b:.259,a:1},vignetteWeight:.855,vignetteStretch:.5,vignetteBlendMode:0,vignetteCameraFov:.7853981633974483,isEnabled:!0,colorCurves:{shadowsHue:0,shadowsDensity:0,shadowsSaturation:0,shadowsExposure:0,midtonesHue:0,midtonesDensity:0,midtonesExposure:0,midtonesSaturation:0,highlightsHue:0,highlightsDensity:0,highlightsExposure:0,highlightsSaturation:0}},assetsRootURL:"https://viewer.babylonjs.com/assets/environment/"},loaderPlugins:{extendedMaterial:!0,applyMaterialConfig:!0,msftLod:!0,telemetry:!0},model:{rotationOffsetAxis:{x:0,y:-1,z:0},rotationOffsetAngle:n.Tools.ToRadians(210),material:{directEnabled:!0,directIntensity:.884,emissiveIntensity:1.04,environmentIntensity:.6},entryAnimation:{scaling:{x:0,y:0,z:0},time:.5,easingFunction:4,easingMode:1},exitAnimation:{scaling:{x:0,y:0,z:0},time:.5,easingFunction:4,easingMode:1},normalize:!0,castShadow:!0,receiveShadows:!0},environmentMap:{texture:"EnvMap_3.0-256.env",rotationY:3,tintLevel:.4,mainColor:{r:.8823529411764706,g:.8823529411764706,b:.8823529411764706}},lab:{defaultRenderingPipelines:{bloomEnabled:!0,bloomThreshold:1,fxaaEnabled:!0,bloomWeight:.05}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderOnlyDefaultConfiguration=void 0,t.renderOnlyDefaultConfiguration={version:"3.2.0-alpha4",camera:{behaviors:{autoRotate:{type:0},framing:{type:2,zoomOnBoundingInfo:!0,zoomStopsAnimation:!1},bouncing:{type:1}}},skybox:{},ground:{receiveShadows:!0},engine:{antialiasing:!0},scene:{}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelLoader=void 0;var n=r(4),i=r(0),o=r(0),s=r(0),a=r(5),l=r(31),c=function(){function e(e,t){this._observablesManager=e,this._configurationContainer=t,this._disposed=!1,this._loaders=[],this._loadId=0,this._plugins=[]}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._baseUrl},enumerable:!1,configurable:!0}),e.prototype.addPlugin=function(e){var t={};if("string"==typeof e){var r=l.getLoaderPluginByName(e);r&&(t=r)}else t=e;t&&-1===this._plugins.indexOf(t)&&this._plugins.push(t)},e.prototype.load=function(e){var t,r=this,l=new a.ViewerModel(this._observablesManager,e,this._configurationContainer);if(l.loadId=this._loadId++,e.file?(this._baseUrl="file:",t=e.file):e.url&&(t=i.Tools.GetFilename(e.url)||e.url,this._baseUrl=e.root||i.Tools.GetFolderPath(e.url)),!t||!this._baseUrl)return l.state=a.ModelState.ERROR,i.Tools.Error("No URL provided"),l;var c=e.loader,u=l.rootMesh.getScene();if(l.loader=o.SceneLoader.ImportMesh(void 0,this._baseUrl,t,u,(function(e,t,n,i){e.forEach((function(e){s.Tags.AddTagsTo(e,"viewerMesh"),l.addMesh(e)})),l.particleSystems=t,l.skeletons=n;for(var o=0,a=i;o<a.length;o++){var c=a[o];l.addAnimationGroup(c)}r._checkAndRun("onLoaded",l),u.executeWhenReady((function(){l.onLoadedObservable.notifyObservers(l)}))}),(function(e){r._checkAndRun("onProgress",e),l.onLoadProgressObservable.notifyObserversWithPromise(e)}),(function(e,t,n){l.state=a.ModelState.ERROR,i.Tools.Error("Load Error: There was an error loading the model. "+t),r._checkAndRun("onError",t,n),l.onLoadErrorObservable.notifyObserversWithPromise({message:t,exception:n})}),c),"gltf"===l.loader.name){var d=l.loader;d.animationStartMode=n.GLTFLoaderAnimationStartMode.NONE,d.compileMaterials=!0,e.file||(d.rewriteRootURL=function(t,r){return e.root||i.Tools.GetFolderPath(r||e.url||"")}),this._configurationContainer&&this._configurationContainer.configuration&&this._configurationContainer.configuration.ground&&"object"==typeof this._configurationContainer.configuration.ground&&this._configurationContainer.configuration.ground.mirror&&(d.useClipPlane=!0),Object.keys(d).filter((function(e){return 0===e.indexOf("on")&&-1!==e.indexOf("Observable")})).forEach((function(e){d[e].add((function(t){r._checkAndRun(e.replace("Observable",""),t)}))})),d.onParsedObservable.add((function(e){e&&e.json&&e.json.asset&&(l.loadInfo=e.json.asset)})),d.onCompleteObservable.add((function(){l.loaderDone=!0}))}else l.loaderDone=!0;return this._checkAndRun("onInit",l.loader,l),this._loaders.push(l.loader),l},e.prototype.cancelLoad=function(e){var t=e.loader||this._loaders[e.loadId];t&&"gltf"===t.name?(t.dispose(),e.state=a.ModelState.CANCELED):i.Tools.Warn("This type of loader cannot cancel the request")},e.prototype.dispose=function(){this._loaders.forEach((function(e){"gltf"===e.name&&e.dispose()})),this._loaders.length=0,this._disposed=!0},e.prototype._checkAndRun=function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._disposed||this._plugins.filter((function(t){return t[e]})).forEach((function(n){try{n[e].apply(t,r)}catch(e){}}))},e}();t.ModelLoader=c},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(16),t),i(r(38),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextureUtils=t.TextureCube=void 0;var n=r(0),i=r(0),o=r(0),s=r(0),a=function(){function e(e,t,r){void 0===r&&(r=[]),this.internalFormat=e,this.type=t,this.source=r}return Object.defineProperty(e.prototype,"Width",{get:function(){return this.source&&this.source[0]&&this.source[0][0]?this.source[0][0].width:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Height",{get:function(){return this.source&&this.source[0]&&this.source[0][0]?this.source[0][0].height:0},enumerable:!1,configurable:!0}),e}();t.TextureCube=a;var l=function(){function e(){}return e.GetBabylonCubeTexture=function(t,r,s,l,c){if(void 0===l&&(l=!1),void 0===c&&(c=!1),!r)throw new Error("no texture cube provided");var u;u=l?c?e._EnvironmentSingleMipSampling:e._EnvironmentSampling:{magFilter:9728,minFilter:9728,wrapS:33071,wrapT:33071};var d=e.BabylonTextureKeyPrefix+u.magFilter+""+u.minFilter+u.wrapS+u.wrapT,h=r[d];if(!h){h=new n.CubeTexture("",t),l&&(h.lodGenerationOffset=e.EnvironmentLODOffset,h.lodGenerationScale=e.EnvironmentLODScale),h.gammaSpace=!1;var f=new i.InternalTexture(t.getEngine(),i.InternalTextureSource.CubeRaw),p=f._webGLTexture;f.isCube=!0,f.generateMipMaps=!1,h._texture=f,e.ApplySamplingParameters(h,u);for(var m=s?0:r.source.length-1,g=0,_=function(){return g===6*(m+1)},v=function(n,i,u){if(p){0===n&&0===i&&(f.width=u.width,f.height=u.height);var d=t.getEngine()._gl;if(d.bindTexture(d.TEXTURE_CUBE_MAP,p),t.getEngine()._unpackFlipY(!1),u instanceof HTMLElement||u instanceof ImageData)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+n,i,r.internalFormat,r.internalFormat,r.type,u);else{var h=u;d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+n,i,r.internalFormat,h.width,h.height,0,h.format,r.type,h.data)}if(g++,_()){if(s){var m=u.width,v=u.height;0===(0!==m&&m&m-1)&&0===(0!==v&&v&v-1)&&d.generateMipmap(d.TEXTURE_CUBE_MAP)}if(l&&!t.getEngine().getCaps().textureLOD&&!c)for(var y=0;y<3;y++){var b=e.BabylonTextureKeyPrefix+"lod"+y,A=r[b];if(null==A&&r.Width){var T=1-y/2,M=(T*T+5e-4)*r.Width,P=e.EnvironmentLODScale*o.Scalar.Log2(M)+e.EnvironmentLODOffset,S=r.source.length-1,E=Math.min(Math.max(Math.round(P),0),S);A=e.GetBabylonCubeTexture(t,new a(6408,5121,[r.source[E]]),!1,!0,!0),0===y?f._lodTextureLow=A:1===y?f._lodTextureMid=A:f._lodTextureHigh=A,r[b]=A}}f.isReady=!0}d.bindTexture(d.TEXTURE_CUBE_MAP,null),t.getEngine().resetTextureCache()}},y=function(e){for(var t=r.source[e],n=function(r){var n=t[r];n instanceof HTMLImageElement&&!n.complete?n.addEventListener("load",(function(){v(r,e,n)}),!1):v(r,e,n)},i=0;i<t.length;i++)n(i)},b=0;b<=m;b++)y(b);t.getEngine().resetTextureCache(),h.isReady=function(){return _()},r[d]=h}return h},e.ApplySamplingParameters=function(e,t){var r=e.getScene();if(r){var n=r.getEngine()._gl,i=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,o=e._texture;if(o){var a=o._webGLTexture;switch(n.bindTexture(i,a),null!=t.magFilter&&n.texParameteri(i,n.TEXTURE_MAG_FILTER,t.magFilter),null!=t.minFilter&&n.texParameteri(i,n.TEXTURE_MIN_FILTER,t.minFilter),null!=t.wrapS&&n.texParameteri(i,n.TEXTURE_WRAP_S,t.wrapS),null!=t.wrapT&&n.texParameteri(i,n.TEXTURE_WRAP_T,t.wrapT),t.wrapS){case 10497:e.wrapU=s.Texture.WRAP_ADDRESSMODE;break;case 33071:e.wrapU=s.Texture.CLAMP_ADDRESSMODE;break;case 33648:e.wrapU=s.Texture.MIRROR_ADDRESSMODE;break;default:e.wrapU=s.Texture.CLAMP_ADDRESSMODE}switch(t.wrapT){case 10497:e.wrapV=s.Texture.WRAP_ADDRESSMODE;break;case 33071:e.wrapV=s.Texture.CLAMP_ADDRESSMODE;break;case 33648:e.wrapV=s.Texture.MIRROR_ADDRESSMODE;break;default:e.wrapV=s.Texture.CLAMP_ADDRESSMODE}if(null!=t.maxAnisotropy&&t.maxAnisotropy>1){var l=n.getExtension("EXT_texture_filter_anisotropic");if(l){var c=n.getParameter(l.MAX_TEXTURE_MAX_ANISOTROPY_EXT),u=Math.min(t.maxAnisotropy,c);n.texParameterf(i,l.TEXTURE_MAX_ANISOTROPY_EXT,u),e.anisotropicFilteringLevel=u}}n.bindTexture(i,null),r.getEngine().resetTextureCache()}}},e.BabylonTextureKeyPrefix="__babylonTexture_",e.MaxAnisotropy=4,e._EnvironmentSampling={magFilter:9729,minFilter:9987,wrapS:33071,wrapT:33071,maxAnisotropy:1},e._EnvironmentSingleMipSampling={magFilter:9729,minFilter:9729,wrapS:33071,wrapT:33071,maxAnisotropy:1},e.EnvironmentLODScale=.8,e.EnvironmentLODOffset=1,e}();t.TextureUtils=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerCustomOptimizer=t.getCustomOptimizerByName=void 0;var n=r(56),i={};t.getCustomOptimizerByName=function(e,t){if(!i[e])switch(e){case"extended":return t?n.extendedUpgrade:n.extendedDegrade}return i[e]},t.registerCustomOptimizer=function(e,t){i[e]=t}},function(e,t,r){e.exports=r(25)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.registerCustomOptimizer=t.AbstractViewerNavbarButton=t.ModelState=t.AnimationState=t.AnimationPlayMode=t.ViewerModel=t.ModelLoader=t.disposeAll=t.mapperManager=t.viewerManager=t.disableInit=t.telemetryManager=t.viewerGlobals=t.AbstractViewer=t.DefaultViewer=t.InitTags=t.Version=t.BABYLON=void 0;var o=r(2);Object.defineProperty(t,"mapperManager",{enumerable:!0,get:function(){return o.mapperManager}});var s=r(3);Object.defineProperty(t,"viewerGlobals",{enumerable:!0,get:function(){return s.viewerGlobals}});var a=r(11);Object.defineProperty(t,"viewerManager",{enumerable:!0,get:function(){return a.viewerManager}});var l=r(12);Object.defineProperty(t,"DefaultViewer",{enumerable:!0,get:function(){return l.DefaultViewer}});var c=r(14);Object.defineProperty(t,"AbstractViewer",{enumerable:!0,get:function(){return c.AbstractViewer}});var u=r(7);Object.defineProperty(t,"telemetryManager",{enumerable:!0,get:function(){return u.telemetryManager}});var d=r(20);Object.defineProperty(t,"ModelLoader",{enumerable:!0,get:function(){return d.ModelLoader}});var h=r(5);Object.defineProperty(t,"ViewerModel",{enumerable:!0,get:function(){return h.ViewerModel}}),Object.defineProperty(t,"ModelState",{enumerable:!0,get:function(){return h.ModelState}});var f=r(6);Object.defineProperty(t,"AnimationPlayMode",{enumerable:!0,get:function(){return f.AnimationPlayMode}}),Object.defineProperty(t,"AnimationState",{enumerable:!0,get:function(){return f.AnimationState}});var p=r(9);Object.defineProperty(t,"AbstractViewerNavbarButton",{enumerable:!0,get:function(){return p.AbstractViewerNavbarButton}});var m=r(23);Object.defineProperty(t,"registerCustomOptimizer",{enumerable:!0,get:function(){return m.registerCustomOptimizer}});var g=r(0);t.BABYLON=g,r(4),r(84);var _=r(85);Object.defineProperty(t,"InitTags",{enumerable:!0,get:function(){return _.InitTags}}),g.PromisePolyfill.Apply(),_.initListeners();var v=s.viewerGlobals.disableInit;t.disableInit=v,t.disposeAll=function(){a.viewerManager.dispose(),o.mapperManager.dispose(),u.telemetryManager.dispose()};var y=s.viewerGlobals.version;t.Version=y,console.log("Babylon.js viewer (v"+y+")");var b=r(4);Object.defineProperty(t,"GLTF2",{enumerable:!0,get:function(){return b.GLTF2}}),i(r(21),t)},function(e,t,r){"use strict";r.r(t);var n=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function s(e,t,r){return e.concat(t).map((function(e){return o(e,r)}))}function a(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||n;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):function(e,t,r){var n={};return r.isMergeableObject(e)&&Object.keys(e).forEach((function(t){n[t]=o(e[t],r)})),Object.keys(t).forEach((function(i){r.isMergeableObject(t[i])&&e[i]?n[i]=a(e[i],t[i],r):n[i]=o(t[i],r)})),n}(e,t,r):o(t,r)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return a(e,r,t)}),{})};var l=a;t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Template=t.TemplateManager=void 0;var n=r(0),i=r(0),o=r(1),s=r(13),a=r(28),l=r(1),c=function(){function e(e){this.containerElement=e,this.templates={},this.onTemplateInit=new n.Observable,this.onTemplateLoaded=new n.Observable,this.onTemplateStateChange=new n.Observable,this.onAllLoaded=new n.Observable,this.onEventTriggered=new n.Observable,this.eventManager=new a.EventManager(this)}return e.prototype.initTemplate=function(e){var t=this,r=function(e,n,i){var s=t.templates[n],a=(Object.keys(e).map((function(t){return r(e[t],t,s)})),function(){var e=i&&i.parent.querySelectorAll(o.camelToKebab(n)),r=e&&e.length&&e.item(e.length-1)||t.containerElement;s.appendTo(r),t._checkLoadedState()});return i&&!i.parent?i.onAppended.add((function(){a()})):a(),s};return this._buildHTMLTree(e).then((function(e){t.templates.main?r(e,"main"):t._checkLoadedState()}))},e.prototype._buildHTMLTree=function(e){var t=this,r=Object.keys(e).map((function(r){if(!e[r])return Promise.resolve(!1);var n=new u(r,e[r]);return n.onLoaded.add((function(){t.onTemplateLoaded.notifyObservers(n)})),n.onStateChange.add((function(){t.onTemplateStateChange.notifyObservers(n)})),t.onTemplateInit.notifyObservers(n),n.onEventTriggered.add((function(e){return t.onEventTriggered.notifyObservers(e)})),t.templates[r]=n,n.initPromise}));return Promise.all(r).then((function(){var e={},r=function(e,n){t.templates[n].isInHtmlTree=!0,t.templates[n].getChildElements().filter((function(e){return!!t.templates[e]})).forEach((function(t){e[t]={},r(e[t],t)}))};return t.templates.main&&r(e,"main"),e}))},e.prototype.getCanvas=function(){return this.containerElement.querySelector("canvas")},e.prototype.getTemplate=function(e){return this.templates[e]},e.prototype._checkLoadedState=function(){var e=this;(0===Object.keys(this.templates).length||Object.keys(this.templates).every((function(t){return e.templates[t].isLoaded&&!!e.templates[t].parent||!e.templates[t].isInHtmlTree})))&&this.onAllLoaded.notifyObservers(this)},e.prototype.dispose=function(){var e=this;Object.keys(this.templates).forEach((function(t){e.templates[t].dispose()})),this.templates={},this.eventManager.dispose(),this.onTemplateInit.clear(),this.onAllLoaded.clear(),this.onEventTriggered.clear(),this.onTemplateLoaded.clear(),this.onTemplateStateChange.clear()},e}();t.TemplateManager=c,s.registerHelper("eachInMap",(function(e,t){var r="";return Object.keys(e).map((function(n){var i=e[n];"object"==typeof i?(i.id=i.id||n,r+=t.fn(i)):r+=t.fn({id:n,value:i})})),r})),s.registerHelper("add",(function(e,t){return e+t})),s.registerHelper("eq",(function(e,t){return e==t})),s.registerHelper("or",(function(e,t){return e||t})),s.registerHelper("not",(function(e){return!e})),s.registerHelper("count",(function(e){return e.length})),s.registerHelper("gt",(function(e,t){return e>t}));var u=function(){function e(e,t){var r=this;this.name=e,this._configuration=t,this.onLoaded=new n.Observable,this.onAppended=new n.Observable,this.onStateChange=new n.Observable,this.onEventTriggered=new n.Observable,this.onParamsUpdated=new n.Observable,this.onHTMLRendered=new n.Observable,this.loadRequests=[],this.isLoaded=!1,this.isShown=!1,this.isInHtmlTree=!1;var i=this._getTemplateAsHtml(t);this.initPromise=i.then((function(e){if(e){r._htmlTemplate=e;var t=s.compile(e,{noEscape:r._configuration.params&&!!r._configuration.params.noEscape}),n=r._configuration.params||{};r._rawHtml=t(n);try{r._fragment=document.createRange().createContextualFragment(r._rawHtml)}catch(e){var i=document.createElement(r.name);i.innerHTML=r._rawHtml,r._fragment=i}r.isLoaded=!0,r.isShown=!0,r.onLoaded.notifyObservers(r)}return r}))}return e.prototype.updateParams=function(e,t){void 0===t&&(t=!0),this._configuration.params=t?l.deepmerge(this._configuration.params,e):e,this.isLoaded;var r=s.compile(this._htmlTemplate),n=this._configuration.params||{};this._rawHtml=r(n);try{this._fragment=document.createRange().createContextualFragment(this._rawHtml)}catch(e){var i=document.createElement(this.name);i.innerHTML=this._rawHtml,this._fragment=i}this.parent&&this.appendTo(this.parent,!0)},e.prototype.redraw=function(){this.updateParams({})},Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configuration},enumerable:!1,configurable:!0}),e.prototype.getChildElements=function(){var e=[],t=this._fragment&&this._fragment.children;if(!this._fragment){var r=this.parent.querySelector(this.name);r&&(t=r.querySelectorAll("*"))}t||(t=this._fragment.querySelectorAll("*"));for(var n=0;n<t.length;++n){var i=t.item(n);i&&e.push(o.kebabToCamel(i.nodeName.toLowerCase()))}return e},e.prototype.appendTo=function(e,t){var r=this;if(this.parent){if(!t||!this._addedFragment)return;this.parent.innerHTML=""}this.parent=e,this._configuration.id&&(this.parent.id=this._configuration.id),this._fragment?(this.parent.appendChild(this._fragment),this._addedFragment=this._fragment):this.parent.insertAdjacentHTML("beforeend",this._rawHtml),this.onHTMLRendered.notifyObservers(this),setTimeout((function(){r._registerEvents(),r.onAppended.notifyObservers(r)}))},e.prototype.show=function(e){var t=this;return this._isHiding?Promise.resolve(this):Promise.resolve().then((function(){return t._isShowing=!0,e?e(t):(t.parent.style.display="flex","flex"!==t.parent.style.display&&(t.parent.style.display=""),t)})).then((function(){return t.isShown=!0,t._isShowing=!1,t.onStateChange.notifyObservers(t),t}))},e.prototype.hide=function(e){var t=this;return this._isShowing?Promise.resolve(this):Promise.resolve().then((function(){return t._isHiding=!0,e?e(t):(t.parent.style.display="none",t)})).then((function(){return t.isShown=!1,t._isHiding=!1,t.onStateChange.notifyObservers(t),t}))},e.prototype.dispose=function(){this.onAppended.clear(),this.onEventTriggered.clear(),this.onLoaded.clear(),this.onStateChange.clear(),this.isLoaded=!1;try{this.parent.removeChild(this._fragment)}catch(e){}this.loadRequests.forEach((function(e){e.abort()})),this._registeredEvents&&this._registeredEvents.forEach((function(e){e.htmlElement.removeEventListener(e.eventName,e.function)})),delete this._fragment},e.prototype._getTemplateAsHtml=function(e){var t=this;if(e){if(e.html&&!e.location)return Promise.resolve(e.html);var r=this._getTemplateLocation(e);if(o.isUrl(r))return new Promise((function(e,n){var o=i.Tools.LoadFile(r,(function(t){e(t)}),void 0,void 0,!1,(function(e,t){n(t)}));t.loadRequests.push(o)}));r=r.replace("#","");var n=document.getElementById(r);return n?Promise.resolve(n.innerHTML):Promise.reject("Template ID not found")}return Promise.reject("No templateConfig provided")},e.prototype._registerEvents=function(){var e=this;if(this._registeredEvents=this._registeredEvents||[],this._registeredEvents.length&&this._registeredEvents.forEach((function(e){e.htmlElement.removeEventListener(e.eventName,e.function)})),this._configuration.events){var t=function(t){if(r._configuration.events&&r._configuration.events[t]){var n=function(t,r){e.onEventTriggered.notifyObservers({event:r,template:e,selector:t})};if("boolean"==typeof r._configuration.events[t]){var i=r.parent.id;i=i?"#"+i:r.parent.tagName;var o=n.bind(r,i);r.parent.addEventListener(t,n.bind(r,i),!1),r._registeredEvents.push({htmlElement:r.parent,eventName:t,function:o})}else if("object"==typeof r._configuration.events[t]){var s=Object.keys(r._configuration.events[t]||{}),a=r._configuration.events[t]||{};s.filter((function(e){return a[e]})).forEach((function(r){var i=e.parent.querySelector(r);if(!i){r&&0!==r.indexOf("#")&&(r="#"+r);try{i=e.parent.querySelector(r)}catch(e){}}if(i){var o=n.bind(e,r);i.addEventListener(t,o,!1),e._registeredEvents.push({htmlElement:i,eventName:t,function:o})}}))}}},r=this;for(var n in this._configuration.events)t(n)}},e.prototype._getTemplateLocation=function(e){return e&&"string"!=typeof e?e.location:e},e}();t.Template=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;var n=function(){function e(e){var t=this;this._templateManager=e,this._callbacksContainer={},this._templateManager.onEventTriggered.add((function(e){t._eventTriggered(e)}))}return e.prototype.registerCallback=function(e,t,r,n){this._callbacksContainer[e]||(this._callbacksContainer[e]=[]),this._callbacksContainer[e].push({eventType:r,callback:t,selector:n})},e.prototype.unregisterCallback=function(e,t,r,n){var i=this._callbacksContainer[e]||[];this._callbacksContainer[e]=i.filter((function(e){return!(e.eventType&&e.eventType!==r||e.selector&&e.selector!==n)}))},e.prototype._eventTriggered=function(e){var t=e.template.name,r=e.event.type,n=e.selector;(this._callbacksContainer[t]||[]).filter((function(e){return!(e.eventType&&e.eventType!==r||e.selector&&e.selector!==n)})).forEach((function(t){t.callback(e)}))},e.prototype.dispose=function(){this._callbacksContainer={}},e}();t.EventManager=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractViewerWithTemplate=void 0;var o=r(14),s=r(57),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getConfigurationLoader=function(){return new s.ConfigurationLoader},t}(o.AbstractViewer);t.AbstractViewerWithTemplate=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationContainer=void 0;var n=r(0),i=function(){this.mainColor=n.Color3.White(),this.reflectionColor=n.Color3.White()};t.ConfigurationContainer=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLoaderPlugin=t.getLoaderPluginByName=t.ExtendedMaterialLoaderPlugin=t.ApplyMaterialConfigPlugin=t.MSFTLodLoaderPlugin=t.TelemetryLoaderPlugin=void 0;var n=r(32);Object.defineProperty(t,"TelemetryLoaderPlugin",{enumerable:!0,get:function(){return n.TelemetryLoaderPlugin}});var i=r(33);Object.defineProperty(t,"MSFTLodLoaderPlugin",{enumerable:!0,get:function(){return i.MSFTLodLoaderPlugin}});var o=r(34);Object.defineProperty(t,"ApplyMaterialConfigPlugin",{enumerable:!0,get:function(){return o.ApplyMaterialConfigPlugin}});var s=r(35);Object.defineProperty(t,"ExtendedMaterialLoaderPlugin",{enumerable:!0,get:function(){return s.ExtendedMaterialLoaderPlugin}});var a=r(0),l={};t.getLoaderPluginByName=function(e){if(!l[e])switch(e){case"telemetry":l[e]=new n.TelemetryLoaderPlugin;break;case"msftLod":l[e]=new i.MSFTLodLoaderPlugin;break;case"applyMaterialConfig":l[e]=new o.ApplyMaterialConfigPlugin;break;case"extendedMaterial":l[e]=new s.ExtendedMaterialLoaderPlugin}return l[e]},t.addLoaderPlugin=function(e,t){l[e]&&a.Tools.Warn("Overwriting plugin with the same name - "+e),l[e]=t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TelemetryLoaderPlugin=void 0;var n=r(7),i=r(0),o=function(){function e(){}return e.prototype.onInit=function(e,t){this._model=t,this._loadStart=i.PrecisionDate.Now},e.prototype.onLoaded=function(e){n.telemetryManager.broadcast("Model Loaded",e.getViewerId(),{model:e,loadTime:i.PrecisionDate.Now-this._loadStart}),n.telemetryManager.flushWebGLErrors(e.rootMesh.getEngine(),e.getViewerId())},e.prototype.onError=function(e,t){this._loadEnd=i.PrecisionDate.Now,n.telemetryManager.broadcast("Load Error",this._model.getViewerId(),{model:this._model,loadTime:this._loadEnd-this._loadStart}),n.telemetryManager.flushWebGLErrors(this._model.rootMesh.getEngine(),this._model.getViewerId())},e.prototype.onComplete=function(){this._loadEnd=i.PrecisionDate.Now,n.telemetryManager.broadcast("Load Complete",this._model.getViewerId(),{model:this._model,loadTime:this._loadEnd-this._loadStart}),n.telemetryManager.flushWebGLErrors(this._model.rootMesh.getEngine(),this._model.getViewerId())},e}();t.TelemetryLoaderPlugin=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSFTLodLoaderPlugin=void 0;var n=function(){function e(){}return e.prototype.onInit=function(e,t){this._model=t},e.prototype.onExtensionLoaded=function(e){if("MSFT_lod"===e.name&&this._model.configuration.loaderConfiguration){var t=e;t.enabled=!!this._model.configuration.loaderConfiguration.progressiveLoading,t.maxLODsToLoad=this._model.configuration.loaderConfiguration.maxLODsToLoad||Number.MAX_VALUE}},e}();t.MSFTLodLoaderPlugin=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplyMaterialConfigPlugin=void 0;var n=function(){function e(){}return e.prototype.onInit=function(e,t){this._model=t},e.prototype.onMaterialLoaded=function(e){this._model&&this._model._applyModelMaterialConfiguration(e)},e}();t.ApplyMaterialConfigPlugin=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedMaterialLoaderPlugin=void 0;var n=r(0),i=function(){function e(){}return e.prototype.onMaterialLoaded=function(e){e.alphaMode=n.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF},e}();t.ExtendedMaterialLoaderPlugin=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservablesManager=void 0;var n=r(0),i=function(){function e(){this.onSceneInitObservable=new n.Observable,this.onEngineInitObservable=new n.Observable,this.onModelLoadedObservable=new n.Observable,this.onModelLoadProgressObservable=new n.Observable,this.onModelLoadErrorObservable=new n.Observable,this.onModelAddedObservable=new n.Observable,this.onModelRemovedObservable=new n.Observable,this.onViewerInitDoneObservable=new n.Observable,this.onViewerInitStartedObservable=new n.Observable,this.onLoaderInitObservable=new n.Observable,this.onFrameRenderedObservable=new n.Observable,this.onEnteringVRObservable=new n.Observable,this.onExitingVRObservable=new n.Observable}return e.prototype.dispose=function(){this.onSceneInitObservable.clear(),this.onEngineInitObservable.clear(),this.onModelLoadedObservable.clear(),this.onModelLoadProgressObservable.clear(),this.onModelLoadErrorObservable.clear(),this.onModelAddedObservable.clear(),this.onModelRemovedObservable.clear(),this.onViewerInitDoneObservable.clear(),this.onLoaderInitObservable.clear(),this.onFrameRenderedObservable.clear(),this.onEnteringVRObservable.clear(),this.onExitingVRObservable.clear()},e}();t.ObservablesManager=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SceneManager=void 0;var n=r(21),i=r(5),o=r(1),s=r(54),a=r(23),l=r(1),c=r(0),u=r(0),d=r(0),h=r(0),f=r(0),p=r(0),m=r(0),g=r(0),_=r(0),v=r(0),y=r(0),b=r(0),A=r(0),T=r(0),M=r(0),P=r(0),S=r(0),E=r(0),C=r(0),x=r(0),R=function(){function e(e,t,r){var n=this;this._engine=e,this._configurationContainer=t,this._observablesManager=r,this._animationBlendingEnabled=!0,this._white=p.Color3.White(),this._forceShadowUpdate=!1,this._processShadows=!0,this._groundEnabled=!0,this._groundMirrorEnabled=!0,this._defaultRenderingPipelineEnabled=!1,this._globalConfiguration={},this._defaultRenderingPipelineShouldBuild=!0,this._bloomEnabled=!1,this._fxaaEnabled=!1,this._focusOnModel=function(e){var t=e.rootMesh.getHierarchyBoundingVectors(!0),r=t.max.subtract(t.min),i=r.scale(.5),o=t.min.add(i);n.camera.setTarget(o),n.camera.alpha=n._globalConfiguration.camera&&n._globalConfiguration.camera.alpha||n.camera.alpha,n.camera.beta=n._globalConfiguration.camera&&n._globalConfiguration.camera.beta||n.camera.beta,n.camera.radius=n._globalConfiguration.camera&&n._globalConfiguration.camera.radius||n.camera.radius;var s=r.length();isFinite(s)&&(n.camera.upperRadiusLimit=4*s),n._configurationContainer.configuration&&n._configureEnvironment(n._configurationContainer.configuration.skybox,n._configurationContainer.configuration.ground)},this._cameraBehaviorMapping={},this.models=[],this.onCameraConfiguredObservable=new c.Observable,this.onLightsConfiguredObservable=new c.Observable,this.onModelsConfiguredObservable=new c.Observable,this.onSceneConfiguredObservable=new c.Observable,this.onSceneInitObservable=new c.Observable,this.onSceneOptimizerConfiguredObservable=new c.Observable,this.onEnvironmentConfiguredObservable=new c.Observable,this.onVRConfiguredObservable=new c.Observable,this._handleHardwareLimitations(),this.onSceneInitObservable.add((function(e){n.scene.animationPropertiesOverride=n.scene.animationPropertiesOverride||new _.AnimationPropertiesOverride,n.labs=new s.ViewerLabs(e);var t=function(){for(var e=0,t=n.scene.lights;e<t.length;e++){var r=t[e].getShadowGenerator();if(r){var i=r.getShadowMap();i&&(i.refreshRate=v.RenderTargetTexture.REFRESHRATE_RENDER_ONCE)}}};return e.registerBeforeRender((function(){n._forceShadowUpdate||e.animatables&&e.animatables.length>0?(t(),n._forceShadowUpdate=!1):n.models.every((function(e){return e.shadowsRenderedAfterLoad?e.state===i.ModelState.COMPLETE&&!e.currentAnimation:(e.shadowsRenderedAfterLoad=!0,!1)}))||t()})),n._observablesManager&&n._observablesManager.onSceneInitObservable.notifyObserversWithPromise(n.scene)})),this._observablesManager&&(this._observablesManager.onModelLoadedObservable.add((function(e){for(var t=0,r=n.scene.lights;t<r.length;t++){var i=r[t].getShadowGenerator();if(i){var o=i.getShadowMap();o&&(o.refreshRate=v.RenderTargetTexture.REFRESHRATE_RENDER_ONCE)}}n._focusOnModel(e)})),this._observablesManager.onModelAddedObservable.add((function(e){n.models.push(e)})),this._observablesManager.onModelRemovedObservable.add((function(e){n.models.splice(n.models.indexOf(e),1)})))}return Object.defineProperty(e.prototype,"defaultRenderingPipeline",{get:function(){return this._defaultRenderingPipeline},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vrHelper",{get:function(){return this._vrHelper},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHdrSupported",{get:function(){return this._hdrSupport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainColor",{get:function(){return this._configurationContainer.mainColor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reflectionColor",{get:function(){return this._configurationContainer.reflectionColor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationBlendingEnabled",{get:function(){return this.scene&&this.scene.animationPropertiesOverride.enableBlending},set:function(e){this.scene.animationPropertiesOverride.enableBlending=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observablesManager",{get:function(){return this._observablesManager},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"processShadows",{get:function(){return this._processShadows},set:function(e){for(var t=e?v.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME:v.RenderTargetTexture.REFRESHRATE_RENDER_ONCE,r=0,n=this.scene.lights;r<n.length;r++){var i=n[r].getShadowGenerator();if(i){var o=i.getShadowMap();o&&(o.refreshRate=t)}}this._processShadows=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundEnabled",{get:function(){return this._groundEnabled},set:function(e){e!==this._groundEnabled&&(this._groundEnabled=e,this.environmentHelper&&this.environmentHelper.ground&&this.environmentHelper.ground.setEnabled(this._groundEnabled))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundMirrorEnabled",{get:function(){return this._groundMirrorEnabled},set:function(e){this._groundMirrorEnabled!==e&&(this._groundMirrorEnabled=e,this.environmentHelper&&this.environmentHelper.groundMaterial&&this.environmentHelper.groundMirror&&(this.environmentHelper.groundMaterial.reflectionTexture=e?this.environmentHelper.groundMirror:null))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultRenderingPipelineEnabled",{get:function(){return this._defaultRenderingPipelineEnabled},set:function(e){e!==this._defaultRenderingPipelineEnabled&&(this._defaultRenderingPipelineEnabled=e,this._rebuildPostprocesses(),this._defaultRenderingPipeline&&(this._defaultRenderingPipelineShouldBuild=!1,this._defaultRenderingPipeline.prepare(),this.scene.imageProcessingConfiguration.applyByPostProcess=!0))},enumerable:!1,configurable:!0}),e.prototype.unlockBabylonFeatures=function(){this.scene.shadowsEnabled=!0,this.scene.particlesEnabled=!0,this.scene.postProcessesEnabled=!0,this.scene.collisionsEnabled=!0,this.scene.lightsEnabled=!0,this.scene.texturesEnabled=!0,this.scene.lensFlaresEnabled=!0,this.scene.proceduralTexturesEnabled=!0,this.scene.renderTargetsEnabled=!0,this.scene.spritesEnabled=!0,this.scene.skeletonsEnabled=!0,this.scene.audioEnabled=!0},e.prototype.initScene=function(e,t){if(void 0===e&&(e={}),this.scene&&this.scene.dispose(),this.scene=new E.Scene(this._engine),this._configurationContainer.scene=this.scene,!e.defaultMaterial){var r=new y.PBRMaterial("defaultMaterial",this.scene);r.reflectivityColor=new p.Color3(.1,.1,.1),r.microSurface=.6,this.scene.defaultMaterial&&this.scene.defaultMaterial.dispose(),this.scene.defaultMaterial=r}return this.scene.animationPropertiesOverride=new _.AnimationPropertiesOverride,g.Animation.AllowMatricesInterpolation=!0,this.onSceneInitObservable.notifyObserversWithPromise(this.scene)},e.prototype.clearScene=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!1),e&&(this.models.forEach((function(e){return e.dispose()})),this.models.length=0),t&&this.scene.lights.forEach((function(e){return e.dispose()}))},e.prototype.updateConfiguration=function(e){var t=this;if(this._configurationContainer?this._globalConfiguration=this._configurationContainer.configuration:this._globalConfiguration=e,e.scene&&this._configureScene(e.scene),void 0!==e.optimizer&&this._configureOptimizer(e.optimizer),this._configureLights(e.lights),void 0===e.skybox&&void 0===e.ground||this._configureEnvironment(e.skybox,e.ground),this._configureCamera(e.camera),void 0!==e.environmentMap&&this._configureEnvironmentMap(e.environmentMap),void 0!==e.vr&&this._configureVR(e.vr),e.lab){if(e.lab.defaultRenderingPipelines){var r=e.lab.defaultRenderingPipelines;this.defaultRenderingPipelineEnabled="boolean"!=typeof r||r}if(this.environmentHelper&&e.lab.environmentMainColor){var n=new p.Color3(e.lab.environmentMainColor.r,e.lab.environmentMainColor.g,e.lab.environmentMainColor.b);this.environmentHelper.setMainColor(n)}void 0!==e.lab.globalLightRotation&&(this.scene.lights.filter((function(e){return e instanceof b.ShadowLight})).forEach((function(r){t.labs.rotateShadowLight(r,e.lab.globalLightRotation)})),this._forceShadowUpdate=!0)}this._defaultRenderingPipeline&&this._defaultRenderingPipeline.imageProcessing&&(this._defaultRenderingPipeline.imageProcessing.fromLinearSpace=!0),this._defaultRenderingPipelineShouldBuild&&this._defaultRenderingPipeline&&(this._defaultRenderingPipelineShouldBuild=!1,this._defaultRenderingPipeline.prepare())},e.prototype._rebuildPostprocesses=function(e){if(this._defaultRenderingPipelineEnabled&&n.getConfigurationKey("scene.imageProcessingConfiguration.isEnabled",this._globalConfiguration)){var t=e||this._globalConfiguration.lab&&this._globalConfiguration.lab.defaultRenderingPipelines;if(t){this._defaultRenderingPipeline||(this._defaultRenderingPipeline=new m.DefaultRenderingPipeline("default rendering pipeline",this._hdrSupport,this.scene,[this.camera],!1)),this.scene.autoClear=!1,this.scene.autoClearDepthAndStencil=!1,this._defaultRenderingPipelineShouldBuild=!0;var r=this._bloomEnabled;"boolean"!=typeof t&&(o.extendClassWithConfig(this._defaultRenderingPipeline,t),this._bloomEnabled=!!t.bloomEnabled,this._fxaaEnabled=!!t.fxaaEnabled,r=this._bloomEnabled&&void 0!==t.bloomWeight&&t.bloomWeight>0,this._defaultRenderingPipeline.bloomWeight=void 0!==t.bloomWeight&&t.bloomWeight||this._defaultRenderingPipeline.bloomWeight),this._defaultRenderingPipeline.bloomEnabled=r,this._defaultRenderingPipeline.fxaaEnabled=this.fxaaEnabled}}else this._defaultRenderingPipeline&&(this._defaultRenderingPipeline.dispose(),this._defaultRenderingPipeline=null,this.scene.autoClearDepthAndStencil=!0,this.scene.autoClear=!0,this.scene.imageProcessingConfiguration.applyByPostProcess=!1)},Object.defineProperty(e.prototype,"bloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._rebuildPostprocesses(),this._defaultRenderingPipeline&&(this._defaultRenderingPipelineShouldBuild=!1,this._defaultRenderingPipeline.prepare(),this.scene.imageProcessingConfiguration.applyByPostProcess=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._rebuildPostprocesses(),this._defaultRenderingPipeline&&(this._defaultRenderingPipelineShouldBuild=!1,this._defaultRenderingPipeline.prepare(),this.scene.imageProcessingConfiguration.applyByPostProcess=!0))},enumerable:!1,configurable:!0}),e.prototype.setDefaultMaterial=function(e){},e.prototype._configureScene=function(e){if(this.scene){var t=e.clearColor,r=this.scene.clearColor;if(t&&(void 0!==t.r&&(r.r=t.r),void 0!==t.g&&(r.g=t.g),void 0!==t.b&&(r.b=t.b),void 0!==t.a&&(r.a=t.a)),e.assetsRootURL&&(this._assetsRootURL=e.assetsRootURL),e.imageProcessingConfiguration&&o.extendClassWithConfig(this.scene.imageProcessingConfiguration,e.imageProcessingConfiguration),e.animationPropertiesOverride&&o.extendClassWithConfig(this.scene.animationPropertiesOverride,e.animationPropertiesOverride),e.environmentTexture&&(!this.scene.environmentTexture||this.scene.environmentTexture.url!==e.environmentTexture)){this.scene.environmentTexture&&this.scene.environmentTexture.dispose&&this.scene.environmentTexture.dispose();var n=A.CubeTexture.CreateFromPrefilteredData(e.environmentTexture,this.scene);this.scene.environmentTexture=n}!0===e.debug?this.scene.debugLayer.show():!1===e.debug&&this.scene.debugLayer.isVisible()&&this.scene.debugLayer.hide(),e.disableHdr?this._handleHardwareLimitations(!1):this._handleHardwareLimitations(!0),void 0!==e.renderInBackground&&(this._engine.renderEvenInBackground=!!e.renderInBackground);var i=this._engine.getInputElement();i&&(this.camera&&e.disableCameraControl?this.camera.detachControl(i):this.camera&&!1===e.disableCameraControl&&this.camera.attachControl(i)),this.setDefaultMaterial(e),e.flags&&o.extendClassWithConfig(this.scene,e.flags),this.onSceneConfiguredObservable.notifyObservers({sceneManager:this,object:this.scene,newConfiguration:e})}},e.prototype._configureOptimizer=function(e){var t=this;if("boolean"==typeof e)this.sceneOptimizer&&(this.sceneOptimizer.stop(),this.sceneOptimizer.dispose(),delete this.sceneOptimizer),e&&(this.sceneOptimizer=new u.SceneOptimizer(this.scene),this.sceneOptimizer.start());else{var r=new u.SceneOptimizerOptions(e.targetFrameRate,e.trackerDuration);if(e.degradation)switch(e.degradation){case"low":r=u.SceneOptimizerOptions.LowDegradationAllowed(e.targetFrameRate);break;case"moderate":r=u.SceneOptimizerOptions.ModerateDegradationAllowed(e.targetFrameRate);break;case"hight":r=u.SceneOptimizerOptions.HighDegradationAllowed(e.targetFrameRate)}if(this.sceneOptimizer&&(this.sceneOptimizer.stop(),this.sceneOptimizer.dispose()),e.custom){var n=a.getCustomOptimizerByName(e.custom,e.improvementMode);n&&r.addCustomOptimization((function(){return n(t)}),(function(){return"Babylon Viewer "+e.custom+" custom optimization"}))}this.sceneOptimizer=new u.SceneOptimizer(this.scene,r,e.autoGeneratePriorities,e.improvementMode),this.sceneOptimizer.start()}this.onSceneOptimizerConfiguredObservable.notifyObservers({sceneManager:this,object:this.sceneOptimizer,newConfiguration:e})},e.prototype._configureVR=function(e){var t=this;if(e.disabled)this._vrHelper&&(this._vrHelper.isInVRMode&&this._vrHelper.exitVR(),this._vrHelper.dispose(),this._vrHelper=void 0);else{var r,n=l.deepmerge({useCustomVRButton:!0,createDeviceOrientationCamera:!1,trackPosition:!0},e.vrOptions||{});if(this._vrHelper=this.scene.createDefaultVRExperience(n),e.disableInteractions||this._vrHelper.enableInteractions(),!e.disableTeleportation){var i=e.overrideFloorMeshName||"BackgroundPlane";this._vrHelper.enableTeleportation({floorMeshName:i})}if(e.rotateUsingControllers)this._vrHelper.onControllerMeshLoadedObservable.add((function(e){e.onTriggerStateChangedObservable.add((function(n){e.mesh&&e.mesh.rotationQuaternion&&(n.pressed?r||(t.models[0].rootMesh.rotationQuaternion=t.models[0].rootMesh.rotationQuaternion||new p.Quaternion,r=e.mesh.rotationQuaternion.conjugate().multiply(t.models[0].rootMesh.rotationQuaternion)):r=null)})),t.scene.registerBeforeRender((function(){t.models[0]&&(r&&e.mesh&&e.mesh.rotationQuaternion?t.models[0].rootMesh.rotationQuaternion.copyFrom(e.mesh.rotationQuaternion).multiplyInPlace(r):t.models[0].rootMesh.rotationQuaternion=null)}))}));this._vrHelper.onEnteringVRObservable.add((function(){t._observablesManager&&t._observablesManager.onEnteringVRObservable.notifyObservers(t)})),this._vrHelper.onExitingVRObservable.add((function(){t._observablesManager&&t._observablesManager.onExitingVRObservable.notifyObservers(t)})),this.onVRConfiguredObservable.notifyObservers({sceneManager:this,object:this._vrHelper,newConfiguration:e})}},e.prototype._configureEnvironmentMap=function(e){if(e.texture&&(this.scene.environmentTexture=new A.CubeTexture(this._getAssetUrl(e.texture),this.scene)),this.scene.environmentTexture){var t=p.Quaternion.RotationAxis(p.Axis.Y,e.rotationY||0);p.Matrix.FromQuaternionToRef(t,this.scene.environmentTexture.getReflectionTextureMatrix())}if(e.mainColor){this._configurationContainer.mainColor=this.mainColor||p.Color3.White();var r=e.mainColor;void 0!==r.r&&(this.mainColor.r=r.r),void 0!==r.g&&(this.mainColor.g=r.g),void 0!==r.b&&(this.mainColor.b=r.b),this.reflectionColor.copyFrom(this.mainColor);var i=n.getConfigurationKey("environmentMap.tintLevel",this._globalConfiguration)||0;this.reflectionColor.toLinearSpaceToRef(this.reflectionColor),this.reflectionColor.scaleToRef(1/this.scene.imageProcessingConfiguration.exposure,this.reflectionColor);var o=p.Color3.Lerp(this._white,this.reflectionColor,i);this.reflectionColor.copyFrom(o),this.environmentHelper&&(this.environmentHelper.groundMaterial&&(this.environmentHelper.groundMaterial._perceptualColor=this.mainColor),this.environmentHelper.skyboxMaterial&&(this.environmentHelper.skyboxMaterial._perceptualColor=this.mainColor))}},e.prototype._configureCamera=function(e){var t=this;if(void 0===e&&(e={}),!this.scene.activeCamera){if(this._globalConfiguration.scene&&this._globalConfiguration.scene.disableCameraControl&&!1,this.scene.activeCamera&&(this.scene.activeCamera.dispose(),this.scene.activeCamera=null),!this.scene.activeCamera){var r,i=this.scene.getWorldExtends(),s=i.max.subtract(i.min),a=i.min.add(s.scale(.5)),l=1.5*s.length();isFinite(l)||(l=1,a.copyFromFloats(0,0,0));var c=new d.ArcRotateCamera("default camera",-Math.PI/2,Math.PI/2,l,a,this.scene);c.lowerRadiusLimit=.01*l,c.wheelPrecision=100/l,(r=c).minZ=.01*l,r.maxZ=1e3*l,r.speed=.2*l,this.scene.activeCamera=r}var u=this.scene.getEngine().getInputElement();u&&this.scene.activeCamera.attachControl(u),this.camera=this.scene.activeCamera,this.camera.setTarget(p.Vector3.Zero())}if(this.camera||(this.camera=this.scene.activeCamera),e.position){var h=this.camera.position.clone();o.extendClassWithConfig(h,e.position),this.camera.setPosition(h)}if(e.target){var f=this.camera.target.clone();o.extendClassWithConfig(f,e.target),this.camera.setTarget(f)}if(e.rotation&&(this.camera.rotationQuaternion=new p.Quaternion(e.rotation.x||0,e.rotation.y||0,e.rotation.z||0,e.rotation.w||0)),e.behaviors)for(var m in e.behaviors)void 0!==e.behaviors[m]&&this._setCameraBehavior(m,e.behaviors[m]);var g=this.scene.getWorldExtends((function(e){return!t.environmentHelper||e!==t.environmentHelper.ground&&e!==t.environmentHelper.rootMesh&&e!==t.environmentHelper.skybox})),_=g.max.subtract(g.min).length();isFinite(_)&&(this.camera.upperRadiusLimit=4*_),this.scene.imageProcessingConfiguration&&(this.scene.imageProcessingConfiguration.colorCurvesEnabled=!0,this.scene.imageProcessingConfiguration.vignetteEnabled=!0,this.scene.imageProcessingConfiguration.toneMappingEnabled=!!n.getConfigurationKey("camera.toneMappingEnabled",this._globalConfiguration)),o.extendClassWithConfig(this.camera,e),this.onCameraConfiguredObservable.notifyObservers({sceneManager:this,object:this.camera,newConfiguration:e})},e.prototype._configureEnvironment=function(e,t){var r=this;if(e||t){var n={createGround:!!t&&this._groundEnabled,createSkybox:!!e,setupImageProcessing:!1};if(t){var i="boolean"==typeof t?{}:t,s=i.size||"object"==typeof e&&e.scale;s&&(n.groundSize=s),n.enableGroundShadow=!0===i||i.receiveShadows,void 0!==i.shadowLevel&&(n.groundShadowLevel=i.shadowLevel),n.enableGroundMirror=!!i.mirror&&this.groundMirrorEnabled,i.texture&&(n.groundTexture=this._getAssetUrl(i.texture)),i.color&&(n.groundColor=new p.Color3(i.color.r,i.color.g,i.color.b)),void 0!==i.opacity&&(n.groundOpacity=i.opacity),i.mirror&&(n.enableGroundMirror=!0,"object"==typeof i.mirror&&(void 0!==i.mirror.amount&&(n.groundMirrorAmount=i.mirror.amount),void 0!==i.mirror.sizeRatio&&(n.groundMirrorSizeRatio=i.mirror.sizeRatio),void 0!==i.mirror.blurKernel&&(n.groundMirrorBlurKernel=i.mirror.blurKernel),void 0!==i.mirror.fresnelWeight&&(n.groundMirrorFresnelWeight=i.mirror.fresnelWeight),void 0!==i.mirror.fallOffDistance&&(n.groundMirrorFallOffDistance=i.mirror.fallOffDistance),void 0!==this._defaultPipelineTextureType&&(n.groundMirrorTextureType=this._defaultPipelineTextureType)))}var a=!1;if(e){var l=!0===e?{}:e;l.material&&l.material.imageProcessingConfiguration&&(n.setupImageProcessing=!1);var c=l.scale;c&&(n.skyboxSize=c),n.sizeAuto=!n.skyboxSize,l.color&&(n.skyboxColor=new p.Color3(l.color.r,l.color.g,l.color.b)),l.cubeTexture&&l.cubeTexture.url&&("string"==typeof l.cubeTexture.url?n.skyboxTexture=this._getAssetUrl(l.cubeTexture.url):a=!0),l.material&&(a=!0)}if(n.setupImageProcessing=!1,this.environmentHelper)this.environmentHelper.rootMesh.getScene()!==this.scene?(this.environmentHelper.dispose(),this.environmentHelper=new f.EnvironmentHelper(n,this.scene)):(this.environmentHelper.ground&&this.environmentHelper.ground.dispose(),this.environmentHelper.skybox&&this.environmentHelper.skybox.dispose(),this.environmentHelper.updateOptions(n));else this.environmentHelper=new f.EnvironmentHelper(n,this.scene);this.environmentHelper.rootMesh&&this._globalConfiguration.scene&&void 0!==this._globalConfiguration.scene.environmentRotationY&&(this.environmentHelper.rootMesh.rotation.y=this._globalConfiguration.scene.environmentRotationY);var u="boolean"==typeof t?{}:t;if(this.environmentHelper.groundMaterial&&u&&(this.environmentHelper.groundMaterial._perceptualColor=this.mainColor,u.material&&o.extendClassWithConfig(this.environmentHelper.groundMaterial,u.material),this.environmentHelper.groundMirror)){var d=this.environmentHelper.groundMaterial._perceptualColor.toLinearSpace(),h=Math.pow(2,-this.scene.imageProcessingConfiguration.exposure)*Math.PI;d.scaleToRef(1/h,d),this.environmentHelper.groundMirror.clearColor.r=M.Scalar.Clamp(d.r),this.environmentHelper.groundMirror.clearColor.g=M.Scalar.Clamp(d.g),this.environmentHelper.groundMirror.clearColor.b=M.Scalar.Clamp(d.b),this.environmentHelper.groundMirror.clearColor.a=1,this.groundMirrorEnabled||(this.environmentHelper.groundMaterial.reflectionTexture=null)}var m=this.environmentHelper.skyboxMaterial;m&&(m._perceptualColor=this.mainColor,a&&"object"==typeof e&&e.material&&o.extendClassWithConfig(m,e.material))}else this.environmentHelper&&(this.environmentHelper.dispose(),this.environmentHelper=void 0);this._observablesManager&&this._observablesManager.onModelLoadedObservable.add((function(e){r._updateGroundMirrorRenderList(e)})),this.onEnvironmentConfiguredObservable.notifyObservers({sceneManager:this,object:this.environmentHelper,newConfiguration:{skybox:e,ground:t}})},e.prototype._configureLights=function(e){var t=this;void 0===e&&(e={});var r=Object.keys(e).filter((function(e){return"globalRotation"!==e}));if(r.length){var n=this.scene.lights.map((function(e){return e.name})),i=Object.keys(this._globalConfiguration.lights||[]);Object.keys(i).length!==n.length&&n.forEach((function(e){-1===i.indexOf(e)&&t.scene.getLightByName(e).dispose()})),r.forEach((function(r,i){var s,a={type:0};if("object"==typeof e[r]&&(a=e[r]),"number"==typeof e[r]&&(a.type=e[r]),a.name=r,-1===n.indexOf(r)){if(!(l=h.Light.GetConstructorFromName(a.type,a.name,t.scene)))return;s=l()}else if(s=t.scene.getLightByName(r),"boolean"==typeof e[r]&&(a.type=s.getTypeID()),n=n.filter((function(e){return e!==r})),void 0!==a.type&&s.getTypeID()!==a.type){var l;if(s.dispose(),!(l=h.Light.GetConstructorFromName(a.type,a.name,t.scene)))return;s=l()}if(!1!==e[r]){var c=void 0!==a.enabled?a.enabled:!a.disabled;if(s.setEnabled(c),o.extendClassWithConfig(s,a),s instanceof b.ShadowLight){if(s.shadowMinZ=s.shadowMinZ||.2,s.shadowMaxZ=Math.min(10,s.shadowMaxZ||10),a.target){if(s.setDirectionToTarget){var u=p.Vector3.Zero().copyFromFloats(a.target.x,a.target.y,a.target.z);s.setDirectionToTarget(u)}}else if(a.direction){var d=p.Vector3.Zero().copyFromFloats(a.direction.x,a.direction.y,a.direction.z);s.direction=d}var f=!1;if(s.getTypeID()===h.Light.LIGHTTYPEID_DIRECTIONALLIGHT)s.shadowFrustumSize=a.shadowFrustumSize||2,f=!0;else if(s.getTypeID()===h.Light.LIGHTTYPEID_SPOTLIGHT){var m=s;void 0!==a.spotAngle&&(m.angle=a.spotAngle*Math.PI/180),m.angle&&a.shadowFieldOfView&&(m.shadowAngleScale=a.shadowFieldOfView/m.angle),f=!0}else s.getTypeID()===h.Light.LIGHTTYPEID_POINTLIGHT&&(a.shadowFieldOfView&&(s.shadowAngle=a.shadowFieldOfView*Math.PI/180),f=!0);var g=s.getShadowGenerator();if(f&&a.shadowEnabled&&t._maxShadows){var _=a.shadowBufferSize||256;g||(g=new C.ShadowGenerator(_,s));var v=t.getBlurKernel(s,_);g.bias=t._shadowGeneratorBias,g.blurKernel=v,o.extendClassWithConfig(g,a.shadowConfig||{}),t._observablesManager&&t._observablesManager.onModelLoadedObservable.add((function(e){t._updateShadowRenderList(g,e)})),t._updateShadowRenderList(g)}else g&&g.dispose()}}else s.dispose()}));var s=this._globalConfiguration.lights||{};Object.keys(s).sort().forEach((function(e,r){s[e];var n=t.scene.getLightByName(e);n&&(n.renderPriority=-r)}))}else this.scene.lights.length||new T.HemisphericLight("default light",p.Vector3.Up(),this.scene);this.onLightsConfiguredObservable.notifyObservers({sceneManager:this,object:this.scene.lights,newConfiguration:e})},e.prototype._updateShadowRenderList=function(e,t,r){var n=t?t.meshes:this.scene.meshes,i=e.getShadowMap();if(i){r&&i.renderList?i.renderList.length=0:i.renderList=i.renderList||[];for(var o=0;o<n.length;o++){var s=n[o];S.Tags.MatchesQuery(s,"castShadow")&&-1===i.renderList.indexOf(s)&&i.renderList.push(s)}if(this._shadowGroundPlane)e.useBlurCloseExponentialShadowMap||(this._shadowGroundPlane.dispose(),this._shadowGroundPlane=null);else if(e.useBlurCloseExponentialShadowMap){var a=P.Mesh.CreatePlane("shadowGroundPlane",100,this.scene,!1);a.useVertexColors=!1,a.material=new y.PBRMaterial("shadowGroundPlaneMaterial",this.scene),a.material.backFaceCulling=!1,a.rotation.x=.5*Math.PI,a.freezeWorldMatrix(),this._shadowGroundPlane=a,this.scene.removeMesh(a)}this._shadowGroundPlane&&-1===i.renderList.indexOf(this._shadowGroundPlane)&&i.renderList.push(this._shadowGroundPlane)}},e.prototype._updateGroundMirrorRenderList=function(e,t){if(this.environmentHelper&&this.environmentHelper.groundMirror&&this.environmentHelper.groundMirror.renderList){var r=e?e.meshes:this.scene.meshes,n=this.environmentHelper.groundMirror.renderList;t&&(n.length=0);for(var i=0;i<r.length;i++){var o=r[i];-1===n.indexOf(o)&&n.push(o)}}},e.prototype.getBlurKernel=function(e,t){var r=.05;e.getTypeID()===h.Light.LIGHTTYPEID_DIRECTIONALLIGHT?r/=e.shadowFrustumSize:e.getTypeID()===h.Light.LIGHTTYPEID_POINTLIGHT?r/=e.shadowAngle:e.getTypeID()===h.Light.LIGHTTYPEID_SPOTLIGHT&&(r/=e.angle*e.shadowAngleScale);var n=5/(t/256);return Math.max(t*r,n)},e.prototype._handleHardwareLimitations=function(e){void 0===e&&(e=!0);var t=this._engine.getCaps().maxVaryingVectors,r=this._engine.getCaps().maxTexturesImageUnits;this._maxShadows=t<8||r<8?0:3;var n=this._engine.getCaps(),i=n.textureHalfFloatRender&&n.textureHalfFloatLinearFiltering,o=n.textureFloatRender&&n.textureFloatLinearFiltering;this._hdrSupport=e&&!(!o&&!i),i?(this._defaultHighpTextureType=x.Constants.TEXTURETYPE_HALF_FLOAT,this._shadowGeneratorBias=.002):o?(this._defaultHighpTextureType=x.Constants.TEXTURETYPE_FLOAT,this._shadowGeneratorBias=.001):(this._defaultHighpTextureType=x.Constants.TEXTURETYPE_UNSIGNED_INT,this._shadowGeneratorBias=.001),this._defaultPipelineTextureType=this._hdrSupport?this._defaultHighpTextureType:x.Constants.TEXTURETYPE_UNSIGNED_INT},e.prototype.dispose=function(){this.onEnvironmentConfiguredObservable.clear(),this.onLightsConfiguredObservable.clear(),this.onModelsConfiguredObservable.clear(),this.onSceneConfiguredObservable.clear(),this.onSceneInitObservable.clear(),this.onSceneOptimizerConfiguredObservable.clear(),this.onVRConfiguredObservable.clear(),this.sceneOptimizer&&(this.sceneOptimizer.stop(),this.sceneOptimizer.dispose()),this.environmentHelper&&this.environmentHelper.dispose(),this.models.forEach((function(e){e.dispose()})),this._defaultRenderingPipeline&&this._defaultRenderingPipeline.dispose(),this.models.length=0,this.scene&&this.scene.dispose()},e.prototype._getAssetUrl=function(e){var t=e;if(e&&-1===e.toLowerCase().indexOf("//")){if(!this._assetsRootURL)return e;t=this._assetsRootURL+t}return t},e.prototype._setCameraBehavior=function(e,t,r){var n,i;if(void 0!==(i="object"==typeof t?t.type:"number"==typeof t?t:this._cameraBehaviorMapping[e])){var s="object"==typeof t?t:{},a=!0;switch("boolean"==typeof t&&(a=t),i){case 0:this.camera.useAutoRotationBehavior=a,n=this.camera.autoRotationBehavior;break;case 1:this.camera.useBouncingBehavior=a,n=this.camera.bouncingBehavior;break;case 2:this.camera.useFramingBehavior=a,n=this.camera.framingBehavior;break;default:n=null}switch(n&&(this._cameraBehaviorMapping[e]=i,"object"==typeof t&&o.extendClassWithConfig(n,t)),i){case 0:case 1:break;case 2:this._observablesManager&&this._observablesManager.onModelLoadedObservable.add((function(e){s.zoomOnBoundingInfo&&n.zoomOnMeshHierarchy(e.rootMesh)}))}}},e}();t.SceneManager=R},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39),t),i(r(40),t),i(r(41),t),i(r(42),t),i(r(43),t),i(r(44),t),i(r(45),t),i(r(46),t),i(r(47),t),i(r(48),t),i(r(49),t),i(r(50),t),i(r(51),t),i(r(52),t),i(r(53),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewerLabs=void 0;var n=r(55),i=r(0),o=r(0),s=r(22),a=r(0),l=function(){function e(e){this._scene=e,this.environment={irradiancePolynomialCoefficients:{x:new i.Vector3(0,0,0),y:new i.Vector3(0,0,0),z:new i.Vector3(0,0,0),xx:new i.Vector3(0,0,0),yy:new i.Vector3(0,0,0),zz:new i.Vector3(0,0,0),yz:new i.Vector3(0,0,0),zx:new i.Vector3(0,0,0),xy:new i.Vector3(0,0,0)},textureIntensityScale:1}}return e.prototype.loadEnvironment=function(e,t,r,i){var o=this;if(e instanceof ArrayBuffer)this.environment=n.EnvironmentDeserializer.Parse(e),t&&t(this.environment);else if("string"==typeof e){var s=this.getAssetUrl(e);this._scene._loadFile(s,(function(e){o.environment=n.EnvironmentDeserializer.Parse(e),t&&t(o.environment)}),(function(e){r&&r(e.loaded,e.total)}),!1,!0,(function(e,t){i&&i(t)}))}else this.environment=e,t&&t(e)},e.prototype.applyEnvironmentMapConfiguration=function(e){if(this.environment){var t=i.Quaternion.RotationAxis(a.Axis.Y,e||0);if(this.environment.specularTexture&&(this._scene.environmentTexture||(this._scene.environmentTexture=s.TextureUtils.GetBabylonCubeTexture(this._scene,this.environment.specularTexture,!1,!0)),this._scene.environmentTexture)){this._scene.environmentTexture.level=this.environment.textureIntensityScale,this._scene.environmentTexture.invertZ=!0,this._scene.environmentTexture.lodLevelInAlpha=!0;var r=this._scene.environmentTexture.sphericalPolynomial||new o.SphericalPolynomial;r.x=this.environment.irradiancePolynomialCoefficients.x,r.y=this.environment.irradiancePolynomialCoefficients.y,r.z=this.environment.irradiancePolynomialCoefficients.z,r.xx=this.environment.irradiancePolynomialCoefficients.xx,r.xy=this.environment.irradiancePolynomialCoefficients.xy,r.yy=this.environment.irradiancePolynomialCoefficients.yy,r.yz=this.environment.irradiancePolynomialCoefficients.yz,r.zx=this.environment.irradiancePolynomialCoefficients.zx,r.zz=this.environment.irradiancePolynomialCoefficients.zz,this._scene.environmentTexture.sphericalPolynomial=r,i.Matrix.FromQuaternionToRef(t,this._scene.environmentTexture.getReflectionTextureMatrix())}}},e.prototype.getAssetUrl=function(e){var t=e;if(e&&-1===e.toLowerCase().indexOf("//")){if(!this.assetsRootURL)return e;t=this.assetsRootURL+t}return t},e.prototype.rotateShadowLight=function(e,t,r,n,o){void 0===r&&(r=i.Vector3.Zero()),void 0===n&&(n=a.Axis.Y),void 0===o&&(o=i.Vector3.Zero()),n.normalize(),r.subtractToRef(e.position,i.TmpVectors.Vector3[0]),i.Matrix.TranslationToRef(i.TmpVectors.Vector3[0].x,i.TmpVectors.Vector3[0].y,i.TmpVectors.Vector3[0].z,i.TmpVectors.Matrix[0]),i.TmpVectors.Matrix[0].invertToRef(i.TmpVectors.Matrix[2]),i.Matrix.RotationAxisToRef(n,t,i.TmpVectors.Matrix[1]),i.TmpVectors.Matrix[2].multiplyToRef(i.TmpVectors.Matrix[1],i.TmpVectors.Matrix[2]),i.TmpVectors.Matrix[2].multiplyToRef(i.TmpVectors.Matrix[0],i.TmpVectors.Matrix[2]),i.TmpVectors.Matrix[2].decompose(i.TmpVectors.Vector3[0],i.TmpVectors.Quaternion[0],i.TmpVectors.Vector3[1]),e.position.addInPlace(i.TmpVectors.Vector3[1]),e.setDirectionToTarget(o)},e}();t.ViewerLabs=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnvironmentDeserializer=void 0;var n=r(0),i=r(0),o=r(22),s=function(){function e(){}return e.Parse=function(t){for(var r={irradiancePolynomialCoefficients:{x:new n.Vector3(0,0,0),y:new n.Vector3(0,0,0),z:new n.Vector3(0,0,0),xx:new n.Vector3(0,0,0),yy:new n.Vector3(0,0,0),zz:new n.Vector3(0,0,0),yz:new n.Vector3(0,0,0),zx:new n.Vector3(0,0,0),xy:new n.Vector3(0,0,0)},textureIntensityScale:1},s=[134,22,135,150,246,214,150,54],a=new DataView(t),l=0,c=0;c<s.length;c++)a.getUint8(l++)!==s[c]&&i.Tools.Error("Not a Spectre environment map");var u=a.getUint16(l,!1);l+=2,1!==u&&i.Tools.Warn('Unsupported Spectre environment map version "'+u+'"');for(var d="",h=0;h=a.getUint8(l++);)d+=String.fromCharCode(h);var f=JSON.parse(d),p=l;switch(f.irradiance.type){case"irradiance_sh_coefficients_9":var m=f.irradiance;e._ConvertSHIrradianceToLambertianRadiance(m),e._ConvertSHToSP(m,r.irradiancePolynomialCoefficients);break;default:i.Tools.Error("Unhandled MapType descriptor.irradiance.type ("+f.irradiance.type+")")}switch(f.specular.type){case"cubemap_faces":var g=f.specular,_=r.specularTexture=new o.TextureCube(6408,5121);r.textureIntensityScale=null!=g.multiplier?g.multiplier:1;for(var v=g.mipmaps,y=g.imageType,b=0;b<v.length;b++){var A=v[b];_.source[b]=[];for(c=0;c<6;c++){var T=A[c],M=new Uint8Array(t,p+T.pos,T.length);switch(y){case"png":var P=new Image,S=URL.createObjectURL(new Blob([M],{type:"image/png"}));P.src=S,_.source[b][c]=P;break;default:i.Tools.Error("Unhandled ImageType descriptor.specular.imageType ("+y+")")}}}break;default:i.Tools.Error("Unhandled MapType descriptor.specular.type ("+f.specular.type+")")}return r},e._ConvertSHIrradianceToLambertianRadiance=function(t){e._ScaleSH(t,1/Math.PI)},e._ConvertSHToSP=function(e,t){var r=1/Math.PI;t.x.x=1.02333*e.l11[0]*r,t.x.y=1.02333*e.l11[1]*r,t.x.z=1.02333*e.l11[2]*r,t.y.x=1.02333*e.l1_1[0]*r,t.y.y=1.02333*e.l1_1[1]*r,t.y.z=1.02333*e.l1_1[2]*r,t.z.x=1.02333*e.l10[0]*r,t.z.y=1.02333*e.l10[1]*r,t.z.z=1.02333*e.l10[2]*r,t.xx.x=(.886277*e.l00[0]-.247708*e.l20[0]+.429043*e.l22[0])*r,t.xx.y=(.886277*e.l00[1]-.247708*e.l20[1]+.429043*e.l22[1])*r,t.xx.z=(.886277*e.l00[2]-.247708*e.l20[2]+.429043*e.l22[2])*r,t.yy.x=(.886277*e.l00[0]-.247708*e.l20[0]-.429043*e.l22[0])*r,t.yy.y=(.886277*e.l00[1]-.247708*e.l20[1]-.429043*e.l22[1])*r,t.yy.z=(.886277*e.l00[2]-.247708*e.l20[2]-.429043*e.l22[2])*r,t.zz.x=(.886277*e.l00[0]+.495417*e.l20[0])*r,t.zz.y=(.886277*e.l00[1]+.495417*e.l20[1])*r,t.zz.z=(.886277*e.l00[2]+.495417*e.l20[2])*r,t.yz.x=.858086*e.l2_1[0]*r,t.yz.y=.858086*e.l2_1[1]*r,t.yz.z=.858086*e.l2_1[2]*r,t.zx.x=.858086*e.l21[0]*r,t.zx.y=.858086*e.l21[1]*r,t.zx.z=.858086*e.l21[2]*r,t.xy.x=.858086*e.l2_2[0]*r,t.xy.y=.858086*e.l2_2[1]*r,t.xy.z=.858086*e.l2_2[2]*r},e._ScaleSH=function(e,t){e.l00[0]*=t,e.l00[1]*=t,e.l00[2]*=t,e.l1_1[0]*=t,e.l1_1[1]*=t,e.l1_1[2]*=t,e.l10[0]*=t,e.l10[1]*=t,e.l10[2]*=t,e.l11[0]*=t,e.l11[1]*=t,e.l11[2]*=t,e.l2_2[0]*=t,e.l2_2[1]*=t,e.l2_2[2]*=t,e.l2_1[0]*=t,e.l2_1[1]*=t,e.l2_1[2]*=t,e.l20[0]*=t,e.l20[1]*=t,e.l20[2]*=t,e.l21[0]*=t,e.l21[1]*=t,e.l21[2]*=t,e.l22[0]*=t,e.l22[1]*=t,e.l22[2]*=t},e}();t.EnvironmentDeserializer=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendedDegrade=t.extendedUpgrade=void 0;var n=r(0);t.extendedUpgrade=function(e){var t=e.defaultRenderingPipeline;if(e.scene.getEngine().getHardwareScalingLevel()>1){var r=n.Scalar.Clamp(e.scene.getEngine().getHardwareScalingLevel()-.25,0,1);return e.scene.getEngine().setHardwareScalingLevel(r),!1}if(!e.scene.postProcessesEnabled)return e.scene.postProcessesEnabled=!0,!1;if(!e.groundEnabled)return e.groundEnabled=!0,!1;if(t&&!e.fxaaEnabled)return e.fxaaEnabled=!0,!1;var i=Math.max(.5,1/(window.devicePixelRatio||2));if(e.scene.getEngine().getHardwareScalingLevel()>i){r=n.Scalar.Clamp(e.scene.getEngine().getHardwareScalingLevel()-.25,0,i);return e.scene.getEngine().setHardwareScalingLevel(r),!1}return e.processShadows?t&&!e.bloomEnabled?(e.bloomEnabled=!0,!1):!!e.groundMirrorEnabled||(e.groundMirrorEnabled=!0,!1):(e.processShadows=!0,!1)},t.extendedDegrade=function(e){var t=e.defaultRenderingPipeline;if(e.groundMirrorEnabled)return e.groundMirrorEnabled=!1,!1;if(t&&e.bloomEnabled)return e.bloomEnabled=!1,!1;if(e.processShadows)return e.processShadows=!1,!1;if(e.scene.getEngine().getHardwareScalingLevel()<1){var r=n.Scalar.Clamp(e.scene.getEngine().getHardwareScalingLevel()+.25,0,1);return e.scene.getEngine().setHardwareScalingLevel(r),!1}if(t&&e.fxaaEnabled)return e.fxaaEnabled=!1,!1;if(e.groundEnabled)return e.groundEnabled=!1,!1;if(e.scene.postProcessesEnabled)return e.scene.postProcessesEnabled=!1,!1;if(e.scene.getEngine().getHardwareScalingLevel()<1.25){r=n.Scalar.Clamp(e.scene.getEngine().getHardwareScalingLevel()+.25,0,1.25);return e.scene.getEngine().setHardwareScalingLevel(r),!1}return!0}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationLoader=void 0;var o=r(17),s=r(58),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getExtendedConfig=function(e){return s.getConfigurationType(e||"extended")},t}(o.RenderOnlyConfigurationLoader);t.ConfigurationLoader=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minimalConfiguration=t.defaultConfiguration=t.getConfigurationType=void 0;var n=r(59);Object.defineProperty(t,"minimalConfiguration",{enumerable:!0,get:function(){return n.minimalConfiguration}});var i=r(79);Object.defineProperty(t,"defaultConfiguration",{enumerable:!0,get:function(){return i.defaultConfiguration}});var o=r(18),s=r(80),a=r(81),l=r(1),c=function(e){var t={};return e.split(",").forEach((function(e){switch(e.trim()){case"environmentMap":t=l.deepmerge(t,a.environmentMapConfiguration);break;case"shadowDirectionalLight":t=l.deepmerge(t,s.shadowDirectionalLightConfiguration);break;case"shadowSpotLight":t=l.deepmerge(t,s.shadowSpotlLightConfiguration);break;case"default":t=l.deepmerge(t,i.defaultConfiguration);break;case"minimal":t=l.deepmerge(t,n.minimalConfiguration);break;case"none":break;case"extended":default:t=l.deepmerge(t,o.extendedConfiguration)}t.extends&&(t=l.deepmerge(t,c(t.extends)))})),t};t.getConfigurationType=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.minimalConfiguration=void 0;var n=r(8);t.minimalConfiguration={version:"0.1",templates:{main:{html:n.defaultTemplate},fillContainer:{html:n.fillContainer,params:{disable:!1}},loadingScreen:{html:n.loadingScreen,params:{backgroundColor:"#000000",loadingImage:n.loading}},viewer:{html:n.defaultViewer},overlay:{html:n.overlay,params:{closeImage:n.close,closeText:"Close"}},error:{html:n.error}},engine:{antialiasing:!0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.babylonFont=void 0,t.babylonFont=r(61)},function(e,t){e.exports="data:font/woff;charset=utf-8;base64,d09GRgABAAAAABTkAA8AAAAAJEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABWAAAAEgAAABgSlp+MVZETVgAAAGgAAACBQAABeCBXolxY21hcAAAA6gAAACIAAAA3oTfhSJjdnQgAAAEMAAAACAAAAAqCdkJr2ZwZ20AAARQAAAA8AAAAVn8nuaOZ2FzcAAABUAAAAAMAAAADAAIABtnbHlmAAAFTAAACPgAAAzOOMLcQmhlYWQAAA5EAAAAMgAAADb+Z7dYaGhlYQAADngAAAAVAAAAJBABCAZobXR4AAAOkAAAACsAAAA2EzQDvGxvY2EAAA68AAAALgAAAC4W1hOObWF4cAAADuwAAAAcAAAAIACPANFuYW1lAAAPCAAABTwAAAvzL/OWdXBvc3QAABREAAAAEwAAACD/UQB3cHJlcAAAFFgAAACJAAAA03i98g542mNgZp/IOIGBlYGDdRarMQMDozSEZr7IkMYkxMHKysXIxAgGDEAgwIAAvsEKCgwODLzf0zjAfAjJAFbHAuEpMDAAAL2BB0542hXJUxQYBgAEwclf2qa2bdu2bdu2bdu2bdu2bTtlur15734WAwz4fwYZPHCIgWGoMHQYJqqD+mHDcGH4MEIYMYwURg6jhFHDaGH0MEYYM4wVxg7jhHHDeGH8MEGYMEwUJg6ThEnDZGHyMEWYMkwVpg7ThGnDdGH6MEOYMcwUZg6zhFnDbGH2MEeYM8wV5g7zhHnDfGH+sEBYMCwUFg6LhEXDYmHxsERYMiwVlg7LhGXDcmH5sEJYMawUVg6rhFXDamH1sEZYM6wV1g7rhHXDemH9sEHYMGwUNg6bhE3DZmHzsEXYMmwVtg7bhG3DdmH7sEPYMewUdg67hF3DbmH3sEfYM+wV9g77hH3DfmH/cEA4MBwUDg6HhEPDYeHwcEQ4MhwVjg7HhGPDceH4cEI4MZwUTg6nhFPDaeH0cEY4M5wVzg7nhHPDeeH8cEG4MFwULg6XhEvDZeHycEW4MlwVrg7XhGvDdeH6cEO4MdwUbg63hFvDbeH2cEe4M9wV7g73hHvDfeH+8EB4MDwUHg6PhEfDY+Hx8ER4MjwVng7PhGfDc+H58EJ4MbwUXg6vhFfDa+H18EZ4M7wV3g7vhHfDe+H98EH4MHwUPg6fhE/DZ+Hz8EX4MnwVvg7fhG/Dd+H78EP4MfwUfg6/hF/Db+H3MDj8Ef4Mf4W/wz/h3zAk/gPilQDpAAAAeNpjYGBgYmBkAAERBmYwy42BjcEISPMCRSAyhAATAwvDDCCtAIQsYJ0Kz/meOzzPfP7lxdOXIm+63/t9lPy27zvvd+Hvaf//Q1XwPrd/noGmggeoIvX///9f/j+S+C5xXGKBhJi4mthP4UaBA3zfOIMYGDhB9uF2FQcUCzEIMogyiAAAKmIy6HjaY9BiCGUoYGhgWMXIwNjA7MB4gMEBiwgQAACqHAeVeNpdj79Ow0AMxnMktIQnQDohnXUqQ5WInemGSyTUJSUM56WA1Eqk74CUhcUDz+JuGfNiCMwR/i62v8/6fL9zp/nJfHacpUcqKVacN+Gg1AsO6u2Z/fkhT+82ZWFM1XlW92XBagmia04X9U2waMjQ9ZZMbR4ftpwtYpfFjvDScNKGTuptAHaov8cd4lU8ksUjhBLfT/F9jEv6tSxWhtOLJqwD916z86gBTMVjE3j0GhB/yKQ/dWcT42w5ZdvATnOCRJ/KAvdEmoT7S49/9aCS/4b7bci/q0H1Tdz0FvSHYcGCsKGXZ9tQCRpg+Q6E/GTGAAEAAgAIAAr//wAPeNptFm1sU9f1nvs+rp0PJ48Xx4mTODw7thO8OJE/gTSOCcWQlH6wdY1mL6HQQWkZm7IBKi1jV6gdWyhiAlRN+wEjUSrKCpPK1DFV2zJtP6qtpasqTeqQxoTUaqtE1WoSI8bvZuc+Oylo03vvvnPvufd8n3MPoeRVQtQXtYNEIYyQpGEZYcuwXlX+XnmTvmmPawfLM2fURwgQEz5mt/R+ohECPjdkgZ0uVsyKWVRO6/0IKbeKlX24T6EKs/WS3OemUTewucpkZbKo2IpNFWW2MlVURIUSQpEj7mQ2cREDaVpGyIAoWGB5LSNpgA8I5dyeLNJZUVJLMG9zTueKCrc5wlNFOkcJp1yU6GwRjxNOOMOHNOJEkqqRsdKM83L1uDYvSsw5Xy45R7V5TijKwhnBk9SRGQwThSZ3CVfOV7arpILIxdt0hs6gzJQD0XChai1IGiHJC+XkiiRSJrrzSe0ISHkIqSdNUjsvPml8DEtDGzNeQUooiSTPF4nOJQ3OVY4IhUv6ODDbRdA6XtKGFKLIiEXdVOplSa7yZ6F55/hcEYZheFHRSJmrJRrmAsmqBMLiOlVm7RKdn8Ud4g8ixF3Evi7CwCkRHMIEZUW7uZAJ6u5G2xnIrd3xRlXSdupAhlwI419FyRZRQhudY3NNGhNX5EwQaSsdXYa6lDl1/jZawCaSG9oEjVHzUYAESYQkSJqsJQ8gt0SAeo0WDw1ZwThNG6kcTVrOqNRYQ6LV26KHgpF0KoNKGywJVtRipCMeamkJxTsW+TIEXI5coCR30ZzlvD8S8eOnFdHiC9M3xVm4mRdnmbOtvEJAcQhQZy71Q03QkwpxzuJn45q4eXNJukWXvnURJwr6yABqMUQ2yGjwhkypSYtH7YJQOpVT06k4DQU91BtCZcLSc068WGmMHCvdR2WIKuj2/Oj+iWRk3ei6CHfGQKrQ21tIBXhi4kDlqPQV8kOdgKOZAeMF8C9DRs0nJ/aPPvC1LUNDG9fk8w4wGpNHJQlJdQGPSfODjCw8hBMpNwaoC6OOJMlTZBplD4DjgBgE4ypKrEpAeiKTzWRzWjIRUH2tLBWNa4jUmY6bA3QIEjlVoiRA01Uf4UHppCT7k79zavbDw9vCI+twHghkUul1I+Fthz+cnery93wpc+LchfOnh9afOX/h3IlMrMfofvHib35xMtq147kfzfzgOxM+Y4xf3LnNjA1m8+Ox2Hg+Oxgzt+34OR+rLEiXcDlo1/2FsFiSNDv7Bvs6nUFyBQgX/D1mW6it2aUormYEzNfazM6+LsOtUNXVaHZYrUa7WNp5kY99cVSyhNiyzx1Py+zAiB0jk2SeXCG/J++htaqhOgDM11qNWzTWMESZXg1gdPYQZONQi2Q5VOOCMp+EQIYEGjApzYYhAolMOhVBy2H5M1pacRkiORhaNqi3hYGkrHsRZ2UzyUQ3SL64MZM2omjuEXAWoUVuc8xvJVqN+2bsPu+4iIyPJeI3T+/+wFwJt9OmX/Dl6PnosXRepgYlvYXJdHqy0Osf2NB7YpfEi5XEaYv3tK6yBiFUdYopTtnXI/5wh+pSO8JVT5lLxPQjL4Rh12XT7zcXTGnfWyYCOLt8dz6CfB28M9b24phfcbWal3zNU7s+uE9GfmpF+kd9T64HJ42lrFLmNQ/nBxtfRjz9iRRVokwr1t6ZCHttJ7NN2Cf5Dmz58pYBOV/wS1kldMmRbVnoT6tCm5focjkRH9eAv30RLXWE1Gq2SaIkhpUhSbJYG0bIRrK1VuVqwSJDxKx5P1SLBtMItVO8sfCe0NKWFxhkNcCC74MwqxZ/UBYm554vFJ6fm1z+yxSXJWD0wEQCi8VRWX6x9mG6l/9aEp8XtUfE5yVoLr8BTSXxmf6rYvW20Mm9ROTfJnh89F5ymrwi+B38BF4mzvVENaRVLIrPStCEJJuRw/T0r+3rNCwvGGwksDxSzJd/4p1nYo2Po9bMAAN1MfBi1VnarbXoDDQTciAzgaUioSAusCxk8DBeGZnV9rNKXslvHLa5/SidptP2STUf6LST4tgUfbdrS++asUw37+v2+OvsrcFj9Jde+n1OD8GGynviIw5b1Sb4mXhS/KUu+K74HVwQb8NaWFvZGR1HElNwiL7T1RlIj63pjrrx/LEgveKVN9MTpJ+9zq4RH/ptA5ki+8kPyTmU3qPSJtoAWoRGc5A1wmYOtDggPIIl04evTpkHmBv1yXqgCRoctBLFIQBySxwGIJJ2pj4kEoBu8LauwmUF1yJRB4VnEYtkWldBFdAZLlcxOVAyPdnqFkAUvohALux1ANbYFvIrq8Rt+9/iP3Ve1/ChYXp1PPVM5cqDxzYe+NfBhonXntBcWmNX4/HKYXFZDXnaPa4G1yqxaN8Wi5ijn+ga0OEXxCeKrsYeX6PRxjbPpmMP1re6c88N17ua3Q+/8u3B7YNUpUbYkz+SH3lhZPPJTQ0+eGzTy4Wh7w6xOpUpyDXzTEZlN6/CvquKplCd0neSu5OKrjz9/h77Su6w7lebEjsviTu/Ndk3/rj7Brx1wwg223tu0UPNHa8knkp2JvxKfMcg1ZXj4tPj8cd77X/ACc2t9U/0s73v70MIel3hr0bGfwxvF2YK2W9lGRL/89NjZx46C9mz6b0Zt+ea2HOt+AYcyXwzQ3Vd+d6dI3Vtrv6v9zd1el8SZZhJ70o1rzYoRQkzz2YafPVAoTlUCAEApVT81NPeiCvr92aPDJSqtb96RzZiNifJZvIVsh1T27DQA7IlQi8YoLOQUS3uuvRMRiZ0DAxNtmeIwTEJ9+S83Ko5lT+TRWdqOahWAJ1x5Wh9o1rxMx7IB+0Luf7hBZmMlIYKlkeWuDz2Hvhiv4Vtzf/P3oFiVGzyd9CH/B0yiXGqY0vWvWG1yu2NZlc9pTZft5lyiawz69SmhmCPU80l1SXs4Zawj67k/6fGYDHo8MNb0eKNaHFAStXhl/0i9hAM2yynF24hFuknxKi1ieD0Eo5lwsbyNef0Po5JZDXDyoKNNbaQUpoFR1nB88uF3c47mjpdnNOOwYIUw5H9iODLNX9pRWzZiP4X0FL98XjaY2BkYGBgujnr9BUxz3h+m68M3BwMILD/78EGEH3d87wDiOZgAItzMjCBKABnJQpuAAB42mNgZGDgYAABOMnIgApYAQLNACAAAAB42mPVYljGAARMhgxgwMHAIMzADIQNTAxMDUCBBoYGBgRoYAgDUQBtJAQEAAAAABQAFAAUABQAKAA9AGQAgQCXAKwAzAEAATYBmgH7Ao8DpgQnBIMFjQYdBmcAAHjaY2BkYGAQY7jAwMUAAoxgEsROAbMYABsCAWF42p1UzYscRRSvTvdmd83uEo0RJUSLIDEJY092JWw+ENkkYKK7CWyWQPBU010zXaanq6mqTtt4Fr14EhG8iaeAB8WDKIgH/Uc8+l/43uvqmd5kDOoMXfWrV+/93mc3Y2zzyD4LGP2CFVxayE7AqcVH2HJwyuOwJ496eImtBWc8PsqeD2KPl9mV4B2PV9jJ4COPj7ELwecerwd/BD95vEHykAVRCH7Xwo8JLwE+Hn5K+CjJvyK8TPJvCa8Q/pHwKjCl4e8eB+xs9IbHR9hGtOdx2JNHPbzEXo4+8PgoOxNZj5eZib70eIVdWFr2+Bg7WNr0eD38bOkTjzdm8ud6uRzDOFfXCa/15BuIV08TPo5xrp4nfALwC6vbhF/s6Z8kntuEX+rJXyHbB4RPkc6E8Omezms9/Drp14QvEG7jf5PwF4hXevGv9Hyt9eRrPpfHfOvi5jbfU4nRVo8dv6FNqY1wShcx38lzvq8mmbN8X1ppHsk0Xr8lR0bW/G4pi4OmlHxXNLpyPNcTlfBEl41BC47MF9/iZ3HbHvB9kZcZvyWKRCcPQfqezgp+q0ot+jnIlOV5n2esDb+uRrlKRM69R9DR4JRbXZlEcgy3Fkbyqkil4S6TfO/2Ad9ViSysvMatlFxORzJNZcrzVspTaROjSkyPfKTSCZXb+LoYNTnI9m7ubvEda6Wz+3JS5cLcl8ai9lZ8+ZLXQqVW556caImBCe6MSOVUmIdcj9tgZjWdGF2VKE70tBSFkjZeWPDMufLqcFjXdTzt7mOwGbqm1BMjyqwZjnXh7HBubquyzBVkiBcxf6ArPhUNryBXh1VFMXeaJ0YKJwc8VbaESg+4KFJeGgW3CahI2IXlpTRT5RzQjRpKoqubgwsov+nAGD0Mnk61NDqtEjfgOC1gO0CbzoEqeJ2pJOtFVoNTVSR5BU2aR6+LvOHn1Pm2fz11YHhWtG27VTHhRlpnVIJVnTtA8xnXNarAOQVenJxiC4wCr6mui1yL9HD1RFsqGDNIR4MrWCtXwrimEtNEnUzm5eGKwgtUNF4dGwKEUJ9MjRTEHLM7TDPDpkywHNCINcE6k+xDVrC/4Jnf3WMO9oKlsBr4UH4d/hD+Gv4Gz8/hL+F37DHjbItdZJtsG9AeUywBPc0sPGOw5ewGsZW0CpAoQAWL4WYH+HPY90E2YRncWTpJ2CVoP4I1Bc3rYAcRUqQFebnJdsErMljSRUu0m7AKtDDS+8RgvTeMMWaX2aUnuDqmPs894tGwcrDGiAQ8jqJPQTol/ocgwwzxJiPdRblP6FxB9p12AvsUzlhTRZnG/6FqWCMH0qtsCP+a/jHwPWkfez9DwA2xTIinBIYGpGNiw2yHC71birmEKinqAZ9ZYN8eUE6cKtHAXlHt2kq0Feu0UaYpawMamIdkAzinpFdSrxqStDPGQWbgrrVNPIv0Z0HcJXUWc3Z0h1YjiqPrRE4ZoVUXV2thqQvmKcl4lsPgX3W1pHMKNgmcB1Svdl5bv4OZnyczUDSLNdUpgXVxzWqfKWonkE1Fc5curD3a5ITOgf552HFCR74ui9jbGP5vbefsKTFNQGZojh11LpnN6qIMOu9Px3WtNwOYSZuLI3/dW4D8ba4pSGrKXNNb+azZE4emSlJftF/brFpc0ZtVkSVG23Wz40HNnN7kf57R9qtW+M7M2bs3RPkq4/xgvCOqdNvb+RdZ0AR35z/h1P9ay0PfZPoqH7oH79Gr0Wb0fvRu9DasVw4xFWB/B/QeUd2KNsrg++CbkFE3d0DTQLyYjfgbYLuFq3jaY2BmAIP/fgzlDFgAACkqAcgAeNrbwKDNsImRk0mbcRMXiNzO1ZobaqvKwKG9nTs12EFPBsTiifCw0JAEsXidzbXlhUEsPh0VGREeEItfTkKYjwPEEuDj4WRnAbEEwQDEEtowoSDAAMhi2M4IN5oJbjQz3GgWuNGscKPZ5CShRrPDjeaAG80JN3qTMCO79gYGBdfaTAkXAMQBKBoAAAA="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.staticLoading=t.loading=t.helpCircle=t.fullscreen=t.close=t.babylonLogo=void 0,t.babylonLogo=r(63),t.close=r(64),t.fullscreen=r(65),t.helpCircle=r(66),t.loading=r(67),t.staticLoading=r(68)},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB7MAAAgHCAYAAABZmyd0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAHMLAABzCwHoYSMTAAAAB3RJTUUH4wQdEi4Vco9w1wAAABBjYU52AAAHswAACAcAAALlAAAB3RcRcisAAIAASURBVHja7N1Z0KVlfff737+ZRxVxnmeN0SQmGoeoUamKGfoM9lGTVNxW3hJe6IbQQJjnQZDuRizMLl9TJXKy4Wx3pioSo3GIijjP8zwhoszQ9H8f3JA4oHbTz9PX/azn86nqIw1+n452r7V+676uBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABId6/t7k9290XdfdDoHgAAAAAAAABWse5+dnf/U/+8b3X3X3Z3je4DAAAAAAAAYBXp7kO6e0t339O/2oe6+yWjWwEAAAAAAABYcN29Z3f/TXf/oHfM9u5+R3c/enQ7AAAAAAAAAAuou1/T3Z/YwRH7F93a3Wd1976jfw4AAAAAAAAAFkB3P727/98HOWL/oi929xGjfyYAAAAAAAAAVqjuPuC+p6nvXKIh+2f9W3c/b/TPCAAAAAAAAMAK0d3V3X/Z3d9dhhH7Z93T3X/f3Y8Y/TMDAAAAAAAAMGPd/aLu/sAyj9i/6KbuXt/de47++QEAAAAAAACYke5+XHe/o7u37+Yh+2d9trv/dPTvBQAAAAAAAACDdff+3X1Sd98ycMT+Rf9fdz9t9O8NAAAAAAAAAAN099ru/uro5fpXuLu7t3T3waN/nwAAAAAAAADYDbr7Bd39ntFr9Q76Tnf/TXfvMfr3DQAAAAAAAIBl0N0Pv+9p522jF+oH4fru/qPRv4cAAAAAAAAALJHu3qu713f3zaMX6V20vbv/3+5+0ujfUwAAAAAAAAB2QXcf1t2fHr1CL7Hbuvus7t5v9O8vAAAAAAAAADuhu5/V3f84enVeZt/s7r/s7hr9+w0AAABLyRtdAAAAFk53PyzJSUmOS7L36J7d5N1JNlTVx0aHAAAAwFIwZgMAALAwuntNknVJLk3yiNE9A2xPcnWSjVX1/dExAAAAsCuM2QAAACyE7n51kk1Jnj+6ZQZuTnJRks1VddfoGAAAAHgwjNkAAACsaN39tCQXJjlidMsMfTHJ8VW1dXQIAAAA7CxjNgAAACtSdx+QZGOmu7H3Hd0zc9dluk/706NDAAAAYEcZswEAAFhRuruSHJnk4iSPHt2zgtyT5MokZ1bVzaNjAAAA4DcxZgMAALBidPcLk2xJ8pLRLSvYTUnOSXJFVd07OgYAAAB+FWM2AAAAs9fdj8t0L/a6eC+7VD6W6ejxd48OAQAAgAfiAwAAAABmq7v3S3JsklOTHDS6Z0FtTXJsVX11dAgAAAD8LGM2AAAAs9TdazMdKf6U0S2rwB1JLk9yflXdMjoGAAAAEmM2AAAAM9Pdv5dkc5JXjG5Zhb6T5O+SXFVVPToGAACA1c2YDQAAwCx098OTnJHk6CR7jO5Z5T6cZH1VfWB0CAAAAKuXMRsAAIChunuvJEclOTvJQ0b38N86ybVJ/raqvjk6BgAAgNXHmA0AAMAw3X1YpiPFnzu6hV/ptiSXJrmoqu4cHQMAAMDqYcwGAABgt+vuZya5LMmfj25hh30jyelV9Y7RIQAAAKwOxmwAAAB2m+5+aJKTkxyXZO/RPTwo70qyoao+MToEAACAxWbMBgAAYNl195ok65JckuSRo3vYZduTXJ3pPu0fjo4BAABgMRmzAQAAWFbd/ceZ7sX+ndEtLLkfJ7k4yaaqunt0DAAAAIvFmA0AAMCy6O4nJDk/yZGjW1h2n09yfFX90+gQAAAAFocxGwAAgCXV3fsnOTHJSUn2Hd3DbnVdkmOr6rOjQwAAAFj5jNkAAAAsie6uJIcnuTTJE0f3MMw9Sa5McnpV/XR0DAAAACuXMRsAAIBd1t1/kGRLkpeObmE2bkxyXpIrqure0TEAAACsPMZsAAAAHrTufmySM5O8Psma0T3M0g1J1lfVe0eHAAAAsLIYswEAANhp3b13kjckOTfJQaN7WBG2JvnfVfX10SEAAACsDMZsAAAAdkp3r02yOclTR7ew4tye5M1JzquqW0fHAAAAMG/GbAAAAHZIdz8nyaYkfzK6hRXvW0lOTXJVVfXoGAAAAObJmA0AAMCv1d2HZLoX++gke4zuYaF8MNN92h8cHQIAAMD8GLMBAAB4QN29V5K/TnJ+kkNH97Cwtie5OsnGqvr+6BgAAADmw5gNAADAL+nuwzIdKf7bo1tYNW5N8qYkF1bVXaNjAAAAGM+YDQAAwH/r7mdkehL7iNEtrFpfTHJqVV0zOgQAAICxjNkAAACkuw9MckKSk5PsM7oHklyX5Liq+tToEAAAAMYwZgMAAKxi3b0mybokb0zyqNE98AvuSfIPmZ7UvnF0DAAAALuXMRsAAGCV6u5XJtmc5HdHt8BvcFOSc5JcUVX3jo4BAABg9zBmAwAArDLd/fgkF2R6Itv7QlaSz2Y6evxfR4cAAACw/HxoAQAAsEp09/5JTrzv136je2AXbE2yvqq+MjoEAACA5WPMBgAAWHDdXUkOT3JJkieN7oElcneStyY5rapuGR0DAADA0jNmAwAALLDu/v0kW5K8bHQLLJPvJDk7yduqavvoGAAAAJaOMRsAAGABdfdjkpyV5PVJ1ozugd3g+kxHj79/dAgAAABLw5gNAACwQLp7ryRHJTknycGje2A36yTXJjmhqr4xOgYAAIBdY8wGAABYEN29NsmmJE8b3QKD3Zbk0iQXVdWdo2MAAAB4cIzZAAAAK1x3PzvTiP3a0S0wM99MclpVvWN0CAAAADvPmA0AALBCdfchSc7MdKz4nqN7YMbelWRDVX1idAgAAAA7zpgNAACwwnT3nklel+S8JI8Y3QMrxPYkV2e6T/sHo2MAAAD4zYzZAAAAK0h3vybTkeLPG90CK9SPk1ycZFNV3T06BgAAgF/NmA0AALACdPfTk1yQ5IjRLbAgPp/k+Kr6p9EhAAAAPDBjNgAAwIx19wFJNiY5Ock+o3tgAV2XZH1VfWZ0CAAAAD/PmA0AADBD3b0mybpMxyE/enQPLLh7klyZ5Iyq+snoGAAAACbGbAAAgJnp7hcl2ZLkxaNbYJX5UZJzk1xRVfeOjgEAAFjtjNkAAAAz0d2PS3JhpieyvV+DcW5IsqGq/nN0CAAAwGrmwxEAAIDBunv/JMckOS3JgaN7gP+2NckxVfW10SEAAACrkTEbAABgoO5em+TyJE8e3QI8oNuTvDnJeVV16+gYAACA1cSYDQAAMEB3vyDJ5iQvH90C7JBvJzklyVVV1aNjAAAAVgNjNgAAwG7U3Q9PckaSo5PsMboH2GkfSrK+qv5rdAgAAMCiM2YDAADsBt29V5Kjkpyd5CGje4Bdsj3J1Uk2VtX3R8cAAAAsKmM2AADAMuvuwzLdi/2c0S3Akro1yZuSXFhVd42OAQAAWDTGbAAAgGXS3c9KclmSPxvdAiyrLyY5taquGR0CAACwSIzZAAAAS6y7H5bkpCTHJdl7dA+w2/xbkg1V9anRIQAAAIvAmA0AALBEuntNknVJLk3yiNE9wBDbkrw905PaN46OAQAAWMmM2QAAAEugu1+dZFOS549uAWbhpiTnJLmiqu4dHQMAALASGbMBAAB2QXc/LcmFSY4Y3QLM0meTHFdV/zo6BAAAYKUxZgMAADwI3X1Ako2Z7sbed3QPMHtbk6yvqq+MDgEAAFgpjNkAAAA7obsryZFJLk7y6NE9wIpyd5K3Jjm9qn46OgYAAGDujNkAAAA7qLtfmGRLkpeMbgFWtO8kOTvJ26pq++gYAACAuTJmAwAA/Abd/bhM92Kvi/dRwNK5PtPR4+8fHQIAADBHPoQBAAD4Fbp7vyTHJjk1yUGje4CF1EmuTXJCVX1jdAwAAMCcGLMBAAAeQHevzXSk+FNGtwCrwu1JLklyUVXdOToGAABgDozZAAAAP6O7fy/J5iSvGN0CrErfTHJaVb1jdAgAAMBoxmwAAIAk3f3wJGckOTrJHqN7gFXvXUmOq6qPjw4BAAAYxZgNAACsat29V5Kjkpyd5CGjewB+xvYkV2e6T/sHo2MAAAB2N2M2AACwanX3YZmOFH/u6BaAX+PmJBcl2VRVd4+OAQAA2F2M2QAAwKrT3c9MclmSPx/dArATvpDk+Kr6x9EhAAAAu4MxGwAAWDW6+6FJTk5yXJK9R/cAPEjXJVlfVZ8ZHQIAALCcjNkAAMDC6+41SdYluSTJI0f3ACyBe5JcmeSMqvrJ6BgAAIDlYMwGAAAWWnf/caZ7sX9ndAvAMvhRknOTXFFV946OAQAAWErGbAAAYCF19xOSnJ/kyNEtALvBDUk2VNV/jg4BAABYKsZsAABgoXT3/klOTHJSkn1H9wDsZluTHFNVXxsdAgAAsKuM2QAAwELo7kpyeJJLkzxxdA/AQHckuTzJeVV16+gYAACAB8uYDQAArHjd/QdJtiR56egWgBn5dpJTklxVVT06BgAAYGcZswEAgBWrux+b5Mwkr0+yZnQPwEx9KMn6qvqv0SEAAAA7w5gNAACsON29d5I3JDk3yUGjewBWgE7yziQnVtX3RscAAADsCGM2AACwonT32iSbkzx1dAvACnRbkkuTXFhVd42OAQAA+HWM2QAAwIrQ3c9JsinJn4xuAVgAX0pySlVdMzoEAADgVzFmAwAAs9bdh2S6F/voJHuM7gFYMP+W5Liq+uToEAAAgF9kzAYAAGapu/dK8tdJzk9y6OgegAW2Lcnbk5xaVTeOjgEAALifMRsAAJid7j4s073Yzx3dArCK3JTknCRvqapto2MAAACM2QAAwGx09zMyPYl9xOgWgFXsc5mOHv+X0SEAAMDqZswGAACG6+6HJjk5yYYk+4zuASBJsjXJ+qr6yugQAABgdTJmAwAAw3T3miTrkrwxyaNG9wDwS+5O8tYkp1fVT0fHAAAAq4sxGwAAGKK7X5npXuzfHd0CwG/03SRnJXlbVW0fHQMAAKwOxmwAAGC36u7HJ7kg0xPZ3pMArCwfyXT0+PtGhwAAAIvPB0cAAMBu0d37Jznxvl/7je4B4EHrJNcmOaGqvjE6BgAAWFzGbAAAYFl1dyU5PMklSZ40ugeAJXN7pj/bL6qqO0fHAAAAi8eYDQAALJvu/v0kW5K8bHQLAMvmm0lOq6p3jA4BAAAWizEbAABYct39mCRnJXl9kjWjewDYLf4jyYaq+vjoEAAAYDEYswEAgCXT3XsneUOSc5IcPLoHgN1ue5KrM92n/YPRMQAAwMpmzAYAAJZEd69NsjnJU0e3ADDczUkuSrKpqu4eHQMAAKxMxmwAAGCXdPezk2xK8trRLQDMzheSHF9V/zg6BAAAWHmM2QAAwIPS3YckOTPJUUn2HN0DwKxdl+k+7U+PDgEAAFYOYzYAALBTunvPJK9Lcn6SQ0f3ALBi3JPkyiRnVNVPRscAAADzZ8wGAAB2WHe/JtOR4s8b3QLAivWjJOcmuaKq7h0dAwAAzJcxGwAA+I26++lJLkhyxOgWABbGRzMdPf6e0SEAAMA8GbMBAIBfqbsPSLIxyclJ9hndA8BC2prk2Kr66ugQAABgXozZAADAL+nuNUnWJXljkkeN7gFg4d2R5PIk51fVLaNjAACAeTBmAwAAP6e7X5RkS5IXj24BYNX5dpJTklxVVT06BgAAGMuYDQAAJEm6+3FJLsz0RLb3CgCM9OEk66vqA6NDAACAcXxABQAAq1x375/kmCSnJTlwdA8A3KeTvDPJiVX1vdExAADA7mfMBgCAVay712a6o/TJo1sA4Fe4LcmlSS6sqrtGxwAAALuPMRsAAFah7n5Bks1JXj66BQB20JeSnFJV14wOAQAAdg9jNgAArCLdfWiS05McnWSP0T0A8CD8e5INVfXJ0SEAAMDyMmYDAMAq0N17JTkqyTlJDh7dAwC7aFuStyc5rap+ODoGAABYHsZsAABYcN19WKZ7sZ8zugUAltiPk5yd5C1VtW10DAAAsLSM2QAAsKC6+1lJLkvyZ6NbAGCZfS7J8VX1z6NDAACApWPMBgCABdPdD0tyUpLjkuw9ugcAdqOtme7T/vLoEAAAYNcZswEAYEF0955JXpfkvCSPGN0DAIPck+TKJKdX1U9HxwAAAA+eMRsAABZAd786yaYkzx/dAgAz8d0kZyV5W1VtHx0DAADsPGM2AACsYN399CQXJDlidAsAzNRHMh09/t7RIQAAwM4xZgMAwArU3Qck2Zjpbux9R/cAwMx1kmuTbKyqr4+OAQAAdowxGwAAVpDuriRHJrk4yaNH9wDACnN7kkuSXFxVd4yOAQAAfj1jNgAArBDd/cIkW5K8ZHQLAKxw30pyapKrqqpHxwAAAA/MmA0AADPX3Y9LcmGSdfEaHgCW0ruTrK+qj48OAQAAfpkPwgAAYKa6e78kx2Z6cuyg0T0AsKC2J7k6033a3x8dAwAA/A9jNgAAzFB3r810pPhTRrcAwCpxc5KLkmyuqrtGxwAAAMZsAACYle7+vSSbk7xidAsArFJfSPK3VbV1dAgAAKx2xmwAAJiB7n54kjOSHJ1kj9E9AECuS7Khqj49OgQAAFYrYzYAAAzU3XslOSrJ2UkeMroHAPg59yS5MskZVfWT0TEAALDaGLMBAGCQ7j4s073YvzW6BQD4tX6U5NwkV1TVvaNjAABgtTBmAwDAbtbdz0xyWZI/H90CAOyUj2Y6evw9o0MAAGA1MGYDAMBu0t0PTXJykuOS7D26BwB40LYmObaqvjo6BAAAFpkxGwAAlll3r0myLsklSR45ugcAWBJ3JLk8yflVdcvoGAAAWETGbAAAWEbd/aokm5L8zugWAGBZfCfJ3yW5qqp6dAwAACwSYzYAACyD7n5CkvOTHDm6BQDYLT6cZH1VfWB0CAAALApjNgAALKHuPiDJxiQnJdl3dA8AsFt1kncmObGqvjc6BgAAVjpjNgAALIHuriSHJ7k0yRNH9wAAQ92W6TXBRVV15+gYAABYqYzZAACwi7r7xUm2JHnR6BYAYDbuynTs+N+PDgEAgJVqzegAAABYqbr7sd3990neF0M2APA/tiZ5riEbAAB2jSezAQBgJ3X33knekOTcJAeN7gEAZuPzSY6rqn8eHQIAAIvAmA0AADuhu9cm2ZzkqaNbAIDZ+HGSs5O8paq2jY4BAIBFYcwGAIAd0N3PSbIpyZ+MbgEAZmNbkrcnOa2qfjg6BgAAFo0xGwAAfo3uPiTJmUmOTrLH6B4AYDb+PcmGqvrk6BAAAFhUxmwAAHgA3b1Xkr9Ocn6SQ0f3AACz8aUkp1TVNaNDAABg0RmzAQDgF3T3YZnuxX7u6BYAYDZuS3Jpkouq6s7RMQAAsBoYswEA4D7d/YwklyX5i9EtAMBsdJJ3Jjmxqr43OgYAAFYTYzYAAKtedz80yclJNiTZZ3QPADAbH06yvqo+MDoEAABWI2M2AACrVnevSbIuyRuTPGp0DwAwG99OckqSq6qqR8cAAMBqZcwGAGBV6u5XZroX+3dHtwAAs3FHksuTnFdVt46OAQCA1c6YDQDAqtLdj09yQaYnsr0eBgDutzXJMVX1tdEhAADAxId3AACsCt29f5IT7/u13+geAGA2PppkQ1W9Z3QIAADw84zZAAAstO6uJIcnuSTJk0b3AACz8aMk5ya5oqruHR0DAAD8MmM2AAALq7t/P8mWJC8b3QIAzMY9Sa5MckZV/WR0DAAA8KsZswEAWDjd/ZgkZyV5fZI1o3sAgNm4Lsn6qvrM6BAAAOA3M2YDALAwunvvJG9Ick6Sg0f3AACz8YUkx1fVP44OAQAAdpwxGwCAhdDda5NsTvLU0S0AwGz8OMnFSTZV1d2jYwAAgJ1jzAYAYEXr7mcn2ZTktaNbAIDZ2J7k6iQnVNUPRscAAAAPjjEbAIAVqbsPSXJmkqOS7Dm6BwCYjXcl2VBVnxgdAgAA7BpjNgAAK0p375nkdUnOT3Lo6B4AYDa+meS0qnrH6BAAAGBpGLMBAFgxuvs1me7F/u3RLQDAbNyW5NIkF1XVnaNjAACApWPMBgBg9rr76UkuSHLE6BYAYDY6ybWZ7sX+xugYAABg6RmzAQCYre4+IMnGJCcn2Wd0DwAwG9cnWV9V7x8dAgAALB9jNgAAs9Pda5KsS/LGJI8a3QMAzMZ3kpyd5G1VtX10DAAAsLyM2QAAzEp3vyjJliQvHt0CAMzG3UnemuS0qrpldAwAALB7GLMBAJiF7n5ckgszPZHtdSoAcL+tSY6tqq+ODgEAAHYvHxICADBUd++f5JgkpyU5cHQPADAbn01yXFX96+gQAABgDGM2AADDdPfaJJcnefLoFgBgNm5Kck6SK6rq3tExAADAOMZsAAB2u+5+QZLNSV4+ugUAmI17kvxDklOr6sbRMQAAwHjGbAAAdpvuPjTJ6UmOTrLH6B4AYDauS7Khqj49OgQAAJgPYzYAAMuuu/dKclSmI0MPHt0DAMzGF5McX1VbR4cAAADzY8wGAGBZdfdhme7Ffs7oFgBgNm5OclGSzVV11+gYAABgnozZAAAsi+5+VpLLkvzZ6BYAYDa2J7k6ycaq+v7oGAAAYN6M2QAALKnufliSk5Icl2Tv0T0AwGy8O9O92B8bHQIAAKwMxmwAAJZEd++Z5HVJzkvyiNE9AMBsfCvJqUmuqqoeHQMAAKwcxmwAAHZZd786yaYkzx/dAgDMxu1JLklycVXdMToGAABYeYzZAAA8aN399CQXJDlidAsAMBud5NpM92J/fXQMAACwchmzAQDYad19QJKNme7G3nd0DwAwGx9Jsr6q3jc6BAAAWPmM2QAA7LDuriRHJrk4yaNH9wAAs/HdJGcleVtVbR8dAwAALAZjNgAAO6S7X5hkS5KXjG4BAGbj7iRvTXJ6Vf10dAwAALBYjNkAAPxa3f24JBcmWRevHwGA/7E105HiXxkdAgAALCYfRgIA8IC6e78kxyY5NclBo3sAgNn4XJLjqupfRocAAACLzZgNAMAv6e61mY4Uf8roFgBgNm5Kck6St1TVttExAADA4jNmAwDw37r795JsTvKK0S0AwGxsS/L2JKdW1Y2jYwAAgNXDmA0AQLr74UnOSHJ0kj1G9wAAs/FvmY4U/+ToEAAAYPUxZgMArGLdvVeSo5KcneQho3sAgNn4UpJTquqa0SEAAMDqZcwGAFiluvuwTPdi/9boFgBgNm5LcmmSC6vqrtExAADA6mbMBgBYZbr7mUkuS/Lno1sAgNnYnuTqJBur6vujYwAAABJjNgDAqtHdD01ycpLjkuw9ugcAmI0PJVlfVf81OgQAAOBnGbMBABZcd69Jsi7JJUkeOboHAJiNbyc5JclVVdWjYwAAAH6RMRsAYIF196uSbE7y/NEtAMBs3J7kzUnOq6pbR8cAAAD8KsZsAIAF1N1PSHJ+kiNHtwAAs7I1yTFV9bXRIQAAAL+JMRsAYIF09wFJNiY5Kcm+o3sAgNm4IcmGqvrP0SEAAAA7ypgNALAAuruSHJ7k0iRPHN0DAMzGj5Kcm+SKqrp3dAwAAMDOMGYDAKxw3f0HSbYkeenoFgBgNu5JcmWSM6rqJ6NjAAAAHgxjNgDACtXdj01yZpLXJ1kzugcAmI3rkhxbVZ8dHQIAALArjNkAACtMd++d5A2Zjgw9aHQPADAbn09yfFX90+gQAACApWDMBgBYQbp7baYjxZ8yugUAmI0fJ7k4yaaqunt0DAAAwFIxZgMArADd/Zwkm5L8yegWAGA2tie5OsnfVtUPR8cAAAAsNWM2AMCMdfchme7FPjrJHqN7AIDZ+Pckx1XVJ0aHAAAALBdjNgDADHX3Xkn+Osn5SQ4d3QMAzMaXk/xdVV0zOgQAAGC5GbMBAGamuw9LsjnJc0e3AACzcVuSS5NcVFV3jo4BAADYHYzZAAAz0d3PSHJZkr8Y3QIAzEYneWeSE6vqe6NjAAAAdidjNgDAYN390CQnJ9mQZJ/RPQDAbHw4yfqq+sDoEAAAgBGM2QAAg3T3miTrkrwxyaNG9wAAs/HtJKckuaqqenQMAADAKMZsAIABuvuVme7F/t3RLQDAbNyR5PIk51fVLaNjAAAARjNmAwDsRt39+CQXZHoi22sxAOB+W5McW1VfHR0CAAAwFz5ABQDYDbp7/yQn3vdrv9E9AMBsfDTJhqp6z+gQAACAuTFmAwAso+6uJIcnuSTJk0b3AACz8aMk5ya5oqruHR0DAAAwR8ZsAIBl0t2/n2RLkpeNbgEAZuOeJFcmOaOqfjI6BgAAYM6M2QAAS6y7H5PkrCSvT7JmdA8AMBvXZTpS/NOjQwAAAFYCYzYAwBLp7r2TvCHJOUkOHt0DAMzGF5IcX1X/ODoEAABgJTFmAwAsge5em2RzkqeObgEAZuPmJBcl2VRVd4+OAQAAWGmM2QAAu6C7n51kU5LXjm4BAGZje5Krk5xQVT8YHQMAALBSGbMBAB6E7j4kyZlJjkqy5+geAGA2/iPTvdgfHx0CAACw0hmzAQB2QnfvmeR1Sc5PcujoHgBgNr6Z5LSqesfoEAAAgEVhzAYA2EHd/ZpM92L/9ugWAGA2bk9ySZKLqurO0TEAAACLxJgNAPAbdPczMj2JfcToFgBgNjrJtZnuxf7G6BgAAIBFZMwGAPgVuvuAJBuTnJxkn9E9AMBsXJ9kfVW9f3QIAADAIjNmAwD8gu5ek2RdkjcmedToHgBgNr6T5Owkb6uq7aNjAAAAFp0xGwDgZ3T3i5JsSfLi0S0AwGzcneStSU6rqltGxwAAAKwWxmwAgCTd/fgkF2R6IttrJADgflszHSn+ldEhAAAAq40PagGAVa27909yTJLTkhw4ugcAmI3PJjmuqv51dAgAAMBqZcwGAFat7l6b5PIkTx7dAgDMxk1JzklyRVXdOzoGAABgNTNmAwCrTne/IMnmJC8f3QIAzMY9Sf4hyalVdePoGAAAAIzZAMAq0t2HJjk9ydFJ9hjdAwDMxnWZjhT/1OgQAAAA/ocxGwBYeN29V5KjMh0ZevDoHgBgNr6Y6Unsa0aHAAAA8MuM2QDAQuvuwzLdi/2c0S0AwGzcmuRNSS6sqrtGxwAAAPDAjNkAwELq7mcluSzJn41uAQBmY3uSq5NsrKrvj44BAADg1zNmAwALpbsfluSsTMeK7zm6BwCYjQ8mWV9VHxwdAgAAwI4xZgMAC6G790zyuiTnJXnE6B4AYDa+leTUJFdVVY+OAQAAYMcZswGAFa+7X51kc5LnjW4BAGbj9iSXJLm4qu4YHQMAAMDOM2YDACtWdz89yQVJjhjdAgDMRie5NtO92F8fHQMAAMCDZ8wGAFac7j4gycYkJyXZd3QPADAbH0myoareOzoEAACAXWfMBgBWjO6uJEcmuTjJo0f3AACz8d0kZyX5P1V17+gYAAAAloYxGwBYEbr7hUm2JHnJ6BYAYDbuSXJlktOr6qejYwAAAFhaxmwAYNa6+3FJLkyyLl67AAD/Y2umI8W/PDoEAACA5eEDYQBglrp7vyTHJjk1yUGjewCA2fhckuOr6p9HhwAAALC8jNkAwOx099oklyd58ugWAGA2fpzk7CRvqapto2MAAABYfsZsAGA2uvv3kmxO8orRLQDAbGxL8vYkp1XVD0fHAAAAsPsYswGA4br74UnOSHJ0kj1G9wAAs/Hvme7F/uToEAAAAHY/YzYAMEx375XkqExHhj5kdA8AMBtfSnJKVV0zOgQAAIBxjNkAwBDdfViSLUl+a3QLADAbtyW5NMmFVXXX6BgAAADGMmYDALtVdz8zyWVJ/nx0CwAwG53knUlOrKrvjY4BAABgHozZAMBu0d0PS3JSkuOS7D26BwCYjQ8lWV9V/zU6BAAAgHkxZgMAy6q71yRZl+SSJI8c3QMAzMa3k5yS5Kqq6tExAAAAzI8xGwBYNt39qiSbkzx/dAsAMBt3JLk8yXlVdevoGAAAAObLmA0ALLnufkKS85McOboFAJiVrUmOqaqvjQ4BAABg/ozZAMCS6e4DkmzMdDf2vqN7AIDZuCHJhqr6z9EhAAAArBzGbABgl3V3JTk8yaVJnji6BwCYjR8lOTfJFVV17+gYAAAAVhZjNgCwS7r7D5JsSfLS0S0AwGzck+TKJGdU1U9GxwAAALAyGbMBgAelux+b5Mwkr0+yZnQPADAb1yVZX1WfGR0CAADAymbMBgB2SnfvneQNmY4MPWh0DwAwG59PcnxV/dPoEAAAABaDMRsA2GHdvTbTkeJPGd0CAMzGj5NcnGRTVd09OgYAAIDFYcwGAH6j7n5Okk1J/mR0CwAwG9uTXJ3khKr6wegYAAAAFo8xGwD4lbr7kEz3Yh+dZI/RPQDAbLwryYaq+sToEAAAABaXMRsA+CXdvVeSo5KcleSho3sAgNn4ZpLTquodo0MAAABYfMZsAODndPdhSTYnee7oFgBgNm5LcmmSi6rqztExAAAArA7GbAAgSdLdz0zypiR/MboFAJiNTnJtkr+tqm+OjgEAAGB1MWYDwCrX3Q9NcnKSDUn2Gd0DAMzGhzPdi/3+0SEAAACsTsZsAFiluntNknVJ3pjkUaN7AIDZ+E6Ss5O8raq2j44BAABg9TJmA8Aq1N2vTLIlye+MbgEAZuOOJJcnOb+qbhkdAwAAAMZsAFhFuvvxSS7I9ES21wEAwP22Jjm2qr46OgQAAADu50NsAFgFunv/JCfe92u/0T0AwGx8LMn6qnrP6BAAAAD4RcZsAFhg3V1JDk9ySZInje4BAGbjR0nOTXJFVd07OgYAAAAeiDEbABZUd/9+pnuxXza6BQCYjXuSXJnkjKr6yegYAAAA+HWM2QCwYLr7MUnOSvL6JGtG9wAAs3Fdkg1V9enRIQAAALAjjNkAsCC6e+8kb0hyTpKDR/cAALPxhSR/W1VbR4cAAADAzjBmA8AC6O61STYneeroFgBgNm5OclGSzVV11+gYAAAA2FnGbABYwbr72Uk2JXnt6BYAYDa2J7k6yQlV9YPRMQAAAPBgGbMBYAXq7kOSnJnkqCR7ju4BAGbjPzLdi/3x0SEAAACwq4zZALCCdPeeSV6X5Pwkh47uAQBm41tJTk1yVVX16BgAAABYCsZsAFghuvs1me7F/u3RLQDAbNye5JIkF1XVnaNjAAAAYCkZswFg5rr7GZmexD5idAsAMBud5NpM92J/Y3QMAAAALAdjNgDMVHcfmOSEJCcn2Wd0DwAwG9dnuhf7faNDAAAAYDkZswFgZrp7TZJ1Sd6Y5FGjewCA2fhukrOSvK2qto+OAQAAgOVmzAaAGenuP8x0L/aLR7cAALNxd5K3Jjm9qn46OgYAAAB2F2M2AMxAdz8+yQWZnsj29zMAcL+tSdZX1VdGhwAAAMDu5sNyABiou/dPckyS05IcOLoHAJiNzyU5rqr+ZXQIAAAAjGLMBoBBunttksuTPHl0CwAwGzclOSfJW6pq2+gYAAAAGMmYDQC7WXe/IMmWJH80ugUAmI1tSd6e5NSqunF0DAAAAMyBMRsAdpPuPjTJ6UmOTrLH6B4AYDb+LcmGqvrU6BAAAACYE2M2ACyz7t4ryVGZjgw9eHQPADAbX8z0JPY1o0MAAABgjozZALCM7rsXe1OSp41uAQBm49Ykb0pyYVXdNToGAAAA5sqYDQDLoLuflWnE/tPRLQDAbGxPcnWSjVX1/dExAAAAMHfGbABYQt39sCRnZTpWfM/RPQDAbHwwyfqq+uDoEAAAAFgpjNkAsAS6e88kr0tyXpJHjO4BAGbjW0lOTXJVVfXoGAAAAFhJjNkAsIu6+9VJNid53ugWAGA2bk/y5iTnVdWto2MAAABgJTJmA8CD1N1PT3JBkiNGtwAAs7I1yf+uqq+PDgEAAICVzJgNADupuw9IsjHJSUn2Hd0DAMzGDZnuxX7v6BAAAABYBMZsANhB3V1JjkxycZJHj+4BAGbjxiTnJbmiqu4dHQMAAACLwpgNADugu1+YZEuSl4xuAQBm454kVyY5vap+OjoGAAAAFo0xGwB+je5+XJILk6yLvzcBgP+xNcmGqvry6BAAAABYVD6UB4AH0N37JTk2yalJDhrdAwDMxueTHFdV/zw6BAAAABadMRsAfkF3r01yeZInj24BAGbjx0nOTvKWqto2OgYAAABWA2M2ANynu38vyeYkrxjdAgDMxrYkb09yWlX9cHQMAAAArCbGbABWve5+eJIzkhydZI/RPQDAbPx7pnuxPzk6BAAAAFYjYzYAq1Z375XkqExHhj5kdA8AMBtfSnJKVV0zOgQAAABWM2M2AKtSdx+WZEuS3xrdAgDMxm1JLk1yUVXdOToGAAAAVjtjNgCrSnc/K8mbkvz56BYAYDY6yTuTnFhV3xsdAwAAAEyM2QCsCt39sCQnJTkuyd6jewCA2fhwkvVV9YHRIQAAAMDPM2YDsNC6e02SdUkuSfLI0T0AwGx8O8kpSa6qqh4dAwAAAPwyYzYAC6u7X5Vkc5Lnj24BAGbjjiSXJzm/qm4ZHQMAAAD8asZsABZOdz8hyflJjhzdAgDMytYkx1TV10aHAAAAAL+ZMRuAhdHdByTZmOlu7H1H9wAAs/HRJBuq6j2jQwAAAIAdZ8wGYMXr7kpyeJJLkzxxdA8AMBs/SnJukiuq6t7RMQAAAMDOMWYDsKJ19wsz3Yv90tEtAMBs3JPkyiRnVNVPRscAAAAAD44xG4AVqbsfm+TMJK9PsmZ0DwAwG9clWV9VnxkdAgAAAOwaYzYAK0p3753kDZmODD1odA8AMBtfSHJ8Vf3j6BAAAABgaRizAVgxunttki1JnjK6BQCYjZuTXJRkU1XdPToGAAAAWDrGbABmr7ufk2RTkj8Z3QIAzMb2JFcnOaGqfjA6BgAAAFh6xmwAZqu7D8l0L/bRSfYY3QMAzMa7kmyoqk+MDgEAAACWjzEbgNnp7r2SHJXkrCQPHd0DAMzGN5OcVlXvGB0CAAAALD9jNgCz0t2HJdmc5LmjWwCA2bgtyaVJLqqqO0fHAAAAALuHMRuAWejuZyZ5U5K/GN0CAMxGJ7k2073Y3xgdAwAAAOxexmwAhuruhyY5OcmGJPuM7gEAZuP6JOur6v2jQwAAAIAxjNkADNHda5KsS/LGJI8a3QMAzMZ3kpyd5G1VtX10DAAAADCOMRuA3a67X5lkS5LfGd0CAMzG3UnemuS0qrpldAwAAAAwnjEbgN2mux+f5IJMT2T7OwgAuN/WJMdW1VdHhwAAAADzYUgAYNl19/5JTkxyUpJ9R/cAALPx2STHVdW/jg4BAAAA5seYDcCy6e5KcniSS5I8aXQPADAbNyU5J8kVVXXv6BgAAABgnozZACyL7v79TPdiv2x0CwAwG/ck+Yckp1bVjaNjAAAAgHkzZgOwpLr7MUnOSvL6JGtG9wAAs3Fdkg1V9enRIQAAAMDKYMwGYEl0995J3pDpyNCDR/cAALPxxSTHV9XW0SEAAADAymLMBmCXdffaJJuTPHV0CwAwGzcnuSjJ5qq6a3QMAAAAsPIYswF40Lr72Uk2JXnt6BYAYDa2J7k6ycaq+v7oGAAAAGDlMmYDsNO6+5AkZyY5Ksmeo3sAgNl4d6Z7sT82OgQAAABY+YzZAOyw7t4zyeuSnJ/k0NE9AMBsfCvJqUmuqqoeHQMAAAAsBmM2ADuku1+T6V7s3x7dAgDMxu1JLklycVXdMToGAAAAWCzGbAB+re5+RqYnsY8Y3QIAzEYnuTbTvdhfHx0DAAAALCZjNgAPqLsPTHJCkpOT7DO6BwCYjY9kuhf7vaNDAABYLN29T1XdNboDgPlYMzoAgHnp7jXd/ZdJvpTkzBiyAYDJd5P8ryQvMmQDALCUuvth3X1Rkh9195bufsjoJgDmwZPZAPy37v7DTPdiv3h0CwAwG3cneWuS06vqp6NjAABYHN29Jsm6JJckeeTP/Es/SnJukiuq6t7RnQCMY8wGIN39+CQXZHrz4O8GAOB+W5Osr6qvjA4BAGCxdPerMj1U8fxf82+7IdMVN/85uheAMQwWAKtYd++f5JgkpyU5cHQPADAbn0tyXFX9y+gQAAAWS3c/Icn5SY7cif+zrUmOqaqvje4HYPcyZgOsUt29NsmbkzxpdAsAMBs3JTknyVuqatvoGAAAFkd3H5BkY5KTkuz7IP4Rt2f6LOu8qrp19M8DwO5hzAZYZbr7BUm2JPmj0S0AwGxsS/L2JKdW1Y2jYwAAWBzdXUkOT3JpkicuwT/y20lOSXJVVfXonw+A5WXMBlgluvvQJKcnOTrJHqN7AIDZ+LdMR4p/cnQIAACLpbtfmOle7Jcuwz/+Q0nWV9V/jf45AVg+xmyABdfdeyU5KtORoQeP7gEAZuNLSU6pqmtGhwAAsFi6+7FJzkzy+iRrlvM/Ksk7k5xYVd8b/XMDsPSM2QAL7L57sTcledroFgBgNm7LdMTjhVV11+gYAAAWR3fvneQNSc5NctBu/I/2GhdgQRmzARZQdz8r04j9p6NbAIDZ2J7k6nhqBQCAZXDfQxVbkjxlYIbThwAWjDEbYIF098OSnJXpWPE9R/cAALPhPkEAAJZFd/9upnuxXzm65Wf8e5INVfXJ0SEA7JrlvKsCgN2ku/fs7r9J8vkkx8aQDQBMvp3kr5K82JANAMBS6u5DuntLkuszryE7SV6d5Ibu/vvufsToGAAePE9mA6xw3f3qTN9+fd7oFgBgNm5P8uYk51XVraNjAABYHN29V6ZTAc9K8tDRPTvgx0nOTvKWqto2OgaAnWPMBlihuvvpSS5IcsToFgBgVrYmOaaqvjY6BACAxdLdh2V6qOK5o1sehM8lOb6q/nl0CAA7zpgNsMJ09wFJNiY5Kcm+o3sAgNm4IdO9gP85OgQAgMXS3c9M8qYkfzG6ZQlszfS6+cujQwD4zYzZACtEd1eSI5NcnOTRo3sAgNn4UZJzk1xRVfeOjgEAYHF090OTnJxkQ5J9RvcsoXuSXJnk9Kr66egYAH41YzbACtDdL0yyJclLRrcAALNx/wdwZ1TVT0bHAACwOLp7TZJ1SS5J8sjRPcvou5nu/v4/vhgKME/GbIAZ6+7HJbkw05sHf2YDAPe7Lsn6qvrM6BAAABZLd/9xpnuxf2d0y250Q6bX1+8dHQLAzzOMAMxQd++X5NgkpyU5cHQPADAbn09yfFX90+gQAAAWS3c/Icn5Wd0PVWxN8r+r6uujQwCYrNa/kABmq7vXJrk8yZNHtwAAs/HjJBcn2VRVd4+OAQBgcXT3/klOTHJSkn1H98zA7UnenOS8qrp1dAzAamfMBpiJ7v69TPdiv3x0CwAwG9uTXJ3kb6vqh6NjAABYHN1dSQ5PcmmSJ47umaFvJTk1yVVV1aNjAFYrYzbAYN398CRnJDk6yR6jewCA2XhXkg1V9YnRIQAALJbu/oNM92K/bHTLCvDBTK/L/2t0CMBqZMwGGKS790pyVJKzkzxkdA8AMBtfTvJ3VXXN6BAAABZLdz82yZlJXp9kzeieFeT+E5M2VtX3R8cArCbGbIABuvuwTEeK/9boFgBgNm7LdMTjRVV15+gYAAAWR3fvneQNSc5JcvDonhXs1iRvSnJhVd01OgZgNTBmA+xG3f2sTC94/3x0CwAwG53knUlOrKrvjY4BAGCxdPfaTEeKP3V0ywL5YpJTnaYEsPyM2QC7QXc/LMlJSY5LsvfoHgBgNj6cZH1VfWB0CAAAi6W7n5NkU5I/Gd2ywP4t033anxodArCojNkAy6i71yRZl+SSJI8c3QMAzMZ3kvxdkquqqkfHAACwOLr7kEz3Yh+dZI/RPavAtiRvz/Sk9o2jYwAWjTEbYJl096syHeH0/NEtAMBs3JHk8iTnV9Uto2MAAFgc3b1Xkr9Ocn6SQ0f3rEI3ZbqT/C1VtW10DMCiMGYDLLHufkKmNw1Hjm4BAGZla5Jjq+qro0MAAFgs3X1YpiPFf3t0C/lckuOq6l9GhwAsAmM2wBLp7gOSbMx0N/a+o3sAgNn4aKZ79N4zOgQAgMXS3c/I9FDFEaNb+CVbk6yvqq+MDgFYyYzZALuouyvJ4UkuTfLE0T0AwGz8KMm5Sa6oqntHxwAAsDi6+8AkJyQ5Ock+o3v4le5O8tYkp1fVT0fHAKxExmyAXdDdL8x0L/ZLR7cAALNxT5Irk5xRVT8ZHQMAwOLo7jVJ1iV5Y5JHje5hh303yVlJ3lZV20fHAKwkxmyAB6G7H5vkzCSvT7JmdA8AMBvXZTpS/NOjQwAAWCzd/cpMD1X87ugWHrSPZHq/8N7RIQArhTEbYCd0995J3pDpyNCDRvcAALPxhSTHV9U/jg4BAGCxdPfjk1yQ6Ylsn+mvfJ3k2iQbq+rro2MA5s5ffAA7qLvXJtmS5CmjWwCA2bg5yUVJNlXV3aNjAABYHN29f5IT7/u13+geltztSS5JcnFV3TE6BmCujNkAv0F3/26mI5xeOboFAJiN7UmuTnJCVf1gdAwAAIujuyvJ4ZmGzieN7mHZfSvJqUmuqqoeHQMwN8ZsgF+huw/JdC/20Un2GN0DAMzGf2S65+7jo0MAAFgs3f37mU4GfNnoFna7d2d6n/Gx0SEAc7JmdADA3HT3Xt29PsmXkxwbQzYAMPlmkr+qqlcZsgEAWErd/Zju/vskH4ohe7V6ZZKPdPc7uvtRo2MA5sKT2QA/o7sPy3Sk+HNHtwAAs3H/XXYXVdWdo2MAAFgc3b1XkqOSnJPk4NE9zMatSd6U5MKqumt0DMBIxmyAJN39zEwvEP9idAsAMBud5NpM92J/Y3QMAACLpbvXJtmU5GmjW5itLyY5taquGR0CMIoxG1jVuvuhSU5OsiHJPqN7AIDZuD7J+qp6/+gQAAAWS3c/O9OI/drRLawY1yU5rqo+NToEYHczZgOrUnevSbIu05GhjxzdAwDMxneSnJ3kbVW1fXQMAACLo7sPSXJmpmPF9xzdw4pzT5J/yPSk9o2jYwB2F2M2sOp09x9nuhf7d0a3AACzcXeStyY5vap+OjoGAIDF0d17JnldkvOTHDq6hxXvpkx3rF9RVfeOjgFYbsZsYNXo7scnuSDTE9n+/AMA7rc105HiXxkdAgDAYunu12Q6Uvx5o1tYOJ/NdPT4v44OAVhOxhxg4XX3/klOTHJSkn1H9wAAs+HDHwAAlkV3Pz3TQxVHjG5h4flyLrDQjNnAwuruSnJ4kkuTPHF0DwAwG47lAwBgWXT3AUk2Jjk5yT6je1g1XJsELCxjNrCQuvv3k2xJ8rLRLQDAbGxL8vYkp1bVjaNjAABYHN29JtPVdm9M8qjRPaxa30lydpK3VdX20TEAS8GYDSyU7n5MkrOSvD7JmtE9AMBsXJfpSPFPjQ4BAGCxdPeLMj1U8eLRLXCf65NsqKr3jQ4B2FXGbGAhdPfeSd6Q6cjQg0f3AACz8cVMT2JfMzoEAIDF0t2PS3JhpieyfdbO3HSSa5OcUFXfGB0D8GD5CxZY8bp7bZLNSZ46ugUAmI1bk7wpyYVVddfoGAAAFkd375/kmCSnJTlwdA/8BrcnuSTJRVV15+gYgJ1lzAZWrO5+dpJNSV47ugUAmI3tSa5OsrGqvj86BgCAxXLfQxWXJ3ny6BbYSd/M9AWMq6qqR8cA7ChjNrDidPchSc5MclSSPUf3AACz8cEk66vqg6NDAABYLN39gkwnA758dAvsov/IdJ/2x0eHAOwIYzawYnT3nklel+T8JIeO7gEAZuNbSU6NJwwAAFhi3X1oktOTHJ1kj9E9sETuP9HqhKr6wegYgF/HmA2sCN39mkzffv3t0S0AwGzcnuTNSc6rqltHxwAAsDi6e69MpwKek+Tg0T2wTG5OclGSzVV11+gYgAdizAZmrbufkelJ7CNGtwAAs9FJrs10L/bXR8cAALBYuvuwTPdiP2d0C+wmX0jyt1W1dXQIwC8yZgOz1N0HJjkhyclJ9hndAwDMxkcy3e/23tEhAAAslu5+VpLLkvzZ6BYY5LpM77c+PToE4H7GbGBWuntNknVJ3pjkUaN7AIDZ+G6Ss5L8n6q6d3QMAACLo7sflum15lFJ9hzdA4Pdk+TKJGdW1c2jYwCM2cBsdPcfJtmS5A9HtwAAs3H/BymnV9VPR8cAALA4unvPJK9Lcl6SR4zugZm5KdOd8Vf4QjEwkjEbGK67H5/kgkxPZPtzCQC439ZMR9x9eXQIAACLpbtfnWRzkueNboGZ+2yS46rqX0eHAKuT0QgYprv3T3JMktOSHDi6BwCYjc8lOb6q/nl0CAAAi6W7n57poYojRrfACrM1ybFV9dXRIcDqYswGhujutUnenORJo1sAgNn4cZKzk7ylqraNjgEAYHF09wFJNiY5Kcm+o3tghbo7yVuTnFZVt4yOAVYHYzawW3X3CzLdi/1Ho1sAgNnYluTtmT4Q+eHoGAAAFkd3V5Ijk1yc5NGje2BBfCfTF5HfVlXbR8cAi82YDewW3f2YJGcl+b+T7DG6BwCYjX/PdC/2J0eHAACwWLr7RZnuxX7J6BZYUNcnWV9V7x8dAiwuYzawrLp7ryRHJTknycGjewCA2fhSklOq6prRIQAALJbuflySC5Osi8/AYbl1kmuTnFBV3xgdAywef5EDy+a+e7E3JXna6BYAYDZuS3Jpkgur6q7RMQAALI7u3i/JsUlOS3Lg6B5YZe5/r3dRVd05OgZYHMZsYMl197OTXJbkT0e3AACz0UnemeTEqvre6BgAABbLfQ9VXJ7kyaNbYJX7ZpLTquodo0OAxWDMBpZMdz8s073YRyXZc3QPADAbH8p0j9p/jQ4BAGCxdPcLMt2L/fLRLcDPeVeS46rq46NDgJXNmA3ssu7eM8nrkpyX5BGjewCA2fh2klOSXFVVPToGAIDF0d0PT3JGkqOT7DG6B3hA25Ncnek+7R+MjgFWJmM2sEu6+9WZvv36vNEtAMBs3JHpiMfzqurW0TEAACyO7t4r06mAZyd5yOgeYIfcnOSiJJuq6u7RMcDKYswGHpTufnqSC5IcMboFAJiVrUmOqaqvjQ4BAGCxdPdhSbYk+a3RLcCD8oUkx1fVP44OAVYOYzawU7r7gCQbk5yUZN/RPQDAbNyQZENV/efoEAAAFkt3PyvJZUn+bHQLsCSuy/T+8dOjQ4D5M2YDO6S7K8mRSS5O8ujRPQDAbPwoyblJrqiqe0fHAACwOLr7YZkeqDguyd6je4AldU+SK5OcUVU/GR0DzJcxG/iNuvtFme7FfsnoFgBgNnzwAADAsujuNUnWJbkkySNH9wDLyhekgV/LmA38St39uCQXZnrz4M8LAOB+1yVZX1WfGR0CAMBi6e5XZXqo4vmjW4Dd6qOZjh5/z+gQYF6MU8Av6e79khyb5LQkB47uAQBm4/NJjq+qfxodAgDAYunuJyQ5P9M1d8DqtTXJsVX11dEhwDwYs4Gf091rk1ye5MmjWwCA2fhxkouTbKqqu0fHAACwOLr7gCQbM92Nve/oHmAW7sj0GfX5VXXL6BhgLGM2kCTp7hdkOsLp5aNbAIDZ2J7k6iQnVNUPRscAALA4uruSHJ7kTUmeMLoHmKXvJPm7JFdVVY+OAcYwZsMq190PT3JGkqOT7DG6BwCYjXdluq/sE6NDAABYLN39wiRbkrxkdAuwInw4yfqq+sDoEGD3M2bDKtXdeyU5KsnZSR4yugcAmI1vJjmtqt4xOgQAgMXS3Y9NclGSdfHZNLBzOsm1Sf62qr45OgbYfbxggFWouw/L9O3X3xrdAgDMxm1JLk1yUVXdOToGAIDF0d37JTk2yalJDhrdA6xo3rvCKmPMhlWku5+V5LIkfza6BQCYjfu/3X5CVX1jdAwAAIulu9dmeqjiKaNbgIXiVDFYJYzZsAp098OSnJTkuCR7j+4BAGbjw5nuxX7/6BAAABZLd/9eks1JXjG6BVho78r0vvYTo0OA5WHMhgXW3Wsy3UF0SZJHju4BAGbjO0nOTvK2qto+OgYAgMXR3Q9PckaSo5PsMboHWBW2J7k604ljPxgdAywtYzYsqO5+VaZvvz5/dAsAMBt3J3lrpqPYbhkdAwDA4ujuvZIclelLkw8Z3QOsSj9OcnGSTVV19+gYYGkYs2HBdPcTkpyf5MjRLQDArGxNcmxVfXV0CAAAi6W7D8v0UMVzR7cAJPl8kuOr6p9GhwC7zpgNC6K7D0iyMdPd2PuO7gEAZuNjme4Pe/foEAAAFkt3PzPJZUn+fHQLwAO4Lsn6qvrM6BDgwTNmwwrX3ZXk8CSXJnni6B4AYDZuSnJOkiuq6t7RMQAALI7ufmiSk5Mcl2Tv0T0Av8Y9Sa5MckZV/WR0DLDzjNmwgnX3CzMd4fTS0S0AwGzc/0b9zKq6eXQMAACLo7vXJFmX5JIkjxzdA7ATfpTk3PjCN6w4xmxYgbr7sUnOTPL6JGtG9wAAs3FdpiPFPz06BACAxdLdf5zpoYrfGd0CsAs+muno8f8cHQLsGGM2rCDdvXeSN2T6BtlBo3sAgNn4QpK/raqto0MAAFgs3f2EJOcnOXJ0C8AS2prkmKr62ugQ4NczZsMK0d1rk2xJ8pTRLQDAbNyc5KIkm6vqrtExAAAsju7eP8mJSU5Ksu/oHoBlcEeSy5OcV1W3jo4BHpgxG2auu38304j9itEtAMBsbE9ydZITquoHo2MAAFgc3V1JDk9yaZInju4B2A2+neSUJFdVVY+OAX6eMRtmqrsPyXQv9tFJ9hjdAwDMxn9kuhf746NDAABYLN39B5keqnjp6BaAAT6c6T7tD4wOAf7HmtEBwM/r7r26e32SLyc5NoZsAGDyrSR/leTVhmwAAJZSdz+2u/8+yQdjyAZWrxcmeV93v6O7Hz06Bph4MhtmpLsPS7I5yXNHtwAAs3F7kkuSXFRVd46OAQBgcXT33knekOTcJAeN7gGYkdsyXbfgvTgMZsyGGejuZyZ5U5K/GN0CAMxGJ7k2ycaq+vroGAAAFkt3r830UMVTR7cAzNiXkpxSVdeMDoHVypgNA3X3Q5OcnGRDkn1G9wAAs/GRTPd0vW90CAAAi6W7n5NkU5I/Gd0CsIL8e5LjquoTo0NgtTFmwwDdvSbJukxHhj5ydA8AMBvfTXJWkrdV1fbRMQAALI7uPiTJmUmOTrLH6B6AFWhbkrcnOa2qfjg6BlYLYzbsZt39x5mOcPqd0S0AwGzcneStSU6vqp+OjgEAYHF0915J/jrJ+UkOHd0DsAB+nOTiJJuq6u7RMbDojNmwm3T3EzK9aVgX/9sDAP7H1kxHin9ldAgAAIuluw/L9FDFc0e3ACygzyc5vqr+aXQILDKDGiyz7t4/yYlJTkqy7+geAGA2Ppfpvq1/GR0CAMBi6e5nJLksyV+MbgFYBa5LcmxVfXZ0CCwiYzYsk+6uJIcnuTTJE0f3AACzcVOSc5K8paq2jY4BAGBxdPdDk5ycZEOSfUb3AKwi9yS5MskZVfWT0TGwSIzZsAy6+w8yHeH0stEtAMBsbEvy9iSnVtWNo2MAAFgc3b0m09V2b0zyqNE9AKvYj5Kcm+SKqrp3dAwsAmM2LKHufkySs5K8Psma0T0AwGz8W5INVfWp0SEAACyW7n5lpocqfnd0CwD/7YZMnwP85+gQWOmM2bAEunvvJG/IdGTowaN7AIDZ+GKmJ7GvGR0CAMBi6e7HJ7kg0xPZPucFmKetSY6pqq+NDoGVyosc2EXdvTbTt1+fOroFAJiNW5O8KcmFVXXX6BgAABZHd++f5MT7fu03ugeA3+j2JG9Ocl5V3To6BlYaYzY8SN39nCSXJXnt6BYAYDa2J7k6ycaq+v7oGAAAFkd3V5LDk1yS5EmjewDYad9OckqSq6qqR8fASmHMhp3U3YckOTPJ0Un2GN0DAMzGBzPdh/Vfo0MAAFgs3f37SbYkednoFgB22YeSrPf5AeyYNaMDYKXo7j27+2+SfD7JsTFkAwCTbyX5qyQv8UYUAICl1N2P6e6/zzR8GLIBFsOLkry/u9/R3Y8eHQNz58ls2AHd/ZpM92L/9ugWAGA23HkFAMCy6O69k7whyTlJDh7dA8CyuS3JpUkurKq7RsfAHBmz4dfo7mckOT/JEaNbAIBZ2ZrkmKr62ugQAAAWS3evzfRQxVNHtwCw23wpySlVdc3oEJgbYzY8gO4+MMkJSU5Oss/oHgBgNm7IdK/Ve0eHAACwWLr72Uk2JXnt6BYAhvn3JBuq6pOjQ2AujNnwM7p7TZJ1Sd6Y5FGjewCA2bgxyXlJrqiqe0fHAACwOLr7kCRnJjkqyZ6jewAYbluStyc5rap+ODoGRjNmw326+w+TbEnyh6NbAIDZuCfJlUlOr6qfjo4BAGBxdPeeSV6X6Yq7Q0f3ADA7P05ydpK3VNW20TEwijGbVa+7H5/kgkxPZPvfBABwv+uSHFtVnx0dAgDAYunu12S6F/u3R7cAMHufS3J8Vf3z6BAYwXDHqtXd+yc5JslpSQ4c3QMAzMbnM71J/KfRIQAALJbufkamJ7GPGN0CwIqzNdN92l8eHQK7kzGbVam71yZ5c5InjW4BAGbD8V0AACyL7j4wyQlJTk6yz+geAFYs16Gx6hizWVW6+wWZ7sX+o9EtAMBsbEvy9iSnVdUPR8cAALA4untNpqvt3pjkUaN7AFgY301yVpL/U1X3jo6B5WTMZlXo7sdk+oP9/06yx+geAGA2/j3TEV2fHB0CAMBi6e4/zPRQxR+ObgFgYd2QZH1VvXd0CCwXYzYLrbv3SnJUknOSHDy6BwCYjS8lOaWqrhkdAgDAYunuxye5INMT2T5/BWB32Jrkf1fV10eHwFLzYoqFdd+92JuSPG10CwAwG7cluTTJRVV15+gYAAAWR3fvn+SYJKclOXB0DwCrzu1J3pzkvKq6dXQMLBVjNgunu5+d5LIkfzq6BQCYjU7yziQnVtX3RscAALBY7nuo4s1JnjS6BYBV71tJTk1yVVX16BjYVcZsFkZ3PyzTvdhHJdlzdA8AMBsfznR/1AdGhwAAsFi6+wWZ7sX+o9EtAPALPpjp85APjg6BXbFmdADsqu7es7v/JsnnkxwbQzYAMPl2kr9K8oeGbAAAllJ3P6a7/z7Jh2LIBmCe/jDJ+7v7Hd39qNEx8GB5MpsVrbtfnWRzkueNbgEAZuOOJJcnOb+qbhkdAwDA4ujuvTKdCnhOkoNH9wDADro1yZuSXFhVd42OgZ1hzGZF6u6nJ7kgyRGjWwCAWdma5Niq+uroEAAAFst992JvSvK00S0A8CB9McmpVXXN6BDYUcZsVpTuPiDJxiQnJ9lndA8AMBsfTbKhqt4zOgQAgMXS3c9OclmSPx3dAgBL5N8yfY7yqdEh8JsYs1kRuruSHJnk4iSPHt0DAMzGj5Kcm+SKqrp3dAwAAIujux+W5KxMx4rvOboHAJbYtiRvz/Sk9o2jY+BXMWYze939oiRbkrx4dAsAMBv3JLkyyRlV9ZPRMQAALI7u3jPJ65Kcl+QRo3sAYJndlOScJG+pqm2jY+AXGbOZre5+XJILk6yL/64CAP/juiTrq+ozo0MAAFgs3f3qJJuTPG90CwDsZp9LclxV/cvoEPhZBkJmp7v3S3JsktOSHDi6BwCYjS8kOb6q/nF0CAAAi6W7n57kgiRHjG4BgMG2ZnqI4CujQyAxZjMz3b02yeVJnjy6BQCYjZuTXJRkU1XdPToGAIDF0d0HJNmY5OQk+4zuAYCZuDvJW5OcXlU/HR3D6mbMZha6+wWZjnB6+egWAGA2tie5OskJVfWD0TEAACyO7q4kRya5OMmjR/cAwEx9N8lZSd5WVdtHx7A6GbMZqrsfnuSMJEcn2WN0DwAwG+/KdE/Tx0eHAACwWLr7RUm2JHnx6BYAWCE+kmRDVb13dAirjzGbIbp7ryRHJTk7yUNG9wAAs/HNJKdV1TtGhwAAsFi6+3FJLkyyLj4XBYCd1UmuTbKxqr4+OobVw4s2drvuPizTt19/a3QLADAbtyW5NMlFVXXn6BgAABZHd++X5NgkpyU5cHQPAKxwtye5JMnFVXXH6BgWnzGb3aa7n5XksiR/NroFAJiN+7/Ve0JVfWN0DAAAi6W71ya5PMmTR7cAwIL5VpJTk1xVVT06hsVlzGbZdffDkpyU5Lgke4/uAQBm4/ok66vq/aNDAABYLN39giSbk7x8dAsALLh3Z7pP+2OjQ1hMxmyWTXevyXQH0SVJHjm6BwCYje8kOTvJ26pq++gYAAAWR3c/PMkZSY5OssfoHgBYJbYnuTrTfdrfHx3DYjFmsyy6+1WZvv36/NEtAMBs3J3krUlOq6pbRscAALA4unuvJEdl+tLkQ0b3AMAqdWuSNyW5sKruGh3DYjBms6S6+wlJzk9y5OgWAGBWtmY6Uvwro0MAAFgs3X1Yki1Jfmt0CwCQJPliklOr6prRIax8xmyWRHcfkGRjprux9x3dAwDMxmeTHFdV/zo6BACAxdLdz0pyWZI/G90CADyg6zJ9LvSp0SGsXMZsdkl3V5LDMx0b8YTRPQDAbNyU5JwkV1TVvaNjAABYHN39sEwPVByXZO/RPQDAr3VPkn/I9KT2jaNjWHmM2Txo3f3CTPdiv3R0CwAwG96gAACwLLp7TZJ1SS5N8ojRPQDATvHgAw+KMZud1t2PTXJmktcnWTO6BwCYjeuSbKiqT48OAQBgsXT3q5NsSvL80S0AwC5xJR07xZjNDuvu/ZIcm+TUJAeN7gEAZuOLmZ7EvmZ0CAAAi6W7n5bkwiRHjG4BAJbU1iTrq+oro0OYN2M2O6S71ybZkuQpo1sAgNm4OclFSTZX1V2jYwAAWBzdfUCSjZnuxt53dA8AsCzuTvLWJKdX1U9HxzBPxmx+re7+3Uwj9itGtwAAs7E9ydVJNlbV90fHAACwOLq7khyZ5OIkjx7dAwDsFt9JcnaSt1XV9tExzIsxmwfU3Q9PckaSo5PsMboHAJiNd2e6F/tjo0MAAFgs3f3CTA9VvGR0CwAwxPWZPnd63+gQ5sOYzc/p7r2SHJXpGzAPGd0DAMzGt5KcmuSqqurRMQAALI7uflyme7HXxeeVALDadZJrk5xQVd8YHcN4a0YHMB/dfViSjybZHEM2ADC5PdOX3J5ZVe8wZAMAsAyeneQPYsgGAKbXA0ck+XR3n9Ld+44OYiwvEEl3PzPJm5L8xegWAGA27v8W7Maq+vroGAAAFlt375nkdUnOT3Lo6B4AYDa+meS0OC1w1TJmr2Ld/dAkJyfZkGSf0T0AwGx8JNP9RO8dHQIAwOrS3YckOTPTNXh7ju4BAGbjPzJ9XvXx0SHsXsbsVai712S6g+iSJI8c3QMAzMZ3k5yV5G1VtX10DAAAq1d3PzvJpiSvHd0CAMzG9iRXZ7pP+wejY9g9jNmrTHf/caY7sX9ndAsAMBv3JLkyyelV9dPRMQAAcL/uXpvps6ynjm4BAGbj5iQXJdlcVXeNjmF5GbNXie5+QqY7h9bF/98BgP+xNdMRTV8eHQIAAA+ku/dO8oYk5yQ5eHQPADAbX0jyt1W1dXQIy2fN6AB2j4997KPn3vijG58dQzYAMPlckj+tqrWGbAAA5qyq7q6qLUmeneT/yXTEKACwyt11110HfepTnzj5+uuv3390C8vHmL1K3HXP3Y/8yle+/MIbPnrDDbfffrsPrAFg9bopyYYkz6uqfxkdAwAAO6qqvltV/yvJi5K8b3QPADDG9u3bb//qV7/87k984uMH337HHS8b3cPyMmavMtu23fOCT336k0/87Oc++557773XnZgAsHpsy/QUy7OraktVbRsdBAAAD0ZVfSTJy5P8X0m+MboHANh9brzxhx/+yA3X3/TDG298ZacPGN3D8jNmr0573XLLT1/xkRuu3/a1b3ztPd197+ggAGBZ/VuSF1TV/6qqH46OAQCAXVVVXVXXJHlOkrOT3Dm6CQBYPrfcesvnbrjhI5/4yle/8sLufvzoHnYfY/bqdsgPvv/9V9xww0e+ePPNN39idAwAsOS+lOT/qqrDquqTo2MAAGCpVdXtVXVWkmckuSpJj24CAJbOtm3bbvrs5z77ns9+9jPP2HbvtueP7mH3M2aTe7ff++wvfPHzz//Yxz/64TvvvPNbo3sAgF12W6anU377vqdVAABgoVXVt6rqL5O8OsnHR/cAALumu+/52je+9p4bPvqRvW655aevSLLH6CbGMGbz3+6+++4XfuKTH3/457/4+Xffu/3e20b3AAA7rTM9jfL0qjqrqu4aHQQAALtTVf1Hkhck+askPxjdAwDsvB//+Ec3fOSG67/5g+9//xVJDhrdw1jGbH7Rfj+5+eZX3nDDR275zne+8744mgkAVooPJXlpVf1lVX1vdAwAAIxSVdur6h1JnpXk4iS+5AkAK8Add9zx1Y997KMf/uKXvvSC7du3P3V0D/NgzOYBdfejv/Xtb77s+o9c/5mf/OQnnxrdAwD8St/O9NTJi6vqv0bHAADAXFTVzVV1cpLnJ9k6ugcAeGDbtm27+fNf/Py7P/mpTzzu7nvufuHoHubFmM2vtX37vc/9/Bc+99xPfeoT7/v/2fu3ILvL+87//X5bB5AE5mhjZDAYhCQwYE4CZAVpktg1mcTkZpe9r4L//7mIa1IVw66KY6p2doEzM1X21Qbf2Re7ymTmBucqJk6mQqKRQOq1Vq9erXNL6tYBSTRuEGqJltRS91rrty/kTBwb2xwkPau7X69LG6T3agOm+/N7nt/MzIyrmQCgd5yNC6dMVmfmS5npNhUAAHgfmbk/M5+MiC9HxO7SPQDABVVVtY8eO/paa6jVOXXy5IaIWFy6id5jzOaDyLNTU+uGtrWWjY6ObKqqrquZAKCsVyLi85n5bGaeLh0DAACzQWa+GhEPRsQzEXGqdA8AzGcTExNDg63mwbfeGnsiorqhdA+9y5jNh7HsxMSJDYODzZ+Nj4/3l44BgHmoFRHrM/PJzDxcOgYAAGabzJzJzBcj4s6I+H5EdEo3AcB8cu7c1JEdO7f1j4zuf7Db7a4s3UPvM2bzoXWr6rY3jhxe29o2OHT6zOmR0j0AMA+8GxdOjzyama+VjgEAgNkuM9/NzKcjYk1EbC7dAwBzXbfbPTM6OrJpx84dnzp37vza0j3MHsZsPrL2TPvBPXt2f27Pnt2vtdvtE6V7AGAOmokLp0XuzMwXM9OpEQAAuIgycygzN0TEH0fEodI9ADAHVWNjY1uagwNnTkyc2BARV5YOYnYxZvNxLTx95vQTrW2DefjI4c1VVbVLBwHAHPFqRDyQmU9npvf5AQDAJZSZP4mIz0fEsxExWboHAOaCycnJPYOt5u5jbx5dFxGfKt3D7GTM5uKo4rq3x8fXNwebR95993izdA4AzGL7IuKPMvPLmbmndAwAAMwXmTmVmd+LiNUR8TcRUZVuAoDZ6Pz58z/btWvHluG9e+7udDr3lu5hdjNmc1FVVfeOAwcPPLJt+9DAuXPnjpbuAYBZZCIunAK5PzN/WjoGAADmq8wcy8ynIuKxiOgv3QMAs0W32506dOjApu07t111dmpqXURk6SZmP2M2l8T09PSaHTu33zS8d3hzp9NxNRMA/HrduHDqY1Vmfi8zp0sHAQAAEZk5EBHrIuJrEeHQBgD8BsePvzMw2Goef+f48Q1RxVWle5g7jNlcSosnJ99bP9hqnj167OhrceGH9QDAv9kYEQ9m5lOZ+U7pGAAA4N/LzCozfxwRd0fEdyLiXOkmAOglp09P7m0NDW4/eOjgmqqqbi3dw9xjzOZyuOmtt8aeGGw19506dXJn6RgA6AFHIuLrmfl7mbmjdAwAAPCbZeaZzHw+IlbGhZuVAGBea7fbJ4b3Dm/eM7znrna7/YXSPcxdxmwum06nc/e+/fvu3bFzW/+58+feLN0DAAWciQunOVZl5kulYwAAgA8nM4/+/H3avxcRHkwFYN6pqmrm8JHDm1tDgwsnJ99bHxELSjcxtxmzudzy3Lnza3fs2H7d6OjIpm63O1U6CAAugyounN5YkZnPZ6arCQEAYBbLzI0R8WBEfD0ivDIIgHlhYuLd1mBr4I23x8fXR8QnSvcwPxizKWXpiYkTGwZbzZNjY2Nb4sIP+QFgLhqIiHU/fy/2z0rHAAAAF0dmdn9+49KqiPheREyXbgKAS2Fqaurwtu1DAyOjow91u9WK0j3ML8Zsiqqq6uZjbx5d1xpq7Th9+vT+0j0AcBGNxYVTGo9lZn/pGAAA4NLIzInMfDYi7o+In5buAYCLpdPpnNo3sm/Tzl07lk9PT68p3cP8ZMymJ7TbM1/YM7x7xa5dO7bMzMwcL90DAB/DVFw4lbE6M1/KTLePAADAPJCZ+zLzjyLiyxGxp3QPAHwM3bGxsS2tocGZUydPboiIxaWDmL+M2fSSvrNTU+uGtrUWHTp0YFNVdc+XDgKAD+mViPh8Zj6bmZOlYwAAgMsvM1+NiAci4pmIOFW6BwA+jImTE9uagwOjx948uq6qqhtL94Axm150zTvHj29otppvHT9+fKB0DAB8AEMRsSEzn8zMQ6VjAACAsjJzJjNfjIg7I+L7EdEp3QQAv8n58+fHdu3asWVkZP8D3W53Zeke+FfGbHpW1a1uP3jowJrWUKt19uzZ0dI9APA+3o0Lpy3WZObm0jEAAEBvycx3M/PpiHg0Il4r3QMAv6zb7Z4dHR3ZtH3HtuvPTk2tK90Dv8yYTc9rt2ce2rV7523De4c3dzodVzMB0Atm4sLpijsz88XMdMoCAAD4tTKzlZnrI+KPI+Jw6R4AiIhqfHy8f7A1cPLExIkNEXFl6SB4P8ZsZotFk5PvrR8canYPHzm8uaoqowEApbwaEQ9m5tOZ6SErAADgA8vMn0TE5yPi2Yg4XboHgPlpcnJyeLA1uOuNI4fXVlUsL90Dv4kxm9mliuveHh9fP9hqjp48eXJ76RwA5pX9EfFkZn45M3eXjgEAAGanzDybmd+LiNUR8TcRUZVuAmB+mJmZGd+zZ/drw3v3rOp02veV7oEPwpjNrNTtdlftH9n3hW3bhwbOnTt3tHQPAHPaybhwauK+zHyldAwAADA3ZOabmflURDweEbXSPQDMXVVVTR8+cnjz0LbW0tNnTj8R9kFmEX+xMqtNT0+v2bFz+437RvZt6nQ6rmYC4GLqxoVTEqsy83uZOV06CAAAmHsysxER6yLi6xHxs9I9AMwtx4+/M9AcHBh/e3x8fURcXboHPixjNnPBklMnT25otQbPHD129LW4MD4AwMfxvyPiocx8KjPfLh0DAADMbZnZzcyXImJFRHwnIs6XbgJgdpuaOntwaNtQ8+Chg2uqqrq1dA98VMZs5owqqpveemvsicHWwN5Tp07tKt0DwKx0NCK+npm/m5nbS8cAAADzS2aeycznI+LeiPhx6R4AZp92uz0xvHd4885dOz87MzP9SOke+LiM2cw5nU73nn37935+x85t/efPnx8r3QPArHA2Lpx+WPnz0xAAAADFZOZoZn4tIr4UETtL9wDQ+6qqah89dvS11tBgNTn53vqIWFi6CS4GYzZzVZ47d37t9h3brhkdHdnU7XbPlQ4CoCdVceG0w92Z+Xxm+v8LAACgZ2TmP0fEQxHxjYg4XroHgN40MTExNNgaOPzWW2NPRMT1pXvgYjJmM9ctOzFxYsNga+DE2NjYltIxAPSUZkQ8kZlfy8wjpWMAAADeT2a2M/OHEbEqIr4fEe3STQD0hqmpqcM7dm7rHxnd/2C3W60o3QOXgjGbeaGqYvmxN4+uG9o2uO306dP7S/cAUNRYXDjV8FhmetAJAACYFTLzRGY+HRH3RcQ/lu4BoJxOt3NmdHRk085dO28+d+782tI9cCkZs5lXZmbaD+wZ3r1i164dW9rtmXdL9wBwWU3HhVMMd2fmDzOzWzoIAADgw8rMvZn5nyLijyPiYOkeAC6r7tjY2JZWa/DsiYkTGyKqK0oHwaVmzGY+6js7NbVuaNvQgkOHDmyqqmq6dBAAl9wrcWHEfjoz3ysdAwAA8HFl5k8i4u6IeCYifJ8DMMdNTr63e7DV3HPszaPrqqr6ZOkeuFyM2cxbVVVd+87x4xuagwNvHn/3+EDpHgAuieGI+IPMfDIznVgAAADmlMyczswXI2J1RPwwItxABTDHnD9//q1du3ZsGd47fE+n07m3dA9cbsZs5r2qqj538OCBNa2hVuvs2bMHSvcAcFGciAunE+7LzP9VOgYAAOBSysy3MvMbEfFoRGwp3QPAx9ftds8eOnRg044d2z9xdmpqXURk6SYowZgNP9duzzy0a/fOzw7vHd7c6XRczQQwO7XjwmmEVZn5YmZ2SgcBAABcLpk5GBFPRMTXIuKN0j0AfDTHj78zMNhqnnjn+PENVVTLSvdAScZs+PcWTU6+t36w1WwfPnJ4c1VVRhCA2eOfI+LBzPxGZh4vHQMAAFBCZlaZ+eOIuCcivhMRU6WbAPhgJk9P7m0NDe44eOjgmqqqbindA73AmA3v7/q3x8fXt1qDIydPntxROgaA32gkIr6WmV/KzF2lYwAAAHpBZp7NzOcjYmVE/E1EVKWbAHh/7Xb7xPDe4c3Dw3vuarfb95fugV5izIbfoNPtrN4/su/+bduHBs6dO3esdA8A/87puHDK4L6fnzoAAADgl2Tmscx8KiJ+NyK2le4B4N9UVTVz+Mjhza2hwUWTk++tj4gFpZug1xiz4QOYnp5es2Pn9uv3jezb1Ol2zpTuAZjnunHhVMGKzHw+M8+XDgIAAOh1mbkpIh6OiK9HxHjpHoD5bmLi3dZgq3n07fHx9RFxdeke6FXGbPjglp46eXJDqzU4OTY2tiVczQRQQj0ivpiZT2WmH74AAAB8CJnZzcyXImJ1RHwvIjwcDHCZTU1NHdq2bWhgZHT0oW63e0fpHuh1xmz4kKqq+vSxN4+uaw4295w6dcq7WQEuj2Nx4fTA2sysl44BAACYzTLzZGY+GxH3R8QrpXsA5oN2u31y38i+TTt37fjM9Mz0mtI9MFsYs+Ej6nY7n9+3f+89u3bt2DIzM/NO6R6AOepsXDgtcHdmvpSZbsUAAAC4SDJzf2Y+GRFfjojdpXsA5qju2NjYltZQq3Pq5MkNEbG4dBDMJsZs+Hj6zk5NrRva1lo6Ojqyqaq6rmYCuDiqiPhxRNyTmc9m5unSQQAAAHNVZr4aEQ9GxDMRcbJ0D8BcMTExMdQcHBg99ubRdRHVDaV7YDYyZsPFsezExIkNg4PNn42Pj/eXjgGY5QYjYn1mfi0z3ygdAwAAMB9k5kxmvhgRd0bE9yOiU7oJYLY6d27qyI6d2/pHRvc/2O12V5bugdnMmA0XUbeqbnvjyOG1rW2DQ2fPnh0t3QMwy7wVEd+IiMcy8/XSMQAAAPNRZp7IzKcj4pGI2FS6B2A26Xa7Z0ZHRzbt2LnjU+fOnV9bugfmAmM2XALtmfaDu3bvvH3Pnt2vtdvtE6V7AHrcTFx46n91Zv4wMz39DwAAUFhmbsvM/xARfxwRh0r3APS4amxsbEtzcODMiYkTGyLiytJBMFcYs+HSWXj6zOknWtsG8/CRw5urqmqXDgLoQa9ExN2Z+XRmvlc6BgAAgH8vM38SEavjwvu0J0v3APSaycnJPYOt5u4L78WOT5XugbnGmA2XWhXXvT0+vr452Dzy7rvHm6VzAHrE3oj4w8x8MjMPlI4BAADg18vM6Z+/T3t1RPwwIrqlmwBKOz9zfnzXrh1bhvfuubvT6dxbugfmKmM2XCZV1b3jwMEDj2zbPjRw7ty5o6V7AAqZiAtP89+Xmf9QOgYAAIAPLjPHMvMbEfF4RGwt3QNQQrfbnTp06MCm7du3LTs7NbUuIrJ0E8xlxmy4zKanp9fs2Ln9puG9w5s7nY6rmYD5oh0Xnt5flZkvZqZXLwAAAMxSmTkQEb8TEV+LiCOlewAul+PH3xkYbDWPv3P8+Iao4qrSPTAfGLOhjMWTk++tH2w1zx49dvS1cDUTMLf9S0Q8lJnfyMx3SscAAADw8WVmlZk/joh7IuI7EXGudBPApXL69OTe1tDg9oOHDq6pqurW0j0wnxizoayb3npr7InBVnPfqVMnd5aOAbjIRiPia5n5+5npn3EAAABzUGaeycznI2JlRPxN6R6Ai6ndbp8Y3ju8ec/wnrva7fYXSvfAfGTMhh7Q6XTu3rd/3707dm7rP3f+3JulewA+pjNx4an8e3/+lD4AAABzXGYezcynIuL3ImJH6R6Aj6OqqpnDRw5vbg0NLpycfG99RCwo3QTzlTEbekeeO3d+7Y4d268bHR3Z1O12Xc0EzDZVXHgKf0VmPp+Z50sHAQAAcHll5saIeDAivh4Rb5fuAfiwJibebQ22Bt54e3x8fUR8onQPzHfGbOg9S09MnNgw2GpOjI2NbYkL4xBAr2tExBcz86nM/FnpGAAAAMrJzG5mvhQRqyPiexExXboJ4LeZmpo6vG370MDI6OhD3W61onQPcIExG3pUVVU3H3vz6LqhocHtp0+f3l+6B+DXeDMuPG3/eGbWSscAAADQOzJzIjOfjYj7I+KnpXsA3k+n0zm1b2Tfpp27dt48PT29pnQP8O8Zs6HHzbTbD+wZ3r1i164dW2ZmZo6X7gH4uam48HT96sx8KTPdIgEAAMD7ysx9mflHEfHliNhTugfg57pjY2NbWkODM6dOntwQUV1ROgj4VcZsmB36zk5NrRva1lp06NCBTVXV9R5aoKRXIuKezHw2M0+XjgEAAGB2yMxXI+KBiHgmIk6V7gHmr4mTE9uagwOjx948uq6qqhtL9wC/njEbZpdr3jl+fEOz1Xzr+PHjA6VjgHmnFRHrM/PJzDxcOgYAAIDZJzNnMvPFiLgzIr4fEZ3STcD8cf78+bd27dqxZWRk/xe63e7K0j3Ab2fMhlmo6la3Hzx0YE1rqNU6e/bsaOkeYM57Ny48Nf9oZr5WOgYAAIDZLzPfzcynI+LRiPC9JnBJdbvds6OjI5u279h23dmpqXURkaWbgA/GmA2zWLs989Cu3TtvG947vLnT6bxXugeYc2biwlPyd2bmi5npaXkAAAAuqsxsZeb6iPjjiDhcugeYc6rx8fH+wdbAyRMTJzZExJWlg4APx5gNs9+iycn31g+2mu3DRw5vrqrK2ARcDK9GxAOZ+XRmeo8ZAAAAl1Rm/iQi7omIZyPidOkeYPabnJwcHmwN7nrjyOG1VRXLS/cAH40xG+aO698eH18/2BocOXny5PbSMcCstS8i/igzv5yZe0rHAAAAMH9k5lRmfi8iVkfE30REVboJmH1mZmbG9+zZ/drw3j2rOp32faV7gI/HmA1zTLfbWb1/ZN8Xtm0fGjh37tzR0j3ArDERF55+vz8zf1o6BgAAgPkrM9/MzKci4vGIqJXuAWaHqqqmDx85vHloW2vp6TOnnwgbGMwJ/kaGOWp6enrNjp3bb9w3sm9Tp9NxNRPw63TjwtPuqzPze5k5XToIAAAAIiIysxERX4yIr0fEz0r3AL3r+PF3BpqDA+Nvj4+vj4irS/cAF48xG+a2JadOntzQag2eGRsb2xKuZgL+vY0R8WBmPpWZb5eOAQAAgF+WmVVmvhQRKyLiOxFxvnQT0Dumps4eHNo21Dx46OCaqqpuLd0DXHzGbJgHqqhuOvbm0XWDrYHhU6dO7SrdAxR3NCK+npm/l5k7SscAAADAb5OZZzLz+Yi4NyJ+XLoHKKvdbk8M7x3evHPXzs/OzEw/UroHuHSM2TCPdDrde/bt3/v5Xbt2bJmZmXEKE+afM3HhKfaVP3+qHQAAAGaVzBzNzK9FxO9HxM7SPcDlVVVV++ixo6+1hgarycn31kfEwtJNwKVlzIb5J89OTa0b2tZaNjo6sqnb7Z4rHQRcclVceGr9nsx8PjP9fQ8AAMCslpn/EhEPRcQ3IuKd0j3ApTcxMTE02Bo4/NZbY09ExPWle4DLw5gN89eyExMnNgy2Bk78/H3awNw0EBG/k5lfy8wjpWMAAADgYsnMdmb+MCJWR8T3I6Jdugm4+Kampg7v2Lmtf2R0/4PdbrWidA9weRmzYZ6rqlh+7M2j64a2DW47ffr0/tI9wEUzFheeTn88M7eWjgEAAIBLJTNPZObTEXFfRPxD6R7g4uh2u2dGR0c27dy18+Zz586vLd0DlGHMBiIiYmam/cCe4d0rdu3asaXdnnm3dA/wkU3HhafRV2fmDzOzWzoIAAAALofM3JuZfxgRfxwRB0r3AB9Zd2xsbMtgq3n2xMSJDRHVFaWDgHKM2cAv6rvwPu2hBYcOHdhUVdV06SDgQ3klLozYT2fmZOkYAAAAKCEzfxIRd0fEMxHxXuke4IObnHxv92CruefYm0fXVVX1ydI9QHnGbOBXVFV17TvHj29oDg68efzd4wOle4DfaltE/IfMfDIzD5WOAQAAgNIycyYzX4wL79P+YUS4uQx62Pnz53+2a9eOLcN7h+/pdDr3lu4BeocxG/i1qqr63MGDB9a0hlqts2fPHizdA/yKE3HhKfNHMnNT6RgAAADoNZn5VmZ+IyIejYgtpXuAf6/b7Z49dOjAph07tl99dmpqXURk6Sagtxizgd+q3Z55aNfunbcO7x3e3Ol0XF0M5c3Ehfdi35mZL2Zmp3QQAAAA9LLMHIyIJyLiaxHxRukeIOL48XcGBlvNE+8cP76himpZ6R6gNxmzgQ9q0eTke+sHW82Zw0cOb66qyngGZbwaEQ/+/L3YJ0vHAAAAwGyRmVVm/jgi7omI70TEVOkmmI8mT0/ubQ0N7jh46OCaqqpuKd0D9DZjNvBhXf/2+Pj6Vmtw5OTJkztKx8A8sj8inszML2fm7tIxAAAAMFtl5tnMfD4iVkbE30REVboJ5oN2u31ieO/w5uHhPXe12+37S/cAs4MxG/hIOt3O6v0j++7ftn1o4Ny5c8dK98AcdjIino2I+zPzldIxAAAAMFdk5rHMfCoifjcitpXugbmqqqqZw0cOb24NDS6cnHxvfUQsKN0EzB7GbOBjmZ6eXrNj5/br943s29Tpds6U7oE5pBsXng5fnZnfy8zzpYMAAABgLsrMTRHxcER8PSLGS/fAXDIx8W5rsNU88vb4+PqI+ETpHmD2MWYDF8PSUydPbmi1BifHxsa2hKuZ4OPaFBEPZeZTmembaAAAALjEMrObmS9FxOqI+F5EeKgcPoapqalD27YNDYyMjj7U7XbvLN0DzF7GbOCiqarq08fePLquOdjcc+rUqV2le2AWOhYXngL/3czcXjoGAAAA5pvMPJmZz0bEfRHx49I9MNu02+2T+0b2bdq5a8dnpmem15TuAWY/YzZw0XW7nc/v27/3nl27dmyZmZl5p3QPzAJnI+I7EXFXZr6UmW43AAAAgIIycyQzvxYRX46I3aV7YBbojo2NbWkNtTqnTp7cEBGLSwcBc4MxG7hU+s5OTa0b2tZaOjo6sqmquq5mgl9VxYWnvO/JzOcz81zpIAAAAODfZOarEfFgRHwjIo6X7oFeNDExsa05ODB67M2j6yKqG0r3AHOLMRu41JadmDixodlqvjU+Pt5fOgZ6yGBEPJGZX8vMN0rHAAAAAO8vM2cy84cRsSoivh8RndJN0AvOnz8/tmvXji0jo/sf6Ha7K0v3AHOTMRu4LKpudfsbRw6vbW0bHDp79uxo6R4o6K248DT3o5m5pXQMAAAA8MFk5onMfDouvE/7f5XugVK63e6Z0dGRTdt3bLv+7NTUutI9wNxmzAYuq/ZM+8Fdu3fevmfP7tfa7faJ0j1wGU3Hhae3V2fmDzOzWzoIAAAA+PAyczgz/yAi/jgiDpXugcuoGh8f7x9sDZw6MXFiQ0RcWToImPuM2UAJC0+fOf1Ea9tgHj5yeHNVVe3SQXCJvRIRd2fm05n5XukYAAAA4OPLzJ9ExOqIeCYiJkv3wKU0OTm5Z7DV3P3GkcNrqyqWl+4B5g9jNlBOFde9PT6+vjnYPPLuu8ebpXPgEtgbEf8pM5/MzIOlYwAAAICLKzOnM/PFuDBq/zAi3MTGnHJ+5vz4rl07tgzv3XN3p9O5t3QPMP8Ys4Hiqqp7x4GDBx7Ztn1o4Ny5c0dL98BFcCIuPJV9X2b+Y+kYAAAA4NLKzLHM/EZEPBYRW0v3wMfV7XanDh06sGn79m3Lfv5e7CzdBMxPxmygZ0xPT6/ZsXP7TcN7hzd3Oh1XMzEbtePCU9irMvPFzHSFPgAAAMwjmdmMiN+JiK9FxJHSPfBRHD/+zsBgq3n8nePHN0QVV5XuAeY3YzbQaxZPTr63frDVPHv02NHXwtVMzB7/HBEPZuY3MvN46RgAAACgjMysMvPHEXFPRHwnIs6VboIP4vTp0/taQ4PbDx46uKaqqltL9wBEGLOB3nXTW2+NPTHYau47derkztIx8BuMRMTXMvNLmbmrdAwAAADQGzLzTGY+HxErI+JvSvfAr9Nut08M7x3evGd494p2u/2F0j0Av8iYDfS0Tqdz9779++7dsXNb//nz58dK98AvOBMXnq6+7+dPWwMAAAD8isw8mplPRcTvRcSO0j3wr6qqmjl85PDm1tDgwsnJ99ZHxILSTQC/zJgNzAZ57tz5tdt3bLt2dHRkU7fbdTUTJXXjwtPUd2bm85l5vnQQAAAA0Psyc2NEPBgRX4+It0v3ML9NTLzbGmwNvPH2+Pj6iPhE6R6AX8eYDcwmS09MnNgw2Bo4MTY2tiUiqtJBzDuNiFiXmU9l5njpGAAAAGB2ycxuZr4UEasj4nsRMV26ifllamrq8LbtQwMjo6MPdbvVitI9AL+NMRuYdaoqlh978+i6oaHB7adPn95fuod54VhceGr68cyslY4BAAAAZrfMnMjMZyPivoj4+9I9zH2dTufUvpF9m3bu2nnz9PT0mtI9AB+UMRuYtWba7Qf2DO9esWvXji0zMzPHS/cwJ52NC09J352ZL2Wm2wAAAACAiyYz92fmVyLiyxGxp3QPc1J3bGxsS2tocObUyZMbIqorSgcBfBjGbGC26zs7NbVuaFtr0aFDBzZVVeVqJi6WVyLi85n5bGaeLh0DAAAAzF2Z+WpEPBARz0TEqdI9zA0nT05sbw4OjB578+i6qqpuLN0D8FEYs4G54pp3jh/f0GwNjB0/fnygdAyzWisi1mfmk5l5uHQMAAAAMD9k5kxmvhgRd0bE9yOiU7qJ2en8+fNv7dq1Y8v+kf33d7vdlaV7AD4OYzYwp1Td6vaDhw6saQ21WmfPnh0t3cOscjwuPP38aGa+VjoGAAAAmJ8y893MfDoi1kSEn1HwgXW73bOjoyObtu/Ydt3Zqal1EZGlmwA+LmM2MCe12zMP7dq987bhvcObO53Oe6V76GkzceFp5zsz88XM9NQzAAAAUFxmDmXm+oj444g4XLqHnlaNj4/3Dw42J05MnNgQEVeWDgK4WIzZwFy2aHLyvfWDrWb78JHDm6uqMlLyy16NiC9k5tOZ6aEHAAAAoOdk5k8i4p6IeDYiTpfuobdMTk4OD7YGd71x5PDaKqrPlO4BuNiM2cB8cP3b4+PrB1uDIydPntxeOoaesC8i/igzv5yZw6VjAAAAAH6TzJzKzO9FxOqI+JuIqEo3UdbMzMz4nj27Xxveu2dVp9O+r3QPwKVizAbmjW63s3r/yL4vbNs+NHDu3LmjpXsoYiIuPMV8f2b+tHQMAAAAwIeRmW9m5lMR8XhE9Jfu4fKrqmr68JHDm4e2tZaePnP6ibDzAHOcf8gB88709PSaHTu337hvZN+mTqfjaqb5oR0RP4yIVZn5vcycLh0EAAAA8FFlZiMi1kXE1yPiZ6V7uDyOH39noDk4MP72+Pj6iLi6dA/A5WDMBuarJadOntzQag2eGRsb2xKuZprL/iUiHs7Mb2TmO6VjAAAAAC6GzKwy86WIWBER34mI86WbuDSmps4eHNo21Dx46OCaqqpuLd0DcDkZs4F5rYrqpmNvHl032BoYPnXq1K7SPVxUoxHxtcz8/czcUToGAAAA4FLIzDOZ+XxE3BsRPy7dw8XTbrcnhvcOb965a+dnZ2amHyndA1CCMRsgIjqd7j379u/9/K5dO7bMzMy8XbqHj+VMXHga+b7M9A0cAAAAMC9k5mhmfi0ifj8idpbu4aOrqqp99NjR11pDg9Xk5HvrI2Jh6SaAUozZAP8mz05NrRva1lo2OjqyqdvtnisdxIdSRcTfRMSKzHw+M/3vBwAAAMw7mfkvEfFQRHwjIrxybZaZmJgYarWah956a+yJiLi+dA9AacZsgF+17MTEiQ2DrcG3x8fH+0vH8IEMRMS6zHwqM39WOgYAAACgpMxsZ+YPI2JVRHw/Itqlm/jNps5NvbFj57b+kdH9D3a63btK9wD0CmM2wK9RVd3PvnHk8NrWtsGh06dP7y/dw/t6MyK+HhGPZaYHDwAAAAB+QWZOZObTEXFfRPxD6R5+VbfbPTM6OrJp586dnz537vza0j0AvcaYDfBbtGfaD+4Z3n3Hnj27X2u3Z94t3UNERExFxPci4u7MfCkzq9JBAAAAAL0qM/dm5h9GxB9HxIHSPURERHdsbGxLc3DgzImJExsiqitKBwH0ImM2wAez8PSZ008MbRtacOjQgU1VVU2XDprHXomIz2fms5k5WToGAAAAYLbIzJ9ExN0R8UxEvFe6Z76anHxv92CruefYm0fXRcSnSvcA9DJjNsCHUFXVte8cP76hOTjw5vF3jw+U7plnhiJiQ2Y+mZmHSscAAAAAzEaZOZOZL0bE6oj4YUR0SjfNF+fPn//Zrl07tgzvHb6n0+ncW7oHYDYwZgN8BFVVfe7gwQNrWkOt1tmzZw+W7pnj3o0LTwuvyczNpWMAAAAA5oLMfCszvxERj0XE66V75rJut3v20KEDm3bs2H712ampdRGRpZsAZgtjNsDH0G7PPLRr985bh/cOb+50Oq68vrhmIuL7EXFnZr6YmZ4SBgAAALjIMnMwItZHxNci4o3SPXPN8ePvDAy2mifeOX58QxXVstI9ALONMRvg41s0Ofne+sFWc+bwkcObq6oyun58r0bEA5n5dGaeKh0DAAAAMJdlZpWZP46IeyLiOxExVbpptps8Pbm3NTS44+Chg2uqqrqldA/AbGXMBrh4rn97fHx9qzU4cvLUyR2lY2ap/RHxlcz8cmbuKR0DAAAAMJ9k5tnMfD4iVkbE30REVbpptmm32yeG9w5vHh7ec1e73b6/dA/AbGfMBrjIOt3O6v37992/bfvQwLlz546V7pklTkbEsxFxX2b+fekYAAAAgPksM49l5lMRsTYi6qV7ZoOqqmYOHzm8uTU0uHBy8r31EbGgdBPAXGDMBrhEpqen1+zYuf36fSP7NnW6nTOle3pUNy485bsqM7+XmdOlgwAAAAC4IDPrEfHFiPh6RIyX7ulVExPvtgZbzSNvj4+vj4hPlO4BmEuM2QCX1tJTJ09uaLUG3xsbG9sSrmb6RRsj4qHMfCoz3y4dAwAAAMCvysxuZr4UESviwvu0z5du6hVTU1OHtm0bGhgZHX2o2+3eWboHYC4yZgNcBlVV3XzszaPrBgebe06dOrWrdE9hRyPi65n5e5m5vXQMAAAAAL9dZp7++fu074uIH5fuKandbp/cN7Jv085dOz4zPTO9pnQPwFxmzAa4jDrdzuf37d97z65dO7bMzMy8U7rnMjsbF57eXfnzp3kBAAAAmGUycyQzvxYRX46I+XZoozs2NralNdTqnDp5ckNELC4dBDDXGbMBLr++s1NT67ZtG1o6Ojqyqaq6c/1qpiouPK17d2Y+n5nnSgcBAAAA8PFk5qsR8VBEfCMijpfuudQmJia2NQcHRo+9eXRdRHVD6R6A+cKYDVBIFdWyExMnNjRbzbfGx8f7S/dcIs2I+J3M/FpmHikdAwAAAMDFk5kzmfnDiFgVEd+PiE7ppovt/PnzY7t27dgyMrr/gW63u7J0D8B8Y8wGKKzqVre/ceTw2ta2waGzZ8+Olu65SMbiwlO5j2Xm1tIxAAAAAFw6mXkiM5+OC+/T/l+ley6Gbrd7ZnR0ZNP2HduuPzs1ta50D8B8ZcwG6BHtmfaDu3bvvH3Pnt2vtdvtE6V7PqLpuPAU7urM/GFmdksHAQAAAHB5ZOZwZv5BRPxxRBws3fMRVePj4/2DrYFTJyZObIiIK0sHAcxnxmyA3rLw9JnTT7S2DebhI4c3V1U1m65meiUuvBf76cycLB0DAAAAQBmZ+ZOIuDsinomIWfNzosnJyT2DrcFdbxw5vLaqYnnpHgCM2QC9qYrr3h4fXz/Yar7x7rvHm6VzfovhiPiDzHwyM2frE7cAAAAAXESZOZ2ZL0bE6oj4YUT07A1+52fOj+/Zs/u14b17Vnc67ftK9wDwb4zZAD2s2+3eceDggUe2bR8aOHfu3NHSPb/kRFx4uva+zJwT70ICAAAA4OLKzLHM/EZEPBYRW0v3/KKqqqYPHzm8efv2bctOnzn9RNhMAHqOfzADzALT09NrduzcftPw3uHNnU6n9NVMM3HhadpVmfliZs6mq9ABAAAAKCAzmxHxOxHxtYg4Urrn+PF3BpqDA+Nvj4+vjyquKt0DwPszZgPMHosnJ99b32oNnj167OhrUeZqplcj4qHM/EZmHi/9BQEAAABg9sjMKjN/HBfep/2diDh3uRtOnz69rzXU2n7w0ME1VVXdWvprAsBvZswGmGWqqG56662xJwZbzX2nTp3ceZl+25GI+Fpmfjkzd5X+GgAAAAAwe2Xm2cx8PiJWRsTfXI7fs91uTwzvHd68Z3j3inZ75gulvwYAfDDGbIBZqtPp3L1v/757d+zc1n/+/PmxS/TbnI4LT8ne9/OnZgEAAADgosjMo5n5VET8bkRsvxS/R1VVM4ePHN7cGhrsm5x8b31ELCj9uQH44IzZALNbnjt3fu32HduuHR0d2dTtdi/W1UzduPBU7IrMfD4zz5f+oAAAAADMTZn5vyPioYj4ekS8fbF+3YmJd1uDrYE33h4fXx8R15T+nAB8eMZsgLlh6YmJExsGWwMnxsbGtnzMX2tTRDycmU9l5njpDwYAAADA3JeZ3cx8KSJWRcT3ImL6o/5aU1NTh7dtHxoYGR19qNutVpT+bAB8dMZsgDmkqmL5sTePrhsaGtx2+vTp/R/yTz8WF55+/d3M3Fb6swAAAAAw/2Tmycx8NiLui4i//zB/bqfTObVvZN+mnbt23jw9Pb2m9GcB4OMzZgPMQTPt9gN7hnev2LVrx5aZmZnjv+UPPxsX3ou9MjNfysyqdD8AAAAA81tm7s/Mr0TElyNiz2/5w7tjY2NbWkOD06dOntwQUV1Ruh+Ai8OYDTB39Z2dmlo3tK216NChA5uqqvrlq5mqiPhxRNzz8/diT5UOBgAAAIBflJmvRsQDEfFMRJz65f/+5MmJ7c3BgZFjbx5dV1XVJ0v3AnBxGbMB5r5r3jl+fEOzNTB2/PjxgZ//Z4MRsT4zv5aZb5QOBAAAAIBfJzNnMvPFiLgzIr4fEZ3z58+/tWvXji37R/bf3+12V5VuBODSMGYDzBNVt7r94KEDa3bt2vH9iHg0M18v3QQAAAAAH1RmvpuZTx8+evj/sX3HtuvOTk2ti4gs3QXApWPMBphnpqamqszslu4AAAAAgI/inZ+9MxERV5buAODSM2YDAAAAAAAA0HOM2QAAAAAAAAD0HGM2AAAAAAAAAD3HmA0AAAAAAABAzzFmCc4dVQAAgABJREFUAwAAAAAAANBzjNkAAAAAAAAA9BxjNgAAAAAAAAA9x5gNAAAAAAAAQM8xZgMAAAAAAADQc4zZAAAAAAAAAPQcYzYAAAAAAAAAPceYDQAAAAAAAEDPMWYDAAAAAAAA0HOM2QAAAAAAAAD0HGM2AAAAAAAAAD3HmA0AAAAAAABAzzFmAwAAAAAAANBzjNkAAAAAAAAA9BxjNgAAAAAAAAA9x5gNAAAAAAAAQM8xZgMAAAAAAADQc4zZAAAAAAAAAPQcYzYAAAAAAAAAPceYDQAAAAAAAEDPMWYDAAAAAAAA0HOM2QAAAAAAAAD0HGM2AAAAAAAAAD3HmA0AAAAAAABAzzFmAwAAAAAAANBzjNkAAAAAAAAA9BxjNgAAAAAAAAA9x5gNAAAAAAAAQM8xZgMAAAAAAADQc4zZAAAAAAAAAPQcYzYAAABcRP39/bdXVZWlOwAAAGC2M2YDAADARVCv12+oNWov9i3I0UazPjAw0L+udBMAAADMZgtLBwAAAMBs1mw2F7W77T+LqL6TEddEREQVD3cjX6sP1P62vaDzrXUPrXujdCcAAADMNk5mAwAAwEc0MND/pU63PZQRL8S/Dtn/JqOKry5sL9hTr/c/v3Xr1iWlewEAAGA2MWYDAADAh1Sv11fWG/0/6Vb5TxHx+d/yhy+NzOcWLOzbX6/Xn/I+bQAAAPhgjNkAAADwAQ0NDV1bH6h/N7LaGZFf+ZB/+i2R1Y8aA42N9Xr9C6U/CwAAAPQ6YzYAAAD8FlVV9dXr9aemZ87vi6r6dkQs/hi/2obIqlWv116q1Wo3lf5sAAAA0KuM2QAAAPAb9A/0/4fGQL0VWf0oIj51kX7Zvsj4k+yLvfV6/7dHRn56RenPCQAAAL3GmA0AAADvo9Fo3Fqv117qq3JjRFyqa8Gvjczvnpi4fke9Xv+w15YDAADAnLawdAAAAAD0kmazubTTmfnLKrrfjowrL9NvuzKy+kmtUXu1L/qeefTRR3eX/joAAABAaU5mAwAAQERUVZX1ev2rne7McGQ+F3HZhuz/IyO+VEV3qNaovTg0NHRt6a8JAAAAlGTMBgAAYN6r1+uPNAYar0dWL0fkZwvnLMqIb07PnD9Qa9SefvnllxeU/voAAABACcZsAAAA5q3XW68vbzRqP4is6hHVF0v3/JLrM+KF2z732Z31ev0/lo4BAACAy807swEAAJh3du/evXjyzOR/yXb81yri6tI9v1EVd0dW/1hv9L8SVd83H3vssUOlkwAAAOBycDIbAACAeaXR6H/y9JnJ4Yx4IXp9yP538iuR1d5ao/bi66+/Pou6AQAA4KMxZgMAADAv9Pf3311v1P6xivy7iLijdM9HtDgjvrl48cK9tYHan1ZV5ft6AAAA5izf9AIAADCnbd269fpao/Zi34LcGRFz4t3TVcTyrOIHjYF6vdHY2mvv+gYAAICLwjuzAQAAmJOazeaidtX+v7OK/x4RN5buuUQeqaLv9fpA7W8X5MK/eOSRR46UDgIAAICLxclsAAAA5pyBgf4vdbrtoaziBzF3h+x/lVHFVzvd9p56vf/5jRs3Xlk6CAAAAC4GYzYAAABzRq1Wu6s+UHu5W+U/RcTnS/dcZssi87mly5bsr9frT5WOAQAAgI/LNeMAAADMekNDQ9dOt6efjSqeiaq6onRPYbdGVj+qD9T+r6oTzzz++OM7SgcBAADAR+FkNgAAALNWVVV99Xr9qemZ83ujqr4dMe+H7H9Txe9mXwzV67WXtmzZ8qnSOQAAAPBhGbMBAACYlRqNrRsaA/XByOpHEXFT6Z4e1RcZf7Jw8YK99Xr/t3fv3r24dBAAAAB8UMZsAAAAZpVarXZLvV57qYq+jRHxQOmeWaGK6yLzu6fPTO6s1+t/VDoHAAAAPgjvzAYAAGBWaDabSzudmb+MjL+MiCWle2aplZHVK7VG7dXoxtOPP/74ntJBAAAA8Os4mQ0AAEBPq6oq6/X6Vzud9p7IfC4M2R9bRnwp+2JbrVF7sdlsXlO6BwAAAN6PMRsAAICeVavVHq4P1F+LrF6OjNtK98wxizLim51u+0CtUXv65ZdfXlA6CAAAAH6RMRsAAICe02w2b240aj/IvmhkxLrSPXPcDRnxwm233zbQaDTWl44BAACAf+Wd2QAAAPSM3bt3L548M/lfOt32X0fEJ0r3zC/Vg1VUm+qN/le6nfjztWvXHi5dBAAAwPzmZDYAAAA9odHof/L0mcnhjHghDNkF5Vf6FuSe+kD9u6+//vrVpWsAAACYv4zZAAAAFNVsbl1db9T/oYr8u4i4o3QPERGxJKrq24sWLxyu1+tPVVWVpYMAAACYf4zZAAAAFLF169bra43ai51u386I6g9K9/C+PhNZ/agxUKvX6/W1pWMAAACYX7wzGwAAgMtq48aNC5dcteQ/ZxX/PSJuLN3DB5FrIqst9Xrtf2T2/eWjjz76s9JFAAAAzH1OZgMAAHDZNBqN31+67MqhrOIHYciebTIy/qSK7mi93v/8xo0brywdBAAAwNxmzAYAAOCSq9Vqd9UHai9X0X01Iu8t3cPHsiwyn1u6dMnOer3+1dIxAAAAzF2uGQcAAOCS2bh741VLT1/5F5H5bFTVFaV7uIgyVkRUL9cbtX/p9HWf+eIjX9xZOgkAAIC5xclsAAAALrqqqvrq9fpTS88sGY3M5yIM2XPY7y3o9rUajdoPWq3NnywdAwAAwNxhzAYAAOCi6m/2P9Zo1LdGVj+KiJtK93BZLKwi/nSms3hfrVF7euPGjW6CAwAA4GMzZgMAAHBR1Gq1W+r12kt93eyPjMdK91BAFddlxAtLly3ZVRuo/WHpHAAAAGY3T0oDAADwsTSbzaWdzsyfR8RfRcZVpXvoCauyir+vNWqvVp3qm2vXrh0uHQQAAMDs42Q2AAAAH0lVVVmv17/a6bT3ROZ3Ddn8soz4Ut+C3F5r1F6s1WqfKN0DAADA7GLMBgAA4EOr1WoPNxr1zZHVy5FxW+keetqijPhm9sWBWqP29Msvv7ygdBAAAACzgzEbAACAD6zZbN7caNR+kH1Rj4zfKd3DrHJjRrxw++2fbdSaNX/tAAAA8Ft5ZzYAAAC/VbPZXNTutv+s023/dUS4LpqPrIp4KLvxWr3R/0q3E3++du3aw6WbAAAA6E1OZgMAAPAbNRr9T3a6neGMeCEM2Vw0+ZW+Bbm7PlD/7sbdG71vHQAAgF9hzAYAAOB9NZtbV9catZ9WkX8XUd1Zuoc5aWlU1beXnlkyXK/Xn6qqKksHAQAA0DuM2QAAAPw7W7duvb7WqL3Y6fbtzIj/VLqHeeGWyOpHjUa9v1arPV46BgAAgN7gndkAAABERMTGjRsXLrlqyX/OKv9bRPXJ0j3MQxmPZcaWer32P6sqvvX444+Pl04CAACgHCezAQAAiEaj8fvLli1pZRU/MGRTWF9k/ElmjNbr/c+PjPz0itJBAAAAlGHMBgAAmMe2Dm5dUR+ovVxF99Uq4r7SPfB/ZFwVmc+dmLh+Z71e/2rpHAAAAC4/14wDAADMQ9u3b1927tzZb0Wn79mIyslXetldkdXL9Ub/P/flwmfWrFmzq3QQAAAAl4eT2QAAAPNIVVV99Xr9qXPnp0Yj8zlDNrNH/n636gw1GrUfNJvNG0vXAAAAcOkZswEAAOaJgYGtjzYG6lsiqx9FxKdL98BHsLCK+NNOt72v1qg9vXHjRjfOAQAAzGHGbAAAgDlu69atn6nXay91q75aRDxeugcugusz4oUly5bsbDS2/kHpGAAAAC4NTzADAADMUc1mc2mnM/PnEflXkXFV6R642DJidRV9/1Bv9L/SlwufXrNmzcHSTQAAAFw8TmYDAADMQY1G/5Odbnt3ZH7XkM3cl1/pVp3hWqP2Yq1W+0TpGgAAAC4OYzYAAMAc0t/sf6jeqG2uIv8uIm4v3QOX0eKM+Gb2xd7aQO1Pq6ryMw8AAIBZzjd2AAAAc0Cz2byx1qi92NfNRkQ8UboHCro5q/hBo1lvDAz0rysdAwAAwEfnndkAAACzWLPZXNTutv+s023/dUa4Xhn+VRUPdyNfqw/U/ra9oPOtdQ+te6N0EgAAAB+Ok9kAAACz1MBA/5c6VXt7RrwQhmx4PxlVfHVhe8Geer3/+Y0bN15ZOggAAIAPzpgNAAAwywwMDKyq12t/363yn6KKu0v3wCywNDKfW7psyUi9Xn+qqqosHQQAAMBvZ8wGAACYJV577bXrao3ai92qsysy/rB0D8xCt0RWP2oMNDbW6/UvlI4BAADgN/PObAAAgB63cePGhUuuWvKfs8r/FlF9snQPzH7Vhsho1eu1/1lV8a3HH398vHQRAAAAv8rJbAAAgB5Wr9d/b9myJa2s4geGbLio+iLjT7Iv9tbr/d8eGfnpFaWDAAAA+PeM2QAAAD1o6+DWFfWB2suR1T9XEfeV7oE57NrI/O6Jiet31Ov1r5SOAQAA4N+4ZhwAAKCHbN++fdm5c2e/FZ38dkRcWboH5pGVkdVPao3aq33R98yjjz66u3QQAADAfOdkNgAAQA+oqirr9fpT585PjUbmc2HIhiIy4ktVdIdqjdqLQ0ND15buAQAAmM+M2QAAAIUNDGx9tDFQ3xJZ/SgiPl26B4hFGfHN6ZnzB2qN2tMvv/zygtJBAAAA85ExGwAAoJCtW7d+pl6vvdSt+moRsbZ0D/Arrs+IF2773Gd31uv1/1g6BgAAYL7xzmwAAIDLbOvWrUsWLMhvRuRfRcZVpXuA36KKuyOrf6w3+l+Jqu+bjz322KHSSQAAAPOBk9kAAACXUaPR/+SChX17IvO7hmyYbfIrkdXeWqP24uuvv3516RoAAIC5zpgNAABwGfQ3+x+qN2qbq8i/i4jbS/cAH9nijPjm4sUL99YGan9aVZWfrQAAAFwivuECAAC4hOr1+g21Ru3Fvm42IuKJ0j3AxVFFLM8qftAYqNcbja1fLN0DAAAwF3lnNgAAwCXQbDYXtbvtP4uovpMR15TuAS6ZR6roe70+UPvbBbnwLx555JEjpYMAAADmCiezAQAALrKBgf4vdbrtbRnxQhiyYT7IqOKrnW57T73e//zGjRuvLB0EAAAwFxizAQAALpKBgYFV9Xrt77tV/lNE3FO6B7jslkXmc0uXLdlfr9efKh0DAAAw2xmzAQAAPqbXXnvtuvpA/bvdqrMjMv6wdA9Q3K2R1Y/qA7V/qdVq95eOAQAAmK2M2QAAAB9RVVV99Xr9qcVXLN4XVfXtiFhcugnoIVX8bvbFUL1ee2nLli2fKp0DAAAw2xizAQAAPoJarfa7jWZ9KLL6UUT1ydI9QM/qi4w/Wbh4wd56vf/bu3fv9tALAADAB2TMBgAA+BCazeZn6/XaS9kX/xJVuD4Y+GCquC4yv3v6zOTOer3+R6VzAAAAZoOFpQMAAABmg+3bty87d+7stzrd9rcj48rSPcCstTKyeqXWqL0a3Xj68ccf31M6CAAAoFc5mQ0AAPAbVFWV9Xr9qXPnp0Yj87kIQzbw8WXEl7IvttUatRebzeY1pXsAAAB6kTEbAADg12g0GmsaA/UtF96LHZ8u3QPMOYsy4pudbvtArVF7+uWXX15QOggAAKCXGLMBAAB+ydatWz9Tr9deqqJbj4i1pXuAOe+GjHjhtttvG2g0GutLxwAAAPQK78wGAAD4ua1bty5ZsCC/GZn/74i4unQPMN9UD1ZRbao3+l/pduLP165de7h0EQAAQElOZgMAAEREo9H/5IKFfbsj87thyAaKyq/0Lcg99YH6d19//XX/PAIAAOYtYzYAADCvDQxsfbDeqG2qIv8uIj5Xugfg55ZEVX170eKFw/V6/amqqrJ0EAAAwOVmzAYAAOaler1+Q61Re7Fb9Q1EhHfUAr3qM5HVjxoDtXq9Xl9bOgYAAOBy8s5sAABgXmk2m4va3fafRVTfyYhrSvcAfDC5JrLaUq/X/kdm318++uijPytdBAAAcKk5mQ0AAMwbAwP9X+p029sy4oUwZAOzT0bGn1TRHa3X+5/fuHHjlaWDAAAALiVjNgAAMOfV6/WV9YHaK90q/yki7indA/AxLYvM55YuXbKzXq9/tXQMAADApeKacQAAYM4aGhq6dro9/WxU1f8rqlhcugfgospYEVG9XG/U/qXT133mi498cWfpJAAAgIvJyWwAAGDOqaqqr16vPzU9c35fVNW3IwzZwJz2ewu6fa1Go/aDVmvzJ0vHAAAAXCzGbAAAYE6p1Wq/22jWhyKrH0XEp0r3AFwmC6uIP53pLN5Xa9Se3rhxo9v4AACAWc+YDQAAzAmNRuPWer32UvbFv0QV95fuASiiiusy4oWly5bsGhjo/0+lcwAAAD4OT+kCAACz2vbt25edO3f2W1V0vx0ZV5buAegRq7pV/rTWqL1adapvrl27drh0EAAAwIflZDYAADArVVWV9Xr9q+fOn90Tmc9FGLIBfllGfKlvQW6vNWov1mq1T5TuAQAA+DCM2QAAwKzTaDTWNAYar0dWL0fkZ0v3APS4RRnxzeyLA7VG7emXX355QekgAACAD8KYDQAAzBqvt15f3mjUflBFtxZRfbF0D8Asc2NGvHD77Z9t1Jq13ykdAwAA8Nt4ZzYAANDzdu/evXjyzOR/yXb81yri6tI9ALNZFfFQduO1eqP/lW4n/nzt2rWHSzcBAAC8HyezAQCAntZo9D95+szk3ox4IQzZABdRfqVvQe6uD9S/u3H3xqtK1wAAAPwyYzYAANCTGo3GA/VGbVMV+XcR8bnSPQBz1NKoqm8vPbNkuF6vP1VVVZYOAgAA+FfGbAAAoKfU6/Ubao3ai1V0mxGxvnQPwDxxS2T1o0aj3l+r1R4vHQMAABDhndkAAECPaDabi9rd9p9FVN/JiGtK9wDMSxmPZcaWer32P6sqvvX444+Pl04CAADmLyezAQCA4gYG+r/U6baHfv5ebEM2QFl9kfEnmTFar/c/PzLy0ytKBwEAAPOTMRsAACimXq+vrDf6f9Kt8p8i4vOlewD4BRlXReZzJyau31mv179aOgcAAJh/XDMOAABcdkNDQ9dOt6efjSqeiUgn/gB6212R1cv1Rv8/9+XCZ9asWbOrdBAAADA/OJkNAABcNlVV9dXr9aemZ87vi6r6dkRlyAaYNfL3u1VnqNGo/aDZbN5YugYAAJj7jNkAAMBl0T/Q/x8aA/VWZPWjiPhU6R4APpKFVcSfdrrtfbVG7emNGze69Q8AALhkjNkAAMAl1Wg0bq3Xay/1VbkxIr5QugeAi+L6jHhhybIlOxuNrX9QOgYAAJibPD0LAABcEs1mc2mnM/OXVXS/HRlXlu4B4OLLiNVV9P1DvdH/Sl8ufHrNmjUHSzcBAABzh5PZAADARVVVVdbr9a92ujPDkflchCEbYO7Lr3SrznCtUXuxVqt9onQNAAAwNxizAQCAi6Zerz/SGGi8Hlm9HJGfLd0DwGW1OCO+mX2xtzZQ+9OqqvzcCQAA+Fh8UwEAAHxsr7deX95o1H4QWdUjqi+W7gGgqJuzih80mvXGwED/utIxAADA7OWd2QAAwEe2e/fuxZNnJv9LtuO/VhFXl+4BoIdU8XA38rX6QO1v2ws631r30Lo3SicBAACzi5PZAADAR9Jo9D95+szkcEa8EIZsAN5fRhVfXdhesKde739+48aNV5YOAgAAZg9jNgAA8KH09/ffXW/U/rGK/LuIuKN0DwCzwtLIfG7psiUj9Xr9qaqqsnQQAADQ+4zZAADAB7J169bra43ai30LcmdE/MfSPQDMSrdEVj9qDDQ21uv1L5SOAQAAept3ZgMAAL9Rs9lc1K7a/3dW8d8j4sbSPQDMBdWGyGjV67X/WVXxrccff3y8dBEAANB7nMwGAAB+rYGB/i91uu2hrOIHYcgG4OLqi4w/yb7YW6/3f3tk5KdXlA4CAAB6izEbAAD4FbVa7a76QO3lbpX/FBGfL90DwJx2bWR+98TE9Tvq9fpXSscAAAC9wzXjAADA/zE0NHTtdHv62ajimagqJ+QAuJxWRlY/qTVqr/ZF3zOPPvro7tJBAABAWU5mAwAAUVVVX71ef2p65vzeqKpvRxiyASgjI75URXeo1qi9ODQ0dG3pHgAAoBxjNgAAzHONxtYNjYH6YGT1o4i4qXQPAETEooz45vTM+QO1Ru3pl19+eUHpIAAA4PIzZgMAwDxVq9VuqddrL1XRtzEiHijdAwDv4/qMeOG2z312Z71e/4+lYwAAgMvLO7MBAGCeaTabSzudmb+MjL+MiCWlewDgt6ri7sjqH+uN/lei6vvmY489dqh0EgAAcOk5mQ0AAPNEVVVZr9e/2um090Tmc2HIBmDWya9EVntrjdqLr7/++tWlawAAgEvLmA0AAPNArVZ7uD5Qfy2yejkybivdAwAfw+KM+ObixQv31gZqf1pVlZ9vAQDAHOVf9gEAYA5rNps3Nxq1H2RfNDJiXekeALhYqojlWcUPGgP1eqOx9YulewAAgIvPO7MBAGAO2r179+LJM5P/pdNt/3VEfKJ0DwBcQo9U0fd6faD2twty4V888sgjR0oHAQAAF4eT2QAAMMc0Gv1Pnj4zOZwRL4QhG4D5IaOKr3a67T31ev/zGzduvLJ0EAAA8PEZswEAYI5oNreurjfq/1BF/l1E3FG6BwAKWBaZzy1dtmR/vV5/qnQMAADw8bhmHAAAZrmtW7de37ew77lON/4sovLv+AAQcWtk9aP6QO3/qjrxzOOPP76jdBAAAPDh+UEXAADMUhs3bly45Kol/zmr+O8RcWPpHgDoOVX8bvbFUL1e+5/tducv1q1b93bpJAAA4INzzTgAAMxCjUbj95cuu3Ioq/hBGLIB4Dfpi4w/Wbh4wd56vf/bu3fvXlw6CAAA+GCM2QAAMIvUarW76gO1l6vovhqR95buAYBZo4rrIvO7p89M7qzX639UOgcAAPjtXDMOAACzwMbdG69aevrKv4jMZ6OqrijdAwCz2MrI6pVao/ZqdOPpxx9/fE/pIAAA4P05mQ0AAD2sqqq+er3+1NIzS0Yj87kIQzYAXAwZ8aXsi221Ru3FZrN5TekeAADgVxmzAQCgR/U3+x9rNOpbI6sfRcRNpXsAYA5alBHf7HTbB2qN2tMvv/zygtJBAADAvzFmAwBAj6nVarfU67WX+rrZHxmPle4BgHnghox44bbbbxtoNBrrS8cAAAAXeGc2AAD0iGazubTTmfnziPiryLiqdA8AzD/Vg1VUm+qN/le6nfjztWvXHi5dBAAA85mT2QAAUFhVVVmv17/a6bT3ROZ3DdkAUFp+pW9B7qkP1L/7+uuvX126BgAA5itjNgAAFFSr1R5uNOqbI6uXI+O20j0AwP+xJKrq24sWLxyu1+tPVVWVpYMAAGC+MWYDAEABzWbz5kaj9oPsi3pk/E7pHgDg1/pMZPWjxkCtXq/X15aOAQCA+cQ7swEA4DJqNpuL2t32n3W67b+OiE+U7gEAPqhcE1ltqddr/yOz7y8fffTRn5UuAgCAuc7JbAAAuEwajf4nO93OcEa8EIZsAJiNMjL+pIruaL3e//zGjRuvLB0EAABzmTEbAAAusWZz6+pao/bTKvLvIqo7S/cAAB/bssh8bunSJTvr9fpXS8cAAMBc5ZpxAAC4RLZu3Xp938K+5zrd+LP0794AMPdkrIioXq43av/S6es+88VHvrizdBIAAMwlfqAGAAAX2caNGxcuuWrJf84q/1tE9cnSPQDAJfd7C7p9rUaj9v9buHD6rx56aP07pYMAAGAucM04AABcRI1G4/eXLVvSyip+YMgGgHllYRXxpzOdxftqjdrTGzdudIgEAAA+JmM2AABcBFsHt66oD9RerqL7ahVxX+keAKCQKq7LiBeWLluya2Cg/z+VzgEAgNnME6IAAPAxbN++fdm5c2e/FZ2+ZyOqK0r3AAA9Y1W3yp/WG/2vLOjrPvPII+sOlA4CAIDZxslsAAD4CKqq6qvX60+dOz81GpnPGbIBgPeXX+l0FwzXGrUXa7XaJ0rXAADAbGLMBgCAD2lgYOujjYH6lsjqRxHx6dI9AEDPW5QR38y+OFBr1J5++eWXF5QOAgCA2cCYDQAAH9DWrVs/U6/XXupWfbWIeLx0DwAw69yYES/cfvtnG7Vm7XdKxwAAQK/zzmwAAPgtms3m0k5n5s8j8q8i46rSPQDA7FZFPJTdeK3e6H+l24k/X7t27eHSTQAA0IuczAYAgN+g0ej/f3a67b2R+V1DNgBwceVX+hbkrkaj9v/ZvXv34tI1AADQa4zZAADwG1SR/9+IuLV0BwAwZy2rIv769OnTt5cOAQCAXmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAAAACAnmPMBgAAAAAAAKDnGLMBAAAAAAAA6DnGbAAAAAAAAAB6jjEbAAAAAAAAgJ5jzAYAAAAAAACg5xizAQAAAAAAAOg5xmwAAAAAAAAAeo4xGwAAAAAAAICeY8wGAAAAAAAAoOcYswEAAAAAAADoOcZsAAAAAAAAAHqOMRsAAAAuksWLFg/cvfqe4euuvfZ/R8S50j0AAAAwmy0sHQAAAACzXfbl4c/ddsc7N95445qIiKuvXnX3+fPnx0ZG9h06OzW1rnQfAAAAzEbGbAAAAPjoTn3yxhu33X775x7P7Lv9F/+LK664Yvm9996/fOLkxLYDB0aXdrvdlaVjAQAAYDYxZgMAAMCH1126ZEn/qlV3r1y0aNGG3/QHXnftdQ888vCa7tjY2JY3x46tqqrqxtLxAAAAMBsYswEAAOBDWLhw0faVd6288qqrrvow14f3LV++fN1NN910avTg6KZTJ0+ujYjFpT8LAAAA9DJjNgAAAHwAmfnWZ5bfcnD58uVfjIj8KL/GggULrll116oNU1NTh/ft3/vO9PT0mtKfCwAAAHqVMRsAAAB+s7PXX3f9wB133PloX1/fhzmN/WstWbLk9ge+8ODtExPvtg4cPPCJbrdaUfpDAgAAQK8xZgMAAMD7q6688oraypWrP3vlFVdu+Pi/3K+67robHnr4oetn3jj6xua3x8cfiIhPlP7QAAAA0CuM2QAAAPBLFixYMHznnSva115z7dpL/Xtl5qLbP3v7+luW33JiZHRk8+Tke+siYkHprwEAAACUZswGAACAfzN+883L9996y63rIqLvcv7GCxcuvP7u1XevP316cu/+kf3n2+32F0p/MQAAAKAkYzYAAABEzFx99Sf6V9618sEFCxY8UTLkqquuXv3Qgw/H8ePvDBw6fOjTVVXdWvqLAwAAACUYswEAAJjXFi9ePLB61eqbrrxyyfrSLb/oxhs/ueb662+YeuONQ5veeff4w1HFVaWbAAAA4HIyZgMAADAvZfYdvONznztxww03rind8uv09fUt+dzn7tywfPktPxsZ2bf97NTUFyMiS3cBAADA5WDMBgAAYH7JmPjUp27aedutt30xM+8onfNBXHHFFZ++9977Pz05Obln/8i+bqfTubd0EwAAAFxqxmwAAADmi/ZVy67qX7ly5T0LFy7qqSvFP6irr776nocfeqQaGxvbcuzNo3dFxKdKNwEAAMClYswGAABgzlu4aOHQyrtWXXXVsqueKN1yEeTy5cvXffrTnz5z8OCBTScmTjwWEVeWjgIAAICLzZgNAADAnNWX+catt942dtNNN60t3XLRP1tf37IVK+7aMHVu6o2RkX1j586dn3OfEQAAgPnNmA0AAMBcdOb6665v3nnnnY9n9t1WOuZSWnLlktvuv++B2yYmJoYOHhy9qtPt3lW6CQAAAC4GYzYAAABzSbV0yZKtq1bdfdeiRYs2lI65nK677roHH3rokfaxN4+99tZbb90TUd1QugkAAAA+DmM2AAAAc0Jf34Ldd624q7rmmmvWlW4pJTMX3nrLrU/c/OmbT46MjmyenHzvi+F7fwAAAGYp39ACAAAwq2Xmzz6z/JYDy5cv/2JEZOmeXrBw4cJr71599/qpqbMH9+7bd2JmZvqR0k0AAADwYRmzAQAAmK2mrrn22saKO1c8sqBvwbw9jf2bLFmy9I4HH3jwjuPH3xk4dPjwTVXV/WzpJgAAAPigjNkAAADMOosXLx5Yverum6+88sp59V7sj+rGGz+55oYbbpx54+gbm98eH38wIq4u3QQAAAC/jTEbAACAWWNB34K9d965Yvraa69dU7pltsnMRbd/9vb1n7n5M+MjI/u3nT5z+osRsaB0FwAAAPw6xmwAAABmgxOfuummXbfdetu6zDTAfgyLFi266Z57Pn/T5OTk8MjI/pl2p31/6SYAAAB4P8ZsAAAAetnM1Vd/on/lXSsfWLBgwfrSMXPJ1VdfffdDDz1cjY+P9x858sZnq6g+U7oJAAAAfpExGwAAgJ60cOGi1upVq69ZunSpEfvSyZtuumntJz/5ybMHDx7YdGLixKMRsaR0FAAAAEQYswEAAOgxmXnoc5+74/iNN9zovdiXSV9f39IVK+7acP78+bdGRva1zk5NfTEisnQXAAAA85sxGwAAgJ6QmSdvvOGG7bfffsfazPxc6Z756Iorrrj53nvvv/nkyYntowdGr+x2u6tKNwEAADB/GbMBAAAorbt0yZL+1avvXr1w4aINpWOIuPba677wyMNrumNjY1veHDu2sqqqT5ZuAgAAYP4xZgMAAFDMokULt921YtXSq666al3pFn5F3/Lly9fddNNNp0YPjm46dfLU4xHVFaWjAAAAmD+M2QAAAFx2mTH2meW3Hlq+fLkRu8ctWLDgmlV3rdowNTV1eN/+ve9MT097lzkAAACXhTEbAACAy+nM9ddd37zjjjsf6+vrW146hg9uyZIltz/whQdvn5h4t3Xg4IFPdLvVitJNAAAAzG3GbAAAAC6H6sorr6itWnn3bVdccYX3Ys9i1113w0MPP3T9zLE3j7321ltjn4+I60s3AQAAMDcZswEAALikFizo27Pizrs611xz7drSLVwcmbno1ltufeLmT988MTI6snly8r11EbGgdBcAAABzizEbAACASyIjxz998837b73l1nUR0Ve6h4tv4cKF1929+u71Z8+ePbhvZO/EzPTMw6WbAAAAmDuM2QAAAFxsU9dce21jxR0rHl6wYMETpWO49JYuXXrHg194KI4ff2fg0OFDn66q6tbSTQAAAMx+xmwAAAAumsWLFw+sXnX3p6+88krvxZ6Hbrzxk2tuuOHG6TeOvrH57bfHH4oqrirdBAAAwOxlzAYAAOBj6+vr27fizrvOXXvttWtKt1BWZi6+/bO3r7/55pvHD4yMDp0+c9o18wAAAHwkxmwAAAA+uoyJT33qpp233XrbusxcUDqH3nHFoituuueez980OTm5Z//I/k6n076vdBMAAACzizEbAACAj2Lm6qs/0b/yrpVfWLBgwfrSMfSuq6+++p6HH3q4Gh8f7z9y9PBtVRXLSzcBAAAwOxizAQAA+FAWLlzUWr1q9SeWLl1qxOaDyptuumntJz/5yTMHDx7YdGLixGMRcWXpKAAAAHqbMRsAAIAPJPvy8Oduu+OdG2+80Xux+Uj6+vqWrVhx14bz58+PjYzsO3R2ampd6SYAAAB6lzEbAACA3+bUJ2+8cdvtt3/u8cy+20vHMPtdccUVy++99/7lExMT2w4cHF3a7XZXlm4CAACg9xizAQAA+HW6S5cs6V+16u5VixYt2lA6hrnnuuuue+CRh9d0x8bGthx789jqiOqG0k0AAAD0DmM2AAAAv2LhwkXbV961cslVV13lGmgutb7ly5ev+9SnPnXywKEDm06dPLk2IhaXjgIAAKA8YzYAAAD/R2a+9Znltxxcvnz5FyMiS/cwfyxcuPDaVXet2jA1NXVo3769x6dnpr2bHQAAYJ4zZgMAABARcfb6664fuOOOOx/r6+tzGptilixZ8rkHHnjwcxMT77YOHDx4TbfbvbN0EwAAAGUYswEAAOa36sorr6itXLn6s1decaX3YtMzrrvuhocefuj6mTeOvrH57fHxByLiE6WbAAAAuLyM2QAAAPPUggULhlfcuaJ9zTXXri3dAu8nMxfd/tnb19+y/JYTI6Mjmycn31sXEQtKdwEAAHB5GLMBAADmn/Gbb16+/9Zbbl0XEX2lY+C3Wbhw4fV3r757/eTpyb0jI/un2+32/aWbAAAAuPSM2QAAAPPH9NVXf6K28q6VDy5YsOD/z96/Bdld33e+9/e7unVoHUASAkFzkEBnTkZC6paQgeDgmsQxuRrz3MTyntRUqHh2kJKJDTv2BHCSCexkEsSe/cxA7Wd2AZMbyFVMnEwFW8Ope/1XtxEYyyAEEkfZ2FjCCB2Qutf/uRCZ2AlnpP6t7n69Liko3qJEqXt9+vf7XV46Bj6q2bNmr1i96tJ4/fWfDO1+YfcZdV2fVboJAACAE8eYDQAAMAlMnTp1aMXyladPnz79itIt8EnNn3/q2nnzTjn44ou7H3r99Z+uqaOeWboJAACA48+YDQAAMIFlNnadd+65e085Zf7a0i1wPDUajRnnnrv4yt7es360c+eOJw4eOnRZRGTpLgAAAI4fYzYAAMBElLHvtNMWPLXw7IWXZeZ5pXPgRJk2bdrpF1548en797+5/dmdz9ajo6MXlm4CAADg+DBmAwAATCwjs2bOGly2bPkF3d3drhRn0pg9+6QLLl29pr1nz57HXt3zyrK6rk8t3QQAAMAnY8wGAACYILqndG9bsWzl7BkzZlxeugUKafT29m5YcPqCA7t37Xpo77596yLqaaWjAAAA+HiM2QAAAONcI/PFs89euGfBggXrS7dAJ+hqdM1csmTplYcOHXph53M7fnj48Nv+3wAAABiHjNkAAADj14F5c+cNL168eF1mY2HpGOg0PT09iy6+6JJF+/bt2/b8rp2z2+16SekmAAAAPjxjNgAAwPjTntHTM7h8+cplU6ZMubJ0DHS6uXPnrrp09dqRV1595ZEf/nDPBRExr3QTAAAAH8yYDQAAMI40Gl3bly5ZWp988skbSrfAeJKZ3WefdfblZ5x+xr6dz+18eP/+NzdERFfpLgAAAN6bMRsAAGAcyMwfndl71vO9vb2XRUSW7oHxqru7e+7KFSuvOHjw4K4dO5/Zd/TI0UtLNwEAAPDujNkAAACd7eDJc+YMLVm8ZE1Xo8tpbDhOZsyYcd6qT62O11//ydDuF3afXtf12aWbAAAA+EXGbAAAgA41derUoRXLV54xffp072LDCTJ//qlrTzll/pEXX37x4R+/9tqqiJhdugkAAIBjjNkAAAAdpqvR9czixUuOzJkzZ23pFpgMMnPqonMWXXHGGWe89vzO555468BbGyKiUboLAABgsjNmAwAAdI69py1Y8P2FZy/ckJldpWNgspk2ZdqC88+/YMH+/fuffnbnsyOjoyMXlW4CAACYzIzZAAAA5R2dPfukwWVLl13S1dV1RekYmOxmz5698tLVl9avvfba4Esvv7CwrqO3dBMAAMBkZMwGAAAoqLt7yuMrlq84ecaMGUZs6Cy5YMGC9aeeeurBXbuef2jvvr39ETG9dBQAAMBkYswGAAAoIDN3n3vuea/PP2W+d7GhgzUajRlLliy98u23396zc+eO3QcPHdpQugkAAGCyMGYDAACMocx8Y/4ppzy5aNF56zPz3NI9wIczbdq03gsvvLh33xv7nnj++edmtNvtZaWbAAAAJjpjNgAAwNhoz+jpGVyxYuWK7u4pV5aOAT6euXPmXrLm0rXtPXv2PPbqnleW13U9v3QTAADARGXMBgAAOMGmTOl+YumS5TNmzZrlemKYGBq9vb0bFixY8LPndj330M/eeGN9REwtHQUAADDRGLMBAABOkMzYc2bv2bt7e3uN2DABdXV1nbx86fIrDx069MKOZ5/5yZEjR9aWbgIAAJhIjNkAAADH34F5c+cNn3fe4v5Go9FbOgY4sXp6ehZd8qlVi/bt++njz+/adXK73V5cugkAAGAiMGYDAAAcP/WMnp6B5ctXLp0yxbvYMNnMnXvK6ktXzzv64ssvPvzj1167JCJOKt0EAAAwnhmzAQAAjoOursYPlixe1j755JNdKQ6TWGZOWXTOoivO6j1r787ndj68f/+bGyKiq3QXAADAeGTMBgAA+AQy8rUzzzzrud7e3ssiIkv3AJ2hu7t73soVK6946639zzy789m3R0ZGPlW6CQAAYLwxZgMAAHw8h06eM6e15Lwll3Z1dTmNDbyrWbNmr1i96tJ4/fWfDO1+YfcZdV2fVboJAABgvDBmAwAAfERTp04dWrF85enTp0/3Ljbwocyff+raefNOOfTii7sfev31n66po55ZugkAAKDTGbMBAAA+pEaj65kli5e8PWfOnLWlW4Dxp9Fo9Jx77uIre3vP+tHOnTueOHjokOcJAAAA3ocxGwAA4IPtPW3Bgu8vPHvhhszsKh0DjG/Tpk07/cILLz59//43tz+789l6dHT0wtJNAAAAnciYDQAA8N6Ozp590uCypcsu6erquqJ0DDCxzJ590gWXrl5T79mz57FXXn15aUScVroJAACgkxizAQAA3kV395THVyxfcdKMGTOM2MCJlL29vRtOP/30A7t2Pf/Q3n371kXU00pHAQAAdAJjNgAAwM/JRr5w7sLzfjJ//nzvYgNjptFozFyyZOmVhw4fenHnzh17Dh9+e33pJgAAgNKM2QAAAMf87NT5859YtOjcdZmNRaVjgMmpZ3rPwosvumThvn37tu3a9dys0XZ7aekmAACAUhqlAwAAAAprz+jpeWzVJauPnnvu4iszG673BYqbO3fuqtWr15x7xhm9j0TkT0v3AAAAlOBkNgAAMGlN6e5+YunS5TNmzZq1oXQLwD+Xmd1nn3X25Wecfsa+nc/tfHj//jcvC5/lAAAAk4hvgAAAgEknM/ac2Xv27t7e3ssiIkv3ALyf7u7uuStXrLzi0KGDu57ZsWPv0aNH1pRuAgAAGAvGbAAAYDI5OG/uvKHzzlvc32g0ekvHAHwUPT0zzlt1yarzXn/9J0O7X3hhQV23zyndBAAAcCIZswEAgMmgnj59WnP5spULp02bdmXpGIBPYv78U9eecsr8oy++/OLDP37ttVURMbt0EwAAwIlgzAYAACa0rq6up5csXjJy8slz1pduATheMnPKonMWXXHmGWe+tnPns0+8deCtDRHRKN0FAABwPBmzAQCAieq1M87offbss8428AAT1pQpUxacf/4FC/bv3//0szufHRkdHbmodBMAAMDxYswGAAAmmiOzZ5/UXLZ02aqurq7LS8cAjIXZs2evvHT1pfVrr702+NJLL55TR31m6SYAAIBPypgNAABMGFOnTh1asXzl6dOnT7+idAtAAblgwYL1p5566sFdu55/aO++vX0R0VM6CgAA4OMyZgMAAONeZmPXeeeeu/eUU+avLd0CUFqj0ZixZMnSK99+++0f7ty54/GDhw5dFhFZugsAAOCjMmYDAADjV8a+005b8NTCsxdelpnnlc4B6CTTpk0748ILLz7jjTf2Pfnc88/1tNvtZaWbAAAAPgpjNgAAMB6NzJo5a3DZsuUXdHd3u1Ic4H3MmTP3U2suXdves2fPY6/ueWVZXdenlm4CAAD4MIzZAADAuNI9pXvbimUrZ8+YMePy0i0A40ijt7d3w4IFC3723K7nHvrZGz9bF1FPKx0FAADwfozZAADAuJCNfOGcsxb+cMGCBetLtwCMV11dXScvX7r8ykOHDr2w49lnfnLkyJG1pZsAAADeizEbAADoaBl5YO7cucOLFy9el9lYVLoHYCLo6elZdMmnVi3at++njz+/6/mT2u16SekmAACAf86YDQAAdKr2jJ6eweXLVy6bMmXKlaVjACaiuXNPWX3p6nlHX3z5xYd//Nprl0TESaWbAAAA/pExGwAA6DiNRtf2pUuW1ieffPKG0i0AE11mTll0zqIrzuo9a+/O53Y+vH//mxsioqt0FwAAgDEbAADoGJn5wzN7z9rV29t7WURk6R6AyaS7u3veyhUrr3jrrbd2PLtzx+GRkZFPlW4CAAAmN2M2AADQCQ6ePGfO0JLFS9Z0NbqcxgYoaNasWctXr7o0Xn/9J0O7X9h9el3XZ5duAgAAJidjNgAAUNTUqVOHVixfecb06dO9iw3QQebPP3XtvHmnHHrxxd0P/eSnr18adcwq3QQAAEwuxmwAAKCIrkbXM4sXLzkyZ86ctaVbAHh3jUaj59xzF1/Ze9ZZr+3csePJg4cOeQYCAAAYM8ZsAABgrO09bcGC7y88e+GGzOwqHQPAB5s2ZdqCCy+8eMH+/ft/8OzOHe3R0dELSzcBAAATnzEbAAAYK0dnzz5pcNnSZau6urquKB0DwEc3e/bs8y9dvabes2fPY6+8+vLSiDitdBMAADBxGbMBAIATrrt7yuMrlq+YM2PGDCM2wPiXvb29G04//fQDu3Y9/9DefXv7I2J66SgAAGDiMWYDAAAnTGbuPvfc816ff8p872IDTDCNRmPmkiVLrzx8+NBLz+7c8erhw2+vL90EAABMLMZsAADguMvMN+afcsqTixadtz4zzy3dA8CJM316zzkXX3TJOfv27dv2/K7nZrbb7WWlmwAAgInBmA0AABxPI7NmzhpctmzZ+d3dU64sHQPA2Jk7d+6qNZeubR97T/uVFRH1KaWbAACA8c2YDQAAHBfdU7q3LVuyfOasWbMuL90CQDGN3t7eDaeddtobz+9+/qGfvfHG+oiYWjoKAAAYn4zZAADAJ5LZeOmcs895dcGCBd5KBSAiIrq7u+csX7r8ykOHDu3eseOZ148cPbK2dBMAADD+GLMBAICP68C8ufOGzztvcX+j0TindAwAnaenp+fcSy5Zde6+fT99/Pldu+a02+3zSjcBAADjhzEbAAD4qOoZPT0Dy5evXDplinexAfhgc+eesvrS1fOOvvjyiw//+LXXVkXE7NJNAABA5zNmAwAAH1pXV+MHSxYva5988skbSrcAML5k5pRF5yy64qzes/bufG7nw/v3v7khIrpKdwEAAJ3LmA0AAHygzPzRmb1nPd/b23tZRGTpHgDGr+7u7nkrV6y8Yv9b+5/Z+eyzR0ZGRy4u3QQAAHQmYzYAAPB+Dp08Z05ryXlLLu3q6nIaG4DjZvas2StWr740Xn/9J0O7d+/uraM+s3QTAADQWYzZAADAu5o6derQiuUrT58+fbp3sQE4YebPP3XtvHmnHHzxxd0Pvf76T9fUUc8s3QQAAHQGYzYAAPALGo2uZ5YsXvL2nDlz1pZuAWByaDQaM849d/GVvb1n/XDnzh1PHDx0yLMWAACAMRsAAPhf9p62YMH3F569cENmdpWOAWDymTZt2hkXXnjxGW/uf3P7zmefjdH26AWlmwAAgHKM2QAAwNHZs08aXLZ02SVdXV1XlI4BgJNmn3TBpZeuae/Zs+exV/e8sqyu61NLNwEAAGPPmA0AAJNYd/eUx1csX3HSjBkzjNgAdJpGb2/vhgWnLziwe9euh/bu27cuop5WOgoAABg7xmwAAJiEspEvnLvwvJ/Mnz/fu9gAdLSuRtfMJUuWXnno0KEXdj6344eHD7+9vnQTAAAwNozZAAAwufzs1Pnzn1i06Lz1mbmodAwAfFg9PT2LLr7okkX79v308ed3PX9Su10vKd0EAACcWMZsAACYHNozenoGly9fuXzKlClXlo4BgI9r7txTVl+6et7IK6++8sgPf7jngoiYV7oJAAA4MYzZAAAwwU3p7n5i6dLlM2bNmrWhdAsAHA+Z2X32WWdffsbpZ+zb+dzOh/fvf3NDRHSV7gIAAI4vYzYAAExQmbHnzN6zd/f29hqxAZiQuru7565csfKKgwcP7tqx85l9R48cvbR0EwAAcPwYswEAYOI5OG/uvKHzzlvc32g0ekvHAMCJNmPGjPNWfWp1vP76T4Z2v7D79Lquzy7dBAAAfHLGbAAAmDjq6dOnNZcvW7lw2rRp3sUGYNKZP//UtaecMv/Iiy+/+PCPf/za6qhjVukmAADg4zNmAwDABNDV1fX0ksVLRk4+ec760i0AUFJmTl10zqIrzjjjjNee3/nctrcOvLUhIhqluwAAgI/OmA0AAONYRr52+hlnPHv2WWf7oB4Afs60KdMWnH/+BQv279//9LM7nx0ZHR25qHQTAADw0RizAQBgfDoye/ZJzWVLl63q6uq6vHQMAHSq2bNnr7x09aX1a6+9NvjSyy8srOvoLd0EAAB8OMZsAAAYZ6ZOnTq0YvnK06dPn35F6RYAGCdywYIF60899dQDu3Y9/9DefXv7I2J66SgAAOD9GbMBAGCcaDQau85ddN6+U045ZW3pFgAYjxqNxswlS5Ze+fbbb+/ZuXPH7oOHDm0o3QQAALw3YzYAAHS6jH2nnbbgqYVnL9yQmeeVzgGA8W7atGm9F154ce++ffueeH7XczPa7fay0k0AAMC/ZMwGAIDONTJr5qzBZcuWX9Dd3e1KcQA4zubOnXvJmkvXtvfs2fPYq3teWV7X9fzSTQAAwD8xZgMAQAfqntK9bcWylbNnzJhxeekWAJjgGr29vRtOO+20N57f/fxDP3vjjfURMbV0FAAAYMwGAICOko184ZyzFv5wwYIF60u3AMBk0t3dPWf50uVXHjp0aPeOZ595/ciRI2tLNwEAwGRnzAYAgA6QkQfmzp07vHjx4nWZjUWlewBgsurp6Tn3kk+tOnffvp8+/vyuXSe32+3FpZsAAGCyMmYDAEBZ7Rk9PYPLl69cNmXKlCtLxwAAx8yde8rqS1fPO/riyy8+/OPXXrskIk4q3QQAAJONMRsAAArpanRtX7psWZw0+6QNpVsAgH8pM6csOmfRFWf1nrV353M7H96//80NEdFVugsAACYLYzYAAIyxzPzhmb1n7ert7b0sIrJ0DwDw/rq7u+etXLHyiv1v7X9m585nj4yMjFxcugkAACYDYzYAAIydgyfPmTO0ZPGSNV2NLqexAWCcmT1r9orVqy6N11//ydDuF3afUdf1WaWbAABgIjNmAwDAGJg6derQihUre6dPm+5dbAAY5+bPP3XtvHmnHHrxxd0Pvf76T9fUUc8s3QQAABORMRsAAE6grkbXM4uXLDky5+Q5a0u3AADHT6PR6Dn33MVX9vae9aOdO3c8cfDQIc+HAADAcWbMBgCAE2PvaQsWfH/h2Qs3ZGZX6RgA4MSYNm3a6RdeePHp+/e/uf3Znc/Wo6OjF5ZuAgCAicKYDQAAx9fR2bNPGly2dNmqrq6uK0rHAABjY/bsky64dPWaes+ePY+98urLSyPitNJNAAAw3hmzAQDgOJk6derQiuUrFkyf3mPEBoDJKXt7ezecfvrpB3btev6hvfv2rYuop5WOAgCA8cqYDQAAn1Bm7j7v3PN+esop872LDQBEo9GYuWTJ0isPHT704s6dO/YcPvz2+tJNAAAwHhmzAQDgY8rMN0497bTvLTx74WWZeW7pHgCgs/RM71l48UWXLNy3b9+2XbuemzXabi8t3QQAAONJo3QAAACMQyOzZs56ZNUlq0YXnbPoisz0Q6IAwHuaO3fuqtWr15x7xhm9j0TE3tI9AAAwXvjQDQAAPoLuKd3bli1dPmvWzFmXl24BAMaPzOw++6yzLz/j9DP27Xxu58P79795WfhsDgAA3pcvmAEA4ENoZL549tkL9yxYsMCblwDAx9bd3T135YqVVxw6dHDXMzt27D169Mia0k0AANCpjNkAAPA+MvLQ3LlzHzrvvMX9jUZjYekeAGBi6OmZcd6qS1ad9/rrPxna/cLu0+u6dBEAAHQeYzYAALyPiy/+1P932rRpfxQR00u3AAATz/z5p66ZO3fevTt27NhTugUAADpNo3QAAAB0sunTp/+niFgaEfdGhDNTAMDx9HhEXNHd3f2lCy644K3SMQAA0GmM2QAA8AEy89XM3BgR6yKiWboHABj3Xo+IzRHRl5mPlo4BAIBOZcwGAIAPKTNbEbEhIr4UET8q3QMAjDtHI+KOiFicmVsyc7R0EAAAdDJjNgAAfASZ2c7MeyJiSUTcEhFvl24CAMaFByJiZWZuysw3S8cAAMB4YMwGAICPITMPZObNEXFhRNxfugcA6Fg7IuJzmXlNZj5fOgYAAMYTYzYAAHwCmflcZl4bEVdHxFOlewCAjrEvjr2LfWFm/l3pGAAAGI+M2QAAcBxk5rcjYnVEXBcRPyndAwAUMxIRd0XE8nfexR4pHQQAAOOVMRsAAI6TzBzJzLsiYkVE3BHHPswGACaP70TE6sy8LjP9cBsAAHxCxmwAADjOMnNvZm6KiIsiwrWiADDxPRcR12bmL2emZ0cAAOA4MWYDAMAJkpnPZObnIuLXI+L50j0AwHF3ICJuiYiLMvP+0jEAADDRGLMBAOAEy8xvRsTKiNgcEW+W7gEAPrE6Iu6NiCWZeXNmHi4dBAAAE5ExGwAAxkBmHs3MLXHsPe27ImK0dBMA8LEMRcSGzNyYmT8qHQMAABOZMRsAAMZQZv4wM6+LiP6IeLR0DwDwob0aEV+KiP7MHCwdAwAAk4ExGwAACsjM70bEFRFxbUS8WLoHAHhPhyLitohYkZn3ZGZdOggAACYLYzYAABSSmXVm3h8R50fEjRHxVukmAOAXPBAR52fmjZnpz2kAABhjxmwAACgsMw9m5m0RsTIi7o0IJ74AoKxtEXFFZl6TmS+UjgEAgMnKmA0AAB0iM1/JzI0RsT4iqtI9ADAJ/TQiNkfE2sx8pHQMAABMdsZsAADoMJlZRcRlEfGliHitdA8ATAJHI+KOiFicmVsyc7R0EAAAYMwGAICOlJntzLwnIpZExC0R8XbpJgCYoB6MiEsyc1Nm/qx0DAAA8E+M2QAA0MEy863MvDkiLoqI+0v3AMAEsiMiPp+Zn83MH5SOAQAA/iVjNgAAjAOZuTMzr42IqyPi+6V7AGAc2xcRN0bExZn5t6VjAACA92bMBgCAcSQzvx0RqyLiuoh4vXQPAIwj7Yi4NyJWZOZtmXmkdBAAAPD+jNkAADDOZOZIZt4VEcsj4o6IGCndBAAdbmtErMrMjZn549IxAADAh2PMBgCAcSoz92bmpjj2nvbfl+4BgA70ckR8KTM/k5nfKx0DAAB8NMZsAAAY5zLzmcz81Yj49YjYVboHADrAgYi4JSKWZeY9pWMAAICPx5gNAAATRGZ+MyJWRsTmiHizdA8AFFBHxP0RcX5m3pyZh0sHAQAAH58xGwAAJpDMPJKZWyJiRUTcFRHt0k0AMEaGIuLTmXltZr5UOgYAAPjkjNkAADABZeYPM/O6iOiLiMdK9wDACbQnIq6LiHWZOVA6BgAAOH6M2QAAMIFl5ncj4vKIuDYiXizdAwDH0ZGIuCMiVmTmXZnpNhIAAJhgjNkAADDBZWadmfdHxPkRcUtEHCrdBACf0ANxbMTelJn7S8cAAAAnhjEbAAAmicw8mJk3R8SyiLg3IurSTQDwET0REb+Umddk5u7SMQAAwIllzAYAgEkmM1/JzI0RcVUcGwUAoNPtjYjNEbEmMx8qHQMAAIwNYzYAAExS74wBl0bElyLitdI9APAujsaxd7EXZ+aWzBwtHQQAAIwdYzYAAEximdnOzHsiYkVE3BYRb5duAoB3PBgRq955F/uN0jEAAMDYM2YDAACRmW9k5o0RcVFE3F+6B4BJ7dmIuCYzP5uZ20vHAAAA5RizAQCA/yUzd2bmtRHx2Yj4fukeACaVNyLixoi4ODMfKB0DAACUZ8wGAAD+hcx8MCJWR8R1EfF66R4AJrR2RNwbEcsz87bM9OQFAAAQEcZsAADgPWTm0cy8KyKWR8QdETFaugmACeehiFidmRsz88elYwAAgM5izAYAAN5XZu7NzE1x7D3t/1G6B4AJ4ZWI+FJEXJWZT5aOAQAAOpMxGwAA+FAy8+nM/JWI+PWI2FW6B4Bx6WBE3BIRSzPznsysSwcBAACdy5gNAAB8JJn5zYhYGRGbI2J/6R4AxoU6Iu6PiPMz8+bMPFw6CAAA6HzGbAAA4CPLzCOZuSUiVkTEXRHRLt0EQMf6bkRcnpnXZuaLpWMAAIDxw5gNAAB8bJm5JzOvi4j+iBgo3QNAR/lhRFwXEX2Z+VjpGAAAYPwxZgMAAJ9YZg5HxKcj4tqIeKl0DwBFHYmIOyJiRWbelZlu7wAAAD4WYzYAAHBcZGadmffHsfe0b4kI76ECTD4PRMTKzNyUmW+WjgEAAMY3YzYAAHBcZebBzLw5IpZFxL2lewAYE89ExK9m5jWZuat0DAAAMDEYswEAgBMiM1/OzI0RcVVEPFm6B4ATYm9EbI6IizLz70vHAAAAE4sxGwAAOKEy839GxOqI+FJE/Lh0DwDHxUhE3BURyzNzS2aOlA4CAAAmHmM2AABwwmVmOzPviYjlEXFbRLxdugmAj+3bEbEqM6/LzNdLxwAAABOXMRsAABgzmflGZt4YERdHxAOlewD4SHZGxLWZeXVmfr90DAAAMPEZswEAgDGXmc9m5jUR8dmI2F66B4D39VZE3BLH3sW+v3QMAAAweRizAQCAYjLzwYhYFRGbI+KN0j0A/IJ2RNwbEUsy8+bM9EQEAAAwpozZAABAUZl5NDO3RMTiiLgjIkZLNwEQVURsyMyNmfla6RgAAGByMmYDAAAdITP3ZuamiFgTEQ+V7gGYpF6JiC9FxPrMbJaOAQAAJjdjNgAA0FEy84nM/KWI+PWI2F26B2CSOBgRt0XEysy8JzPr0kEAAADGbAAAoCNl5jcjYkUce097f+kegAnsgYg4PzNvzMy3SscAAAD8I2M2AADQsTLzyDvvaa+IiLsiol26CWACeTwiLs/MazLzxdIxAAAA/5wxGwAA6HiZuSczr4uIdRExULoHYJx7PY7detGXmY+WjgEAAHgvxmwAAGDcyMyhiPh0RFwbES+V7gEYZ45GxB0RsTgzt2TmaOkgAACA92PMBgAAxpXMrDPz/og4PyJuiYjDpZsAxoEHImJlZm7KzDdLxwAAAHwYxmwAAGBcyswDmXlzRCyLiHtL9wB0qB0R8bl33sV+vnQMAADAR2HMBgAAxrXMfDkzN0bEZyLie6V7ADrEvjj2LvaFmfl3pWMAAAA+DmM2AAAwIWTm1ohYFRFfiogfl+4BKGQkIu6KiOXvvIs9UjoIAADg4zJmAwAAE0ZmtjPznohYHhG3RcSR0k0AY+g7EbE6M6/LzJ+UjgEAAPikjNkAAMCEk5lvZOaNEXFRRPxt6R6AE+y5iLg2M385M58qHQMAAHC8GLMBAIAJKzOfzczPR8RnI+IHpXsAjrMDEXFLRFyUmfeXjgEAADjejNkAAMCEl5kPRsQlEbE5In5WugfgE6oj4t6IWJKZN2fm4dJBAAAAJ4IxGwAAmBQy82hmbomIxRFxR0SMlm4C+BiGImJDZm7MzB+VjgEAADiRjNkAAMCkkpk/zcxNEbE2Ih4u3QPwIb0aEV+KiP7MHCwdAwAAMBaM2QAAwKSUmdsy88qI+PWI2F26B+A9HIqI2yJiRWbek5l16SAAAICxYswGAAAmtcz8ZkRcEBE3RsT+0j0AP+eBiDg/M2/MzLdKxwAAAIw1YzYAADDpZeahzLwtIlZGxL0R4eQjUNK2iLgiM6/JzBdKxwAAAJRizAYAAHhHZr6amRsjoj8ivEkLjLWfRsTmiFibmY+UjgEAACjNmA0AAPDPZOZQRGyIiC9FxI9K9wAT3tGIuCMiFmfmlswcLR0EAADQCYzZAAAA7yIz68y8JyKWRMQtEXG4dBMwIT0YEZdk5qbM/FnpGAAAgE5izAYAAHgfmXkgM2+OiOVx7D1tgONhR0R8PjM/m5k/KB0DAADQiYzZAAAAH0JmvvTOe9qfiYjvle4Bxq19EXFjRFycmX9bOgYAAKCTGbMBAAA+gszcGhGr4th72j8p3QOMG+04drvDisy8LTOPlA4CAADodMZsAACAjygz2++8p708Im6LCKMU8H62RsSqzNyYmT8uHQMAADBeGLMBAAA+pszcl5k3RsTFEfGt0j1Ax3k5Ir6UmZ/JTM8TAAAAfETGbAAAgE8oM3dk5q9FxGcj4gele4DiDkTELRGx7J1bHAAAAPgYjNkAAADHSWY+GBGXRMTmiPhZ6R5gzNURcX9EnJ+ZN2fm4dJBAAAA45kxGwAA4DjKzKOZuSUiFkfEHRExWroJGBNDEfHpzLw2M18qHQMAADARGLMBAABOgMz8aWZuioi+iHikdA9wwuyJiOsiYl1mDpSOAQAAmEiM2QAAACdQZj6emVdExK9HxAule4Dj5kgcu31hRWbelZnt0kEAAAATjTEbAABgDGTmNyPi/Ii4MSLeKt0DfCIPxLERe1Nm7i8dAwAAMFEZswEAAMZIZh7KzNsiYkVE3BsRdekm4CN5OiJ+JTOvyczdpWMAAAAmOmM2AADAGMvMVzNzY0Ssi4jB0j3AB9obEZsj4qLM/B+lYwAAACYLYzYAAEAhmdmKiA0R8aWI+FHpHuBfOBrH3sVenJlbMnO0dBAAAMBkYswGAAAoKDPrzLwnIpZExC0Rcbh0ExAREQ9GxKp33sV+o3QMAADAZGTMBgAA6ACZeSAzb46IiyLi/tI9MIk9GxHXZOZnM3N76RgAAIDJzJgNAADQQTLzucy8NiJ+OSKeKt0Dk8gbEXFjRFycmQ+UjgEAAMCYDQAA0JEy8zsRsToirouIn5TugQmsHRH3RsTyzLwtM98uHQQAAMAxxmwAAIAOlZkjmXlXRCyPiDsiYqR0E0wwD0XE6szcmJk/Lh0DAADALzJmAwAAdLjM3JeZmyLiwoj4VukemABeiYgvRcRVmflk6RgAAADenTEbAABgnMjMHZn5axHx2Yh4unQPjEMHI+KWiFiamfdkZl06CAAAgPdmzAYAABhnMvPBiPhURGyOiDdL98A4UEfE/RFxfmbenJmHSwcBAADwwYzZAAAA41BmHs3MLRGxOI69pz1augk61Hcj4vLMvDYzXywdAwAAwIdnzAYAABjHMvP1d97T7ouIR0r3QAf5YURcFxF9mflY6RgAAAA+OmM2AADABJCZj2fmFRHx6xHxQukeKOhIHLutYEVm3pWZ7dJBAAAAfDzGbAAAgAkkM78ZERdExI0R8VbpHhhjD0TEyszclJnekwcAABjnjNkAAAATTGYezMzbImJFRNwbEXXpJjjBnomIX83MazJzV+kYAAAAjg9jNgAAwASVma9m5saIWBcRzdI9cALsjYjNEXFRZv596RgAAACOL2M2AADABJeZrYjYEBFfiogfle6B42AkIu6KiOWZuSUzR0oHAQAAcPwZswEAACaBzGxn5j0RsSQibomIt0s3wcf07YhYlZnXZebrpWMAAAA4cYzZAAAAk0hmHsjMmyPiwoi4v3QPfAQ7I+LazLw6M79fOgYAAIATz5gNAAAwCWXmc5l5bURcHRFPle6B9/FWHLtN4KLM9AMYAAAAk4gxGwAAYBLLzG9HxOqIuC4iflK6B35OOyLujYglmXlzZroaHwAAYJIxZgMAAExymTmSmXdFxIqIuCMiRko3MelVEbEhMzdm5mulYwAAACjDmA0AAEBERGTm3szcFBEXRcTfle5hUnolIr4UEeszs1k6BgAAgLKM2QAAAPyCzHwmMz8XEb8eEc+X7mFSOBgRt0XEysy8JzPr0kEAAACUZ8wGAADgXWXmNyNiZURsjog3S/cwYT0QEedn5o2Z+VbpGAAAADqHMRsAAID3lJlHM3NLHHtP+66IGC3dxITxeERcnpnXZOaLpWMAAADoPMZsAAAAPlBm/jAzr4uI/oh4tHQP49rrcey0f19m+r0EAADAezJmAwAA8KFl5ncj4oqIuDYinKblozgaEXdExOLM3JKZTvkDAADwvozZAAAAfCSZWWfm/RFxfkTcGBHeOeaDPBARKzNzU2Z6fx0AAIAPxZgNAADAx5KZBzPztohYGRH3RkRduomOsyMiPvfOu9jPl44BAABgfDFmAwAA8Ilk5iuZuTEi1kdEVbqHjrAvjr2LfWFm/l3pGAAAAMYnYzYAAADHRWZWEXFZRHwpIl4r3UMRIxFxV0Qsf+dd7JHSQQAAAIxfxmwAAACOm8xsZ+Y9EbEkIm6JiLdLNzFmvhMRqzPzusz8SekYAAAAxj9jNgAAAMddZr6VmTdHxEURcX/pHk6o5yLi2sz85cx8qnQMAAAAE4cxGwAAgBMmM3dm5rURcXVEfL90D8fVgTh2+v6izPQDCwAAABx3xmwAAABOuMz8dkSsiojrIuL10j18InVE3BsRSzLz5sw8XDoIAACAicmYDQAAwJjIzJHMvCsilkfEHRExUrqJj2woIjZk5sbM/FHpGAAAACY2YzYAAABjKjP3ZuamOPae9t+X7uFDeTUivhQR/Zk5WDoGAACAycGYDQAAQBGZ+Uxm/mpE/HpE7Crdw7s6FBG3RcSKzLwnM+vSQQAAAEwexmwAAACKysxvRsTKiNgcEW+W7uF/eSAizs/MGzPzrdIxAAAATD7GbAAAAIrLzCOZuSUiVkTEXRHRLt00iW2LiCsz85rMfKF0DAAAAJOXMRsAAICOkZk/zMzrIqIvIh4r3TPJ/DSOnY5fm5kPl44BAAAAYzYAAAAdJzO/GxGXR8S1EfFi6Z4J7mhE3BERizNzS2aOlg4CAACACGM2AAAAHSoz68y8PyLOj4hbIuJQ6aYJ6MGIuCQzN2Xmz0rHAAAAwM8zZgMAANDRMvNgZt4cEcsi4t6IqEs3TQA7IuLzmfnZzPxB6RgAAAB4N8ZsAAAAxoXMfCUzN0bEVRHxROmecWpfRNwYERdn5t+WjgEAAID3Y8wGAABgXMnMhyLi0oj4UkS8VrpnnGjHsVPtKzLztsw8UjoIAAAAPogxGwAAgHEnM9uZeU9ErIiI2yLi7dJNHWxrRKzKzI2Z+ePSMQAAAPBhGbMBAAAYtzLzjcy8MSIuioj7S/d0mJcj4kuZ+ZnM/F7pGAAAAPiojNkAAACMe5m5MzOvjYjPRsT20j2FHYiIWyJi2Tun1wEAAGBcMmYDAAAwYWTmgxGxKiKui4jXS/eMsTqOnU4/PzNvzszDpYMAAADgkzBmAwAAMKFk5tHMvCsilkfEHRExWrppDAxFxKcz89rMfKl0DAAAABwPxmwAAAAmpMzcm5mb4th72v+jdM8JsieOnUJfl5kDpWMAAADgeDJmAwAAMKFl5tOZ+SsR8esRsat0z3FyJI6dOl+RmXdlZrt0EAAAABxvxmwAAAAmhcz8ZkSsjIjNEbG/dM8n8EAcG7E3ZeZ4/nUAAADA+zJmAwAAMGlk5pHM3BIRKyLirogYTyean46IX8nMazJzd+kYAAAAONGM2QAAAEw6mbknM6+LiP6I6PS3pvfGsdPkF2XmRH37GwAAAP4FYzYAAACTVmYOR8SnI+LaiHipdM8/czSOvYu9ODO3ZOZo6SAAAAAYS8ZsAAAAJrXMrDPz/jj2nvYtEXG4dFNEPBgRq955F/uN0jEAAABQgjEbAAAAIiIzD2bmzRGxLCLuLZTxbERck5mfzcztpf+bAAAAQEnGbAAAAPg5mflyZm6MiKsi4skx+te+ERE3RsTFmflA6f8GAAAA0AmM2QAAAPAuMvN/RsTqiPhSRPz4BP1r2nHsFPiKzLwtM98u/esGAACATmHMBgAAgPeQme3MvCcilkfEbRFxPMfmhyJidWZuzMzXSv9aAQAAoNMYswEAAOADZOYbmXljRFwcEZ/0GvBX4thp76syc6yuMQcAAIBxx5gNAAAAH1JmPpuZ10TEZyNi+0f8xw9GxC0RsTQz78nMuvSvBwAAADqZMRsAAAA+osx8MCJWRcTmiPjZB/ztdUTcHxHnZ+bNmXm4dD8AAACMB8ZsAAAA+Bgy82hmbomIxRFxR0SMvsvf9t2IuDwzr83MF0s3AwAAwHhizAYAAIBPIDN/mpmbImJNRDz8zl/+YURcFxF9mflY6UYAAAAYj7pLBwAAAMBEkJlPRMSVdV1/NiIGM/Ot0k0AAAAwnhmzAQAA4DjKzH8o3QAAAAATgWvGAQAAAAAAAOg4xmwAAAAAAAAAOo4xGwAAAAAAAICOY8wGAAAAAAAAoOMYswEAAAAAAADoOMZsAAAAAAAAADqOMRsAAAAAAACAjmPMBgAAAAAAAKDjGLMBAAAAAAAA6DjGbAAAAAAAAAA6jjEbAAAAAAAAgI5jzAYAAAAAAACg4xizAQAAAAAAAOg4xmwAAAAAAAAAOo4xGwAAAAAAAICOY8wGAAAAAAAAoOMYswEAAAAAAADoOMZsAAAAAAAAADqOMRsAAAAAAACAjmPMBgAAAAAAAKDjGLMBAAAAAAAA6DjGbAAAAAAAAAA6jjEbAAAAAAAAgI5jzAYAAAAAAACg4xizAQAAAAAAAOg4xmwAAAAAAAAAOo4xGwAAAAAAAICOY8wGAAAAAAAAoOMYswEAAAAAAADoOMZsAAAAAAAAADqOMRsAAAAAAACAjmPMBgAAAAAAAKDjGLMBAAAAAAAA6DjGbAAAAAAAAAA6jjEbYJKp65heugEAAAAAPq52tqeVbgBgbHSXDgBgjGVcV7UGzxzpbv/vG1ZveLF0DgAAAAB8GMPDw1NG2iNfzjpuKd0CwNhwMhtgUsrPd490/aAaqm7dun3rrNI1AAAAAPB+hoYGrx5tjzyREbdHxMmlewAYG8ZsgMlrRtT1DTMO9DxdVdXGuq6zdBAAAAAA/LyhoaHlVdX823ad/xAR55fuAWBsGbMBOCuyvrvVqgYHhwf7S8cAAAAAwCOPPDK3Gqpubdej34uMz5XuAaAMYzYAx2T0N9o5UFXNe5rN5oLSOQAAAABMPnVdN6qq2jh12pRnoq5viIippZsAKMeYDcDPa0TGFzPjuaoavHnnzm9NKx0EAAAAwOTQbDavag1X2yLruyPitNI9AJRnzAbgX8qYFZk37d0376mqqr5QOgcAAACAiavVap1dVc17shHfiTouLt0DQOfoLh0AQEdbGlnfV7UGv93I7s1r1679fukgAAAAACaGJ598cubhwwe/Ukf7hsiYXroHgM7jZDYAH0L+crse3dZqNe8cHh6eX7oGAAAAgPGrruusquoLh98+9HRk3hRhyAbg3RmzAfiwuuuI3xptj+xotpqb7rvvvq7SQQAAAACML61Wa21rqPVoZH1fRJxdugeAzmbMBuCjmpcRty8895ynWq2BXykdAwAAAEDne/TxR3tbreaddbSbEfVlpXsAGB+8mQ3Ax1PHyjoaf1e1Bh9oZPemtWvX7iqdBAAAAEBn2b59+9T9B/b/do7EH9URs0v3ADC+OJkNwCeUn2/Xo083W80tzWbzpNI1AAAAAHSGVmvwmrcO7H8mI24PQzYAH4MxG4DjYWpGXJ+NeKY51Pytuq79+QIAAAAwSbVarUuqVvOhOvJvIuLc0j0AjF/GBgCOpzOyjjtbQ1U1NDS4oXQMAAAAAGNnYGBgXrPV3FJHezgirijdA8D4581sAE6ENe06H6mGmn/dld2/v2bNmpdKBwEAAABwYgwPD08ZaY98OSNujog5pXsAmDiczAbgRMmo4wuj7ZGnq2rw5q1bt04vHQQAAADA8TU0NHj1aHtk2zvvYs8p3QPAxGLMBuBEmxGZN82Y2fNsVVUb67rO0kEAAAAAfDJVVS2rWoPfbNf5DxFxQekeACYmYzYAY+XsyPruoaHqO1VVfap0DAAAAAAf3bZt2+ZUQ9WtkfG9iPx86R4AJjZjNgBjqo74pcj68apq3vPYY4+dVroHAAAAgA9W13WjqqqNR46+vSPq+oaIelrpJgAmPmM2ACU0IuOL3VO6dlTV4A07d37LNz8AAAAAHWpwaPCXWkPV45H13RHhcAIAY8aYDUBJcyLz1r375n2vqirXUgEAAAB0kGazeVZVNe9p1PmdiPBsHABjrrt0AABExLLI+pvNVvPBRjQ29/X1bS8dBAAAADBZDQ8PzxgdPfrVyLghIqaX7gFg8nIyG4COkRFX19He1mw1twwPD59cugcAAABgMqnrOquq+sLo6MgPIvOmMGQDUJgxG4BOMyUjrh9tjzzfbDU33XfffV2lgwAAAAAmumazeWk1VD0SWd8XGQtL9wBAhDEbgM51SkbcvnDRwqFWq3VF6RgAAACAiWh4ePiMVqt5ZzailREbSvcAwM/zZjYAHa5eVUf9UNUafCDqxvX9/f27SxcBAAAAjHfbt2+fuv/A/t8ebY98IyJOKt0DAO/GyWwAxon8fGS9vRqqbn300Udnl64BAAAAGK9arcFr3jqw/+mMuD0M2QB0MGM2AONJT9T1DVOndj9TVdXGuq6zdBAAAADAeDE8PLCialV/V0f+TUScV7oHAD6IMRuAcaeO6I2s724NNauqqtaX7gEAAADoZAMDA/OareaW0XbjqYj6V0r3AMCH5c1sAMaxXBtZP1YNNf8668a/7+vre7l0EQAAAECn2Lp1a3fPrJ7fzDr+JCLml+4BgI/KyWwAxruMOr5QR/vpqhq8eevWrdNLBwEAAACU1mq1fnnGzOnbso47w5ANwDhlzAZgopgZmTfNmNnzbFVVG0vHAAAAAJTQbDaXVkPN++poPxiRF5buAYBPwjXjAEw0Z0fWd1dDzf+tHo3N69at+17pIAAAAIATbev2rbNmvDX99yPzxqjraaV7AOB4cDIbgImpjquyEduqqnnP448/fGrpHAAAAIAToa7rRlVVG2cc6HkuMm+KMGQDMHEYswGYyBqR8cWjo1N3VNXgDdu3b59aOggAAADgeBkcHuxvDVWPRdZ3R8SC0j0AcLwZswGY+OqYG5m3vnVg//eaQ83Plc4BAAAA+CSazeZZVdW8p9HOwYhYV7oHAE4Ub2YDMJkszzr+ttlqPhjt2LRu3boflA4CAAAA+LCGh4dnjI4e/Z2I+HpkzCrdAwAnmpPZAEw6GXF1NuKJZqu5ZXh4+OTSPQAAAAAfpNUavGa0PbI9Mm81ZAMwWRizAZispmTE9aPtkeebream++67r6t0EAAAAMA/Nzg8uLqqmo/UkX8TEYtK9wDAWDJmAzDZnZIRty9adE6rqqrLS8cAAAAAREQMDw/Pb7aaWxrtbEXGp0v3AEAJ3swGgIioI1ZH1g9XrcEH2qPxO+vXr3+hdBMAAAAw+QwPD08ZaY98ebQ98o2MOKl0DwCU5GQ2APyC/HyjK39QDVW3bt2+1ftTAAAAwJgZGhq8erQeeTIjbg9DNgAYswHgXfREXd8w40DPM1VVbazrOksHAQAAABPX0NDQ8qpq/m27zn+IOlaW7gGATmHMBoD3dmZkfXc1VDWbzea60jEAAADAxPLII4/MbbaaW9r16Pcj43OlewCg03gzGwA+QEb0RSMGqqr53zMbX+3r6/tR6SYAAABg/Nq6dWt3z6ye38w6/ziiPrV0DwB0KiezAeDDycj4Yh3t56pq8OadO781rXQQAAAAMP5UVfWZmTN7Hs867jRkA8D7M2YDwEczMzJv2rt33verqvpC6RgAAABgfBj47sCSaqh5X2T97TriotI9ADAeuGYcAD6OjCUR9X1Vq/md0UZ782VrLnuqdBIAAADQeZ588smZhw8f/EqM5g0RMb10DwCMJ05mA8An85muduPxVqt55+OPP+xqMAAAACAiIuq6zqqqNh5++9BzkXlTGLIB4CMzZgPAJ9ddR/zW0ZGpzzRbzU1bt2518wkAAABMYq1Wa21rqHossr47Ik4v3QMA45UxGwCOn3kZcXvPzJ6nhoYGf7V0DAAAADC2BgYGzqyq5j11tKuIWF+6BwDGOyfHAOA4y4gV7Tq/VbUGH+hqtDevWbPh+dJNAAAAwIkzMDDQ09WV10fm1yJidukeAJgonMwGgBMmPz/a7nq62WpuaTabJ5WuAQAAAI6/Vmvwmq7uxvbIvDUM2QBwXBmzAeDEmpIR12cjnmkONX+rrmt/9gIAAMAEMDQ0sKpqNR+qI/8mIs4t3QMAE5EP1AFgbJyRddzZGq5azeHmp0vHAAAAAB9PVVWnNFvNLe26MRQRV5TuAYCJzJvZADCW6rg063i4Gmr+9UjX6Fc2rN7wYukkAAAA4IMNDw9PGWmPfDmiviUjTi7dAwCTgZPZADD2Mur4QvdI1w+qavDmgYGBntJBAAAAwHsbGhq8erQ98kRG3B6GbAAYM8ZsAChnRmTe1NXdeLaqqo11XWfpIAAAAOCfVFW1rBpqPtCu8x8i4vzSPQAw2RizAaC8syLru1tDra2tVuuS0jEAAAAw2W3btm1ONVTdGlk/FXX8WukeAJisjNkA0DHqK+tof7eqmvc0m80FpWsAAABgsqnrulFV1cYjR9/eEXV9Q0RMLd0EAJOZMRsAOksjMr6YGc9V1eDNO3d+a1rpIAAAAJgMms3mVa3haltkfXdEnFa6BwAwZgNAZ8qYFZk37d0376mqqr5QOgcAAAAmqlardXZVNe/JRnwn6ri4dA8A8E+6SwcAAO9raWR9X7PVfLAru3537dq13y8dBAAAABPBk08+OfPw4YNfqaN9Q2RML90DAPxLTmYDwDiQEVe369HHW63mncPDw/NL9wAAAMB4Vdd1VlX1hcNvH/xBZN4UYcgGgE5lzAaA8WNKHfFbo+2RHc1Wc9N9993XVToIAAAAxpOqqta0hlqPRtb3ReQ5pXsAgPdnzAaA8WdeRty+8Nxznqqq6l+VjgEAAIBO9+jjj/a2Ws07I+sqor6sdA8A8OF4MxsAxqs6VkbWf1+1Bh9oZPemtWvX7iqdBAAAAJ1k+/btU/cf2P/bORJ/VEfMLt0DAHw0TmYDwLiXn2/Xo083W80tjz76qG/MAQAAICJarcFr3jqw/+mMuD0M2QAwLhmzAWBimJoR10+d2v1Mc6j5W3Vd+zMeAACASWlwcHBl1Wr+fR35NxFxXukeAODj80E3AEwgdURv1nFna6iqWq0Bb4ABAAAwaQwMDMxrtppbGl35VET8q9I9AMAn581sAJiY1tTReLQaav51V3b//po1a14qHQQAAAAnwvDw8JSReuTfZB1/EhHzS/cAAMePk9kAMHFl1PGF0fbI01U1ePPWrVunlw4CAACA42loaPDq0fbItqzjzjBkA8CEY8wGgIlvRmTeNGNmz7NVVW0sHQMAAACfVLPZXFoNNe9r1/kPEXFB6R4A4MRwzTgATB5nR9Z3t1rNf1PXubm/v//J0kEAAADwUWzbtm3OkZEjN0Ydm6Oup5XuAQBOLCezAWCSqSN+KbJ+vKqa9zz22GOnle4BAACAD1LXdaOqqo1Hjr79TNT1DRGGbACYDIzZADA5NSLji91TunZU1eAN27dvn1o6CAAAAN5NqzVwZWuo+m5kfXdELCjdAwCMHWM2AExucyLz1rcO7H+qqqpfKx0DAAAA/6jZbJ5VVc176mhsjYhLSvcAAGPPm9kAQETEssj6gWar+WAjGpv7+vq2lw4CAABgchoeHp4xOnr0q5Hx1YjoKd0DAJTjZDYA8L9kxNV1tLc1W80tw8PDJ5fuAQAAYPKo6zqrqvrC6OjIDyLzpjBkA8CkZ8wGAP65KRlx/Wh75Plmq7npvvvu6yodBAAAwMTWbDYvrYaqRyLr+yJjYekeAKAzGLMBgPdySkbcvnDRwqFWq3VF6RgAAAAmnuHh4TNaread2YhWRmwo3QMAdBZvZgMAH6BeVUf9UNUafCDqxvX9/f27SxcBAAAwvg0PD08ZaY98ebQ98o2IOKl0DwDQmZzMBgA+pPx8ZL29GqpuffTRR2eXrgEAAGB8arUGrxltjz6dEbeHIRsAeB/GbADgo+iJur5hytTup6uq2ljXdZYOAgAAYHwYHh5YUbWqv6sj/yaiXly6BwDofMZsAODjODOyvrs11KyqqlpfOgYAAIDONTAwMK/Zam4ZbTeeiqh/pXQPADB+eDMbAPgEcm1k/VhVNf97ZuOrfX19PypdBAAAQGfYunVrd8+snt/MOv84oj61dA8AMP44mQ0AfFIZGV+so/1cVQ3evHXr1umlgwAAACir1Wr98syZPY9nHXcasgGAj8uYDQAcLzMj86YZM3qeqqrqC6VjAAAAGHsD3x1YUg0176uj/WAdcVHpHgBgfHPNOABwfGUsiajvq1rN79Tt+N1169Z9r3QSAAAAJ9aTTz458/Dhg1+J0caNEfW00j0AwMTgZDYAcKJ8Jhvx3Vareefjjz/sSjkAAIAJqK7rrKpq4+G3Dz0XmTcZsgGA48mYDQCcSN11xG8dHZ26o6oGb9i+ffvU0kEAAAAcH0NDA32toWogsr47Ik4v3QMATDzGbADgxKtjbmTe+taB/d9rDjU/VzoHAACAj29gYODMqmre064bzYhYV7oHAJi4vJkNAIyl5VnH3zZbzQfr0fr69evXP106CAAAgA9neHh4xujo0d+JyK9HxqzSPQDAxOdkNgAw5jLi6kZXPtlsNbc0m82TSvcAAADw/lqtwWtG2yPbI/NWQzYAMFaM2QBAKVMy4vpsxPPNVnPTfffd11U6CAAAgF80ODy4umo1H64j/yYiFpXuAQAmF2M2AFDa/Iy4fdGic1pVVV1eOgYAAICIqqpOabaaWxrtbEWE79UAgCK8mQ0AdIQ6YnVk/XDVGnygPRq/s379+hdKNwEAAEw2w8PDU0baI1+OqG/JiJNL9wAAk5uT2QBAh8nPN7pyezVU3bp1+1bvsAEAAIyRoaHBq0fbI09kxO1hyAYAOoAxGwDoRDOirm+YcaDnmaqqNtZ1naWDAAAAJqqhoaHlVdX823ad/xAR55fuAQD4R8ZsAKCTnRlZ310NVc1ms7mudAwAAMBE8sgjj8ythqpb2/Xo9yLjc6V7AAD+OWM2ANDxMqIvG/FYVTXvaTabC0r3AAAAjGd1XTeqqto4ddrUHVHXN0TE1NJNAADvxpgNAIwXjcj4Yjbi+aoavHnnzm9NKx0EAAAw3jSbzataw9W2yPruiPrU0j0AAO/HmA0AjDczI/OmvfvmPVVV1RdKxwAAAIwHw8PD51RV855sxHeijotL9wAAfBjdpQMAAD6mpZH1fVVr8NuN7N68du3a75cOAgAA6DRPPvnkzMOHD35ltD1yQ2RML90DAPBROJkNAIxz+cvtenRbq9W8c3h4eH7pGgAAgE5Q13VWVbXx8NuHnovMmyIM2QDA+GPMBgAmgu464rdG2yM7mq3mpq1bt7p9BgAAmLRardba1lD12LF3seP00j0AAB+XMRsAmEjmZcTtPTN7nmq1Bn6ldAwAAMBYevTxR3urqnlPHe0qItaX7gEA+KScWgIAJpyMWFFH4++q1uADjezetHbt2l2lmwAAAE6UgYGBnq6uvD5G8muRMbt0DwDA8eJkNgAwgeXn2/Xo081Wc0uz2TypdA0AAMDx1moNXtPV3dgembdGGLIBgInFmA0ATHRTM+L6bMQzzaHmb9V17esfAABg3BsaGlhVtZoP1ZF/ExHnlu4BADgRfJgLAEwWZ2Qdd7aGq9bQ0OCG0jEAAAAfR1VVpzRbzS3tujEUEVeU7gEAOJG8mQ0ATC51XNqOfKQaav71SNfoVzas3vBi6SQAAIAPMjw8PGWkPfLliPqWjDi5dA8AwFhwMhsAmIwy6vhC90jXD6pq8OaBgYGe0kEAAADvZWho8OrR9si2jLg9DNkAwCRizAYAJrMZkXlTV3fj2aqqNtZ1naWDAAAA/lFVVcuq1uA323X+Q0RcULoHAGCsGbMBACLOiqzvbg21trZarUtKxwAAAJPbtm3b5lRD1a2R9VMR+fnSPQAApRizAQD+l/rKOtrfrarmPc1mc0HpGgAAYHKp67pRVdXGI0ff3hF1fUNETC3dBABQkjEbAOAXNSLji9mIZ6pq8IadO781rXQQAAAw8Q0ODf5Sa6h6PLK+OyJOK90DANAJjNkAAO9uTmTeunffvO9VVeVaPwAA4IRotVpnV1XznkadWyPiU6V7AAA6SXfpAACADrcssv5ms9V8sBGNzX19fdtLBwEAAOPf8PDwjNHRo1+to31DZEwv3QMA0ImczAYA+BAy4uo62tuareaWbdu2zSndAwAAjE91XWdVVV8YbR99OjJvijBkAwC8F2M2AMCHNyUjrj9y9O3nm63mpvvuu6+rdBAAADB+VFW1phqqHoms74vIc0r3AAB0OmM2AMBHNy8jbl947jlPVVX1r0rHAAAAne3Rxx/tbbWad0bWVUZsKN0DADBeeDMbAODjqmNlZP33VWvwgagb1/f39+8unQQAAHSO7du3T91/YP9v50h8o444qXQPAMB442Q2AMAnlp+PrJ9ptppbHn300dmlawAAgPJarcFr3jqw/+mMuD0M2QAAH4sxGwDg+JiaEddPndr9THOo+Vt1Xfs6CwAAJqHBwcGVVav593Xk30TEeaV7AADGMx+yAgAcR3VEb9ZxZ2uoqlqtgctK9wAAAGNjYGBgXrPV3NLoyqci4l+V7gEAmAi8mQ0AcGKsqaPxaDXU/Ouu7P79NWvWvFQ6CAAAOP62bt3a3TOr5zezjj+JiPmlewAAJhInswEATpyMOr4w2h75QVUN3rx169bppYMAAIDjp9Vq/fKMmdO3ZR13hiEbAOC4M2YDAJx4MyPzphkze56tqmpj6RgAAOCTaTabS6uh5n11tB+MyAtL9wAATFSuGQcAGDtnR9Z3V0PN/60ejc3r1q37XukgAADgw9u6feusGW9N//3IvDHqelrpHgCAic7JbACAsVbHVdmIbVXVvOexxx47rXQOAADw/uq6blRVtXHGgZ7nIvOmCEM2AMBYMGYDAJTRiIwvdk/teqaqBm/Yvn371NJBAADAvzQ4PNjfalUDkfXdEbGgdA8AwGRizAYAKKmOuZF561sH9n+vqqpfK50DAAAc02w2z6qq5j2Ndg5GRn/pHgCAycib2QAAnWF5ZP1As9V8MNqxad26dT8oHQQAAJPR8PDwjNHRo78TEV+PjFmlewAAJjMnswEAOkhGXJ2NeKLZam4ZHh4+uXQPAABMFnVdZ1VVXxgdHflBZN5qyAYAKM+YDQDQeaZkxPWj7ZHnm63mpvvuu6+rdBAAAExkzWbz0larejiyvi8yFpbuAQDgGGM2AEDnOiUjbl+4aOFQVVWXl44BAICJZnh4+IxWq3lnNqKKjE+X7gEA4Bd5MxsAoOPVqyLj4ao1+EB7NH5n/fr1L5QuAgCA8Wx4eHjKSHvky6PtkW9ExEmlewAAeHdOZgMAjBv5+UZX/qAaqm7dun2r9/sAAOBjaLUGrxltjz6dEbeHIRsAoKMZswEAxpeeqOsbZhzoeaaqqo11XWfpIAAAGA+GhwdWNFvNb9WRfxNRLy7dAwDABzNmAwCMT2dG1ne3hppVVVXrS8cAAECneuSRR+Y2W80to+3GUxnxq6V7AAD48LyZDQAwruXayPqxqmr+98zGV/v6+n5UuggAADrB1q1bu3tm9fxm1vnHEfWppXsAAPjonMwGABj/MjK+WEf7uaoavHnr1q3TSwcBAEBJVVV9ZubMnsezjjsN2QAA45cxGwBg4pgZmTfNmNHzVFVVXygdAwAAY23guwNLqqHmfZH1t+uIi0r3AADwybhmHABgoslYElHfV7Wa3xlttDdftuayp0onAQDAifTkk0/OPHz44FditHFjRD2tdA8AAMeHk9kAABPXZ7rajcdbreadjz/+sKsVAQCYcOq6zqqqNh5++9BzkXmTIRsAYGIxZgMATGzddcRvHR2duqPZam7aunWrm3kAAJgQhoYG+lpD1UBkfXdEnF66BwCA48+YDQAwGdQxNyNu75nZ89TQ0OCvls4BAICPa2Bg4Myqat7TrhvNiFhXugcAgBPHyRwAgEkkI1a06/xW1Rp8oKvR3rxmzYbnSzcBAMCHMTAw0NPVlddH5NcjY1bpHgAATjwnsyeJrPP/yIj/WboDAOgU+fnRdvf2aqi69dFHH51dugYAAN5LXdfZag3+f7q685nIvNWQDQC849WM+OKll156qHQIJ06WDmBstVqD19SRt0fEeaVbAICO8cM64+aXdr/0/7v22mtHS8cAAMA/GhweXN1o5+0RcXnpFgCgYxypI/7ryJGRr3/605/eXzqGE8uYPQlt37596v4D+387I/4oIpzEAgAiIiIjHm83YtO6NeseLd0CAMDkVlXVKXXWf5gR/y4iukr3AACdon6gkd2b1q5du6t0CWPDmD2JPfr4o71TR7pvqiP+bbhyHgD4X+oHRrrb//uG1RteLF0CAMDkMjw8PGWkPfLljLglIk4u3QMAdIiMp6Odv9vf3/8/SqcwtozZRFVVayJjS0R9WekWAKBjHIzM/+vgjIN/fNUFV71VOgYAgIlvaGjw6nadWyLi/NItAEDH2FtHfOOlF176z57Hm5yM2URERF3X2Wq1/nVk+88j8pzSPQBAx3gl6vxaX1/fvZlZl44BAGDiGRoaWt5uj/5FZHyudAsA0DGOZsT/22h0f23NmjWvl46hHGM2v2B4eHjG6OjRr0bmDRExvXQPANAh6qjaXfWm9WvWV6VTAACYGB555JG5U6dPvSHq+ncjYmrpHgCgM9QRDzaisbmvr2976RbKM2bzrlqt1tl13f6TyPhi6RYAoGO0o46/quv4yrp1614rHQMAwPhU13Wj1Wr9RmT9ZxFxWukeAKBj7Iw6f6+/v/+B0iF0DmM272twaPCXGnXeHhGfKt0CAHSIOt6KqP/TvHn7/nTp0s+9XToHAIDxo9lsXpVdcXvUcXHpFgCgY7wRdX3rvHn7bvdZE/+cMZsP5KdlAYD3sDPq/Fp/f//9pUMAAOhsbgEEAN6FWwD5QMZsPrRt27bNOTJy5EbvGAEAv6j+diO7N69du/b7pUsAAOgsTz755MzDhw9+JTJviIjppXsAgE6RD2Xk5r6+vidKl9DZjNl8ZFVVLYtG/RdRx6+VbgEAOsZIRvy3RqP7a2vWrHm9dAwAAGXVdZ2tVutfR7b/PCLPKd0DAHSMV6LOr/X19d2bmXXpGDqfMZuPbWho8Or2sfe0LyjdAgB0jL11xDdeeuGl/3zttdeOlo4BAGDstVqttXXUt0fUl5VuAQA6xsGo6z8bHa1vu+yyyw6VjmH8MGbziQwPD08ZaY98OSNuiYiTS/cAAB0i4+ms27/X13fZ35dOAQBgbDz6+KO9U0e6b6oj/m1ENEr3AAAdoY6Mvx7pGv3KhtUbXiwdw/hjzOa4qKrqlDrrP8yIfxcRXaV7AIBOUT/QyO5Na9eu3VW6BACAE2P79u1T9x/Y/9sZ8UcRMbt0DwDQITK+24h609q16x8rncL4ZczmuBoaGljVrhu3R8QVpVsAgI5xpI74r9GO/7Bu3bo3S8cAAHD8tFqD19SRWyLi3NItAEDH+GGdcXP/mv7/JzPbpWMY34zZnBC+kQEA3oVvZAAAJohWq3XJO+9iX1m6BQDoGA40cNwZszlhBgYGerq68vrI/Fq4YgoA+CfDjaw3u2IKAGD8GRgYmNfobtzkqTkA4Bd5ao4Tw5jNCTcwMHBmV1fjTyPjN8LvOQDgmDoy/roru39/zZo1L5WOAQDg/Q0PD08ZaY98OSNujog5pXsAgM5QRzzTiPbv9vVd9velW5iYDIuMmVartbaO9paIWF+6BQDoGAejrv/s4MHDt1511VWHS8cAAPAvDQ0NXt2u8/aIuKB0CwDQMfbWEd84dODQ/33VVVeNlI5h4jJmM6bqus5Wq/XFyPq2iDi9dA8A0DFejjq/3tfXd29m1qVjAAB6isL/AABf9ElEQVSIqKpqWWT7P0Xk50u3AAAdYyQj/luj0f21NWvWvF46honPmE0RTz755MzDhw9+JTJviIjppXsAgM6QEf+zrnNzf3//k6VbAAAmq23bts05MnLkxqhjc0Q9rXQPANAp6m83snvz2rVrv1+6hMnDmE1Rw8OPLR6tu/406vhC6RYAoGO0o46/GhkZ/f0NGzb8uHQMAMBkUdd1o9Vq/UZk/X9GxILSPQBAh6jjuYj8g/7+/vtLpzD5GLPpCFVVfSYa9V9GHReXbgEAOsYbUde3zpu37/alSz/3dukYAICJrNUauLKOxpaI+FTpFgCgYxyIuv7zefP2/anPZijFmE3H+Kef/o0/j6hPLd0DAHSMZ6POf9/f3/9A6RAAgImm2WyelRn/MTJ+I3xWCAAc0446/qqu4yvr1q17rXQMk5svUOk4jzzyyNyp06feEHX9uxExtXQPANAZ6ogHG9HY3NfXt710CwDAeDc8PDxjdPToVyPzhoiYXroHAOgMdUQr2rFp3bp1zdItEGHMpoMNDQ0tb7dH/yIyPle6BQDoGEfriP/S3ej+wzVr1vysdAwAwHhT13W2Wq1/HVH/WWQsLN0DAHSMV6POP+jr67s3M+vSMfCPjNl0vKGhwavbdW6JiPNLtwAAHeOndcQfvfTCS//52muvHS0dAwAwHjSbzUujEVsyYkPpFgCgYxyMzP/r4IyDf3zVBVe9VToG/jljNuPC8PDwlJH2yJcz4paIOLl0DwDQKXJbRm7u6+t7uHQJAECnGh4ePqPdHrm5jvi3EdEo3QMAdIr6gfZo/M769etfKF0C78WYzbhSVdUpddZ/mBH/LiK6SvcAAJ2ifiDqxvX9/f27S5cAAHSK7du3T91/YP9vZ8Q3IuKk0j0AQGfIiMfrOjf39/c/UroFPogxm3FpcHhwdaOdt0fE5aVbAICOcSgy7zj69tE/+fSnP72/dAwAQEmt1uA1deTtEXFe6RYAoGO8Xkf8sWfbGE+M2Yxr73xjdkdELCrdAgB0hozYU9f5f/T19d2bmXXpHgCAsTQ8PLBitN31lxH1r5RuAQA6xtE64r9EO/7DunXr3iwdAx+FMZtxb3h4eMbo6NHficivR8as0j0AQKeoh6JubOrv7x8sXQIAcKINDAzMa3Q3bsqIL0dEd+keAKAz1BEP1qP19evXr3+6dAt8HMZsJoyBgYEzu7oafxoZvxF+bwMAx9SR8ddZN/59X1/fy6VjAACOt61bt3b3zOr5zazjTyJifukeAKBj7Kgzfm/d2nXfKh0Cn4TBjwlnaGigr103tkTEutItAEDHOBB1/ecHDx6+9aqrrjpcOgYA4HhotVq/XMfo7RF5YekWAKBDZOyLdn3brFkn/eUFF1xwpHQOfFLGbCakuq6z1Wp9MbK+LSJOL90DAHSMl6POr/f3999TOgQA4ONqNptLsyv+JOr4QukWAKBjjGTEf+vuPvL11auv+EnpGDhejNlMaE8++eTMw4cPfiWycWNEPa10DwDQITK21qOxed26dd8rnQIA8GH5nAMAeA/fqdvxuz7nYCIyZjMpDHx3YElXu/Ef/cQyAPBz2lHHX02ZcuTf+4llAKCT1XXdaLVavxFZ/58RsaB0DwDQIep4LiL/oL+///7SKXCiGLOZVFqt1i9HtP+yjriodAsA0CG8JQUAdLChoYG+dt3YEhHrSrcAAB3jQNT1nx88ePjWq6666nDpGDiRjNlMOlu3bu3umdXzm1nnH0fUp5buAQA6xo464/fWrV33rdIhAADNZvOszPiPkfEb4TM8AOCYOur475mNr/b19f2odAyMBV8IM2kNDAzMa3Q3bsqIL0dEd+keAKAz1BEPRjs2rVu37gelWwCAyWd4eHjG6OjR34nIr0fGrNI9AECnqIeibmzq7+8fLF0CY8mYzaQ3PDywYqTd+IuM+NXSLQBAxzhaR/yX7kb3H65Zs+ZnpWMAgMmh1Rq8po68IyIWlW4BADrGq1HnH/T19d2bmXXpGBhrxmx4x7FvGBt/GVEvLt0CAHSMn9YRf/TSCy/952uvvXa0dAwAMDENDg+ubrTz9oi4vHQLANAxDkXmHUffPvonn/70p/eXjoFSjNnwc4aHh6eMtEe+nBHfiIiTSvcAAJ0hIx6v69zc39//SOkWAGDiGB4enj/SHvkPGfHvIqKrdA8A0CnqB6JuXN/f37+7dAmUZsyGdzE8PHxGuz1ycx3xbyOiUboHAOgU9QPt0fid9evXv1C6BAAYv/wwPQDw7nJbRm7u6+t7uHQJdApjNryPZrN5aTRiS0ZsKN0CAHSMQ5F5x8EZB//4qguueqt0DAAwvgwNDV7djrwj6lhZugUA6BieOYP3YMyGD1DXdbZarX8dUf9ZZCws3QMAdIxXo84/6Ovruzcz69IxAEBnGxoaWt5uj/5FZHyudAsA0DGO1hH/pbvR/Ydr1qz5WekY6ETGbPiQhoeHZ4yOHv1qZH41InpK9wAAnaGOaEU7Nq1bt65ZugUA6DyPPPLI3KnTp94Qdf27ETG1dA8A0BnqiAff+TzhB6VboJMZs+EjajabZ2XGf4yM3wj/DwEAx9RRx3/PbHy1r6/vR6VjAIDytm7d2t0zq+c3s84/jqhPLd0DAHSMZ6PO3+vv7//b0iEwHhji4GNqtQaurKNxe0RcUroFAOgYB6Ku/3zevH1/unTp594uHQMAlFFV1WeiUf9l1HFx6RYAoGO8EXV966xZJ/3lBRdccKR0DIwXxmz4BOq6brRard+IrP/PiFhQugcA6BB1PBeRf9Df339/6RQAYOwMfHdgSVe78R+jji+UbgEAOkY76virkZHR39+wYcOPS8fAeGPMhuNg6/ats2a8Nf33Ixs3RtTTSvcAAJ2i/vZoo/7dy9Zc9lTpEgDgxHnyySdnHj588CuReUNETC/dAwB0iIyt9WhsXrdu3fdKp8B4ZcyG46jZbC7NrvgTP4ENAPyckYz4b93dR76+evUVPykdAwAcP3VdZ6vV+mJkfVtEnF66BwDoGC9HnV/v7++/p3QIjHfGbDgBhoYGr27X8ZcReWHpFgCgY+ytI75x6MCh//uqq64aKR0DAHwyrVZrbR3tLRGxvnQLANAxDkRd//nBg4dvveqqqw6XjoGJwJgNJ8jw8PCUkXrk32QdfxIR80v3AACdoY54pivr31u7dv3flW4BAD66gYGBM7u6Gn8aGb8RPlsDAI6pI+Ovu7L799esWfNS6RiYSHzBDSfYwMDAvEZ346aM+HcR0VW6BwDoFPUDXY325jVrNjxfugQA+GADAwM9XV15fWR+LSJml+4BADrGcEZ7U1/fZQOlQ2AiMmbDGBkcHFzZ6Mq/jIh/VboFAOgYR+uI/xLt+A/r1q17s3QMAPDuWq3Ba+rILRFxbukWAKAzZMSedsYt/Wv6/5/MbJfugYnKmA1j7J1vgG+PiPNKtwAAHeOHdcbNvgEGgM4yNDSwql03bo+IK0q3AAAd40gd8V9Hjox8/dOf/vT+0jEw0RmzoYDt27dP3X9g/29nxB+Fq8kAgH+U8d06Y/O6NeseLZ0CAJNZVVWn1Fn/oSfDAIBfVD8QdeP6/v7+3aVLYLIwZkNBjz7+aO/Uke6b6oh/GxGN0j0AQEeoI+OvR7pGv7Jh9YYXS8cAwGQyPDw8ZaQ98uWMuCUiTi7dAwB0iIyno52/29/f/z9Kp8BkY8yGDlBV1ZrI2BJRX1a6BQDoGAejrv9sdLS+7bLLLjtUOgYAJrqhocGr23XeHhEXlG4BADrG3jriGy+98NJ/vvbaa0dLx8BkZMyGDlHXdbZarX8d2f7ziDyndA8A0DFeiTq/1tfXd29m1qVjAGCiqapqWTTqv4g6fq10CwDQMY5mxP/baHR/bc2aNa+XjoHJzJgNHWZ4eHjG6OjRr0bmDRExvXQPANAp8qGM3NzX1/dE6RIAmAi2bds258jIkRujrn83IqaW7gEAOkMd8WAjGpv7+vq2l24BjNnQsVqt1tl13f6TyPhi6RYAoGO0o46/quv4yrp1614rHQMA41Fd141Wq/UbkfWfRcRppXsAgI6xM+r8vf7+/gdKhwD/xJgNHW5waPCXGsfe7PpU6RYAoEPU8VZE/Z/mzdv3p0uXfu7t0jkAMF74HhsAeBdv/P/b+7cguc/Czv//PD0j2TKKCQJCQiBnJyTKYe3MdLcOYTOJqzbxxnegK3HxY7nBDpYMPvDHxidsMNhgyZgy9S+WX/3j+AoulcNWkWgTOXPoaewoiRJIssERJAQCGLA1lqWefv4XZgMEAz5IenpmXq9L25p5t6o809/n093f1Hrntm2PHXCNDZPHmA1rgFeNAwDfxT+klht6vd7HWocAwCTz6WcAwDPw6WewBhizYQ1xPy8A4JnU5BNTZerq2dnZv2ndAgCTZDgcXrC6evq6lHJ9kvNb9wAAk6L8WUnZ3+12/7J1CfC9GbNhDVpaWvrZdOoHUvPfW7cAABPjdEn+305n+oaZmZkvtY4BgJZqrWUwGLwuZXx3Un6sdQ8AMDE+l1pu6Ha7D5RSausY4PszZsMatry8cOn46Xt9bW/dAgBMjK/U5Lbjjx6/b8+ePautYwDgXFtaWppJycGk7mzdAgBMjJXUetfqan3vzp07n2wdAzx7xmxY44bD4abReHRFSW5N8uLWPQDAhCj5u4zL1b1e73+1TgGAc+Ghhx965ebR9M01eVOSTuseAGAi1JR8fDS1eu2uS3b9c+sY4LkzZsM6sbS09NJa6k0luTLJVOseAGBS1EOdMr1vdnb2n1qXAMDZcOzYsc2Pn3j8zSV5V5IfaN0DAEyIkk92UvfNzu74i9YpwPNnzIZ1Znl5/uJx7RxI8trWLQDAxDhVkw+PTo1u3L179+OtYwDgTBkMFi6vKQeS/FTrFgBgYny+ltzSm+l9pJQybh0DvDDGbFinvnFBfzDJT7ZuAQAmQ0n+dVxyqwt6ANa6hYWFn+9MlXuS/LfWLQDAxDhVkw9nnHf2+/2vt44BzgxjNqxj8/PzW6amylUp5Yb4qDUA4JuGJeN93e7O+dYhAPBczM/Pb+tMd252iy0A4Nu5xRasV8Zs2AAeevihV246PX1nSvbG//cAwNNqSj4+VaavmZmZOd46BgC+l+FwuGlUR/9Pqbkjycta9wAAk6Emn+pkfHW3u/OPW7cAZ4dRCzaQwWAwWzM+mGRH6xYAYGKspNa7VlZO3jk3N3eydQwA/GfLywuXjmvuScovtm4BACbGV2py25MnnvzQ3NzcqHUMcPYYs2GDqbWWwWDwhpT63iQ/3LoHAJgYn00tN/Z6vd9rHQIASbK4uHhRmcodqXl96xYAYGKMSvLRTmf6hpmZmS+1jgHOPmM2bFBHjx590cmTK9emlOuTnN+6BwCYDCX537WW/b1e72jrFgA2psPHDm+94Inzr0npvD2p57XuAQAmRf2TTpnePzs7+zetS4Bzx5gNG9xwOPyx1dXR7Sl5Q+sWAGBijFPz4Gi0es2uXbu+2DoGgI2h1toZDAZ7U+r7kryidQ8AMDH+IbXc0Ov1PtY6BDj3jNlAkmRxcXGuTOVAan65dQsAMDG+mlrv3Lr1wnu2b99+qnUMAOvXYDD/X2s6B5L8l9YtAMDEOJFa79627bH3XHTRZU+1jgHaMGYD/+Gbr4LP3Ul9eeseAGBi/H1qeWuv1/uD1iEArC+Li4uvKiXvTsneOKcCAJ42Ts2Dtebafr//hdYxQFsuEoDvcOTIkZdsPn/z9an16iSbW/cAAJOhJp/opLO/2+0ea90CwNo2HA4vWF09fV1KuS7JltY9AMBkqMkg4+zr9/uLrVuAyWDMBr6r5eXlnxuPVz+QkstatwAAE+N0Te6f7kzfNDMz87XWMQCsLbXWMhgMXpfUu1Ly4617AICJ8S+p5R3dbveBUkptHQNMDmM28H0tLy9cOq7lYJJfaN0CAEyML9fkXccfPX7fnj17VlvHADD5FhcXfzWdHCzJrtYtAMDEWEkpH1y5YOX2ue1zT7SOASaPMRt4VobD4abReHRFSW5N8uLWPQDApCiPlJT93W73z1uXADCZhsPhj4zHo1tq8qYkndY9AMCkqIfGq3nLjh07Hm1dAkwuYzbwnCwtLb20lnpTSa5MMtW6BwCYFPVQaueqXq/3mdYlAEyGb3lR9G1JLmzdAwBMhpI8XGvZ3+v1jrRuASafMRt4XhaGC5d0xuVAkl9r3QIATIwnU8q9p586fcfu3bsfbx0DQDuDwcLlNZ17kvrTrVsAgInxpZrc7nZVwHNhzAZekKcPKMq9SX6idQsAMDH+JbW8o9vtPlBKqa1jADh3hsP514zGnQ+U5LdbtwAAE+N0Te7POO/s9/tfbx0DrC3GbOAFm5+f3zI1Va5Kyo0p2dq6BwCYFHU5tbOv1+sttC4B4Oyan5/f1pnu3FySK5JMt+4BACZDTT5RV+tVO3bs+LvWLcDaZMwGzpj5+fkfnZrqvCcle+PnCwDwtJqa3y+lc1232/231jEAnFmHDx+e3rJ1yxtLLbcn9eWtewCAifHpWvLW/mz/D1uHAGubsQk445aX57vj2jmYpN+6BQCYGCdS690rKyfvnJubO9k6BoAXbjAY/GYyvqcmv9S6BQCYECWP1Zpbnzzx5Ifm5uZGrXOAtc+YDZwVtdYyGAzekFLfm+SHW/cAABOi5h+T8o5er/ex1ikAPD/zn5z/malx592peX3rFgBgYoxK8tHp6VM3XnLJa/+9dQywfhizgbPq6NGjLzp5cuXalM7bk3pe6x4AYGL8aR3n6n6//1etQwB4dlzfAQDfhes74KwxZgPnhFfuAwDPwCv3AdYAn7wFADwjn7wFnAPGbOCcck81AOA7lDyWcX3v1q0X3rN9+/ZTrXMA+Kbl5fnuuHYOJum3bgEAJsaJ1Hr3ysrJO+fm5k62jgHWN2M2cM4dPnx4esvWLW8stdye1Je37gEAJsana8lb+7P9P2wdArDRzc/P/+jUVOc9Kdkb50cAwNNqan6/lM513W7331rHABuDixGgmfn5+W2d6c7NJbkiyXTrHgBgMtTkE3W1XrVjx46/a90CsNHMz89vmZoqVyXlxpRsbd0DAEyKupza2dfr9RZalwAbizEbaG44nH/NaNz5QEl+u3ULADAxTtfk/ozzzn6///XWMQAbwWCwcHlNuTfJT7RuAQAmxr+klnd0u90HSim1dQyw8RizgYnx9MFJ556k/nTrFgBgYnypJrcff/T4fXv27FltHQOwHi0MFy7pjMuBJL/WugUAmBhPppR7Tz91+o7du3c/3joG2LiM2cBEGQ6Hm0bj0RUluS3Jha17AIDJUJKHay37e73ekdYtAOvF0tLSS2upN5XkyiRTrXsAgElRD6V2rur1ep9pXQJgzAYm0nA4/JHxeHRLTd6UpNO6BwCYFPXQeDVv2bFjx6OtSwDWqm95EfGtSV7cugcAmBTlkZKyv9vt/nnrEoD/y5gNTLTFxcVfLSUHUrK7dQsAMDFWUsoHVy5YuX1u+9wTrWMA1pLl5YVLx7UcTPILrVsAgInx5Zq8y+2dgElkzAYmXq21DAaD1yX1rpT8eOseAGBi/EtqeUe3232glFJbxwBMsuXl5Z8bj1c/kJLLWrcAABPjdE3un+5M3zQzM/O11jEAz8SYDawZw+HwgtXV09ellOuSbGndAwBMhpoMMs6+fr+/2LoFYNIcOXLkJZvP33x9ar06yebWPQDAZKjJJ75xHfW3rVsAvhdjNrDmLC4uvqqUvDsle+PnGADwtHFqHqw11/b7/S+0jgFordbaGQwGe1Nyd1Jf3roHAJgYf59a3trr9f6gdQjAs2EEAtasheFCr7NaDqak17oFAJgYJ1Lr3du2Pfaeiy667KnWMQAtLC4uzpWpHEjNL7duAQAmxldT651bt154z/bt20+1jgF4tozZwJr2zXcb1PcleUXrHgBgYvxDarmh1+t9rHUIwLkyGAxeXev4jpS8oXULADAxxql5cDRavWbXrl1fbB0D8FwZs4F14fCxw1sveOL8a1I6b0/qea17AIBJUf+kU6b3z87O/k3rEoCz5ejRoy86eXLl2pRyfZLzW/cAABOi5HBdzf5+v/9XrVMAni9jNrCuLC4uXlSmckdqXt+6BQCYGKOSfLTTmb5hZmbmS61jAM6UWmsZDAavS6nvT/Lq1j0AwMT4bGq5sdfr/V7rEIAXypgNrEvLywuXjmvuScovtm4BACbGV2py25MnnvzQ3NzcqHUMwAsxGAxma8YHk+xo3QIATIwTqfXulZWTd87NzZ1sHQNwJhizgXVrOBxuGtXR/1Nq7kjystY9AMBkqMmnOhlf3e3u/OPWLQDP1UMPP/TKTaen70zJ3jjXAQCeVlPy8akyfc3MzMzx1jEAZ5KLHmDdm5+f39aZ7txckiuTTLXuAQAmRT3UKdP7Zmdn/6l1CcD3Mz8/v2VqqlyVUm5I8gOtewCAiTEsGe/rdnfOtw4BOBuM2cCGsbCw8POdqXJPkv/WugUAmBinavLhjPPOfr//9dYxAM9kMFi4vKYcTPKTrVsAgMlQkn8dl9zam+l9pJQybt0DcLYYs4EN5xsHQQeS/FTrFgBgYny+ltziIAiYJMvL8xePa+dAkte2bgEAJsapmnx4dGp04+7dux9vHQNwthmzgQ3p2LFjmx8/8fibS3Jbkgtb9wAAE6Lkk53UfbOzO/6idQqwcS0tLb20lnqTWyUBAN+uHkrtXNXr9T7TugTgXDFmAxvaQw8/9MrNo+mba/KmJJ3WPQDARKgp+fhoavXaXZfs+ufWMcDGMRwON43GoytKcmuSF7fuAQAmRMnfZVyu7vV6/6t1CsC5ZswGSLK0tDSTkoNJ3dm6BQCYGCup9a7V1frenTt3Ptk6BljflpcXLh3XciDJ9tYtAMDE+EpNbjv+6PH79uzZs9o6BqAFYzbAN9Ray2AweF3K+O6k/FjrHgBgYnwutdzQ7XYfKKXU1jHA+rK0tPSzKeP3J+V3WrcAABPjdEn+305n+oaZmZkvtY4BaMmYDfCfDIfDC1ZXT1+XUq5Pcn7rHgBgUpQ/Kyn7u93uX7YuAda+Rx555AdPjU69PTX7k3pe6x4AYDLU5BOddPZ3u91jrVsAJoExG+C7GAwGr651fEdK3tC6BQCYGOPUPFhrru33+19oHQOsPbXWzmAw2JtS70ryQ617AICJ8Q+p5a29Xu9Q6xCASWLMBvg+FpYXfr3z9L3rfqV1CwAwMb6aWu/ctu2xAxdddNlTrWOAtcG1BQDwDFxbAHwPxmyAZ8G7JwCA7+LvU8vbvHsC+F586hMA8Ax86hPAs2DMBngOvnlfu3p1ks2tewCAyeC+dsAzGQ6HF6yunr4upVyf5PzWPQDApCh/VlL2d7vdv2xdAjDpjNkAz8PS0tLPplM/kJr/3roFAJgYp2ty/3mbzrv54osv/mrrGKCdWmsZDAavSxnfnZQfa90DAEyMz6WWG7rd7gOllNo6BmAtMGYDvADLywuXjp++59321i0AwMT4Sk1uO/7o8fv27Nmz2joGOLeWlpZmaqkHSrKrdQsAMDFWUutdq6v1vTt37nyydQzAWmLMBniBhsPhptF4dEVJbk3y4tY9AMCEKPm7jMvVvV7vf7VOAc6+hx5+6JWbR9M31+RNSTqtewCAiVBT8vHR1Oq1uy7Z9c+tYwDWImM2wBmytLT00lrqTSW5MslU6x4AYFLUQ6mdq3q93mdalwBn3rFjxzY/fuLxN5fktiQXtu4BACZEySc7qftmZ3f8ResUgLXMmA1whi0vz188rp0DSV7bugUAmBinavLh0anRjbt37368dQxwZgwGC5fXlANJfqp1CwAwMT5fS27pzfQ+UkoZt44BWOuM2QBnyTcOtg4m+cnWLQDAZCjJv45LbnWwBWvbwsLCz3emOh9I6m+1bgEAJsapmnw447yz3+9/vXUMwHphzAY4i+bn57dMTZWrUsoNSX6gdQ8AMDGGJeN93e7O+dYhwLM3Pz+/rTPdudmthQCAb1cPdcr0vtnZ2X9qXQKw3hizAc6Bhx5+6JWbTk/fmZK98bMXAHhaTcnHp8r0NTMzM8dbxwDf3eHDh6e3bN3yxlJzR5KXte4BACZDTT7VyfjqbnfnH7duAVivDCoA59BgMJitGR9MsqN1CwAwMU6k1rtXVk7eOTc3d7J1DPDtBoPBb9asHkjKL7ZuAQAmxldqctuTJ5780Nzc3Kh1DMB6ZswGOMdqrWUwGLwupb4/yatb9wAAE+OzqeXGXq/3e61DgGRxcfGiMpU7UvP61i0AwMQYleSjnc70DTMzM19qHQOwERizARo5evToi06eXLk2pVyf5PzWPQDAhCg5XFezv9/v/1XrFNiIDh87vPWCJ86/JqXz9qSe17oHAJgU9U86ZXr/7Ozs37QuAdhIjNkAjQ0Gg1fXOr4jJW9o3QIATIxxah4cjVav2bVr1xdbx8BGUGvtDAaDvSn1fUle0boHAJgY/5Babuj1eh9rHQKwERmzASbE4uLiXJnKgdT8cusWAGBClDyWcX3v1q0X3rN9+/ZTrXNgvVoYLvQ6q+VgSnqtWwCAiXEitd69bdtj77noosueah0DsFEZswEmyDffDZK7k/ry1j0AwMT4dGp5W6/X+4PWIbCeLC4uvqqUvDsle+OMBAB42jg1D9aaa/v9/hdaxwBsdC7UACbQkSNHXrL5/M3Xp9ark2xu3QMATIaafCLj7Ov3+3/bugXWsuFweMHq6um3JOXGlGxt3QMATIaaDL7xfHuxdQsATzNmA0yw5eXlnxuPVz+QkstatwAAE+N0Te6f7kzfNDMz87XWMbDWDAYLl9daPpiSH2/dAgBMjM+llhu63e4DpZTaOgaAbzJmA6wBy8sLl45rOZjkF1q3AAAT48s1edfxR4/ft2fPntXWMTDpFoYLl3zjvti7W7cAABNjJaV8cOWCldvnts890ToGgO9kzAZYI4bD4abReHRFSW5N8uLWPQDApCiPpGZfr9c70roEJtFwOPyR8Xh0S03+R5Kp1j0AwKSoh8arecuOHTsebV0CwHdnzAZYY5aWll5aS72pJFfGYRwA8B8cxsG3+pYXg96W5MLWPQDAZCjJw+NO9vVn+g+1bgHg+zNmA6xRC8OFSzrjciDJr7VuAQAmxpMp5V4fk8hGNxgsXF7TuSepP926BQCYGF+qye1u0wOwthizAda4pw/qyr1JfqJ1CwAwMf4ltbyj2+0+UEqprWPgXBkO518zGnc+UJLfbt0CAEyM0zW5P+O8s9/vf711DADPjTEbYB2Yn5/fMjVVrkrKjSnZ2roHAJgMNRmUWvb3er2F1i1wNh05cuQlm87bdEtJrkgy3boHAJgMNflEXa1X7dix4+9atwDw/BizAdaR+fn5H52a6rwnJXvjZzwA8LSamt8vpXNdt9v9t9YxcCYdPnx4esvWLW8stdye1Je37gEAJsana8lb+7P9P2wdAsALY+gAWIeWl+e749o5mKTfugUAmBgnUuvdKysn75ybmzvZOgZeqKWlpd8opR6oyS+1bgEAJkTJY7Xm1idPPPmhubm5UescAF44YzbAOlVrLYPB4A0p9b1Jfrh1DwAwIWr+MSnv6PV6H2udAs/H/Cfnf2Zq3Hl3al7fugUAmBijknx0evrUjZdc8tp/bx0DwJljzAZY544ePfqikydXrk3pvD2p57XuAQAmxp+udsb7d87s/OvWIfBsfPN5bbk+yfmtewCAieF5LcA6ZswG2CC8gwUAeAbewcLE84lDAMAz8olDABuCMRtgg3FvQQDgO7i3IBNqMBjM1owPJtnRugUAmBgnUuvdKysn75ybmzvZOgaAs8uYDbABHT58eHrL1i1vLLXcntSXt+4BACZDTT41VepbZ2d3/FHrFja2+fn5H52a6rwnJXvj7AIAeFpNze+X0rmu2+3+W+sYAM4NF4QAG9iRI0desum8TbeU5Iok0617AIBJUQ9Ndcb7Z2Z2/Z/WJWws8/PzW6amylVJuTElW1v3AACToi6ndvb1er2F1iUAnFvGbAAyHM6/ZjTufKAkv926BQCYGKdrcn/GeWe/3/966xjWv8Fg4fKacm+Sn2jdAgBMjH9JLe/odrsPlFJq6xgAzj1jNgD/4ekDxM49Sf3p1i0AwMT4fC255fhnjv/PPXv2rLaOYf1ZXp6/eFw7B5P8WusWAGBiPJlS7j391Ok7du/e/XjrGADaMWYD8G2Gw+Gm0Xh0RUluS3Jh6x4AYDKU5OFxJ/v6M/2HWrewPiwtLb20lnpTSa5MMtW6BwCYFPXQeDVv2bFjx6OtSwBoz5gNwDMaDoc/Mh6PbqnJ/4jDRQDgP9RDo+nx7+66ZNc/ty5hbfqWF0/emuTFrXsAgElRHikp+7vd7p+3LgFgchizAfieFhcXf7WUHEjJ7tYtAMDEWEkpH1y5YOX2ue1zT7SOYe1YXl64dFzLwSS/0LoFAJgYX67Ju44/evw+t7UB4D8zZgPwfdVay2AweF1S70rJj7fuAQAmxudSyw3dbveBUkptHcPkWl5e/rlxVt+fmv/eugUAmBina3L/dGf6ppmZma+1jgFgMhmzAXjWhsPhBaurp69LKdcl2dK6BwCYEDVL46m6b8fMjqXWKUyWI0eOvGTz+ZuvT61XJ9ncugcAmAw1+UTG2dfv9/+2dQsAk82YDcBztri4+KpS8u6U7I3fJQDA08apebDWXNvv97/QOoa2aq2dwWCwN6XeleSHWvcAABPj71PLW3u93h+0DgFgbTBAAPC8LQwXep3VcjAlvdYtAMCEqHkiqe/ftu2x91x00WVPtc7h3FtcXJwrUzmQml9u3QIATIiSxzKu79269cJ7tm/ffqp1DgBrhzEbgBfkW951874kr2jdAwBMjH9ILTf0er2PtQ7h3BgMBq+udXxHSt7QugUAmBjj1Dw4Gq1es2vXri+2jgFg7TFmA3BGHD52eOsFT5x/TUrn7Uk9r3UPADAp6p90yvT+2dnZv2ldwtlx9OjRF508uXJtSrk+yfmtewCACVFyuK5mf7/f/6vWKQCsXcZsAM6oxcXFi8pU7kjN61u3AAATY1SSj3Y60zfMzMx8qXUMZ0attQwGg9eljO9Oyo+17gEAJsZnU8uNvV7v91qHALD2GbMBOCuWlxcuHdfck5RfbN0CAEyMr9TktuOPHr9vz549q61jeP6WlpZmUnIwqTtbtwAAE+NEar17ZeXknXNzcydbxwCwPhizAThrDh8+PL1l65Y3lpo7krysdQ8AMCFK/q7U8Vu73Z1/3DqF5+ahhx965ebR9M01eVOSTuseAGAi1JR8fKpMXzMzM3O8dQwA64sxG4Czbn5+fltnunNzSa5MMtW6BwCYFPVQp0zvm52d/afWJXxvx44d2/z4icffXJJ3JfmB1j0AwMQYloz3dbs751uHALA+GbMBOGcWFhZ+vjNV7kny31q3AAAT41RNPpxx3tnv97/eOobvNBgsXF5TDib5ydYtAMBkKMm/jktu7c30PlJKGbfuAWD9MmYDcM5940D0QJKfat0CAEwGB6KTxwsRAYBncKomHx6dGt24e/fux1vHALD+GbMBaOJbPqrytiQXtu4BACbGsFPq/tnZHX/ROmSjcosYAOCZ1UOpnat6vd5nWpcAsHEYswFo6qGHH3rl5tH0zTV5U5JO6x4AYCLUlHx8qkxfMzMzc7x1zEYxHA43jcajK0pyS5IfbN0DAEyIkr/LuFzd6/X+V+sUADYeYzYAE2FpaWmmlnqgJLtatwAAE2Mltd61snLyzrm5uZOtY9az5eWFS8e1HEiyvXULADAxvlKT244/evy+PXv2rLaOAWBjMmYDMDFqrWUwGLwuZXx3Un6sdQ8AMDE+m1pu7PV6v9c6ZL1ZWlr62ZTx+5PyO61bAICJcbom95+36bybL7744q+2jgFgYzNmAzBxhsPhBaurp69LKdcnOb91DwAwGUryv2st+3u93tHWLWvdI4888oOnRqfenpr9ST2vdQ8AMBlq8olOOvu73e6x1i0AkBizAZhgg8Hg1bWO70jJG1q3AAATY5yaB0ej1Wt27dr1xdYxa02ttTMYDPam1PcleUXrHgBgYvx9anlbr9c71DoEAL6VMRuAibewvPDrnafv4fgrrVsAgInx1dR657Ztjx246KLLnmodsxYMBvP/taZzIMl/ad0CAEwMz6kAmGjGbADWhG95F9FdSX6odQ8AMDG8i+j7WFxcfFUpeXdK9sY5AADwtHFqHqw11/b7/S+0jgGA78ZFLABryjfv71ivTrK5dQ8AMBnc3/E7DYfDC1ZXT1+XUq5LsqV1DwAwKcqfpWZfr9c72roEAL4fYzYAa9LS0tLPpozfn5Tfad0CAEyM0zW5f7ozfdPMzMzXWse0Umstg8HgdUm9KyU/3roHAJgYn0stN3S73QdKKbV1DAA8G8ZsANa05eWFS8dP3097e+sWAGBifLkm7zr+6PH79uzZs9o65lxaXFz81XRysCS7WrcAABNjJbXetbpa37tz584nW8cAwHNhzAZgzRsOh5tG49EVJbk1yYtb9wAAk6I8UlL2d7vdP29dcrYNh8MfGY9Ht9TkTUk6rXsAgIlQU/Lx0dTqtbsu2fXPrWMA4PkwZgOwbiwtLb20lnpTSa5MMtW6BwCYFPVQaueqXq/3mdYlZ9qxY8c2P37i8TeX5LYkF7buAQAmRMknO6n7Zmd3/EXrFAB4IYzZAKw7y8vzF49r50CS17ZuAQAmxpMp5d7TT52+Y/fu3Y+3jjkTBoOFy2vKgSQ/1boFAJgYn68lt/Rmeh8ppYxbxwDAC2XMBmDd+sYB78EkP9m6BQCYDCX511rL/6fb7T5QSqmte56P4XD+NavjqXuS+lutWwCAiXGqJh/OOO/s9/tfbx0DAGeKMRuAdW1+fn7L1FS5KqXckOQHWvcAAJOiLqd29vV6vYXWJc/W/Pz8ts505+aSXJFkunUPADAp6qFOmd43Ozv7T61LAOBMM2YDsCE89PBDr9x0evrOlOyN338AwNNqSj5eaudt3W73s61jvpvDhw9Pb9m65Y2l5o4kL2vdAwBMhpp8qpPx1d3uzj9u3QIAZ4vDfAA2lMFgMFszPphkR+sWAGBinEitd6+snLxzbm7uZOuYbzUYDH6zZvVAUn6xdQsAMDG+UpPbnjzx5Ifm5uZGrWMA4GwyZgOw4dRay2AweF1KfX+SV7fuAQAmxmdTy429Xu/3WofMf3L+Z6bGnXen5vWtWwCAiTEqyUc7nekbZmZmvtQ6BgDOBWM2ABvW0aNHX3Ty5Mq1KeX6JOe37gEAJkTJ4bqa/f1+/6/O9bf+5vOTztuTel7rvwoAYFLUP+mU6f2zs7N/07oEAM4lYzYAG95gMHh1reM7UvKG1i0AwMQYp+bBTZtOve2SS17772f7m9VaO4PBYG9KfV+SV7R+8ADAxPiH1HJDr9f7WOsQAGjBmA0A37C4uDhXpnIgNb/cugUAmBAlj2Vc37t164X3bN++/dTZ+BbLy/Pdce0cTNJv/XABgAlR80RS379t22Pvueiiy55qnQMArRizAeBbfPNdUbk7qS9v3QMATIxP15K39mf7f3imvuD8/PyPTk113pOSvXF9DgA8bZyaB2vNtf1+/wutYwCgNRfLAPAMjhw58pLN52++PrVenWRz6x4AYDLU5BMZZ1+/3//b5/s1hsPhBaurp9+SlBtTsrX1YwIAJkNNBt94nrHYugUAJoUxGwC+h+Xl5Z8bj1c/kJLLWrcAABPjdE3un+5M3zQzM/O15/IHB4OFy2vKvUl+ovWDAAAmxudSyw3dbveBUkptHQMAk8SYDQDPwvLywqXjWg4m+YXWLQDAxPhyTd51/NHj9+3Zs2f1e/2HC8OFSzrjciDJr7WOBgAmxkpK+eDKBSu3z22fe6J1DABMImM2ADxLw+Fw02g8uqIktyZ5ceseAGAylOThWsv+Xq935D//u+Fw+LLRePTOklyZZKp1KwAwKeqh8WresmPHjkdblwDAJDNmA8BztLS09NJa6k0OpQGAb/fNQ+lveRHcbUkubF0GAEyGkjw87mRff6b/UOsWAFgLjNkA8DwtLi7+ajo5WJJdrVsAgImxUpL/b635nZT8TOsYAGBi/FtN3tGb7f3/Sinj1jEAsFYYswHgBRoMFi6vKfcm+YnWLQAAAMBEOV2T+zPOO/v9/tdbxwDAWmPMBoAzYH5+fsvUVLkqKTemZGvrHgAAAKCtmnyirtarduzY8XetWwBgrTJmA8AZND8//6NTU533pGRv/J4FAACAjejTnVKvnp3d8UetQwBgrXPIDgBnwfLyfHdcOweT9Fu3AAAAAOdAyWO15tYnTzz5obm5uVHrHABYD4zZAHCW1FrLYDB4Q0p9b5Ifbt0DAAAAnBWjknx0evrUjZdc8tp/bx0DAOuJMRsAzrKjR4++6OTJlWtTOm9P6nmtewAAAIAz5k9XO+P9O2d2/nXrEABYj4zZAHCOzH9y/memxp13p+b1rVsAAACAF6DmH5Pyjl6v97HWKQCwnhmzAeAcW1pa+o1S6oGa/FLrFgAAAOA5OZFa715ZOXnn3NzcydYxALDeGbMBoIHDhw9Pb9m65Y2lltuT+vLWPQAAAMD3VFPz+6V0rut2u//WOgYANgpjNgA0dOTIkZdsOm/TLSW5Isl06x4AAADgP6vLqZ19vV5voXUJAGw0xmwAmADD4fxrRuPOB0ry261bAAAAgCTJv6SWd3S73QdKKbV1DABsRMZsAJggg8HC5TWde5L6061bAAAAYIN6MqXce/qp03fs3r378dYxALCRGbMBYMIMh8NNo/HoipLcluTC1j0AAACwcdRD49W8ZceOHY+2LgEAjNkAMLGGw+GPjMejW2ryP5JMte4BAACA9as8UlL2d7vdP29dAgB8kzEbACbc4uLir5aSAynZ3boFAAAA1pkv1+Rdxx89ft+ePXtWW8cAAN/OmA0Aa0CttQwGg9cl9a6U/HjrHgAAAFjjTtfk/unO9E0zMzNfax0DADwzYzYArCHD4fCC1dXTb0nKjSnZ2roHAAAA1pqafCLj7Ov3+3/bugUA+N6M2QCwBi0uLr6qlLw7JXvj9zkAAAA8G3+fWt7a6/X+oHUIAPDsOPwGgDVsYbjQ66yWgynptW4BAACAiVTyWMb1vVu3XnjP9u3bT7XOAQCePWM2AKxxtdbOYDDYm1Lfl+QVrXsAAABgQoxT8+BotHrNrl27vtg6BgB47ozZALBOHD52eOsFT5x/TUrn7Uk9r3UPAAAANFNyuK5mf7/f/6vWKQDA82fMBoB1ZnFx8aIylTtS8/rWLQAAAHCOfTa13Njr9X6vdQgA8MIZswFgnRoMBr9Zs3ogKb/YugUAAADOshOp9e6VlZN3zs3NnWwdAwCcGcZsAFjHDh8+PL1l65Y3lpo7krysdQ8AAACcYTUlH58q09fMzMwcbx0DAJxZxmwA2ADm5+e3daY7N5fkyiRTrXsAAADgDBiWjPd1uzvnW4cAAGeHMRsANpCFhYWf70yVe5L8t9YtAAAA8HyU5F/HJbf2ZnofKaWMW/cAAGePMRsANqDBYOHymnIgyU+1bgEAAIBn6VRNPjw6Nbpx9+7dj7eOAQDOPmM2AGxQx44d2/z4icffXJLbklzYugcAAAC+u3ootXNVr9f7TOsSAODcMWYDwAb30MMPvXLzaPrmmrwpSad1DwAAAPyHkr/LuFzd6/X+V+sUAODcM2YDAEmSpaWlmVrqgZLsat0CAADAhveVmtx2/NHj9+3Zs2e1dQwA0IYxGwD4D7XWMhgMXpcyvjspP9a6BwAAgA3ndE3uP2/TeTdffPHFX20dAwC0ZcwGAL7DcDi8YHX19HUp5fok57fuAQAAYP2rySc66ezvdrvHWrcAAJPBmA0AfFeDweDVtY7vSMkbWrcAAACwbv19anlbr9c71DoEAJgsxmwA4PtaWF749U4tB5L8SusWAAAA1o2vptY7t2177MBFF132VOsYAGDyGLMBgGel1toZDAZ7U+pdSX6odQ8AAABr1jg1D9aaa/v9/hdaxwAAk8uYDQA8J4888sgPnhqdentq9if1vNY9AAAArCXlz1Kzr9frHW1dAgBMPmM2APC8LC0t/WzK+P1J+Z3WLQAAAEy8z6WWG7rd7gOllNo6BgBYG4zZAMALsry8cOn46ftpb2/dAgAAwMRZSa13raycvHNubu5k6xgAYG0xZgMAL9hwONw0Go+uKMmtSV7cugcAAIDmako+PppavXbXJbv+uXUMALA2GbMBgDNmaWnppbXUm0pyZZKp1j0AAAA0UPLJTuq+2dkdf9E6BQBY24zZAMAZt7w8f/G4dg4keW3rFgAAAM6Zz9eSW3ozvY+UUsatYwCAtc+YDQCcNYPBwuU15WCSn2zdAgAAwFlzqiYfzjjv7Pf7X28dAwCsH8ZsAOCsmp+f3zI1Va5KKTck+YHWPQAAAJxJ9VCnTO+bnZ39p9YlAMD6Y8wGAM6Jhx5+6JWbR9M31+RNSTqtewAAAHj+avKpTsZXd7s7/7h1CwCwfhmzAYBzajAYzNbUA0nd2boFAACA5+wrNbntyRNPfmhubm7UOgYAWN+M2QDAOVdrLYPB4HUp9f1JXt26BwAAgO9rVJKPdjrTN8zMzHypdQwAsDEYswGAZo4ePfqikydXrk0p1yc5v3UPAAAAz6T+SadM75+dnf2b1iUAwMZizAYAmhsMBq+udXxHSt7QugUAAID/8A+p5YZer/ex1iEAwMZkzAYAJsbi4uJcmcqB1Pxy6xYAAIANq+aJpL5/27bH3nPRRZc91ToHANi4jNkAwESptXYGg8HelHpXkh9q3QMAALCBjFPzYK25tt/vf6F1DACAMRsAmEhHjhx5yebzN1+fWq9Osrl1DwAAwLpWs1Rr9vf7/cXWKQAA/5cxGwCYaMvLyz83Hq9+ICWXtW4BAABYhz6XWm7odrsPlFJq6xgAgG9lzAYA1oTl5YVLx7UcTPILrVsAAADWgZWU8sGVC1Zun9s+90TrGACAZ2LMBgDWjOFwuGk0Hl1RkluTvLh1DwAAwNpUD42mx7+765Jd/9y6BADgezFmAwBrztLS0ktrqTeV5MokU617AAAA1oKSPDzuZF9/pv9Q6xYAgGfDmA0ArFkLw4VLOuNyIMmvtW4BAACYYF+qye3HHz1+3549e1ZbxwAAPFvGbABgzRsMFi6vKfcm+YnWLQAAABPkdE3uzzjv7Pf7X28dAwDwXBmzAYB1YX5+fsvUVLkqKTemZGvrHgAAgLbqoanOeP/MzK7/07oEAOD5MmYDAOvK/Pz8j05Ndd6Tkr3xXAcAANh4Pt0p9erZ2R1/1DoEAOCFcsALAKxLy8vz3XHtHEzSb90CAABw1pU8VmtuffLEkx+am5sbtc4BADgTjNkAwLpVay2DweANKfW9SX64dQ8AAMBZMCrJR6enT914ySWv/ffWMQAAZ5IxGwBY944ePfqikydXrk3pvD2p57XuAQAAOEP+dLUz3r9zZudftw4BADgbjNkAwIYx/8n5n5kad96dmte3bgEAAHjeav4xKe/o9Xofa50CAHA2GbMBgA1naWnpN0qpB2ryS61bAAAAnoMTqfXulZWTd87NzZ1sHQMAcLYZswGADenw4cPTW7ZueWOp5fakvrx1DwAAwPdQU/P7pXSu63a7/9Y6BgDgXDFmAwAb2pEjR16y6bxNt5TkiiTTrXsAAAC+XV1O7ezr9XoLrUsAAM41YzYAQJLhcP41o3HnAyX57dYtAAAASf4ltbyj2+0+UEqprWMAAFowZgMAfIvBYOHyms49Sf3p1i0AAMCG9GRKuXflgpXb57bPPdE6BgCgJWM2AMB/MhwON43GoytKcluSC1v3AAAAG0U9NF7NW3bs2PFo6xIAgElgzAYA+C6Gw+GPjMejW2ryP5JMte4BAADWq/JIavb1er0jrUsAACaJMRsA4PtYGC5c0lktB1Oyu3ULAACwrny5Ju86/ujx+/bs2bPaOgYAYNIYswEAnoVaaxkMBq9L6l0p+fHWPQAAwJp2uib3T3emb5qZmfla6xgAgEllzAYAeA6Gw+EFq6un35KUG1OytXUPAACwttTkExlnX7/f/9vWLQAAk86YDQDwPCwuLr6qlLw7JXvjORUAAPD9fTq1vK3X6/1B6xAAgLXCwSsAwAuwMFzofeN+2r3WLQAAwAQqeSzj+t6tWy+8Z/v27ada5wAArCXGbACAF6jW2hkMBntT6vuSvKJ1DwAAMBHGqXlwNFq9ZteuXV9sHQMAsBYZswEAzpDDxw5vveCJ869J6bw9qee17gEAABopOVxXs7/f7/9V6xQAgLXMmA0AcIYtLi5eVKZyR2pe37oFAAA4pz6bWm7s9Xq/1zoEAGA9MGYDAJwlg8HgN2tWDyTlF1u3AAAAZ9WJ1Hr3ysrJO+fm5k62jgEAWC+M2QAAZ9Hhw4ent2zd8sZSc0eSl7XuAQAAzqiako9PlelrZmZmjreOAQBYb4zZAADnwPz8/LbOdOfmklyZZKp1DwAA8ELV5ZK6v9vdOd+6BABgvTJmAwCcQwsLCz/fmep8IKm/1boFAAB47kryr+OSW3szvY+UUsatewAA1jNjNgBAA4PBwuU15UCSn2rdAgAAPCunavLh0anRjbt37368dQwAwEZgzAYAaOTYsWObHz/x+JtLcluSC1v3AAAA3009lNq5qtfrfaZ1CQDARmLMBgBobDgc/sh4PLqlJm9K0mndAwAA/Ie/LBnv73Z3/lnrEACAjciYDQAwIZaWlmZqqQdKsqt1CwAAbHBfqcltxx89ft+ePXtWW8cAAGxUxmwAgAlSay2DweB1KeO7k/JjrXsAAGCDOV2T+8/bdN7NF1988VdbxwAAbHTGbACACTQcDi9YXT19XUq5Psn5rXsAAGC9q8knOuns73a7x1q3AADwNGM2AMAEGwwGr651fEdK9sZzNwAAOBv+PrW8rdfrHWodAgDAt3MgCgCwBiwsL/x6p5YDSX6ldQsAAKwTX02td27b9tiBiy667KnWMQAAfCdjNgDAGlFr7QwGg70p9a4kP9S6BwAA1qhxah4cjVav2bVr1xdbxwAA8N0ZswEA1phHHnnkB0+NTr09NfuTel7rHgAAWDvKn6VmX6/XO9q6BACA78+YDQCwRi0tLf1syvj9Sfmd1i0AADDhPpdabuh2uw+UUmrrGAAAnh1jNgDAGre8vHDp+On7aW9v3QIAABNmJbXetbJy8s65ubmTrWMAAHhujNkAAOvAcDjcNBqPrijJrUle3LoHAAAaqyn5+Ghq9dpdl+z659YxAAA8P8ZsAIB1ZGlp6aW11JtKcmWSqdY9AABwzpV8spO6b3Z2x1+0TgEA4IUxZgMArEODweC/1IwPJnlt6xYAADhHPl9LbunN9D5SShm3jgEA4IUzZgMArGODwcLlNeVgkp9s3QIAAGfJqZp8OOO8s9/vf711DAAAZ44xGwBgnZufn98yNVWuSik3JPmB1j0AAHDm1EOdMr1vdnb2n1qXAABw5hmzAQA2iIcefuiVm0fTN9fkTUk6rXsAAOD5qsmnOhlf3e3u/OPWLQAAnD3GbACADWYwGMzW1ANJ3dm6BQAAnqOv1OS2J088+aG5ublR6xgAAM4uYzYAwAZUay2DweB1KfX9SV7dugcAAL6PUUk+2ulM3zAzM/Ol1jEAAJwbxmwAgA3s6NGjLzp5cuXalHJ9kvNb9wAAwHeqf9Ip0/tnZ2f/pnUJAADnljEbAIAMBoNX1zq+IyVvaN0CAADf8A+p5YZer/ex1iEAALRhzAYA4D8sLi7OlakcSM0vt24BAGCDqnkiqe/ftu2x91x00WVPtc4BAKAdYzYAAN+m1toZDAZ7U+pdSX6odQ8AABvGODUP1ppr+/3+F1rHAADQnjEbAIBndOTIkZdsPn/z9an16iSbW/cAALCO1SyNp+q+HTM7llqnAAAwOYzZAAB8T8vLyz83Hq9+ICWXtW4BAGDd+VxquaHb7T5QSqmtYwAAmCzGbAAAnpXl5YVLx7UcTPILrVsAAFjzVlLKB1cuWLl9bvvcE61jAACYTMZsAACeteFwuGk0Hl1RkluTvLh1DwAAa1E9NJoe/+6uS3b9c+sSAAAmmzEbAIDnbGlp6aW11JtKcmWSqdY9AABMvpI8PO5kX3+m/1DrFgAA1gZjNgAAz9vCcOGSzrgcSPJrrVsAAJhYX6rJ7ccfPX7fnj17VlvHAACwdhizAQB4wQaDhctryr1JfqJ1CwAAE+N0Te7POO/s9/tfbx0DAMDaY8wGAOCMmJ+f3zI1Va5Kyo0p2dq6BwCAluqhqc54/8zMrv/TugQAgLXLmA0AwBk1Pz//o1NTnfekZG883wQA2Gg+3Sn16tnZHX/UOgQAgLXP4SIAAGfF8vJ8d1w7B5LsaN0CAMBZVvJYrbn1yRNPfmhubm7UOgcAgPXBmA0AwFlTay2DweANKfW9SX64dQ8AAGfcqCQfnZ4+deMll7z231vHAACwvhizAQA4644ePfqikydXrk3pvD2p57XuAQDgjPjT1c54/86ZnX/dOgQAgPXJmA0AwDkz/8n5n5kad96dmte3bgEA4Hmq+cekvKPX632sdQoAAOubMRsAgHNuaWnpN0qpB2ryS61bAAB41k6k1rtXVk7eOTc3d7J1DAAA658xGwCAJg4fPjy9ZeuWN5Zabk/qy1v3AADwXdXU/H4pneu63e6/tY4BAGDjMGYDANDUkSNHXrLpvE23lOSKJNOtewAA+FZ1ObWzr9frLbQuAQBg4zFmAwAwEYbD+deMxp0PlOS3W7cAAJB/SS3v6Ha7D5RSausYAAA2JmM2AAATZTBYuLymc09Sf7p1CwDABvRkSrl35YKV2+e2zz3ROgYAgI3NmA0AwMQZDoebRuPRFSW5LcmFrXsAADaGemi8mrfs2LHj0dYlAACQGLMBAJhgw+HwR8bj0S01+R9Jplr3AACsT+WR1Ozr9XpHWpcAAMC3MmYDADDxFoYLl3RWy8GU7G7dAgCwjny5Ju86/ujx+/bs2bPaOgYAAP4zYzYAAGvGYLBwea3lgyn58dYtAABr2Oma3D/dmb5pZmbma61jAADguzFmAwCwpgyHwwtWV0+/JSk3pmRr6x4AgLWkJp/IOPv6/f7ftm4BAIDvx5gNAMCatLi4+KpS8u6U7I3ntQAA38+na8lb+7P9P2wdAgAAz5ZDPwAA1rSF4ULvG/fT7rVuAQCYOCWPZVzfu3Xrhfds3779VOscAAB4LozZAACsebXWzmAw2JtS35fkFa17AAAmwDg1D45Gq9fs2rXri61jAADg+TBmAwCwbhw+dnjrBU+cf01K5+1JPa91DwBAEyWH62r29/v9v2qdAgAAL4QxGwCAdWdxcfGiMpU7UvP61i0AAOfQZ1PLjb1e7/dahwAAwJlgzAYAYN0aDAa/WbN6ICm/2LoFAOAsOpFa715ZOXnn3NzcydYxAABwphizAQBY1w4fPjy9ZeuWN5aaO5K8rHUPAMAZVFPy8akyfc3MzMzx1jEAAHCmGbMBANgQ5ufnt3WmOzeX5Iok0617AABemLpcUvd3uzvnW5cAAMDZYswGAGBDGQ7nX7M6nronqb/VugUA4Lkqyb+OS27tzfQ+UkoZt+4BAICzyZgNAMCGNBgsXF5TDiT5qdYtAADPwqmafHh0anTj7t27H28dAwAA54IxGwCADevYsWObHz/x+JtLcluSC1v3AAA8s3ootXNVr9f7TOsSAAA4l4zZAABseMPh8EfG49EtNXlTkk7rHgCAb/jLkvH+bnfnn7UOAQCAFozZAADwDUtLSzO11AMl2dW6BQDY0L5Sk9uOP3r8vj179qy2jgEAgFaM2QAA8C1qrWUwGLwuZXx3Un6sdQ8AsKGcrsn952067+aLL774q61jAACgNWM2AAA8g+FweMHq6unrUsr1Sc5v3QMArG81+UQnnf3dbvdY6xYAAJgUxmwAAPgeFhcXX1VK3p2SvfH8GQA48/4+tbyt1+sdah0CAACTxmEcAAA8CwvLC7/eqeVAkl9p3QIArAtfTa13btv22IGLLrrsqdYxAAAwiYzZAADwLNVaO4PBYG9KvSvJD7XuAQDWpHFqHhyNVq/ZtWvXF1vHAADAJDNmAwDAc/TII4/84KnRqbenZn9Sz2vdAwCsDSX537WW/b1e72jrFgAAWAuM2QAA8DwtLS39bMr4/Un5ndYtAMBE+1xquaHb7T5QSqmtYwAAYK0wZgMAwAu0vLxw6fjp+2lvb90CAEyUldR618rKyTvn5uZOto4BAIC1xpgNAABnwHA43DQaj64oyS1JfrB1DwDQVE3Jx6fK9DUzMzPHW8cAAMBaZcwGAIAzaH5+fltnunNzSa5MMtW6BwA4x0o+2UndNzu74y9apwAAwFpnzAYAgLNgMBj8l5p6IKn/tXULAHBOfL6W3NKb6X2klDJuHQMAAOuBMRsAAM6iwWDh8ppyMMlPtm4BAM6KUzX5cMZ5Z7/f/3rrGAAAWE+M2QAAcJYdO3Zs8+MnHn9zSd6V5Ada9wAAZ0o91CnT+2ZnZ/+pdQkAAKxHxmwAADhHHnr4oVduHk3fXJM3Jem07gEAnp+afKqT8dXd7s4/bt0CAADrmTEbAADOscFgMPuN+2nvbN0CADwnX6nJbU+eePJDc3Nzo9YxAACw3hmzAQCggVprGQwGr0sZ352UH2vdAwB8T6OSfLTTmb5hZmbmS61jAABgozBmAwBAQ0ePHn3RyZMr16aU65Oc37oHAPjP6p90yvT+2dnZv2ldAgAAG40xGwAAJsBgMHh1reM7UvKG1i0AQJLkH1LLDb1e72OtQwAAYKMyZgMAwARZXFycK1M5kJpfbt0CABtSzRNJff+2bY+956KLLnuqdQ4AAGxkxmwAAJgwtdbOYDDYm1LvSvJDrXsAYIMYp+bBWnNtv9//QusYAADAmA0AABPryJEjL9l8/ubrU+vVSTa37gGAdatmaTxV9+2Y2bHUOgUAAPgmYzYAAEy45eXlnxuPVz+QkstatwDAOvO51HJDt9t9oJRSW8cAAADfzpgNAABrxPLywqXjWg4m+YXWLQCwxq2klA+uXLBy+9z2uSdaxwAAAM/MmA0AAGvIcDjcNBqPrijJrUle3LoHANaeemg0Pf7dXZfs+ufWJQAAwPdmzAYAgDVoaWnppbXUm0pyZZKp1j0AMOlK8vC4k339mf5DrVsAAIBnx5gNAABr2PLy/MXj2jmY5NdatwDAhPp8Lbnl+GeO/889e/asto4BAACePWM2AACsA4PBwuU15d4kP9G6BQAmxOma3J9x3tnv97/eOgYAAHjujNkAALBOzM/Pb5maKlcl5caUbG3dAwDt1ENTnfH+mZld/6d1CQAA8PwZswEAYJ2Zn5//0ampzntSsjee8wOwgdTkU1OlvnV2dscftW4BAABeOAdbAACwTi0vz3fHtXMgyY7WLQBwVpU8VmtuffLEkx+am5sbtc4BAADODGM2AACsY7XWMhgM3pBS35vkh1v3AMAZNirJR6enT914ySWv/ffWMQAAwJllzAYAgA3g6NGjLzp5cuXalHJ9kvNb9wDAGfCnq53x/p0zO/+6dQgAAHB2GLMBAGADmf/k/M9MjTvvTs3rW7cAwPNS849JeUev1/tY6xQAAODsMmYDAMAGtLS09Bul1AM1+aXWLQDwLJ1IrXevrJy8c25u7mTrGAAA4OwzZgMAwAZ1+PDh6S1bt7yx1HJ7Ul/eugcAvouamt8vpXNdt9v9t9YxAADAuWPMBgCADe7IkSMv2XTepltKckWS6dY9APB/1WRQatnf6/UWWrcAAADnnjEbAABIkgyH868ZjTsfKMlvt24BYMP7l9Tyjm63+0AppbaOAQAA2jBmAwAA32YwWLi8pnNPUn+6dQsAG86TKeXelQtWbp/bPvdE6xgAAKAtYzYAAPAdhsPhptF4dEVJbktyYeseADaCemi8mrfs2LHj0dYlAADAZDBmAwAA39VwOHzZaDx6Z0muTDLVugeA9ag8kpp9vV7vSOsSAABgshizAQCA72thuHBJZ7UcTMnu1i0ArBtfrsm7jj96/L49e/asto4BAAAmjzEbAAB41gaDhctrLR9MyY+3bgFgzTpdk/unO9M3zczMfK11DAAAMLmM2QAAwHMyHA4vWF09/Zak3JiSra17AFg7avKJjLOv3+//besWAABg8hmzAQCA52VxcfFVpeTdKdkb1xYAfG+friVv7c/2/7B1CAAAsHY4cAIAAF6QheFC7xv30+61bgFgwpQ8lnF979atF96zffv2U61zAACAtcWYDQAAvGC11s5gMNibUt+X5BWtewBobpyaB0ej1Wt27dr1xdYxAADA2mTMBgAAzpjDxw5vveCJ869J6bw9qee17gGggZLDdTX7+/3+X7VOAQAA1jZjNgAAcMYtLi5eVKZyR2pe37oFgHPms6nlxl6v93utQwAAgPXBmA0AAJw1g8HgN2tWDyTlF1u3AHDWnEitd6+snLxzbm7uZOsYAABg/TBmAwAAZ9Xhw4ent2zd8sZSc0eSl7XuAeCMqSn5+FSZvmZmZuZ46xgAAGD9MWYDAADnxPz8/LbOdOfmklyRZLp1DwAvRF0uqfu73Z3zrUsAAID1y5gNAACcU8Ph/GtWx1P3JPW3WrcA8NyU5F/HJbf2ZnofKaWMW/cAAADrmzEbAABoYjBYuLymHEjyU61bAPi+TtXkw6NToxt37979eOsYAABgYzBmAwAAzRw7dmzz4ycef3NJbktyYeseAJ5JPZTauarX632mdQkAALCxGLMBAIDmhsPhj4zHo1tq8qYkndY9ACRJ/rKks6/b7f556xAAAGBjMmYDAAATY3Fx8VfTycGS7GrdArCBfaUmtx1/9Ph9e/bsWW0dAwAAbFzGbAAAYKLUWstgMHhdUu9KyY+37gHYQE7X5P7zNp1388UXX/zV1jEAAADGbAAAYCINh8MLVldPX5dSrk9yfusegPWsJp/opLO/2+0ea90CAADwfxmzAQCAiba4uPiqUvLulOyNaxiAM+3vU8vber3eodYhAAAA/5mDIAAAYE1YWF749U4tB5L8SusWgHXgq6n1zm3bHjtw0UWXPdU6BgAA4JkYswEAgDWj1toZDAZ7U+pdSX6odQ/AGjROzYOj0eo1u3bt+mLrGAAAgO/FmA0AAKw5jzzyyA+eGp16e2r2J/W81j0Aa0FJ/netZX+v1zvaugUAAODZMGYDAABr1tLS0s+mjN+flN9p3QIwwT6XWm7odrsPlFJq6xgAAIBny5gNAACsecvLC5eOn76f9vbWLQATZCW13rWycvLOubm5k61jAAAAnitjNgAAsC4Mh8NNo/HoipLckuQHW/cANFRT8vGpMn3NzMzM8dYxAAAAz5cxGwAAWFfm5+e3daY7N5fkyiRTrXsAzrFhp9T9s7M7/qJ1CAAAwAtlzAYAANalwWDwX2rqgaT+19YtAOfA52vJLb2Z3kdKKePWMQAAAGeCMRsAAFjXBoOFy2vKwSQ/2boF4Cw4VZMPZ5x39vv9r7eOAQAAOJOM2QAAwLp37NixzY+fePzNJXlXkh9o3QNwZtRDnTK9b3Z29p9alwAAAJwNxmwAAGDDeOjhh165eTR9c03elKTTugfg+ajJpzoZX93t7vzj1i0AAABnkzEbAADYcAaDwew37qe9s3ULwHPwlZrc9uSJJz80Nzc3ah0DAABwthmzAQCADanWWgaDwetSxncn5cda9wB8D6OSfLTTmb5hZmbmS61jAAAAzhVjNgAAsKEdPXr0RSdPrlybUq5Pcn7rHoBvV/+kU6b3z87O/k3rEgAAgHPNmA0AAJBkMBi8utbxHSl5Q+sWgCT/kFpu6PV6H2sdAgAA0IoxGwAA4FssLi7OlakcSM0vt24BNqCaJ5L6/m3bHnvPRRdd9lTrHAAAgJaM2QAAAP9JrbUzGAz2ptS7kvxQ6x5gQxin5sFac22/3/9C6xgAAIBJYMwGAAD4Lo4cOfKSzedvvj61Xp1kc+seYJ2qWRpP1X07ZnYstU4BAACYJMZsAACA72N5efnnxll9f2r+e+sWYF35XGq5odvtPlBKqa1jAAAAJo0xGwAA4FlaXl64dFzLwSS/0LoFWNNWUsoHVy5YuX1u+9wTrWMAAAAmlTEbAADgORgOh5tG49EVJbk1yYtb9wBrTT00mh7/7q5Ldv1z6xIAAIBJZ8wGAAB4HpaWll5aS72pJFcmmWrdA0y2kjw87mRff6b/UOsWAACAtcKYDQAA8AIsL89fPK6dg0l+rXULMJE+X0tuOf6Z4/9zz549q61jAAAA1hJjNgAAwBkwGCxcXlPuTfITrVuAiXC6JvdnnHf2+/2vt44BAABYi4zZAAAAZ8j8/PyWqalyVVJuTMnW1j1AK/XQVGe8f2Zm1/9pXQIAALCWGbMBAADOsPn5+R+dmuq8JyV747oLNoyafGqq1LfOzu74o9YtAAAA64FDFQAAgLNkMBjM1owPJtnRugU4i0oeqzW3PnniyQ/Nzc2NWucAAACsF8ZsAACAs6jWWgaDwRtS6nuT/HDrHuCMGpXko9PTp2685JLX/nvrGAAAgPXGmA0AAHAOHD169EUnT65cm1KuT3J+6x7gBfvT1c54/86ZnX/dOgQAAGC9MmYDAACcQ/OfnP+ZqXHn3al5fesW4Hmo+cekvKPX632sdQoAAMB6Z8wGAABoYGlp6TdKqQdq8kutW4Bn5URqvXvbtsfec9FFlz3VOgYAAGAjMGYDAAA0cvjw4ektW7e8sdRye1Jf3roHeEY1Nb9fSue6brf7b61jAAAANhJjNgAAQGNHjhx5yabzNt1SkiuSTLfuAZ5Wk0HG2dfv9xdbtwAAAGxExmwAAIAJsby8/HOrdfWekvx26xbY4P4ltbyj2+0+UEqprWMAAAA2KmM2AADAhBkMFi6v6dyT1J9u3QIbzJMp5d6VC1Zun9s+90TrGAAAgI3OmA0AADCBhsPhptF4dEVJbktyYeseWP/qofFq3rJjx45HW5cAAADwNGM2AADABBsOhy8bjUfvLMmVSaZa98B6U5KHay37e73ekdYtAAAAfDtjNgAAwBqwMFy4pLNaDqZkd+sWWCe+XJN3HX/0+H179uxZbR0DAADAdzJmAwAArCGDwcLltZYPpuTHW7fAGnW6JvdPd6ZvmpmZ+VrrGAAAAL47YzYAAMAaMxwOL1hdPf2WpNyYkq2te2CtqMknMs6+fr//t61bAAAA+P6M2QAAAGvU4uLiq0rJu1OyN67v4Hv5dC15a3+2/4etQwAAAHj2HHYAAACscQvDhV5nXA4k6bdugYlS8ljG9b1bt154z/bt20+1zgEAAOC5MWYDAACsA7XWzmAw2JtS35fkFa17oLFxah4cjVav2bVr1xdbxwAAAPD8GLMBAADWkcPHDm+94Inzr0npvD2p57XugXOu5HBdzf5+v/9XrVMAAAB4YYzZAAAA69Di4uJFZSp3pOb1rVvgHPlsarmx1+v9XusQAAAAzgxjNgAAwDo2GAx+s2b1QFJ+sXULnCUnUuvdKysn75ybmzvZOgYAAIAzx5gNAACwzh0+fHh6y9Ytbyw1dyR5WeseOENqSj5eaudt3W73s61jAAAAOPOM2QAAABvE/Pz8ts505+aSXJFkunUPPH91uaTu73Z3zrcuAQAA4OwxZgMAAGwww+H8a1bHU/ck9bdat8BzUZJ/HZfc2pvpfaSUMm7dAwAAwNllzAYAANigBoOFy2vKgSQ/1boFvo8nU8q9p586fcfu3bsfbx0DAADAuWHMBgAA2MCOHTu2+fETj7+5JLclubB1D3yneii1c1Wv1/tM6xIAAADOLWM2AAAAGQ6HPzIej26pyZuSdFr3QJK/LOns63a7f946BAAAgDaM2QAAAPyHxcXFX00nB0uyq3ULG9aXa/Ku448ev2/Pnj2rrWMAAABox5gNAADAt6m1lsFg8Lqk3pWSH2/dw4Zxuib3T3emb5qZmfla6xgAAADaM2YDAADwjIbD4QWrq6evSynXJzm/dQ/rV00+0Ulnf7fbPda6BQAAgMlhzAYAAOB7WlxcfFUpeXdK9sZ1JGfW36eWt/V6vUOtQwAAAJg8DiEAAAB4VgaD+f9a0zmY5Fdat7DmfTW13rlt22MHLrrosqdaxwAAADCZjNkAAAA8a7XWzmAw2JtS35fkFa17WHPGqXlwNFq9ZteuXV9sHQMAAMBkM2YDAADwnD3yyCM/eGp06u2p2Z/U81r3MPlK8r9rLft7vd7R1i0AAACsDcZsAAAAnrelpaWfTRm/Pym/07qFifXZ1HJjt9t9oJRSW8cAAACwdhizAQAAeMGWlxcuHddyIMn21i1MjJXUetfKysk75+bmTraOAQAAYO0xZgMAAHBGDIfDTaPx6IqS3JLkB1v30ExNycenyvQ1MzMzx1vHAAAAsHYZswEAADij5ufnt3WmOzeX5MokU617OKeGnVL3z87u+IvWIQAAAKx9xmwAAADOioWFhZ/vTJV7kvy31i2cdZ+vJbf0ZnofKaWMW8cAAACwPhizAQAAOKsGg4XLa8rBJD/ZuoUz7lRNPpxx3tnv97/eOgYAAID1xZgNAADAWXfs2LHNj594/M0leVeSH2jdw5lQD3XK9L7Z2dl/al0CAADA+mTMBgAA4Jx56OGHXrl5NH1zTd6UpNO6h+eh5O9KHb+12935x61TAAAAWN+M2QAAAJxzS0tLMyk5mNSdrVt41r5Sk9uOP3r8vj179qy2jgEAAGD9M2YDAADQRK21DAaD16WM707Kj7Xu4bsaleSjnc70DTMzM19qHQMAAMDGYcwGAACgqaNHj77o5MmVa1PK9UnOb93Dt6p/0inT+2dnZ/+mdQkAAAAbjzEbAACAiTAYDF5d6/iOlLyhdQv5h9RyQ6/X+1jrEAAAADYuYzYAAAATZXFxca5M5UBqfrl1y4ZT80RS379t22Pvueiiy55qnQMAAMDGZswGAABg4tRaO4PBYG9KvSvJD7Xu2QDGqXmw1lzb7/e/0DoGAAAAEmM2AAAAE+zIkSMv2Xz+5utT69VJNrfuWZdqlsZTdd+OmR1LrVMAAADgWxmzAQAAmHhLS0s/m079QGr+e+uWdeRzqeWGbrf7QCmlto4BAACA/8yYDQAAwJqxvLxw6biWg0l+oXXLGraSUj64csHK7XPb555oHQMAAADfjTEbAACANWU4HG4ajUdXlOTWJC9u3bO21EOj6fHv7rpk1z+3LgEAAIDvx5gNAADAmrS0tPTSWupNJbkyyVTrnklWkofHnezrz/Qfat0CAAAAz5YxGwAAgDVteXn+4nHtHEjy2tYtE+jzteSW4585/j/37Nmz2joGAAAAngtjNgAAAOvCYLBweU25N8lPtG6ZAKdrcn/GeWe/3/966xgAAAB4PozZAAAArBvz8/NbpqbKVSnlhiQ/0LqnjXpoqjPePzOz6/+0LgEAAIAXwpgNAADAujM/P/+jU1Od96RkbzbItW9NPjVV6ltnZ3f8UesWAAAAOBM2xAU9AAAAG9NgMJitGR9MsqN1y1lT8litufXJE09+aG5ubtQ6BwAAAM4UYzYAAADrWq21DAaDN6TU9yb54dY9Z9CoJB+dnj514yWXvPbfW8cAAADAmWbMBgAAYEM4evToi06eXLk2pVyf5PzWPS/Qn652xvt3zuz869YhAAAAcLYYswEAANhQ5j85/zNT4867U/P61i3PWc0/JuUdvV7vY61TAAAA4GwzZgMAALAhLS0t/UYp9UBNfql1y7NwIrXevW3bY++56KLLnmodAwAAAOeCMRsAAIAN6/Dhw9Nbtm55Y6nl9qS+vHXPM6ip+f1SOtd1u91/ax0DAAAA55IxGwAAgA3vyJEjL9l03qZbSnJFkunWPUlSk0HG2dfv9xdbtwAAAEALxmwAAAD4huXl5Z8bj1c/kJLLGmb8S2p5R7fbfaCUUlv/nQAAAEArxmwAAAD4T5aXFy4dp9ybmp8/h9/2yZRy78oFK7fPbZ97ovXfAQAAALRmzAYAAIBnMBwON43GoytKcluSC8/ud6uHxqt5y44dOx5t/bgBAABgUhizAQAA4HsYDocvG41H7yzJlUmmzuTXLsnDtZb9vV7vSOvHCQAAAJPGmA0AAADPwsJw4ZLOajmYkt1n4Mt9uSbvOv7o8fv27Nmz2vqxAQAAwCQyZgMAAMBzMBgsXF5T7k3yE8/jj5+uyf3TnembZmZmvtb6sQAAAMAkM2YDAADAczQcDi9YXT39lqTcmJKtz+bP1OQTGWdfv9//29b9AAAAsBYYswEAAOB5WlxcfFUpeXdK9ua7X2N/upa8tT/b/8PWvQAAALCWGLMBAADgBVpenu+Oa+dgkv5//MOSxzKu79269cJ7tm/ffqp1IwAAAKw1xmwAAAA4A2qtncFgsDel3pmaT4xGq9fs2rXri627AAAAAAAAACC11k7rBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABg0v3/AQBbq7ozLjXSAAAAKHRFWHRDb21tZW50AENyb3BwZWQgd2l0aCBlemdpZi5jb20gR0lGIG1ha2VyWZBFzQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNC0yOVQxODo0NToyNiswMDowMIQ0Nm4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDQtMjlUMTg6NDU6MjYrMDA6MDD1aY7SAAAAEnRFWHRTb2Z0d2FyZQBlemdpZi5jb22gw7NYAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAt0lEQVR42u2WAQbDQBBFQ9IbRtDcrrqK3LBbXrEH6OuHEPMBjPd2xHyZKtdNpcLMg11Pr7y4/YdvwIdd4jtw4BU0Rjrbz9mNzkjzgpU3wNhCvH5M3i1fKzzeK3K8V+R4r8jxTpHjlULhc0WOd8fU6e4I8y3y13tFjHel4GswwAvFSR/ZN6Zv2gjvmzbGhwqPzxUenys83is8Pld4vFac/9sy8/SVNrbgYJl8WGhsvkpoA1+pVK6ZLyLNXm2txsT5AAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQAAAAB/ecQqAAAAAnRSTlMAAHaTzTgAAAAeSURBVHgBY6ASsP/A/wcXZQNGhCkyAfE24HUndQAAXlkXcQ24P7gAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAB/ElEQVR42u3Xs4JdQRzH8X9sqYrNNnbqtPELxKgWD7AsI71B7BcI21W9rNa+d27zjSac/5kzZ2J8yqPfGUn++xMwis2UcpsGuilQoJt6blHCJkbKt2I+FbSRpJVy5kos5nAVQxrDJWbFfP4wXYTqYL9kwRiuk9VFRksYJvKEGA+ZEPb3+udrOcNaJjGJtZyhTo8IKIVaOXmOMfKrrnsCo1WU+HFE/fxu9dk9asR+f8fswnU08fmTuDo8nZarat2P/DjobtFPP3dY8bGi6jNUE/MxuM58vNsFVvfHiHNqleqjmwo0a+zdW3zutr26Dk2ZPqW1oZli7/fzuT57dQqaFmUaZDNZ9HoDYIMbUEoWt+xb69EVuwG3CdfNcvtWNbqbbkB9ePVgK4DFDKGrcwO6CNPHJvvGdGpI0uEGGELk2WGfn8or33OxAUc/TulP8cnHVVENI5Vhp+mIa+TT9tm9pKkN7ab6tHEDRVo3LUGjTxuNpClyAzaRSiwGSbPeDRhJC99Ls7rno5zvpUw0zMMQQV1wdFzmezgvSZhJR1Aj+3QyW5Jx8JsD9okfV74p4ELIceNudMAjRodtfh8T4yETg7fvEf3pAqMlCw7QQah29kl2zOIiedLkOc9MicVcymkhSQtlzJVvxUg2UMxNaunCYOiihpsUsZ6R8t8f4DUz8hFGPnrb0AAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAFpgAABaYBiY4SdAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUnSURBVHic7dxdiFRlHMfx33Nmt2xXpNIlXzLXtVC7ilYKNDQitmyd6GZ6wRQiGXcXKi0hSNANIwiKSGVdV7MXCbIw0l23rKjoohtThJRetNzRdl0tosJ9cWfm+XdjlJL4smfmzMx+P5czZ/7P7+LHc84Z5owEAAAAABi5XNQBCsmRZQ9cHZxOXyvpmqx3mVHmuie2tf8Wda5iNGKL1ZOMjzvtsnOcgjmSzZLTzZKu+59DD0t6Tz6zvrpt9/E8xyxaI6pYvyyZf326zD3q5O6XdJuk2CV8vF+yxdWtndtzFK+klHyxDiYSV1SO7YtLweOS1enSynQ20x+xioqJk199fyC8hKWpLOoAudKTjI8bCvwyqT8puSrJhj/U6WoNDFwrqXv4w0pbyRWrK3nPBAVlzww53yBTZcjj901u7aBUF6FkinWk6b7xzruVkpZIGhXGBnUW0xdlWb845Kklq+ivsQ49MX9MeTpYIWm5pNEhj/9T0qdm9nr1xs7dLpTz6chQtMX6JllbXuUmNJmzlZKqLmuI6Q85HZd0QnI9Jv+rpF6ZUuaCn6aOP7XPNX+ZCTP3SFGUxfq5KV4XeP+apBkXOHRI0gEnfevluiTf5WRHA69Udmige+qbXw7mPu3IVFTFSjXW15i3V+TcA+c55IScOpx3X2WDYP/v2e7vZrXtTec1JCQVSbGsuTlIHd/ztJzWSBp1ztvfS/rAvO2snnjbHtfc7COIiHMUfLGONNxb7RR7Q9Kd/3nZS/rcmVt7w8aODi6qC09BF+tIw31LndzL+vdur1/SBlN2/dTWj7uiS4YLKchinWxKjB6wvs1m7qEzLw2Z6c1Yeez5G9bv7Ik0HC5KwRWrq6l+pry2S5opyZz0VsYHq6e1tR+NOhsuXkEVK9VYnzDTFkmjJfeDN5+s2dj5VdS5cOmCqAP8I7V0wVNmelfSlWZ6yQZP3UKpilfkO5YlErHU2P51khpNOqTAHpza0rk/6lwYnkiL1ZOMVwwFtk2yBZLeT5f7JTet++ivKDMhHJH9uqF3UV3lYOA7JM12pienbNy1LqosCF8kxepJxisGnW+XVOuDIF7T0v5JFDmQO3kvVu+iuspB59vlNMMCm1vT0s71VAnKa7EOJhJXDFYO7JSsKhOU3X5jy45j+Vwf+ZO3rxtMchXj+jZJmuQzsbspVWnL2451tGHBi85stnx6bs3m3SfytS6ikZcdK9VYnzTZw5mg7C4e+hwZcv49VioZv8MCvy0WxOZNbtl5ONfroTDktFhnHsX6WoEWVrfs+jqXa6Gw5OxUaIlETK7sHSdbRalGnpwVKzW2/zkFOjCltXNrrtZA4crJXWGqsb7WpPq+3yrm5mI+Ct/l/0HGeRxbnrjKpzMfZrO2cPrWHSfDno/iEPqpMDvY94KkLdM2df4Y9mwUj1CLlWqsr5W5W6eMn9US5lwUn9CKZZIz01rntIJn+xBasVIN9Y+Z6cCUDbv2hjUTxSuUu8JDT8wfoyE9q5jNC2Meil8oxSrPuNUu0Jbqls7eMOah+A27WMcaFkzKmi3M+NPTwwiE0jDsa6ys+TUy9/a0ts/+DCMQSsOwdqyfG++dLnOPZL1jt8JZhrVjxSy2XNJ2Hn/HuYa1Y6WVXpUZGsV/ngMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACS/gYMCI78lMOpVQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIoAAAB4CAYAAAAt3Wp2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAEmgAABJoBLnDN3gAAABJ0RVh0U29mdHdhcmUAZXpnaWYuY29toMOzWAAADURJREFUeJzt3Xt0k2cdB/Dv8yZN0iRNaS69QMu6llLWAmVlXIabc7qLlw2hQEXGpQJOh5tO5zzDc3ZOzzhu8xyn0w0YtzEH80C36XRORd2ZU9DSSUcp9Ebp/Z5b06a5NW9e/xiZDNuaJk+a902ez5807y+/lm+f5v09b94ADMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDBPfSKwbEBP7b47mjvd1vUlUqn4h5caN6eXlzlj3JBYsKACE996T27ov7HVdOLuTdzo4AJDp08fVxaUvGh545Hux7k8MEj4olpMHvu1trH12fKAneaKvK3ILbMnzFu5IW7/zrZnuTUwSNiiON48uc3e3nvA01+VBEKZ+MCeD6qYljeo5+Wt0ZdtaZqZDcUm4oIy8/Sujp7/zDXd9zR3CuG9ax3JqraBeuPwtgzZnIykvn97BEpdQQbG+tm+Pu776Cf+wVR5JnaTMHI9q8fInDWXbf0KrN7FLiKDYTr602dNyca+vt11Hq2baup3Qffb+HnCyjYSQM7TqilVcB2XknRPz3Z0tVe6LH5QgEKBSM3nhMhi2fRcy7ScyVw2gjBDST+VJRCgug9L39gG1wuw87rpQvSbgcVH5HuWmLJge3A1Fdt5kD+EBHAHwECGETipFJO6CYju5/weui7VP+c19SioF5QoYNz8CzfLPACSkH9cYgEcJIYepPL9IxE1QrG+8fK+vreGYt63RRKum7u4yzFq9BUSeFM7hbQDWEkIu0OonliQfFPs7r93g62o/4bn0wUrB76dSU1VYAuO270KWZqRR7n0AqwkhIzSKxYpkgzLR2D1SXEoqTDufgGr+IhrlrjUO4EVCiGS3AyQZFGvVwe94Gs49M9nYfdo4DoZND0O76i6AUMncZKzg+Qoil/8+mk8SDZIKyrTG7iHSrPwc9F/5JjgVncxNxdfTBvNLP4I8M1ty2wGSCEokY/fJKHLyYXpwN+TGTCr1phIYG4Xl1efhvnD243+T2naAqIMiCAKxVx16xvXh6cciHbsHcWotjNsfR3LxUhrlpiTwfjj+WAXHO7+a9DFyY5ZXVVz6lPGru56OekMREG1QbK8fecDTcn6fr7uN2th91v2bobt3A4hMRqvkxAQB7oZaWA7/GAGPK6RDlHlFg6r84vK0dRV/j25z4RFdUEb/+laR6/LFk+76swujPHaPCr9lAOb9e+Dr65z2sSRJAVXR0mou/YYy07ototoOEE1QojJ2T5+N9Ad/iKQ5uTTKTSngccF2/AWMnftHxLVkqXo+efGKg4bLlodJZaUotgOo/N2nYfSy889y65VPyUJcqqdCkpQwbHsUmtLbQh27R4xTKKGcV4yx2tOI9IyMd9hk9ub2h+wZeTyAR+h0GJmoDg2mwzU8pm37dxfsmgUQtIaw6+juLkPOT09As/T2GQsJAICTIeUz9yHnuRPQLL0t7DIBXSbMinnoqG6Czz2uodhhRESzogAABAGW+ibYlUpklCyCxt4M8KGdOVIeu4eNS9bAuPMJzFozgKF9T2G8vyuk4wSVFqPqXAzVNkAIDES5y+kTV1Cu4r1e9NXUQ6nXI2N+JpTmxkmX8yiO3SMiN2Zi9pN7Pzr7OfQMAl7PhI8TiAw+0wL0N3RhfOTiDHcZOlEGJchrs6Gr2obUeXkwzvKCs/f+94scB/3GXUi57Z5oj93DRwiSi5ci+7kTE85T/MZ8DPW5MVZ9KUYNhk7UQQlytLZhhBAYFxch1d8DbcmyGRu700Bkcsy6bxN0d94Py6vPY6y9HY6AHpaapli3FjKR/ir+L0EQYK5rgFU7H9ryb0gmJNfiNCnQbn0U7ZdssNRLJySARFaUawUgoK31ErQpqZiTnQeZnO63IPj9gEwGQvmMyT8+DvNQL3w+LwKUrpuZSZJZUa7nHHWgufFDDA50Q6CxkywIsH5wDu9v2IR/fHUL7BfqI68JQBACsFoG0dvTBp/PS6VmLEhuRbme1TwAu3UIs7PzoEtNC6uGu38AdZV74Oy4OnZ3uXDu8d3Qly5B0fcehcoU3in36OgwbJbBsI4VG8kHBQACgQB6ulqhUKqQnZMPVbI6pON4twfN+w+g79RfJvy6rfY8Tm+uwA0b1iF/22ZwSaFdO+vzeTE02ANegn9iJiPZPz0T8Xk9aGu9hN7uKwjw/KSPEwIB9L7zJ7xXVj5pSK7V+fqb+Nv6jRg6888px/M878dAfxf6ezviKiRAnKwo13MM2+AYtiEjay70hvRPvDB1NDWjrnIPfPbhadUMeLy48NTTSM7KwuIndyMl/7/v7xEEAY5hKxzDVmrfg9jEZVCCBvu7YDX3IXvuPHBjbtT/6Fk4miK7+tDd34+zu76NzDvvQOHDD8GHACxmUV0REBVxHRQA8Pv96GhrwvBLx+BqbaNWd+C998GZ9NB8NvwNQCmJq9coTPSwoDAhYUFhQsKCwoSEBYUJSdyf9UyHUp+GjPmZ4CHHQF0reLc71i2JBgsKAE4uh2nJAuicV4ChRgDAjTemYFS98OqliaK4ED6mEj4oaTfNhyHJDmL75GWIxDMKneciNDfnwDIsw8iVjtg0KBIJGxR1ViYycrSQW1qAKXb/ZfZuZBCCtJULMNhqhscSv2P6qSTci9kkrRbZKxZittoMuaU1tIMEAYqhJmQbnJi9fBE4hSK6TYpQwqwoRMYhvbQYOk8XiDm8q93JuBcaSz3yCvVwcNG/C4KYJMyKMqfsHqSONoF4RiOuRcZsSBO6kbailEJn0pAwK4rTYIJiVyVUtafBnzkVfiGOg/LeDeBLVsKXQGdDCRMUAPDxfvhKVkK9eCVkf3gNgc4QX6NclbRkBXDPBnhBQOtOC1KRUEEJchGA3LcZGpcTeOMQhFHHlI/njJlIWr8TXl141+TGg4QMCvDRVWnOZA3kFY9B3doA/lTV/6wSJEkB5bod8OUWwBugc884qUrYoAT5eR4jNxZC9a1KKM6cAl/70ecfKG7/AgKr7oZHEIAEDwnAgvIxD8/Ds/IuaG/5NBQ6PbwcF/F9TuIJC8p1PCoNBC5hpgYhk9xPxHn+ImQ9Q+Ak+J/JEQ7emrpYtxEWya0ovNeL7uf3I3luDjK2b4JPq4p1S/8XIQTCkA3tP9sLn80e63bCIrmgBLm7utFR+WOkrVqO1LIvwQdxzjVkXj96DxzFaIO07l5wPckGJcj+zxrYq/+NzPI1UCy/Gf6AON6hJwOH4VPvYuA3krvt/YQkHxQAQCCAgRO/hvz3f8bsb1aAzzJBEGKzwnCEg6+xBVf2HkZgfDwmPURDfATlKr/Tia6fvAh1fi7SKzbBlxzWBzKFhxAQ2wg6XzgIT1/fzD3vDBHNqYN67tzHUouKqNwjwnWlAx1PPg3fu6eh4KL/uyDzB2A+dAwtuyuphIRwHEwrljWpTJnPUmiPCtHcuTqo8YWXvm+rPbfH1dtH5XSG4zhkPlAOWWkR+CnucBAklydBGeJtv2QcB+ffq9Fz/GSkbX5MV1gwql+27FsFWx84Rq0oBaILCgC0Hz2qclnsh8xnazaNj4xSWfUUJgOydm6F35g65R2aQgkKIRz4zh50/Hw/+LHI77QNAAq9njcuv+VI0Yj9IbHc1vxaogxK0OVXXsl3tnW9aa35oITWlfApi4ph3LIe3kni9/+Cwrm86Nl3GGOU3vAuUyphunXlGdOCkrLMsnuHqBSNAlEHJajlwOEvDTc0vOJobKZ2W2rTmvugvmMFxvlPnk5PFhSZAFjeeBuWd/9GqwWkFhUNGkoXrc/fuvU0taJRIomgBDX8Yt8e69mzT3jMFiqvUIlSgTk7tgD5cxG4ejp9fVA4wsFz/iK6DxxFgNKqprlhrttwc+njhbu+vpdKwRkgqaAAQPfhKr3d3H7c8q+az/MeD5X+r90OCAYlOHbvpDh2T0rRCoZly9/i8nI2Fkvg4+GuJbmgBF05cuSW4ebW12119bm0LgdIu30V0tZ+AQpO/tHYvZHOZ0NycjlMq26t0y0uWpu7enU7laIzTLJBCWo+cHibrfbDF5ztHSmx7mUiusL5Nv3Ni7YXbN/+21j3EgnJBwUAhMpKrkGXtt9SXbPTNzwsiiFicmaGz/SpW39a+I2v7451LzTERVCCWl99Nd3V2Vtlrj57R6z2WeQatWC8dcW7SYUFZQu+/OXI30QkEnEVlKCWl39510hj41F7XX32TD0nIQRpS0radDcVrC6oqBD/56pMU1wGJYj2dsBkxDp2pymugwIA3VVVySOdPQdpbgcEiX3sTlPcByWI5nZAcOxunLdwbVb5F82UWhS1hAlKUOsvj6+1nz9/ZPhSY1hv+0stKhrULyleN6+i4gzt3sQs4YISNN3tAM3cHJehdOkPpDR2pylhgwKEth0g5bE7TQkdlKDLLx8rHWluet12vi4vuB1A5HIYbllal5Kbff+87du7Y9xizLGgXKPl4JEK67naX3AKxbh+ycKvFezY8btY98SIlFBZKYotAIZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhGIaa/wDuuvLKPcgIqgAAADV0RVh0Q29tbWVudABDb252ZXJ0ZWQgd2l0aCBlemdpZi5jb20gU1ZHIHRvIFBORyBjb252ZXJ0ZXIsKeMjAAAAAElFTkSuQmCC"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.share=t.overlay=t.navbar=t.loadingScreen=t.help=t.fillContainer=t.error=t.defaultViewer=t.defaultTemplate=void 0,t.defaultTemplate=r(70),t.defaultViewer=r(71),t.error=r(72),t.fillContainer=r(73),t.help=r(74),t.loadingScreen=r(75),t.navbar=r(76),t.overlay=r(77),t.share=r(78)},function(e,t){e.exports="<style>@font-face{font-family:babylon;src:url({{babylonFont}}) format('woff');font-weight:400;font-style:normal}.icon{font-family:babylon}</style> {{#if fillScreen}} <style>body,html{width:100%;height:100%;margin:0;padding:0}</style> {{/if}} <fill-container></fill-container>"},function(e,t){e.exports="<style>viewer{position:relative;overflow:hidden;z-index:1;justify-content:center;align-items:center;width:100%;height:100%}.babylonjs-canvas{flex:1;width:100%;height:100%;touch-action:none}</style> <canvas class=babylonjs-canvas touch-action=none> </canvas> <nav-bar></nav-bar>"},function(e,t){e.exports="<style>.narrator-readable-text{border:none;background:0 0;color:inherit;border:none;padding:0;font:inherit;cursor:pointer;outline:inherit}</style> <button class=narrator-readable-text>Error loading the model</button>"},function(e,t){e.exports="<style>fill-container{display:flex}fill-container>*{touch-action:none}</style> {{#unless disable}} <style>fill-container{width:100%;height:100%;justify-content:flex-start;align-items:stretch;align-content:stretch}fill-container>*{flex:1 1 auto;flex-direction:row;justify-content:flex-start;align-items:stretch;align-content:stretch}</style> {{/unless}} <viewer></viewer> <loading-screen></loading-screen> <overlay></overlay>"},function(e,t){e.exports="HELP"},function(e,t){e.exports="<style>loading-screen{position:absolute;left:0;z-index:100;opacity:1;pointer-events:none;display:flex;justify-content:center;align-items:center;-webkit-transition:opacity 1s ease;-moz-transition:opacity 1s ease;transition:opacity 1s ease}img.loading-image{-webkit-animation:spin .75s linear infinite;animation:spin .75s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}</style> <img class=loading-image style=position:absolute src={{loadingImage}}> <img class=static-loading-image style=position:absolute src={{staticLoadingImage}}>"},function(e,t){e.exports='<style>nav-bar{position:absolute;height:48px;width:100%;bottom:10px;display:flex;justify-content:center}nav-bar .nav-container{display:flex;flex-direction:row;margin:0 10px;height:100%;width:100%;justify-content:center}nav-bar .animation-control{background-color:rgba(91,93,107,.75);display:flex;flex-direction:row;height:100%;width:100%;max-width:1280px;justify-content:center}nav-bar .flex-container{display:flex;flex-direction:row;justify-content:center;height:100%;width:100%}nav-bar button{background:0 0;border:none;color:#fff;margin:0;padding:0;height:100%;min-width:48px;cursor:pointer}nav-bar button:active,nav-bar button:focus,nav-bar button:hover{background:0 0;border:none;outline:0}nav-bar button:hover{background-color:rgba(22,24,26,.2)}nav-bar .control-text{font-family:"Segoe UI";font-size:12px;font-weight:400;pointer-events:none}nav-bar .icon,nav-bar img{pointer-events:none}.logo-button{display:flex;align-items:center;flex-direction:row;justify-content:center;background-color:rgba(91,93,107,.75);height:48px;min-width:48px;margin-right:4px}.logo-button img{height:20px;width:20px;padding-top:5px}.types{display:flex;flex-direction:column;width:48px}.speed .flex-container,.types .flex-container{align-items:center}.menu-options{position:absolute;bottom:48px;width:48px;background-color:rgba(22,24,26,.9)}.animation-label,.help,.logo-button,.speed,.types-icon{display:none}.types-icon:after{font-size:16px;content:"\\F6BE"}.up-icon:after{line-height:16px;font-size:12px;content:"\\E70E"}.play-icon:after{font-size:16px;content:"\\E768"}.pause-icon:after{font-size:16px;content:"\\E769"}.fullscreen-icon:after{font-size:16px;content:"\\E740"}viewer.in-fullscreen .fullscreen-icon:after{content:"\\E73F"}.help-icon:after{font-size:16px;content:"\\EF4E"}viewer.in-vr .vr-icon:after{font-size:16px;content:"\\E7F4"}.vr-icon:after{font-size:16px;content:"\\F119"}.progress-control{display:flex;flex:1;position:relative;overflow:hidden;cursor:pointer;align-items:center}.animation-number{margin:0 6px}.speed-text{margin-right:6px}.progress-circle{width:12px;height:12px;border:2px solid #fff;border-radius:50%;background-color:#5b5d6b;cursor:pointer;position:relative;bottom:10px;pointer-events:none}.default-control{display:flex;flex-direction:row;height:100%;background-color:rgba(91,93,107,.75)}.menu-options button{width:100%;height:48px;color:#8e939b}.menu-options button{width:100%;height:48px;color:#8e939b}.menu-options button:hover{background-color:transparent;color:#fff}.menu-options .animation-number{margin:0 18px 0 6px}.menu-options .speed-text{margin-right:18px}.menu-options{visibility:hidden}.open .menu-options{visibility:visible}.types .menu-options{width:144px}.types .menu-options button{padding:0 8px;justify-content:left}.types .menu-options button>*{display:flex;margin:8px}.types .menu-options button span.animation-number{display:none}.fullscreen{display:none}@media screen and (min-width:540px){.help,.speed,.types-icon{display:inline-block}.logo-button{display:flex}.types{width:84px}.progress-bar-container{margin:0 12px}.speed{width:64px}.speed .menu-options{width:64px}.fullscreen{display:block}}@media screen and (min-width:1024px){.animation-label{display:block;margin-left:6px;text-overflow:ellipsis;overflow:hidden}nav-bar button.animation-buttons{padding:0 8px;justify-content:left}.icon.up-icon{margin-left:8px}nav-bar button.animation-buttons>div{display:flex;pointer-events:none}.animation-number{display:none}.progress-bar-container{margin:0 12px}.types{width:144px}}.progress-wrapper{-webkit-appearance:none;cursor:pointer;width:100%;outline:0;margin:0 12px;height:30px;background-color:transparent}.progress-wrapper::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:rgba(91,93,107,1);margin-top:-10px}.progress-wrapper::-webkit-slider-runnable-track{height:2px;-webkit-appearance:none;background-color:#fff}.progress-wrapper::-moz-range-progress{background-color:#fff;height:2px}.progress-wrapper::-moz-range-thumb{width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:rgba(91,93,107,1)}.progress-wrapper::-moz-range-track{background:#fff;height:2px}.progress-wrapper::-ms-track{height:2px;background:0 0;border-color:transparent;border-width:10px 0;color:transparent}.progress-wrapper::-ms-fill-lower{background:#fff;border-radius:5px}.progress-wrapper::-ms-fill-upper{background:#fff;border-radius:5px}.progress-wrapper::-ms-thumb{width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:rgba(91,93,107,1);margin-top:0}span{display:inline-block}</style> {{#if (or (not animations) hideAnimations)}} {{#if hideLogo}} <style>nav-bar .nav-container{justify-content:flex-end}</style> {{else}} <style>nav-bar .nav-container{justify-content:space-between}</style> {{/if}} {{/if}} {{#if disableOnFullscreen}} <style>viewer.in-fullscreen nav-bar{display:none}</style> {{/if}} <div class="nav-container navbar-control"> {{#unless hideLogo}} <div class=logo-button title={{logoText}}> {{#if logoLink}} <a href={{logoLink}} target=_blank> <img src={{logoImage}}> </a> {{else}} <img src={{logoImage}}> {{/if}} </div> {{/unless}}{{#unless (or (not animations) hideAnimations)}} <div class=animation-control> <div class=types> <button class="flex-container types-button animation-buttons"> <span class="icon types-icon"></span> <span class="control-text animation-label">{{selectedAnimationName}}</span> <span class="control-text animation-number">{{selectedAnimation}}</span> {{#if (gt (count animations) 1)}} <span class="icon up-icon"></span> {{/if}} </button> <div class=menu-options> {{#each animations}} {{#unless (eq ../selectedAnimation (add @index 1))}} <button class="flex-container label-option-button animation-buttons" data-value="{{this.value}} "> <span class="icon types-icon"></span> <span class="control-text animation-label">{{this.label}}</span> <span class="control-text animation-number">{{add @index 1}}</span> </button> {{/unless}} {{/each}} </div> </div> <div class=progress-control> <button class="play-pause play-pause-button"> {{#if paused}} <span class="icon play-icon"></span> {{else}} <span class="icon pause-icon"></span> {{/if}} </button> <input class=progress-wrapper type=range min=0 max=100 step=0.01> </div> <div class=speed> <button class="flex-container speed-button"> <span class="control-text speed-text">{{selectedSpeed}}</span> <span class="icon up-icon"></span> </button> <div class=menu-options> {{#eachInMap speedList}} {{#unless (eq ../selectedSpeed id)}} <button class="flex-container speed-option-button" data-value={{value}}> <span class="control-text speed-text">{{id}}</span> </button> {{/unless}} {{/eachInMap}} </div> </div> </div> {{/unless}} <div class=default-control> {{#unless hideVr}} <button class="vr vr-button" title="{{text.vrButton}} "> <span class="icon vr-icon"></span> </button> {{/unless}}{{#unless hideHelp}} <button class="help help-button" title="{{text.helpButton}} "> <span class="icon help-icon"></span> </button> {{/unless}} {{#unless hideFullscreen}} <button class="fullscreen fullscreen-button" title="{{text.fullscreenButton}} " name=fullscreenToggle> <span class="icon fullscreen-icon"></span> </button> {{/unless}} </div> </div>'},function(e,t){e.exports="<style>overlay{position:absolute;z-index:99;opacity:0;display:none;justify-content:center;align-items:center;-webkit-transition:opacity 1s ease;-moz-transition:opacity 1s ease;transition:opacity 1s ease}.overlay-item{width:100%;height:100%;display:none;align-items:center;justify-content:center;background-color:rgba(121,121,121,.3)}error.overlay-item{background-color:rgba(121,121,121,1)}div#close-button{position:absolute;top:10px;right:10px;width:30px;height:30px;cursor:pointer}div#close-button img{width:100%}</style> <div id=close-button> <img src={{closeImage}} alt={{closeText}}> </div> <help class=overlay-item></help> <error class=overlay-item></error> <share class=overlay-item></share>"},function(e,t){e.exports="SHARE"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultConfiguration=void 0;var n=r(8),i=r(8),o=r(19),s=r(1);t.defaultConfiguration=s.deepmerge(o.renderOnlyDefaultConfiguration,{version:"3.2.0-alpha4",templates:{main:{html:n.defaultTemplate,params:{babylonFont:n.babylonFont,noEscape:!0}},fillContainer:{html:n.fillContainer,params:{disable:!1}},loadingScreen:{html:n.loadingScreen,params:{backgroundColor:"#000000",loadingImage:i.loading,staticLoadingImage:i.staticLoading}},viewer:{html:n.defaultViewer,params:{enableDragAndDrop:!1}},navBar:{html:n.navbar,params:{speedList:{"0.5x":"0.5","1.0x":"1.0","1.5x":"1.5","2.0x":"2.0"},logoImage:i.babylonLogo,logoText:"BabylonJS",logoLink:"https://babylonjs.com",hideHelp:!0,hideHd:!0,hideVr:!0,hidePrint:!0,disableOnFullscreen:!1,text:{hdButton:"Toggle HD",fullscreenButton:"Toggle Fullscreen",helpButton:"Help",vrButton:"Toggle VR",printButton:"3D Print Object"}},events:{click:{".navbar-control":!0},pointerdown:{".help-button":!0},input:{".progress-wrapper":!0},pointerup:{".progress-wrapper":!0}}},overlay:{html:n.overlay,params:{closeImage:i.close,closeText:"Close"}},help:{html:n.help},share:{html:n.share},error:{html:n.error}},camera:{behaviors:{autoRotate:{type:0},framing:{type:2,zoomOnBoundingInfo:!0,zoomStopsAnimation:!1},bouncing:{type:1}}},skybox:{},ground:{receiveShadows:!0},engine:{antialiasing:!0},scene:{}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shadowSpotlLightConfiguration=t.shadowDirectionalLightConfiguration=void 0,t.shadowDirectionalLightConfiguration={model:{receiveShadows:!0,castShadow:!0},ground:{receiveShadows:!0},lights:{shadowDirectionalLight:{type:1,shadowEnabled:!0,target:{x:0,y:0,z:.5},position:{x:1.49,y:2.39,z:-1.33},diffuse:{r:.867,g:.816,b:.788},intensity:4.887,intensityMode:0,shadowBufferSize:1024,shadowFrustumSize:6,shadowFieldOfView:50.977,shadowMinZ:.1,shadowMaxZ:10,shadowConfig:{blurKernel:32,useBlurCloseExponentialShadowMap:!0}}}},t.shadowSpotlLightConfiguration={model:{receiveShadows:!0,castShadow:!0},ground:{receiveShadows:!0},lights:{shadowSpotLight:{type:2,intensity:2,shadowEnabled:!0,target:{x:0,y:0,z:.5},position:{x:0,y:3.5,z:3.7},angle:1,shadowOrthoScale:.5,shadowBufferSize:1024,shadowMinZ:.1,shadowMaxZ:50,shadowConfig:{frustumEdgeFalloff:.5,blurKernel:32,useBlurExponentialShadowMap:!0}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.environmentMapConfiguration=void 0,t.environmentMapConfiguration={lab:{assetsRootURL:"/assets/environment/",environmentMap:{texture:"EnvMap_3.0-256.env",rotationY:0,tintLevel:.4}}}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.HDButtonPlugin=void 0;var o=function(e){function t(r){var n=e.call(this,"hd","hd-button",t.HtmlTemplate)||this;return n._viewer=r,n}return i(t,e),t.prototype.onEvent=function(e){var t=e.template.parent.querySelector(".hd-button");t&&(t.classList.contains("hd-toggled")?t.classList.remove("hd-toggled"):t.classList.add("hd-toggled")),this._viewer.toggleHD()},t.HtmlTemplate='\n{{#unless hideHd}}\n<style>\n.hd-icon:after {\n font-size: 16px;\n content: "\\F765";\n}\n\n.hd-toggled span.hd-icon:after {\n content: "\\F766";\n}\n</style>\n<button class="hd-button" title="{{text.hdButton}}">\n <span class="icon hd-icon"></span>\n </button>\n {{/unless}}\n',t}(r(9).AbstractViewerNavbarButton);t.HDButtonPlugin=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.PrintButtonPlugin=void 0;var o=r(9),s=r(0),a=function(e){function t(r){var n=e.call(this,"print","print-button",t.HtmlTemplate)||this;return n._viewer=r,n._viewer.onModelLoadedObservable.add((function(e){if(n._currentModelUrl="",e.configuration.url){var t=s.Tools.GetFilename(e.configuration.url)||e.configuration.url,r=e.configuration.root||s.Tools.GetFolderPath(e.configuration.url),i=e.configuration.loader||t.split(".").pop()||"",o=!1;["gltf","glb","obj","stl"].forEach((function(e){-1!==i.indexOf(e)&&(o=!0)})),o&&(n._currentModelUrl=r+t)}})),n}return i(t,e),t.prototype.onEvent=function(e){if(this._currentModelUrl){var t=this._currentModelUrl.replace(/https?:\/\//,"com.microsoft.builder3d://");window.open(t,"_self")}},t.HtmlTemplate='\n{{#unless hidePrint}}\n<style>\n\n/* Show only if it\'s a windows 10 printer */\n.print-icon.not-win-10 {\n display: none;\n}\n\n.print-icon:after {\n font-size: 16px;\n content: "\\E914";\n}\n\n</style>\n<button class="print-button '+(-1===window.navigator.userAgent.indexOf("Windows NT 10.0")?"no-win-10":"")+'" title="{{text.printButton}}">\n <span class="icon print-icon"></span>\n </button>\n {{/unless}}\n',t}(o.AbstractViewerNavbarButton);t.PrintButtonPlugin=a},function(e,t,r){
- /*!
- * PEP v0.4.3 | https://github.com/jquery/PEP
- * Copyright jQuery Foundation and other contributors | http://jquery.org/license
- */
- e.exports=function(){"use strict";var e=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],t=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0];function r(r,n){n=n||Object.create(null);var i=document.createEvent("Event");i.initEvent(r,n.bubbles||!1,n.cancelable||!1);for(var o,s=2;s<e.length;s++)i[o=e[s]]=n[o]||t[s];i.buttons=n.buttons||0;var a=0;return a=n.pressure&&i.buttons?n.pressure:i.buttons?.5:0,i.x=i.clientX,i.y=i.clientY,i.pointerId=n.pointerId||0,i.width=n.width||0,i.height=n.height||0,i.pressure=a,i.tiltX=n.tiltX||0,i.tiltY=n.tiltY||0,i.twist=n.twist||0,i.tangentialPressure=n.tangentialPressure||0,i.pointerType=n.pointerType||"",i.hwTimestamp=n.hwTimestamp||0,i.isPrimary=n.isPrimary||!1,i}var n=window.Map&&window.Map.prototype.forEach?Map:i;function i(){this.array=[],this.size=0}i.prototype={set:function(e,t){if(void 0===t)return this.delete(e);this.has(e)||this.size++,this.array[e]=t},has:function(e){return void 0!==this.array[e]},delete:function(e){this.has(e)&&(delete this.array[e],this.size--)},get:function(e){return this.array[e]},clear:function(){this.array.length=0,this.size=0},forEach:function(e,t){return this.array.forEach((function(r,n){e.call(t,r,n,this)}),this)}};var o=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],s=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],a={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},l="undefined"!=typeof SVGElementInstance,c={pointermap:new n,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(e,t){var r=t,n=r.events;n&&(n.forEach((function(e){r[e]&&(this.eventMap[e]=r[e].bind(r))}),this),this.eventSources[e]=r,this.eventSourceList.push(r))},register:function(e){for(var t,r=this.eventSourceList.length,n=0;n<r&&(t=this.eventSourceList[n]);n++)t.register.call(t,e)},unregister:function(e){for(var t,r=this.eventSourceList.length,n=0;n<r&&(t=this.eventSourceList[n]);n++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(e){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.propagate(e,this.leave,!1)},enterOver:function(e){this.over(e),this.propagate(e,this.enter,!0)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,r=this.eventMap&&this.eventMap[t];r&&r(e),e._handledByPE=!0}},listen:function(e,t){t.forEach((function(t){this.addEvent(e,t)}),this)},unlisten:function(e,t){t.forEach((function(t){this.removeEvent(e,t)}),this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(e,t){this.captureInfo[t.pointerId]&&(t.relatedTarget=null);var n=new r(e,t);return t.preventDefault&&(n.preventDefault=t.preventDefault),n._target=n._target||t.target,n},fireEvent:function(e,t){var r=this.makeEvent(e,t);return this.dispatchEvent(r)},cloneEvent:function(e){for(var t,r=Object.create(null),n=0;n<o.length;n++)r[t=o[n]]=e[t]||s[n],!l||"target"!==t&&"relatedTarget"!==t||r[t]instanceof SVGElementInstance&&(r[t]=r[t].correspondingUseElement);return e.preventDefault&&(r.preventDefault=function(){e.preventDefault()}),r},getTarget:function(e){var t=this.captureInfo[e.pointerId];return t?e._target!==t&&e.type in a?void 0:t:e._target},propagate:function(e,t,r){for(var n=e.target,i=[];n!==document&&!n.contains(e.relatedTarget);)if(i.push(n),!(n=n.parentNode))return;r&&i.reverse(),i.forEach((function(r){e.target=r,t.call(this,e)}),this)},setCapture:function(e,t,n){this.captureInfo[e]&&this.releaseCapture(e,n),this.captureInfo[e]=t,this.implicitRelease=this.releaseCapture.bind(this,e,n),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease);var i=new r("gotpointercapture");i.pointerId=e,i._target=t,n||this.asyncDispatchEvent(i)},releaseCapture:function(e,t){var n=this.captureInfo[e];if(n){this.captureInfo[e]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease);var i=new r("lostpointercapture");i.pointerId=e,i._target=n,t||this.asyncDispatchEvent(i)}},dispatchEvent:function(e){var t=this.getTarget(e);if(t)return t.dispatchEvent(e)},asyncDispatchEvent:function(e){requestAnimationFrame(this.dispatchEvent.bind(this,e))}};c.boundHandler=c.eventHandler.bind(c);var u={shadow:function(e){if(e)return e.shadowRoot||e.webkitShadowRoot},canTarget:function(e){return e&&Boolean(e.elementFromPoint)},targetingShadow:function(e){var t=this.shadow(e);if(this.canTarget(t))return t},olderShadow:function(e){var t=e.olderShadowRoot;if(!t){var r=e.querySelector("shadow");r&&(t=r.olderShadowRoot)}return t},allShadows:function(e){for(var t=[],r=this.shadow(e);r;)t.push(r),r=this.olderShadow(r);return t},searchRoot:function(e,t,r){if(e){var n,i,o=e.elementFromPoint(t,r);for(i=this.targetingShadow(o);i;){if(n=i.elementFromPoint(t,r)){var s=this.targetingShadow(n);return this.searchRoot(s,t,r)||n}i=this.olderShadow(i)}return o}},owner:function(e){for(var t=e;t.parentNode;)t=t.parentNode;return t.nodeType!==Node.DOCUMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(t=document),t},findTarget:function(e){var t=e.clientX,r=e.clientY,n=this.owner(e.target);return n.elementFromPoint(t,r)||(n=document),this.searchRoot(n,t,r)}},d=Array.prototype.forEach.call.bind(Array.prototype.forEach),h=Array.prototype.map.call.bind(Array.prototype.map),f=Array.prototype.slice.call.bind(Array.prototype.slice),p=Array.prototype.filter.call.bind(Array.prototype.filter),m=window.MutationObserver||window.WebKitMutationObserver,g={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};function _(e,t,r,n){this.addCallback=e.bind(n),this.removeCallback=t.bind(n),this.changedCallback=r.bind(n),m&&(this.observer=new m(this.mutationWatcher.bind(this)))}function v(e){return"body /shadow-deep/ "+y(e)}function y(e){return'[touch-action="'+e+'"]'}function b(e){return"{ -ms-touch-action: "+e+"; touch-action: "+e+"; }"}_.prototype={watchSubtree:function(e){this.observer&&u.canTarget(e)&&this.observer.observe(e,g)},enableOnSubtree:function(e){this.watchSubtree(e),e===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(e)},installNewSubtree:function(e){d(this.findElements(e),this.addElement,this)},findElements:function(e){return e.querySelectorAll?e.querySelectorAll("[touch-action]"):[]},removeElement:function(e){this.removeCallback(e)},addElement:function(e){this.addCallback(e)},elementChanged:function(e,t){this.changedCallback(e,t)},concatLists:function(e,t){return e.concat(f(t))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(e){return e.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(e){var t=h(e,this.findElements,this);return t.push(p(e,this.isElement)),t.reduce(this.concatLists,[])},mutationWatcher:function(e){e.forEach(this.mutationHandler,this)},mutationHandler:function(e){"childList"===e.type?(this.flattenMutationTree(e.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(e.removedNodes).forEach(this.removeElement,this)):"attributes"===e.type&&this.elementChanged(e.target,e.oldValue)}};var A=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],T="",M=window.PointerEvent||window.MSPointerEvent,P=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,S=c.pointermap,E=[1,4,2,8,16],C=!1;try{C=1===new MouseEvent("test",{buttons:1}).buttons}catch(e){}var x,R={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(e){c.listen(e,this.events)},unregister:function(e){c.unlisten(e,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(e){for(var t,r=this.lastTouches,n=e.clientX,i=e.clientY,o=0,s=r.length;o<s&&(t=r[o]);o++){var a=Math.abs(n-t.x),l=Math.abs(i-t.y);if(a<=25&&l<=25)return!0}},prepareEvent:function(e){var t=c.cloneEvent(e),r=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),r()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var r=S.get(this.POINTER_ID);0!==t.which&&r?e.buttons=r.buttons:e.buttons=0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=S.get(this.POINTER_ID),r=this.prepareEvent(e);C||(r.buttons=E[r.button],t&&(r.buttons|=t.buttons),e.buttons=r.buttons),S.set(this.POINTER_ID,e),t&&0!==t.buttons?c.move(r):c.down(r)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);C||this.prepareButtonsForMove(t,e),t.button=-1,S.set(this.POINTER_ID,e),c.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=S.get(this.POINTER_ID),r=this.prepareEvent(e);if(!C){var n=E[r.button];r.buttons=t?t.buttons&~n:0,e.buttons=r.buttons}S.set(this.POINTER_ID,e),r.buttons&=~E[r.button],0===r.buttons?c.up(r):c.move(r)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);C||this.prepareButtonsForMove(t,e),t.button=-1,S.set(this.POINTER_ID,e),c.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);C||this.prepareButtonsForMove(t,e),t.button=-1,c.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);c.cancel(t),this.deactivateMouse()},deactivateMouse:function(){S.delete(this.POINTER_ID)}},O=c.captureInfo,I=u.findTarget.bind(u),D=u.allShadows.bind(u),B=c.pointermap,N={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){x.enableOnSubtree(e)},unregister:function(){},elementAdded:function(e){var t=e.getAttribute("touch-action"),r=this.touchActionToScrollType(t);r&&(e._scrollType=r,c.listen(e,this.events),D(e).forEach((function(e){e._scrollType=r,c.listen(e,this.events)}),this))},elementRemoved:function(e){e._scrollType=void 0,c.unlisten(e,this.events),D(e).forEach((function(e){e._scrollType=void 0,c.unlisten(e,this.events)}),this)},elementChanged:function(e,t){var r=e.getAttribute("touch-action"),n=this.touchActionToScrollType(r),i=this.touchActionToScrollType(t);n&&i?(e._scrollType=n,D(e).forEach((function(e){e._scrollType=n}),this)):i?this.elementRemoved(e):n&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,r=this.scrollTypes;return"none"===t?"none":t===r.XSCROLLER?"X":t===r.YSCROLLER?"Y":r.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===B.size||1===B.size&&B.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return"touchstart"!==e&&"touchmove"!==e||(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,r=c.cloneEvent(e),n=r.pointerId=e.identifier+2;r.target=O[n]||I(r),r.bubbles=!0,r.cancelable=!0,r.detail=this.clickCount,r.button=0,r.buttons=this.typeToButtons(t.type),r.width=2*(e.radiusX||e.webkitRadiusX||0),r.height=2*(e.radiusY||e.webkitRadiusY||0),r.pressure=e.force||e.webkitForce||.5,r.isPrimary=this.isPrimaryTouch(e),r.pointerType=this.POINTER_TYPE,r.altKey=t.altKey,r.ctrlKey=t.ctrlKey,r.metaKey=t.metaKey,r.shiftKey=t.shiftKey;var i=this;return r.preventDefault=function(){i.scrolling=!1,i.firstXY=null,t.preventDefault()},r},processTouches:function(e,t){var r=e.changedTouches;this.currentTouchEvent=e;for(var n,i=0;i<r.length;i++)n=r[i],t.call(this,this.touchToPointer(n))},shouldScroll:function(e){if(this.firstXY){var t,r=e.currentTarget._scrollType;if("none"===r)t=!1;else if("XY"===r)t=!0;else{var n=e.changedTouches[0],i=r,o="Y"===r?"X":"Y";t=Math.abs(n["client"+i]-this.firstXY[i])>=Math.abs(n["client"+o]-this.firstXY[o])}return this.firstXY=null,t}},findTouch:function(e,t){for(var r,n=0,i=e.length;n<i&&(r=e[n]);n++)if(r.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(B.size>=t.length){var r=[];B.forEach((function(e,n){if(1!==n&&!this.findTouch(t,n-2)){var i=e.out;r.push(i)}}),this),r.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){B.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),c.enterOver(e),c.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,r=B.get(t.pointerId);if(r){var n=r.out,i=r.outTarget;c.move(t),n&&i!==t.target&&(n.relatedTarget=t.target,t.relatedTarget=i,n.target=i,t.target?(c.leaveOut(n),c.enterOver(t)):(t.target=i,t.relatedTarget=null,this.cancelOut(t))),r.out=t,r.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(c.up(e),c.leaveOut(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){c.cancel(e),c.leaveOut(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){B.delete(e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=R.lastTouches,r=e.changedTouches[0];if(this.isPrimaryTouch(r)){var n={x:r.clientX,y:r.clientY};t.push(n);var i=function(e,t){var r=e.indexOf(t);r>-1&&e.splice(r,1)}.bind(null,t,n);setTimeout(i,2500)}}};x=new _(N.elementAdded,N.elementRemoved,N.elementChanged,N);var L,w,F,V=c.pointermap,k=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,U={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){c.listen(e,this.events)},unregister:function(e){c.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return k&&((t=c.cloneEvent(e)).pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){V.delete(e)},MSPointerDown:function(e){V.set(e.pointerId,e);var t=this.prepareEvent(e);c.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);c.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);c.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);c.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);c.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);c.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=c.makeEvent("lostpointercapture",e);c.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=c.makeEvent("gotpointercapture",e);c.dispatchEvent(t)}};function z(e){if(!c.pointermap.has(e)){var t=new Error("InvalidPointerId");throw t.name="InvalidPointerId",t}}function G(e){for(var t=e.parentNode;t&&t!==e.ownerDocument;)t=t.parentNode;if(!t){var r=new Error("InvalidStateError");throw r.name="InvalidStateError",r}}function j(e){return 0!==c.pointermap.get(e).buttons}return window.navigator.msPointerEnabled?(L=function(e){z(e),G(this),j(e)&&(c.setCapture(e,this,!0),this.msSetPointerCapture(e))},w=function(e){z(e),c.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(L=function(e){z(e),G(this),j(e)&&c.setCapture(e,this)},w=function(e){z(e),c.releaseCapture(e)}),F=function(e){return!!c.captureInfo[e]},function(){if(M){A.forEach((function(e){String(e)===e?(T+=y(e)+b(e)+"\n",P&&(T+=v(e)+b(e)+"\n")):(T+=e.selectors.map(y)+b(e.rule)+"\n",P&&(T+=e.selectors.map(v)+b(e.rule)+"\n"))}));var e=document.createElement("style");e.textContent=T,document.head.appendChild(e)}}(),function(){if(!window.PointerEvent){if(window.PointerEvent=r,window.navigator.msPointerEnabled){var e=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:e,enumerable:!0}),c.registerSource("ms",U)}else Object.defineProperty(window.navigator,"maxTouchPoints",{value:0,enumerable:!0}),c.registerSource("mouse",R),void 0!==window.ontouchstart&&c.registerSource("touch",N);c.register(document)}}(),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:L},releasePointerCapture:{value:w},hasPointerCapture:{value:F}}),{dispatcher:c,Installer:_,PointerEvent:r,PointerMap:n,targetFinding:u}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InitTags=t.initListeners=void 0;var n=r(12),i=r(2),o=r(3);function s(e){void 0===e&&(e="babylon");for(var t=document.querySelectorAll(e),r=0;r<t.length;++r){var o=t.item(r),s=i.mapperManager.getMapper("dom").map(o);new n.DefaultViewer(o,s)}}t.initListeners=function(){document.addEventListener("DOMContentLoaded",(function e(t){if(document.removeEventListener("DOMContentLoaded",e),o.viewerGlobals.disableInit)return;s()}))},t.InitTags=s}]);
-
- return BabylonViewer;
- });
|